File: /www/exchange0old/exchange/cache/%%AD^AD2^AD2A0A1A%%add_manual_transactions.html.php
<?php /* Smarty version 2.6.19, created on 2024-06-18 13:58:16
compiled from add_manual_transactions.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'siteUrl', 'add_manual_transactions.html', 2, false),array('modifier', 'tokenUrl', 'add_manual_transactions.html', 72, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "header.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
?>
<script type="text/javascript" src="<?php echo ((is_array($_tmp='/js/jquery.ui.core.js')) ? $this->_run_mod_handler('siteUrl', true, $_tmp) : smarty_modifier_siteUrl($_tmp)); ?>
"></script>
<script type="text/javascript" src="<?php echo ((is_array($_tmp='/js/ui.datepicker.js')) ? $this->_run_mod_handler('siteUrl', true, $_tmp) : smarty_modifier_siteUrl($_tmp)); ?>
"></script>
<script type="text/javascript" src="<?php echo ((is_array($_tmp='/js/add_transaction.js')) ? $this->_run_mod_handler('siteUrl', true, $_tmp) : smarty_modifier_siteUrl($_tmp)); ?>
"></script>
<style>
.clshide{
display: none;
}
.bold{
font-weight: bold;
}
</style>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top"> </td>
</tr>
<tr>
<td class="login_bg" align="left" valign="middle"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="" align="left" valign="middle" class="login_bg_t">Exchange Trade Centre | Transaction Update</td>
<td width="" align="left" valign="middle" class="txt_11">Originator Organisation ID:
<?php echo $_SESSION['user']['org_ref_id']; ?>
</td>
<td width="" align="right" valign="middle" class="txt_11"><?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'originator_top_dashboard_links.html', 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
?></td>
</tr>
</table></td>
</tr>
<tr>
<td align="center" valign="top" class="about_c">
<table width="100%" border="0" cellspacing="5" cellpadding="5">
<tr>
<td width="18%" align="left" valign="top"><?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'left_sidebar.html', 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
?></td>
<td width="82%" align="right" valign="top">
<?php if (! empty ( $_SESSION['error_transaction'] )): ?>
<div class="error-trmsgbox">
<?php echo $_SESSION['error_transaction']; ?>
</div>
<?php endif; ?>
<?php if (count ( $this->_tpl_vars['success_transactions_msg'] ) > 0): ?>
<div class="success-msgbox">
<span>
<?php echo $this->_tpl_vars['success_transactions_msg']; ?>
<br>
</span>
</div>
<?php endif; ?>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td valign="top" align="left" class="hdr_center">
<form action="index.php?do=savetransaction" method="post" enctype="multipart/form-data" id="save_transaction">
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td valign="top" align="center" class="inves_top1" colspan="2">Manual Transactions</td>
</tr>
<tr class="row1" id="notification" style="display:none;">
<td valign="top" align="center" colspan="2">Use this interface to update the Exchange of any payment related Debtor/Creditor transaction.</td>
</tr>
<tr class="row1" id="rec_notification" style="display:none;">
<td valign="top" align="center" colspan="2">Use this interface to reconcile a Debtor/Creditor Account with <a href="<?php echo ((is_array($_tmp='/exchange-help/policy/balances')) ? $this->_run_mod_handler('tokenUrl', true, $_tmp) : smarty_modifier_tokenUrl($_tmp)); ?>
#reconciliation" class="Clstr_hints" style="font-weight:normal;" target="_blank" >R-Trades</a>, or request Credebt Exchange to reconcile the account.<br><br>Select the ‘Credebt Exchange to reconcile’ option from the Reconcile Payment drop down menu if you would prefer the Back Office to reconcile this account for you.<br><br></td>
</tr>
<tr class="row1" id="rem_notification" style="display:none;">
<td valign="top" align="justify" colspan="2">Use this form to notify the Trade Desk of any Debtor/Creditor payment directly to the Credebt Exchange Account Bank. Use the Notes/Comments text box to enter as much information and details about the payment including, amount, invoice(s) being paid, date of transmission and any other details. If you have a transmission notice, remittance notice, email or other document that supports this payment, use the Choose File button to attach a copy of the file and save this notice.</td>
</tr>
<tr class="row1" id="row_transaction_type">
<td width="24%" valign="top" align="left">Transaction Type :</td>
<td width="70%" valign="top" align="left"><?php echo $this->_tpl_vars['transaction_types']; ?>
<br>
<span style="color:#FF0000">
<?php echo $this->_tpl_vars['errmsg']['transaction_type']; ?>
</span></td>
</tr>
<tr class="clshide" id="row_notify">
<td colspan="2">
<p align="justify" style="background:#F4F4F4;border: 1px solid #000000;color: #1F69BA;font-size: 11px;line-height: 20px;margin: 10px;padding: 5px;"><span class="red" style="font-size:11px; height: 1px;width: 90px;float:left;">IMPORTANT:-</span>Only choose this option: Transfer of Payment by Originator - after you have a transmission receipt from your bank confirming a specific electronic payment amount to the Credebt Exchange Account Bank.<span class="red"> ALSO:-</span> if the transmission receipt from your bank confirming a specific electronic payment amount is for multiple Debtors/Creditors, you <span class="red">MUST</span> select the invoice numbers and the corresponding values must <span class="red">EXACTLY MATCH</span> the value entered in the Amount field on this form. <br/><br/>
If the transmission receipt from your bank confirming a specific electronic payment amount does <span class="red">NOT EXACTLY MATCH</span> specific invoice(s), select only <span class="red">ONE</span> Debtor/Creditor and the Amount paid by that Debtor/Creditor before using the Submit button (and repeat this exercise until all the Debtor/Creditor payments added together are equal to the value on the transmission receipt from your bank confirming the specific electronic payment amount). Then upload a copy of the transmission receipt using the Bank Transmission Receipt option from the Transaction Type dialog above. For more information, see the <a href="<?php echo ((is_array($_tmp='/exchange-help/policy/balances')) ? $this->_run_mod_handler('tokenUrl', true, $_tmp) : smarty_modifier_tokenUrl($_tmp)); ?>
#balance" style="color:#1F69BA;text-decoration:underline;" target="_blank">Cash Balance Policy</a>.
</p>
</td>
</tr>
<tr class="row1 clshide" id="currencyId">
<td valign="top" align="left">Select Currency</td>
<td valign="top" align="left">
<span id="err_currency">
<?php if ($this->_tpl_vars['values']['currency_id'] != ''): ?>
<span>
<?php echo $this->_tpl_vars['currency']; ?>
</span>
<?php endif; ?>
<span id="currency" style="display:none;"><?php echo $this->_tpl_vars['currency_list']; ?>
</span>
</span>
<br/>
<?php if ($this->_tpl_vars['errmsg']['currency_id'] != ''): ?>
<span style="color:#FF0000;">
<?php echo $this->_tpl_vars['errmsg']['currency_id']; ?>
</span>
<?php endif; ?>
</td>
</tr>
<tr class="row1 clshide" id="row_debtor_id">
<td valign="top" align="left">Credebtor's Name :</td>
<td valign="top" align="left"><span id="d_debtors">
<input type="text" name="debtors" value="" class="text_b">
</span>
<?php if ($this->_tpl_vars['values']['debtor_id'] != ''): ?>
<span>
<?php echo $this->_tpl_vars['debtors']; ?>
</span>
<?php else: ?>
<span id="debtors" style="display:none;"></span>
<?php endif; ?>
<br>
<span style="color:#FF0000">
<?php echo $this->_tpl_vars['errmsg']['debtor_id']; ?>
</span></td>
</tr>
<tr class="row1 clshide" id="row_date">
<td align="left" valign="top">Date: <span class="txt_11_cute">(DD/MM/YYYY)</span></td>
<td align="left" valign="top" style="font-size: 11px; padding-left: 10px;"><div id="body_tag">
<div id="search_all_id" class="search_all">
<div class="search_element1">
<div class="city_div">
<table cellspacing="0" cellpadding="0" border="0" width="55%">
<tbody>
<tr>
<td align="left" width="13%" valign="top" style="border:none; padding:5px 0px;"> <input type="text" maxlength="2" size="2" class="text_dd_code" id="trans_date" name="trans_date" value="<?php echo $this->_tpl_vars['values']['trans_date']; ?>
" style="vertical-align:top;">
</td>
<td align="left" width="13%" valign="top" style="border:none; padding:5px 0px;"><input type="text" maxlength="2" size="2" class="text_dd_code" id="trans_month" name="trans_month" value="<?php echo $this->_tpl_vars['values']['trans_month']; ?>
" style="vertical-align:top;">
</td>
<td align="left" valign="top" style="border:none; padding:5px 0px;"><input type="text" maxlength="4" size="4" class="text_c_code" id="trans_year" name="trans_year" value="<?php echo $this->_tpl_vars['values']['trans_year']; ?>
" style="vertical-align:top;">
</td>
</tr>
</tbody>
</table>
<script>
//For Date Picker
$(function() {
$( "#trans_year" ).datepicker({
minDate: -365,
maxDate: "+0D",
showOn: "button",
buttonImage: "<?php echo ((is_array($_tmp='/images/calender_month.png')) ? $this->_run_mod_handler('siteUrl', true, $_tmp) : smarty_modifier_siteUrl($_tmp)); ?>
",
buttonImageOnly: true,
onSelect: function( selectedDate ) {
var i =0;selDate = selectedDate.split('/');var dates = new Array("trans_month","trans_date","trans_year");
for(i = 0; i <=2; i++){
$( "#"+dates[i] ).val(selDate[i]);
}
},
onClose:function( selectedDate ) {
if ($("#transaction_type option:selected").val() == '<?php echo @INBOUND_DEBTOR_PAYMENT; ?>
' || $("#transaction_type option:selected").val() == '<?php echo @TRANSFER_OF_PAYMENT_BY_ORIGINATOR; ?>
' || $("#transaction_type option:selected").val() == '<?php echo @PAID_DIRECTLY_TO_ORIGINATOR; ?>
' || $("#transaction_type option:selected").val() == '<?php echo @INBOUND_CREDITOR_PAYMENT; ?>
')
{
showTrades();
}
}
});
$('#trans_month,#trans_date,#trans_year').change(function(){
if ($("#transaction_type option:selected").val() == '<?php echo @INBOUND_DEBTOR_PAYMENT; ?>
' || $("#transaction_type option:selected").val() == '<?php echo @TRANSFER_OF_PAYMENT_BY_ORIGINATOR; ?>
' || $("#transaction_type option:selected").val() == '<?php echo @PAID_DIRECTLY_TO_ORIGINATOR; ?>
' || $("#transaction_type option:selected").val() == '<?php echo @INBOUND_CREDITOR_PAYMENT; ?>
')
{
showTrades();
}
});
});
</script>
</div>
</div>
<div class="clear_div"></div>
<span style="color:#FF0000">
<?php echo $this->_tpl_vars['errmsg']['trans_date']; ?>
</span>
</div>
</div>
</td>
</tr>
<?php if (( $this->_tpl_vars['values']['fx_rate'] != '' || $this->_tpl_vars['errmsg']['fx_rate'] != '' )): ?>
<tbody id="err_fx_rate_notify" style="display:none;"><?php echo $this->_tpl_vars['fx_rate']; ?>
</tbody>
<?php else: ?>
<tbody id="fx_rate_notify" style="display:none;"></tbody>
<?php endif; ?>
<tr class="row1" id="row_reconcile" style="display:none;">
<td valign="top" align="left">Payment(s) :</td>
<td valign="top" align="left">
<div style="clear:both;">
<span id="d_reconcile">
<input type="text" name"d_reconcile" value="" class="text_b" style="display:none;">
</span>
<?php if ($this->_tpl_vars['values']['reconcile_payment'] != ''): ?>
<span id="err_reconcile">
<?php echo $this->_tpl_vars['reconcile_payment']; ?>
</span>
<?php else: ?>
<span id="reconcile" style="display:none;"></span>
<?php endif; ?>
<span id="rec_deductibles" style="display:none;">
<input type="checkbox" name="check_deductible" id="check_deductible" value="1" onClick="javascript:checkDeductible();"
<?php if ($this->_tpl_vars['values']['check_deductible'] == '1'): ?>
checked="true"
<?php endif; ?>
style="vertical-align:middle;" /> & Specific Deductible(s)
<input type="checkbox" name="check_trailing" id="check_trailing" value="1" onClick="javascript:checkTrailing();"
<?php if ($this->_tpl_vars['values']['check_trailing'] == '1'): ?>
checked="true"
<?php endif; ?>
style="vertical-align:middle;" /> & Trailing Balance
</span>
</div>
<br>
<span style="color:#FF0000">
<?php echo $this->_tpl_vars['errmsg']['reconcile_payment']; ?>
</span></td>
</tr>
<tr class="row1" id="row_rpas" style="display: none;">
<td valign="top" align="left">b-ETR:</td>
<td valign="top" align="left" id="rpas"></td>
</tr>
<tr class="row1 clshide" id="row_amount">
<td valign="top" align="left">Amount :</td>
<td valign="top" align="left">
<input type="text" size="25" class="text_b_small" value="<?php if ($this->_tpl_vars['values']['amount'] != ''): ?><?php echo $this->_tpl_vars['values']['amount']; ?>
<?php endif; ?>" name="amount" id="amount">
<span id="credit" style="display:none;font-size:11px;">Do not use a minus ( - ) sign, when entering the Credit Note value</span>
<span id="withallocation"><input type="checkbox" name="trade_select" id="trade_select" value="1"
<?php if ($this->_tpl_vars['values']['trade_select'] == '1'): ?>
checked="true"
<?php endif; ?>
style="vertical-align:middle;" /> With Specific Allocation
<span id="deductibles" style="display:none;" >
<input type="checkbox" name="check_deductible" id="check_deductible" value="1" onClick="javascript:checkDeductible();"
<?php if ($this->_tpl_vars['values']['check_deductible'] == '1'): ?>
checked="true"
<?php endif; ?>
style="vertical-align:middle;" /> & Specific Deductible(s)
<span id="trailing" style="display:none;" >
<input type="checkbox" name="check_trailing" id="check_trailing" value="1" onClick="javascript:checkTrailing();"
<?php if ($this->_tpl_vars['values']['check_trailing'] == '1'): ?>
checked="true"
<?php endif; ?>
style="vertical-align:middle;" /> & Trailing Balance
</span>
<!-- <input type="checkbox" name="check_deductible" id="check_deductible" value="2" onClick="javascript:checkDeductible();"
<?php if ($this->_tpl_vars['values']['check_deductible'] == '2'): ?>
checked="true"
<?php endif; ?>
style="vertical-align:middle;" /> Multiple Deductibles -->
</span>
<br/><br/>
<a href="http://www.credebtexchange.com/blog/tips-help/specific-allocation" target="_blank" class="Clstr_hints" style="text-decoration:none;">Help on using Specific Allocation, Specific Deductible & Trailing Balance</a>
<input type="hidden" name="amountval" id="amountval" value="<?php if ($this->_tpl_vars['values']['amount'] != ''): ?><?php echo $this->_tpl_vars['values']['amount']; ?>
<?php endif; ?>" />
</span>
<?php if ($this->_tpl_vars['errmsg']['amount'] != ''): ?>
<br>
<span style="color:#FF0000">
<?php echo $this->_tpl_vars['errmsg']['amount']; ?>
</span>
<?php endif; ?>
<br/><br/>
<b style="color:#FF0000;font-size:11px;" id="shortDescription" class="clshide">Hold down CTRL keyboard button to make multiple selections</b>
</td>
</tr>
<tr class="row1 clshide" id="row_credit_note_no">
<td valign="top" align="left">Number :</td>
<td valign="top" align="left">
<input type="text" class="text_b" value="<?php if ($this->_tpl_vars['values']['credit_note_no'] != ''): ?><?php echo $this->_tpl_vars['values']['credit_note_no']; ?>
<?php endif; ?>" name="credit_note_no" id="credit_note_no">
<?php if ($this->_tpl_vars['errmsg']['credit_note_no'] != ''): ?>
<br>
<span style="color:#FF0000">
<?php echo $this->_tpl_vars['errmsg']['credit_note_no']; ?>
</span>
<?php endif; ?>
</td>
</tr>
<tr class="row1" id="row_reference_to" style="display:none;">
<td valign="top" align="left">With specific reference to :</td>
<td valign="top" align="left">
<div style="display: block; height: 21px; width: 450px;">
<span style="float: left; padding-left: 28px; width: 195px;">Reference</span>
<span style="float: left; width: 77px;">Amount</span>
<span style="float: right; width: 101px;">Issue Date</span>
</div>
<div style="clear:both;">
<span id="d_reference">
<input type="text" name"d_reference" value="" class="text_b" style="display:none;">
</span>
<?php if ($this->_tpl_vars['values']['reference_to'] != ''): ?>
<span id="err_reference">
<?php echo $this->_tpl_vars['reference_to']; ?>
</span>
<?php else: ?>
<span id="reference" style="display:none;"></span>
<?php endif; ?>
</div>
<br>
<span style="color:#FF0000">
<?php echo $this->_tpl_vars['errmsg']['reference_to']; ?>
</span></td>
</tr>
<tr class="clshide" id="row_credit_txt">
<td colspan="2">
<p align="justify" style="background:#F4F4F4;border: 1px solid #000000;color: #1F69BA;font-size: 11px;line-height: 20px;margin: 10px;padding: 5px;"><span class="red" style="font-size:11px; height: 1px;width: 90px;float:left;">IMPORTANT:-</span>Credit Notes are not displayed on this interface and payments cannot be reconciled against Invoice(s) and Credit Note(s) balances using this interface. If Credit Notes are required to reconcile this payment, uncheck the ‘With Specific Allocation’, Submit and then Authorise the payment. To complete the process, use the ‘Reconcile a Debtor/Creditor Account’ option above to select the payment entered and reconcile using this interface instead
</p>
</td>
</tr>
<tr class="row1 clshide" id="row_balance">
<td valign="top" align="left">Balance :</td>
<td valign="top" align="left"><span id="d_balance">
<?php echo $this->_tpl_vars['currency']; ?>
<?php echo $this->_tpl_vars['balance']; ?>
</span>
<?php if ($this->_tpl_vars['values']['balance'] != ''): ?>
<span>
<?php echo $this->_tpl_vars['currency']; ?>
<?php echo $this->_tpl_vars['balance']; ?>
</span>
<?php else: ?>
<span id="bal_currency" style="display:none;"></span> <span id="balance" style="display:none;"></span>
<?php endif; ?>
<br>
<span style="color:#FF0000">
<?php echo $this->_tpl_vars['errmsg']['balance']; ?>
</span></td>
</tr>
<tr class="row1 clshide" id="row_credit_note">
<td valign="top" align="left">Credit Notes on this Account:</td>
<td valign="top" align="left"><span id="d_creditnote">
<?php echo $this->_tpl_vars['currency']; ?>
<?php echo $this->_tpl_vars['creditnote']; ?>
</span>
<?php if ($this->_tpl_vars['values']['balance'] != ''): ?>
<span>
<?php echo $this->_tpl_vars['currency']; ?>
<?php echo $this->_tpl_vars['creditnote']; ?>
</span>
<?php else: ?>
<span id="bal_creditnote" style="display:none;"></span> <span id="creditnote" style="display:none;"></span>
<?php endif; ?>
</td>
</tr>
<tr class="clshide" id="row_deductible_txt">
<td colspan="2">
<p align="justify" style="background:#F4F4F4;border: 1px solid #000000;color: #1F69BA;font-size: 11px;line-height: 20px;margin: 10px;padding: 5px;"><span class="red" style="font-size:11px; height: 1px;width: 90px;float:left;">IMPORTANT:-</span>The Specific Deductible(s) should only be used to allocate small discrepancies between the payment receipt and the ETR value(s). If there is a significant difference, a Credit Note must be requested from the Originator
</p>
</td>
</tr>
<tr class="row1" id="row_deductible" style="display:none;">
<td valign="top" align="left">Specific Deductible <!-- <span id="txt_deductible" style="font-size:11px;"></span> --> :</td>
<td valign="top" align="left">
<div style="display: block; height: 21px; width: 450px;">
<!-- <span style="float: left; padding-left: 28px; width: 195px;"> </span> -->
<span style="float: left; width: 77px;"><input type="text" id="balance_deductible" name="balance_deductible" value="<?php echo $this->_tpl_vars['values']['balance_deductible']; ?>
" class="text_b_small" size="25" /></span>
<span style="float: right; width: 101px;"> </span>
</div>
<?php if ($this->_tpl_vars['errmsg']['balance_deductible'] != ''): ?>
<span style="color:#FF0000;padding-left:221px;">
<?php echo $this->_tpl_vars['errmsg']['balance_deductible']; ?>
</span>
<?php endif; ?>
</td>
</tr>
<tr class="row1" id="row_trailing" style="display:none;">
<td valign="top" align="left">Trailing Balance <!-- <span id="txt_deductible" style="font-size:11px;"></span> --> :</td>
<td valign="top" align="left">
<div style="display: block; height: 21px; width: 450px;">
<!-- <span style="float: left; padding-left: 28px; width: 195px;"> </span> -->
<span style="float: left; width: 77px;"><input type="text" id="trailing_balance_amt" name="trailing_balance_amt" value="<?php echo $this->_tpl_vars['values']['trailing_balance_amt']; ?>
" class="text_b_small" size="25" /></span>
<span style="float: right; width: 101px;"> </span>
</div>
<?php if ($this->_tpl_vars['errmsg']['trailing_balance_amt'] != ''): ?>
<span style="color:#FF0000;padding-left:221px;">
<?php echo $this->_tpl_vars['errmsg']['trailing_balance_amt']; ?>
</span>
<?php endif; ?>
</td>
</tr>
<tr class="row1" id="row_transaction_file" style="display:none;">
<td valign="top" align="left">Transaction File :</td>
<td valign="top" align="left"><input type="file" name="transaction_file" value="" />
<br>
<span style="color:#FF0000">
<?php echo $this->_tpl_vars['errmsg']['transaction_file']; ?>
</span></td>
</tr>
<tr class="row1 clshide" id="row_notes">
<td valign="top" align="left">Notes/Comments :</td>
<td valign="top" align="left">Enter one transaction per line, followed by a comma , <br/>
<textarea style="height: 150px;width:420px;" class="text_b" name="notes"><?php echo $this->_tpl_vars['values']['notes']; ?>
</textarea>
<!-- style="height: 50px;width:210px;" -->
<br>
<span style="color:#FF0000">
<?php echo $this->_tpl_vars['errmsg']['email']; ?>
</span></td>
</tr>
<tr>
<td align="left" valign="top" > </td>
<td align="left" valign="top" id="waiting_box"> </td>
</tr>
<tr>
<td align="left" valign="top" ></td>
<td align="left" valign="top">
<input type="submit" value="Submit" class="login_bttn"></td>
</tr>
</tbody>
</table>
</form></td>
</tr>
</tbody>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td align="left" valign="top"> </td>
</tr>
</table>
<script type="text/javascript">
$(function(){
var type = '<?php echo $_GET['type']; ?>
';
var trans_type = '<?php echo $this->_tpl_vars['values']['transaction_type']; ?>
';
if(type != '')
{
$("#transaction_type option:selected").val(type);
showFields(type);
showDebtors();
}
if(trans_type!=<?php echo @NOTICE_OF_DEBTOR_REMITTANCE; ?>
&& trans_type!=<?php echo @RECONCILE_DEBTOR_ACCOUNT; ?>
&& trans_type!=<?php echo @RECONCILE_CREDITOR_ACCOUNT; ?>
&& type!=<?php echo @NOTICE_OF_DEBTOR_REMITTANCE; ?>
&& type!=<?php echo @RECONCILE_DEBTOR_ACCOUNT; ?>
&& type!=<?php echo @RECONCILE_CREDITOR_ACCOUNT; ?>
)
{
$('#notification').show();
}
var transactionType = $('#transaction_type').val();
if (transactionType=='<?php echo @TRANSFER_OF_PAYMENT_BY_ORIGINATOR; ?>
' || transactionType=='<?php echo @INBOUND_CREDITOR_PAYMENT; ?>
')
{
$('#row_notify').removeClass('clshide');
}
else
{
$('#row_notify').addClass('clshide');
}
$('#transaction_type').change(function()
{
var transactionType = $('#transaction_type').val();
if (transactionType=='<?php echo @TRANSFER_OF_PAYMENT_BY_ORIGINATOR; ?>
' || transactionType=='<?php echo @INBOUND_CREDITOR_PAYMENT; ?>
')
{
$('#row_notify').removeClass('clshide');
}
else
{
$('#row_notify').addClass('clshide');
}
showCurrency(transactionType);
if (transactionType == '<?php echo @INBOUND_DEBTOR_PAYMENT; ?>
' || transactionType == '<?php echo @TRANSFER_OF_PAYMENT_BY_ORIGINATOR; ?>
' || transactionType == '<?php echo @INBOUND_CREDITOR_PAYMENT; ?>
')
{
$('#d_debtors').hide();
$('#row_debtor_id').show();
$('#row_debtor_id').removeClass('clshide');
$('#debtors').show();
$('#row_amount,#row_date,#row_balance,#row_notes').show();
}
else if (transactionType == '<?php echo @CREDIT_NOTE; ?>
')
{
$('#d_debtors').hide();
$('#row_debtor_id').show();
$('#row_debtor_id').removeClass('clshide');
$('#debtors').show();
$('#row_amount,#row_date,#row_notes').show();
}
});
});
function showFields(val)
{
if( val != <?php echo @ORIGINATOR_DEPOSIT; ?>
)
{
$('#row_rpas').hide();
}
if(val=='')
{
$('#notification').show();
$('#row_debtor_id,#row_amount,#row_date,#row_balance,#row_notes,#row_reconcile,#row_reference_to,#row_credit_txt,#row_deductible,#row_credit_note,#row_deductible_txt,#row_trailing,#credit').hide();
$('#rem_notification,#rec_notification,#row_reconcile').hide();
}
else if(val==<?php echo @INBOUND_DEBTOR_PAYMENT; ?>
)
{
$('#row_debtor_id,#row_amount,#row_date,#row_balance,#row_notes,#row_reconcile').hide();
$('#row_debtor_id,#row_amount,#row_date,#row_balance,#row_notes').addClass('clshide');
$('#row_date').removeClass('row1');
$('#row_date').addClass('row1');
$('#row_amount').removeClass('row1');
$('#row_amount').addClass('row1');
$('#row_notes').removeClass('row1');
$('#row_notes').addClass('row1');
$('#row_transaction_file').hide();
$('#err_currency').hide();
$('#withallocation').show();
$('#fx_rate_notify').hide();
$('#notification').show();
$('#rem_notification').hide();
$('#rec_notification').hide();
$('#credit').hide();
$('#row_credit_note,#row_deductible_txt').hide();
$('#shortDescription').removeClass('clshide');
}
else if(val==<?php echo @TRANSFER_OF_PAYMENT_BY_ORIGINATOR; ?>
|| val == <?php echo @INBOUND_CREDITOR_PAYMENT; ?>
)
{
$('#row_debtor_id,#row_amount,#row_date,#row_balance,#row_notes,#row_reconcile').hide();
$('#row_debtor_id,#row_amount,#row_date,#row_balance,#row_notes').addClass('clshide');
$('#row_date').removeClass('row1');
$('#row_date').addClass('row1');
$('#row_amount').removeClass('row1');
$('#row_amount').addClass('row1');
$('#row_notes').removeClass('row1');
$('#row_notes').addClass('row1');
$('#row_transaction_file').hide();
$('#row_originator_id').hide();
$('#row_notes').hide();
$('#row_debtor_id').hide();
$('#row_amount').hide();
$('#currency').hide();
$('#err_currency').hide();
$('#row_reference_to').hide();
$('#row_credit_txt').hide();
$('#row_balance').hide();
if( val == <?php echo @INBOUND_CREDITOR_PAYMENT; ?>
)
{
$('#withallocation').hide();
}
else
{
$('#withallocation').show();
}
$('#fx_rate_notify').hide();
$('#err_fx_rate_notify').show();
$('#row_fx_rate').hide();
$('#notification').show();
$('#rem_notification').hide();
$('#rec_notification').hide();
$('#credit').hide();
$('#row_credit_note,#row_deductible_txt').hide();
$('#shortDescription').removeClass('clshide');
$('#row_amount,#row_date,#row_balance,#row_notes').addClass('clshide');
}
else if(val==<?php echo @NOTICE_OF_DEBTOR_REMITTANCE; ?>
)
{
$('#notification,#row_reconcile').hide();
$('#rem_notification').show();
$('#rec_notification').hide();
$('#row_date').removeClass('row1').removeClass('clshide').show();
$('#row_date').addClass('row1');
$('#row_transaction_file').show();
$('#row_notes').show();
$('#row_debtor_id').hide();
// $('#row_amount').hide();
$('#row_amount').show();
$('#currency').hide();
$('#err_currency').hide();
$('#row_reference_to').hide();
$('#row_credit_txt').hide();
$('#row_balance').hide();
$('#row_originator_id').show();
$('#withallocation').hide();
$('#fx_rate_notify').hide();
$('#err_fx_rate_notify').hide();
$('#row_fx_rate').hide();
$('#credit').hide();
$('#row_credit_note,#row_deductible_txt').hide();
$('#shortDescription').addClass('clshide');
}
else if(val==<?php echo @CREDIT_NOTE; ?>
)
{
$('#row_debtor_id,#row_amount,#row_date,#row_balance,#row_notes,#row_reconcile').hide();
$('#row_debtor_id,#row_amount,#row_date,#row_balance,#row_notes').addClass('clshide');
$('#row_date').removeClass('row1');
$('#row_date').addClass('row1');
$('#row_amount').removeClass('row1');
$('#row_amount').addClass('row1');
$('#row_notes').removeClass('row1');
$('#row_notes').addClass('row1');
$('#row_transaction_file').hide();
$('#row_originator_id').hide();
$('#row_notes').hide();
$('#row_debtor_id').hide();
$('#row_amount').hide();
$('#row_balance').hide();
$('#currency').hide();
$('#err_currency').hide();
$('#row_reference_to').hide();
$('#row_credit_txt').hide();
$('#row_transaction_file').show();
$('#notification').show();
$('#rem_notification').hide();
$('#rec_notification').hide();
$('#credit').show();
$('#row_credit_note_no').show();
$('#row_credit_note,#row_deductible_txt').hide();
// $('#row_balance').hide();
$('#withallocation').hide();
$('#fx_rate_notify').hide();
$('#err_fx_rate_notify').hide();
$('#row_fx_rate').hide();
$('#shortDescription').addClass('clshide');
}
else if(val==<?php echo @RECONCILE_DEBTOR_ACCOUNT; ?>
)
{
var today = new Date();
var day = ("0" + today.getDate().toString()).substr(-2);
var month = ("0" + (today.getMonth() + 1).toString()).substr(-2);
var year = today.getFullYear();
$('#trans_date').val(day);
$('#trans_month').val(month);
$('#trans_year').val(year);
$('#row_date').removeClass('row1').removeClass('clshide').show();
$('#row_date').addClass('row1');
// $('#row_transaction_file').show();
$('#row_transaction_file').hide();
$('#row_notes').hide();
$('#row_debtor_id').hide();
$('#row_amount').hide();
$('#currency').hide();
$('#err_currency').hide();
$('#row_reference_to').hide();
$('#row_credit_txt').hide();
// $('#row_balance').show();
$('#row_balance').hide();
$('#row_originator_id').show();
$('#withallocation').hide();
$('#fx_rate_notify').hide();
$('#err_fx_rate_notify').hide();
$('#row_fx_rate').hide();
$('#notification').hide();
$('#rem_notification').hide();
$('#rec_notification').hide();
// $('#row_reconcile').show();
$('#row_reconcile').hide();
$('#credit').hide();
$('#row_credit_note,#row_deductible_txt').hide();
$('#shortDescription').addClass('clshide');
}
else if(val==<?php echo @ORIGINATOR_PAYMENT_ON_ACCOUNT; ?>
|| val==<?php echo @ORIGINATOR_DEPOSIT; ?>
)
{
$('#row_date').removeClass('row1').removeClass('clshide').show();
$('#row_date').addClass('row1');
$('#row_amount').removeClass('row1');
$('#row_amount').addClass('row1');
$('#row_transaction_file').hide();
$('#row_debtor_id').hide();
$('#row_amount').show();
$('#currencyId').show();
$('#err_currency').show();
$('#row_notes').show();
$('#row_reference_to').hide();
$('#row_credit_txt').hide();
$('#row_balance').hide();
$('#row_originator_id').show();
$('#withallocation').hide();
$('#fx_rate_notify').hide();
$('#err_fx_rate_notify').hide();
$('#row_fx_rate').hide();
$('#notification').show();
$('#rem_notification').hide();
$('#rec_notification').hide();
$('#row_reconcile').hide();
$('#credit').hide();
$('#row_credit_note,#row_deductible_txt').hide();
$('#shortDescription').addClass('clshide');
if( val == <?php echo @ORIGINATOR_DEPOSIT; ?>
)
{
$.ajax({
type: "POST",
url: "?do=getrpas",
success: function(msg){
document.getElementById("rpas").innerHTML=msg;
$('#row_rpas').show();
}
});
}
}
else if(val==<?php echo @BANK_TRANSMISSION_RECEIPT; ?>
)
{
$('#row_date').removeClass('row1').removeClass('clshide').show();
$('#row_date').addClass('row1');
$('#row_notes').removeClass('row1');
$('#row_notes').addClass('row1');
$('#row_transaction_file').show();
$('#row_notes').show();
$('#row_debtor_id').hide();
// $('#row_amount').hide();
$('#row_amount').show();
$('#currency').hide();
$('#err_currency').hide();
$('#row_reference_to').hide();
$('#row_credit_txt').hide();
$('#row_balance').hide();
$('#row_originator_id').show();
$('#withallocation').hide();
$('#fx_rate_notify').hide();
$('#err_fx_rate_notify').hide();
$('#row_fx_rate').hide();
$('#notification').show();
$('#rem_notification').hide();
$('#rec_notification').hide();
$('#row_reconcile').hide();
$('#credit').hide();
$('#row_credit_note,#row_deductible_txt').hide();
$('#shortDescription').addClass('clshide');
}
else if(val==<?php echo @CREDITOR_OUTBOUND_PAYMENT; ?>
)
{
$('#row_date').removeClass('row1').removeClass('clshide').show();
$('#row_date').addClass('row1');
$('#row_amount').removeClass('row2').removeClass('clshide').show();
$('#row_amount').addClass('row1');
$('#row_notes').removeClass('row1').removeClass('clshide').show();
$('#row_notes').addClass('row1');
$('#row_debtor_id').show();
$('#row_debtor_id').removeClass('clshide');
$('#row_transaction_file').hide();
$('#row_originator_id').show();
$('#row_notes').show();
$('#row_amount').show();
$('#row_reference_to').hide();
$('#withallocation').hide();
}
else if(val==<?php echo @RECONCILE_CREDITOR_ACCOUNT; ?>
)
{
var today = new Date();
var day = ("0" + today.getDate().toString()).substr(-2);
var month = ("0" + (today.getMonth() + 1).toString()).substr(-2);
var year = today.getFullYear();
$('#trans_date').val(day);
$('#trans_month').val(month);
$('#trans_year').val(year);
$('#row_date').removeClass('row1').removeClass('clshide').show();
$('#row_date').addClass('row1');
// $('#row_transaction_file').show();
$('#row_transaction_file').hide();
$('#row_notes').hide();
$('#row_debtor_id').hide();
$('#row_amount').hide();
$('#currency').hide();
$('#err_currency').hide();
$('#row_reference_to').hide();
$('#row_credit_txt').hide();
// $('#row_balance').show();
$('#row_balance').hide();
$('#row_originator_id').show();
$('#withallocation').hide();
$('#fx_rate_notify').hide();
$('#err_fx_rate_notify').hide();
$('#row_fx_rate').hide();
$('#notification').show();
$('#rem_notification').hide();
$('#rec_notification').hide();
// $('#row_reconcile').show();
$('#row_reconcile').hide();
$('#credit').hide();
$('#row_credit_note,#row_deductible_txt').hide();
$('#shortDescription').addClass('clshide');
}
if(val != <?php echo @RECONCILE_DEBTOR_ACCOUNT; ?>
&& val != <?php echo @RECONCILE_CREDITOR_ACCOUNT; ?>
){
$('#trans_date').val('');
$('#trans_month').val('');
$('#trans_year').val('');
}
if( val == <?php echo @INBOUND_CREDITOR_PAYMENT; ?>
|| val == <?php echo @RECONCILE_CREDITOR_ACCOUNT; ?>
|| val == <?php echo @CREDITOR_OUTBOUND_PAYMENT; ?>
|| val == <?php echo @MERGE_INBOUND_DEBTOR_PAYMENT; ?>
|| val == <?php echo @SPLIT_INBOUND_DEBTOR_PAYMENT; ?>
|| val == <?php echo @OCPA_TO_ICP; ?>
|| val == <?php echo @ICP_SPLIT; ?>
|| val == <?php echo @ICP_MERGE; ?>
|| val == <?php echo @OCPA_MERGE; ?>
)
{
$('#withallocation').hide();
}
}
function showCurrency(val){
val ='';
trans_type = $("#transaction_type option:selected").val();
if(trans_type=='<?php echo @ORIGINATOR_PAYMENT_ON_ACCOUNT; ?>
' || '<?php echo @ORIGINATOR_DEPOSIT; ?>
' )
{
$('#currency').show();
var orgId = '<?php echo $_SESSION['user']['userid']; ?>
';
$.ajax({
type: "POST",
url: "?do=getoriginatorcurrency",
data: "id="+val,
success: function(msg){
$("#currency").html(msg);
$('#currency').show();
}
});
}else{
$('#currency,#currencyId').hide();
}
}
function showDebtors(flag)
{
var val ='';
var transactionType = $('#transaction_type').val();
if (transactionType!='')
{
$.ajax({
type: "POST",
url: "?do=getdebtors&type=" + $('#transaction_type option:selected').attr('type'),
success: function(msg){
// var organisation = $('#originator_id').val();
if (transactionType=='<?php echo @INBOUND_DEBTOR_PAYMENT; ?>
' || transactionType=='<?php echo @TRANSFER_OF_PAYMENT_BY_ORIGINATOR; ?>
' || transactionType=='<?php echo @INBOUND_CREDITOR_PAYMENT; ?>
')
{
$('#d_debtors').hide();
$('#row_debtor_id').show();
$('#row_debtor_id').removeClass('clshide');
$('#debtors').show();
$('#row_amount,#row_date,#row_balance,#row_notes').show();
}
else if(transactionType=='<?php echo @CREDIT_NOTE; ?>
')
{
$('#d_debtors').hide();
$('#row_debtor_id').show();
$('#row_debtor_id').removeClass('clshide');
$('#debtors').show();
$('#row_amount,#row_date,#row_notes').show();
}
else if (transactionType=='<?php echo @CREDITOR_OUTBOUND_PAYMENT; ?>
' || transactionType=='<?php echo @NOTICE_OF_DEBTOR_REMITTANCE; ?>
'|| transactionType=='<?php echo @BANK_TRANSMISSION_RECEIPT; ?>
' || transactionType=='<?php echo @RECONCILE_DEBTOR_ACCOUNT; ?>
' || transactionType=='<?php echo @RECONCILE_CREDITOR_ACCOUNT; ?>
')
{
$('#d_debtors').hide();
$('#row_debtor_id').show();
$('#row_debtor_id').removeClass('clshide');
$('#debtors').show();
$('#row_notes').show();
$('#row_date').show();
$('#row_amount').show();
if(transactionType=='<?php echo @NOTICE_OF_DEBTOR_REMITTANCE; ?>
' || transactionType=='<?php echo @BANK_TRANSMISSION_RECEIPT; ?>
')
{
$('#row_balance').hide();
}
else if(transactionType=='<?php echo @RECONCILE_DEBTOR_ACCOUNT; ?>
' || transactionType=='<?php echo @RECONCILE_CREDITOR_ACCOUNT; ?>
')
{
// $('#row_balance').show();
$('#row_balance').hide();
$('#row_amount').hide();
$('#row_notes').hide();
}
else
{
$('#row_amount,#row_balance').hide();
}
}
if (msg!='') {
$("#debtors").html(msg);
}
}
});
}else{
$('#debtors').show();
$('#d_debtors').hide();
}
}
function showTrades(flag){
if(flag==1){
$('#rows_notify').hide();
}
$('#row_fx_rate').show();
var transaction_type = $('#transaction_type').val();
var trade_select = $('#trade_select').checked;
val ='';
// user_id = $('#originator_id').val();
user_id = '<?php echo $_SESSION['user']['userid']; ?>
';
$("#debtor_id option:selected").each(function () {
val += $(this).val() + ",";
});
var amounts = $('#amount').val();
initialAmount = parseFloat(Math.round(amounts * 100) / 100);
// msg = msg.toFixed(2);
initialAmount = initialAmount.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
$('#balance').html(initialAmount);
if(transaction_type!='<?php echo @RECONCILE_DEBTOR_ACCOUNT; ?>
' || transaction_type!='<?php echo @RECONCILE_CREDITOR_ACCOUNT; ?>
')
{
data="id="+$("#debtor_id").val()+"&user_id="+user_id;
if (transaction_type == '<?php echo @INBOUND_DEBTOR_PAYMENT; ?>
' || transaction_type == '<?php echo @TRANSFER_OF_PAYMENT_BY_ORIGINATOR; ?>
' || transaction_type == '<?php echo @PAID_DIRECTLY_TO_ORIGINATOR; ?>
' || transaction_type == '<?php echo @INBOUND_CREDITOR_PAYMENT; ?>
')
{
data+="&max_date="+$('#trans_year').val()+'-'+$('#trans_month').val()+'-'+$('#trans_date').val();
}
$.ajax({
type: "POST",
url: "?do=gettrades",
data: data,
success: function(msg)
{
$('#d_reference').hide();
$('#reference').show();
if($("#debtor_id option:selected").val()!=undefined && ($('#amount').val()!=''))
{
if(flag==1)
{
$("#err_reference").html(msg);
}
else
{
try
{
$("#reference").html(msg);
}
catch(errs)
{
if(((transaction_type == '<?php echo @INBOUND_DEBTOR_PAYMENT; ?>
' || transaction_type == '<?php echo @TRANSFER_OF_PAYMENT_BY_ORIGINATOR; ?>
' || transaction_type == '<?php echo @INBOUND_CREDITOR_PAYMENT; ?>
') && $('#trade_select').attr('checked')==true))
{
$('#row_reference_to').show();
$('#row_credit_txt').show();
}
}
}
if(((transaction_type == '<?php echo @INBOUND_DEBTOR_PAYMENT; ?>
' || transaction_type == '<?php echo @TRANSFER_OF_PAYMENT_BY_ORIGINATOR; ?>
' || transaction_type == '<?php echo @INBOUND_CREDITOR_PAYMENT; ?>
') && $('#trade_select').attr('checked')==true))
{
$('#row_reference_to').show();
$('#row_credit_txt').show();
}
}
else
{
if(transaction_type != '<?php echo @INBOUND_CREDITOR_PAYMENT; ?>
') {
$('#row_reference_to').hide();
$('#row_credit_txt').hide();
}
else
{
$("#reference").html(msg);
}
}
}
});
}else{
$('#row_reference_to').hide();
$('#row_credit_txt').hide();
$('#rec_deductibles').hide();
$('#row_balance').hide();
$('#row_notes').hide();
}
}
function showFXRate(flag){
val ='';
org ='';
user_id = '<?php echo $_SESSION['user']['userid']; ?>
';
$("#debtor_id option:selected").each(function () {
val += $(this).val();
});
if(val!='undefined' && val!='' && user_id!='undefined' && flag!='3')
{
$.ajax({
type: "POST",
url: "?do=getcurrencylist",
data: "id="+user_id+"&deb_id="+$("#debtor_id").val(),
success: function(msg){
if(val!='undefined' && user_id!='undefined' && msg!='')
{
$('#row_amount').removeClass('row1');
$('#row_amount').addClass('row1');
$('#row_balance').removeClass('row1');
$('#row_balance').addClass('row1');
$('#row_notes').removeClass('row1');
$('#row_notes').addClass('row1');
document.getElementById("fx_rate_notify").innerHTML=msg;
}
}
});
}else{
document.getElementById("fx_rate_notify").innerHTML='';
$('#fx_rate_notify').hide();
}
}
$('#amount').bind('blur keyup input',function(){
if($("#reference_to option:selected").val()==undefined)
{
if($('#trade_select').attr('checked') == 'checked')
{
$('#trailing').show();
$('#deductibles').show();
showTrades();
}
}
getBalance();
});
$('#reference_to').live('change',function(){
switch($('#transaction_type').val())
{
case '<?php echo @RECONCILE_DEBTOR_ACCOUNT; ?>
':{
getReconcileBalance();
break;
}
default:{
getBalance();
break;
}
}
});
$('input[type="submit"]').click(function(){
$(this)
.attr('disabled','disabled')
.css('border','1px solid #808080').css('background','#808080').css('cursor','auto');
$("#waiting_box").html('Please wait...');
$('#save_transaction').submit();
})
<?php if ($this->_tpl_vars['values']['transaction_type'] != ''): ?>
showFields(<?php echo $this->_tpl_vars['values']['transaction_type']; ?>
);
<?php endif; ?>
<?php if ($this->_tpl_vars['values']['transaction_type'] != ''): ?>
showDebtors();
<?php if ($this->_tpl_vars['values']['transaction_type'] == @ORIGINATOR_PAYMENT_ON_ACCOUNT || $this->_tpl_vars['values']['transaction_type'] == @ORIGINATOR_DEPOSIT || $this->_tpl_vars['values']['transaction_type'] == @TRANSFER_OF_PAYMENT_BY_ORIGINATOR || $this->_tpl_vars['values']['transaction_type'] == @INBOUND_DEBTOR_PAYMENT || $this->_tpl_vars['values']['transaction_type'] == @INBOUND_CREDITOR_PAYMENT): ?>
showCurrency();
showFXRate(4);
<?php endif; ?>
<?php endif; ?>
<?php if ($this->_tpl_vars['values']['debtor_id'] != '' && ( $this->_tpl_vars['values']['transaction_type'] == @RECONCILE_DEBTOR_ACCOUNT || $this->_tpl_vars['values']['transaction_type'] == @RECONCILE_CREDITOR_ACCOUNT )): ?>
getReconcilePayments();
showReconcileTrades();
<?php else: ?>
//showTrades();
//showFXRate(4);
<?php endif; ?>
<?php if ($this->_tpl_vars['values']['amount'] != '' && ( $this->_tpl_vars['values']['transaction_type'] != @RECONCILE_DEBTOR_ACCOUNT || $this->_tpl_vars['values']['transaction_type'] != @RECONCILE_CREDITOR_ACCOUNT )): ?>
showTrades();
getBalance(<?php echo $this->_tpl_vars['values']['amount']; ?>
);
<?php elseif (( $this->_tpl_vars['values']['transaction_type'] == @RECONCILE_DEBTOR_ACCOUNT || $this->_tpl_vars['values']['transaction_type'] == @RECONCILE_CREDITOR_ACCOUNT )): ?>
showReconcileTrades();
getReconcileBalance(<?php echo $this->_tpl_vars['values']['amount']; ?>
);
<?php elseif ($this->_tpl_vars['values']['reference_to'] != '' && ( $this->_tpl_vars['values']['transaction_type'] != @RECONCILE_DEBTOR_ACCOUNT || $this->_tpl_vars['values']['transaction_type'] != @RECONCILE_CREDITOR_ACCOUNT )): ?>
getBalance();
<?php elseif ($this->_tpl_vars['values']['reference_to'] != '' && ( $this->_tpl_vars['values']['transaction_type'] == @RECONCILE_DEBTOR_ACCOUNT || $this->_tpl_vars['values']['transaction_type'] == @RECONCILE_CREDITOR_ACCOUNT )): ?>
getReconcileBalance();
<?php endif; ?>
<?php if ($this->_tpl_vars['values']['trade_select'] != '' && ( $this->_tpl_vars['values']['transaction_type'] == @TRANSFER_OF_PAYMENT_BY_ORIGINATOR || $this->_tpl_vars['values']['transaction_type'] == @INBOUND_DEBTOR_PAYMENT || $this->_tpl_vars['values']['transaction_type'] == @INBOUND_CREDITOR_PAYMENT )): ?>
$('#row_reference_to').show();
$('#row_credit_txt').show();
checkDeductible();
checkTrailing();
<?php endif; ?>
<?php if ($this->_tpl_vars['values']['check_trailing'] != ''): ?>
checkTrailing();
<?php endif; ?>
<?php if ($this->_tpl_vars['values']['check_deductible'] != ''): ?>
checkDeductible();
<?php endif; ?>
$('#trade_select').click(function()
{
if($(this).attr('checked') != 'checked')
{
$('#row_reference_to').hide();
$('#row_credit_txt').hide();
$('#trailing').hide();
$('#deductibles').hide();
$('#row_deductible').hide();
}
else
{
$('#row_reference_to').show();
$('#row_credit_txt').show();
$('#trailing').show();
$('#deductibles').show();
//$('#row_deductible').show();
showTrades();
}
});
$(':checkbox').on('change',function(){
var th = $(this), name = th.prop('name');
if(th.is(':checked')){
$(':checkbox[name="' + name + '"]').not($(this)).prop('checked',false);
}
if(name=='check_deductible'){
$('#row_deductible').show();
$('#row_credit_note,#row_deductible_txt').show();
if($('input[name="check_deductible"]:checked').val()==undefined){
$('#row_deductible').hide();
$('#row_credit_note,#row_deductible_txt').hide();
$('#balance_deductible').val('');
$('#row_notes').removeClass('row1');
$('#row_notes').addClass('row1');
}else if($('input[name="check_deductible"]:checked').val()=='1')
{
$('#row_notes').removeClass('row1');
$('#row_notes').addClass('row1');
}else{
$('#row_notes').removeClass('row1');
$('#row_notes').addClass('row1');
}
}else{
if($('#transaction_type').val()!='<?php echo @RECONCILE_DEBTOR_ACCOUNT; ?>
' && $('#transaction_type').val()!='<?php echo @RECONCILE_CREDITOR_ACCOUNT; ?>
')
{
if($('input[name="check_deductible"]:checked').val()!=undefined && $('input[name="trade_select"]:checked').val()!=undefined )
{
$('#row_deductible').show();
$('#row_credit_note,#row_deductible_txt').show();
}else{
$('#row_deductible').hide();
$('#row_credit_note,#row_deductible_txt').hide();
}
}
}
});
$('#balance_deductible,#trailing_balance_amt').bind('blur keyup input',function(){
($('#transaction_type').val()=='<?php echo @RECONCILE_DEBTOR_ACCOUNT; ?>
' || $('#transaction_type').val()=='<?php echo @RECONCILE_CREDITOR_ACCOUNT; ?>
')?getReconcileBalance():getBalance();
});
function checkDeductible(){
$('#deductibles').show();
transaction_type = $('#transaction_type').val();
if($('input[name="check_deductible"]:checked').val()==undefined){
$('#row_deductible').hide();
$('#row_credit_note,#row_deductible_txt').hide();
$('#balance_deductible').val('');
$('#row_notes').removeClass('row1');
$('#row_notes').addClass('row1');
if(transaction_type=='<?php echo @RECONCILE_DEBTOR_ACCOUNT; ?>
' || transaction_type=='<?php echo @RECONCILE_CREDITOR_ACCOUNT; ?>
')
{
getReconcileBalance();
}else{
getBalance();
}
}else if($('input[name="check_deductible"]:checked').val()=='1')
{
$('#row_deductible').show();
$('#row_credit_note,#row_deductible_txt').show();
$('#row_notes').removeClass('row1');
$('#row_notes').addClass('row1');
if(transaction_type=='<?php echo @RECONCILE_DEBTOR_ACCOUNT; ?>
' || transaction_type=='<?php echo @RECONCILE_CREDITOR_ACCOUNT; ?>
')
{
getReconcileBalance();
}else{
getBalance();
}
// document.getElementById('txt_deductible').innerHTML = 'Single Deductible';
}else if($('input[name="check_deductible"]:checked').val()=='2'){
$('#row_deductible').show();
$('#row_credit_note,#row_deductible_txt').show();
$('#row_notes').removeClass('row1');
$('#row_notes').addClass('row1');
if(transaction_type=='<?php echo @RECONCILE_DEBTOR_ACCOUNT; ?>
' || transaction_type=='<?php echo @RECONCILE_CREDITOR_ACCOUNT; ?>
')
{
getReconcileBalance();
}else{
getBalance();
}
// document.getElementById('txt_deductible').innerHTML = 'Multiple Deductibles';
}
}
function checkTrailing(){
$('#trailing').show();
transaction_type = $('#transaction_type').val();
if($('input[name="check_trailing"]:checked').val()==undefined){
$('#row_trailing').hide();
$('#trailing_balance_amt').val('');
$('#row_notes').removeClass('row1');
$('#row_notes').addClass('row1');
if(transaction_type=='<?php echo @RECONCILE_DEBTOR_ACCOUNT; ?>
' || transaction_type=='<?php echo @RECONCILE_CREDITOR_ACCOUNT; ?>
'){
getReconcileBalance();
}else{
getBalance();
}
}else if($('input[name="check_trailing"]:checked').val()=='1')
{
$('#row_trailing').show();
$('#row_notes').removeClass('row1');
$('#row_notes').addClass('row1');
if(transaction_type=='<?php echo @RECONCILE_DEBTOR_ACCOUNT; ?>
' || transaction_type=='<?php echo @RECONCILE_CREDITOR_ACCOUNT; ?>
')
{
getReconcileBalance();
}else{
getBalance();
}
// document.getElementById('txt_deductible').innerHTML = 'Single Deductible';
}else if($('input[name="check_trailing"]:checked').val()=='2'){
$('#row_trailing').show();
$('#row_notes').removeClass('row1');
$('#row_notes').addClass('row1');
if(transaction_type=='<?php echo @RECONCILE_DEBTOR_ACCOUNT; ?>
' || transaction_type=='<?php echo @RECONCILE_CREDITOR_ACCOUNT; ?>
')
{
getReconcileBalance();
}else{
getBalance();
}
// document.getElementById('txt_deductible').innerHTML = 'Multiple Deductibles';
}
}
function getReconcilePayments(flag){
$('#row_fx_rate').show();
var transaction_type = $('#transaction_type').val();
var reconcile = $('#reconcile_payment').val();
val ='';
user_id = '<?php echo $_SESSION['user']['userid']; ?>
';
$("#debtor_id option:selected").each(function () {
val += $(this).val();
});
var amounts = $('#amount').val();
initialAmount = parseFloat(Math.round(amounts * 100) / 100);
initialAmount = initialAmount.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
$('#balance').html(initialAmount);
$.ajax({
type: "POST",
url: "?do=getreconcilepayments",
data: "id="+$("#debtor_id").val()+"&user_id="+user_id,
success: function(msg)
{
$('#d_reconcile').hide();
$('#reconcile').show();
if($("#debtor_id option:selected").val()!=undefined && $("#debtor_id option:selected").val()!='' && transaction_type!='')
{
if(reconcile!='0' && reconcile!=undefined)
{
deductiblesShow();
}
if(flag==1){
$("#err_reconcile").html(msg);
}else{
try{
$("#reconcile").html(msg);
}catch(errs){
if(transaction_type == '<?php echo @RECONCILE_DEBTOR_ACCOUNT; ?>
' || transaction_type == '<?php echo @RECONCILE_CREDITOR_ACCOUNT; ?>
'){
$('#row_reconcile').show();
}
}
}
if(transaction_type == '<?php echo @RECONCILE_DEBTOR_ACCOUNT; ?>
' || transaction_type == '<?php echo @RECONCILE_CREDITOR_ACCOUNT; ?>
'){
$('#row_reconcile').show();
$('#check_deductible').prop('checked', false);
$('#check_trailing').prop('checked', false);
}
}else{
$('#row_reconcile').hide();
$('#row_deductible').hide();
$('#row_trailing').hide();
}
}
});
}
function showReconcileTrades(flag){
$('#row_fx_rate').show();
var transaction_type = $('#transaction_type').val();
var trade_select = $('#trade_select').checked;
var reconcile = $('#reconcile_payment').val();
val ='';
user_id = '<?php echo $_SESSION['user']['userid']; ?>
';
$("#debtor_id option:selected").each(function () {
val += $(this).val() + ",";
});
var amounts = $('#amount').val();
initialAmount = parseFloat(Math.round(amounts * 100) / 100);
initialAmount = initialAmount.toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
$('#balance').html(initialAmount);
$.ajax({
type: "POST",
url: "?do=getreconciletrades",
data: "id="+$("#debtor_id").val()+"&user_id="+user_id+"&trans_id="+$('#reconcile_payment').val(),
success: function(msg){
$('#d_reference').hide();
$('#reference').show();
if($("#debtor_id option:selected").val()!=undefined && reconcile!='0' && reconcile!='' && transaction_type!='')
{
if(reconcile!='0'){
deductiblesShow();
}
if(flag==1){
$("#err_reference").html(msg);
}else{
try{
$("#reference").html(msg);
}catch(errs){
if(transaction_type == '<?php echo @RECONCILE_DEBTOR_ACCOUNT; ?>
' || transaction_type == '<?php echo @RECONCILE_CREDITOR_ACCOUNT; ?>
'){
$('#row_reference_to').show();
}
}
}
if((transaction_type == '<?php echo @RECONCILE_DEBTOR_ACCOUNT; ?>
' || transaction_type == '<?php echo @RECONCILE_CREDITOR_ACCOUNT; ?>
') && reconcile!='0' && reconcile!=''){
$('#row_reference_to').show();
$('#row_balance').show();
$('#row_notes').show();
$('#check_deductible').prop('checked', false);
$('#check_trailing').prop('checked', false);
}
}else{
$('#row_reference_to').hide();
$('#rec_deductibles').hide();
$('#row_deductible').hide();
$('#row_trailing').hide();
$('#row_balance').hide();
$('#row_notes').hide();
$('#check_deductible').prop('checked', false);
$('#check_trailing').prop('checked', false);
}
}
});
}
function deductiblesShow()
{
var $transaction_type = $('#transaction_type').val();
$('#rec_deductibles').show();
if( $transaction_type == <?php echo @INBOUND_CREDITOR_PAYMENT; ?>
|| $transaction_type == <?php echo @RECONCILE_CREDITOR_ACCOUNT; ?>
|| $transaction_type == <?php echo @CREDITOR_OUTBOUND_PAYMENT; ?>
|| $transaction_type == <?php echo @MERGE_INBOUND_DEBTOR_PAYMENT; ?>
|| $transaction_type == <?php echo @SPLIT_INBOUND_DEBTOR_PAYMENT; ?>
|| $transaction_type == <?php echo @OCPA_TO_ICP; ?>
|| $transaction_type == <?php echo @ICP_SPLIT; ?>
|| $transaction_type == <?php echo @ICP_MERGE; ?>
|| $transaction_type == <?php echo @OCPA_MERGE; ?>
)
{
$('#rec_deductibles').hide();
}
}
</script>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "footer.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
?>