?
Current Path : /home1/savoy/www/savoyglobal.net/drafthr/system/application/views/Accounting/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : /home1/savoy/www/savoyglobal.net/drafthr/system/application/views/Accounting/loadpayment_list.php |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?> <script type="text/javascript" src="<?=base_url()?>/assets/js/autonumeric.js"></script> <script> jQuery(document).ready(function () { $('.one').datepick({dateFormat: 'dd-mm-yyyy'}); $('input.auto').autoNumeric(); checkfiscalyear("fyear","mycompany"); }); function check_amount(total,paid,payid,cnt) { var pay=payid.value; if(pay=='') pay=0; var k; var sum_cnt=0; for(k=1;k<=cnt;k++) { var count=document.getElementById('Temp-'+k).value; if(count=='') count=0; sum_cnt=parseFloat(sum_cnt)+parseFloat(count); } document.getElementById('count').value=sum_cnt; var tot=parseFloat(total); var amount=parseFloat(paid)+parseFloat(pay); if( tot < amount) { alert('Amount is greater '); document.getElementById('count').value=''; payid.value=''; return false; } } function sumamount(total,premium,pay,txtbx) { if(isNaN(txtbx.value)) { txtbx.value="0"; } var tot_pre=parseFloat(pay)+parseFloat(txtbx.value); if(premium<tot_pre) { alert('you can\'t pay more than the payable amount ' ); txtbx.value=""; txtbx.focus(); return false; } var a=0; dml=document.forms['temp']; len = dml.elements.length; for( i=0 ; i<len ; i++) { if (dml.elements[i].name=='pay_amt[]') { var b=parseFloat(dml.elements[i].value); if(!isNaN(b)) { a+= b; if(total<a) { alert('your total allocated amount exceeds your limit '+ total); txtbx.value=""; txtbx.focus(); return; } } } } } function checknumeric() { $('input.auto').autoNumeric(); } </script> <?php $attributes = array('id' => 'customForm','name'=>'temp'); echo form_open('accounting/addemployeeallocation',$attributes); $cnt=count($bankpayment->result_array()); $idval=0; if($type==1) { echo "<table class='sort' style='margin:10px 0 10px 0' align='center' width=100%><tr><th width='15%'>Quotation Ref No</th><th width='15%'>Policy No</th><th width='10%'>Gross Premium</th><th width='10%'>Amount Payable</th><th width='10%'>Amount Paid</th><th width='10%'>Balance</th><th width='10%'>Pay</th><tr>"; $remain=$totalpaid-$totalalloc; echo '<caption>Amount to Be Allocated. '.$remain. ' out of ' . $totalpaid.'</caption>'; foreach ($bankpayment->result_array() as $payment) { $idval++; $brok=$payment['percentage']; //$payamt=$payment['amount']*($brok/100); $payalloc=$payment['alloc']; $tamount=str_replace('-','',$payment['tamount']); $balance=$tamount-$payment['alloc']; if($balance<=0) { $type='hidden'; } else { $type='text'; } echo "<tr><td>".$payment['quotation_ref']."</td><td>".$payment['policyno']."</td><td>".$payment['premium']."</td><td>".$tamount."</td><td>".$payment['alloc']."</td><td>".$balance."</td>"; echo "<td><input type='$type' style='width:120px;text-align:right;' class='auto' onfocus='checknumeric()' name='pay_amt[]' onblur='sumamount($remain,$tamount,$payalloc,this)' id='Temp-".$idval."' maxlength='10' /> <input type='hidden' name='p_id[]' value='".$payment['pid']."'/> <input type='hidden' name='prev_amt[]' value='".$payment['alloc']."'/><input type='hidden' name='t_no[]' value='".$payment['tno']."' /></td>"; echo '</tr>'; } echo "</td></tr></table>"; echo " <input type='hidden' name='alloc_table' value='agent_allocate'/> <input type='hidden' name='trans_table' value='agent_trans'/>"; } else if($type==2) { echo "<table class='sort' style='margin:10px 0 10px 0' width=100%><tr><th width='15%'>Quotation Ref No</th><th width='15%'>Policy No</th><th width='10%'>Gross Premium</th><th width='10%'>Amount Payable</th><th width='10%'>Amount Paid</th><th width='10%'>Balance</th><th width='10%'>Pay</th><tr>"; $remain=$totalpaid-$totalalloc; echo '<caption>Amount to Be Allocated. '.$remain. ' out of ' . $totalpaid.'</caption>'; foreach ($bankpayment->result_array() as $payment) { $idval++; $payalloc=$payment['alloc']; $brok=100-$payment['brokerage']; //$payamt=$payment['amount']*($brok/100); $tamount=str_replace('-','',$payment['tamount']); $balance=$tamount-$payment['alloc']; echo "<tr><td>".$payment['quotation_ref']."</td><td>".$payment['policyno']."</td><td>".$payment['premium']."</td><td>".$tamount."</td><td>".$payment['alloc']."</td><td>".$balance."</td>"; if($balance<=0) { $type='hidden'; } else { $type='text'; } echo "<td><input type='$type' style='width:120px;text-align:right;' class='auto' onfocus='checknumeric()' name='pay_amt[]' onblur='sumamount($remain,$tamount,$payalloc,this)' id='Temp-".$idval."' maxlength='10'/> <input type='hidden' name='p_id[]' value='".$payment['pid']."'/> <input type='hidden' name='prev_amt[]' value='".$payment['alloc']."'/><input type='hidden' name='t_no[]' value='".$payment['tno']."'/></td>"; echo '</tr>'; } echo "</td></tr></table>"; echo " <input type='hidden' name='alloc_table' value='company_allocate'/> <input type='hidden' name='trans_table' value='company_trans'/>"; } ?> <input type="hidden" name="account_code" value="<?=$account?>"> <input type="hidden" name="fromid" value="<?=$fromid?>"> <input type="hidden" name="bal_allocate" value="<?=$totalalloc?>"> <?php if(count($bankpayment->result_array())!=0) { echo "<input type='submit' name='submit' value='Process'/>"; } ?> <?=form_close() ?>