?
Current Path : /home1/savoy/www/savoyglobal.net/drafthr/system/application/views/Documents/ |
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/Documents/pslippayment.php |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); $this->load->view('Accounting/accounting_common_function');?> <script type="text/javascript" src="<?=base_url()?>/assets/js/autonumeric.js"></script> <script type="text/javascript"> jQuery(document).ready(function () { checkfiscalyear("fyear","mycompany"); check_tran_code_setting(5); check_tran_code_setting(6); Getmainacc_settings() $("input.auto").autoNumeric(); }); function Getmainacc_settings() { $.ajax({ type: "POST", url: "<?= site_url('settings/countmainacc_settings/') ?>/", success: function(msg){ if(msg==0) { $("#viewmsg").fadeIn(900,0); $("#viewmsg").html("<div style=\"border:2px solid red;padding-top:4px;text-align:center; width:500px;height:20px;margin-left:30%\" ><font color=\"red\" >Commission Payable A/c not Set</font></div>"); $('button[type=submit]#button1').attr('disabled', 'disabled'); } } }); } function check_tran_code_setting(val) { $.ajax({ type: "POST", url: "<?= site_url('accounting/checktrans_codeset/') ?>/"+val, success: function(msg){ if(msg==0) { $("#viewmsg").fadeIn(900,0); $("#viewmsg").html("<div style=\"border:2px solid red;padding-top:4px;text-align:center; width:500px;height:20px;margin-left:30%\" ><font color=\"red\" >Transaction Code not Set</font></div>"); $('button[type=submit]#button1').attr('disabled', 'disabled'); } } }); } function validations() { if(!validateform('insurance_company_id','refno','preamt')) { return false; } } </script> <div id="viewmsg"></div> <?php foreach($viewinfo as $updata) { $cover_id=$updata['cover_id']; $header=$updata['template_header']; $customer_id=$updata['customer_id']; $qdate=$updata['quotation_date']; $placingslip_id=$updata['id']; $qrefno=$updata['quotation_ref']; $typeof_policy=$updata['typeof_policy']; $currency=$updata['currencytype']; } $qdate=$this->mastermodel->convdatformat($qdate); $currency_type=$this->mastermodel->get_data_srow('country',$currency,'id'); $cr=$this->mastermodel->get_data_srow('covers',$cover_id,'id'); $type=$this->customermodel->getSingleFieldValue('customers','type','id',$customer_id); if($type=='Individual') { $name=$this->customermodel->getSingleFieldValue('customer_personal_ind','insured','customer_id',$customer_id); $business='NIL'; } else { $name=$this->customermodel->getSingleFieldValue('customer_corp_info','insured','customer_id',$customer_id); $business=$this->customermodel->getSingleFieldValue('customer_corp_info','business_activity','customer_id',$customer_id); } //$templatetype=$this->mastermodel->get_data_srow('template_type',$templatetype_id,'id'); $placingslipform=$this->mastermodel->get_data(' placing_slip_form',$placingslip_id,'placing_slip_id'); $policyfeesname=$this->documentsmodel->getpolicyfeesname($placingslip_id); $covername=$this->customermodel->getSingleFieldValue('covers','cover','id',$cover_id); $cust_acc=$this->accountingsmodel->get_acc_id('customers','code',$customer_id); $viewpslip_section_insured=$this->mastermodel->get_data('placing_slip_section',$placingslip_id,'placing_slip_id'); $premiumdetails=$this->mastermodel->get_data_srow('placing_slip_premiumdetails',$placingslip_id,'placing_slip_id'); $companyname=$this->mastermodel->get_data_srow('insurance_company',$premiumdetails->insurance_company_id,'id'); $stakeholders=$this->mastermodel->get_data('placing_slip_stakeholders',$placingslip_id,'placing_slip_id'); //$placing_slip_paymentdetails=$this->mastermodel->get_data('placing_slip_paymentdetails',$placingslip_id,'placing_slip_id'); $placing_slip_paymentdesc=$this->mastermodel->get_data_srow('placing_slip_paymentdetails',$placingslip_id,'placing_slip_id'); if(count($placing_slip_paymentdesc)!=0) { $amnt=$placing_slip_paymentdesc->amount; $desc=$placing_slip_paymentdesc->description; } else { $amnt=''; $desc=''; } $policyfees=$premiumdetails->policy_fees; $premium=$premiumdetails->premium ; $paymode=$premiumdetails->payment_method; $policyno= $this->customermodel->getSingleFieldValue('policynote','policyno','quotation_ref',$qrefno); $attributes = array('id' => 'customForm','name'=>'testform'); echo form_open('documents/insertplacingslippayment',$attributes); ?> <li></li> <fieldset> <legend>Premium Distribution</legend> <table id ='paymenttable' class="sort" > <tr><th colspan="3"> </th></tr> <tr> <td style="width:380px;"> <label style="color:#000;">Quotation Ref No</label> <label><?=$qrefno?></label> </td> <td> <label style="color:#000;">Policy No</label> </td> <td> <label><?=$policyno?></label> </td> </tr> <tr> <td> <label style="color:#000;">Insured</label> <label><?=$name;?></label> </td> <td> <label style="color:#000;">Type Of Cover</label> </td> <td> <label><?=$covername;?></label> </td> </tr> <tr> <td> <label style="color:#000;">Premium (<?=$currency_type->currencycode?>)</label> <label> <input type='text' readonly id='preamt' name='preamt' value='<?=$premium?>'/></label> </td> <td> <label style="color:#000;">Period Of Insurance</label> </td> <td > <label><?=$this->mastermodel->convdatformat($premiumdetails->fromdate)?> To <?=$this->mastermodel->convdatformat($premiumdetails->todate)?></label> </td> </tr> <tr> <td colspan="3"> <label style="color:#000;">Insurance Company</label> <?php echo '<input type="hidden" name="placing_slip_id" value="'.$placingslip_id.'">'; $company=$this->mastermodel->getdatas('insurance_company'); echo "<select name='insurance_company_id' id='insurance_company_id' >"; if($companyname->company_name) echo "<option value='".$companyname->id."'>$companyname->company_name</option>"; else echo "<option value='0'>Select Company</option>"; if (count($company)) { foreach ($company as $key => $list) { if($list['company_name']!=$companyname->company_name) echo "<option value='". $list['id'] . "'>" . $list['company_name'] . "</option>"; } echo "</select>"; echo ' <span id="insurance_company_idInfo" class="red_bold">*</span>'; } $brokerage=$premiumdetails->brokerage; $insurer= 100 - $brokerage; $brokeragecommission= $premium * ($brokerage/100); $insurercommission= $premium * ($insurer/100) +$policyfees; $totalcommission=$brokeragecommission+$insurercommission; ?> </td></tr> <?php $reff_id=$this->customermodel->getSingleFieldValue('placing_slip_refs','id','pslip_id',$placingslip_id); $refer=$this->customermodel->getSingleFieldValue('refs','reference','id',$reff_id); if($reff_id=='') { ?> <input type="hidden" name="refno" onblur="data_exist(this)" id="refno"/> <?php } else { ?> <input type="hidden" readonly value="<?=$refer?>" name="refno" id="refno"/> <?php } ?> </table> <table class="sort"> <tr> <th> <label style="color:#CC3300;">Premium Distribution</label>% </th> <th style="text-align:right"> <label style="color:#CC3300;">Amount</label> </th> </tr> <tr> <td> <label style="color:#000;">Brokerage</label> <input type='text' id='brokerage' readonly name='brokerage' value='<?=$brokerage?>'/> </td> <td style="text-align:right"> <label ><?=number_format($brokeragecommission,2)?></label> <input type="hidden" id="currencytype" name="currencytype" value="<?=$currency_type->currencycode?>"> </td> </tr> <tr> <td> <label style="color:#000;">Insurer</label> <input type='text' readonly id='insurer' name='insurer' value='<?=$insurer?>'/> </td> <td style="text-align:right"> <label><?=number_format($insurercommission,2)?></label> </td> </tr> <tr><th colspan="2"></th></tr> <tr > <td style="width:410px;"> <label> </label> <label>Total(<?=$currency_type->currencycode?>)</label> </td> <td style="text-align:right"> <label><?=number_format($totalcommission,2)?></label> </td> </tr> <tr> <td colspan="2"> <label style="color:#000;"><?=$policyfeesname?></label> <input type='text' id='policyfees' readonly name='policyfees' value='<?=$policyfees?>'/> </td> </tr> </table> <table class="sort" id="stakeholdertable"> <tr> <td colspan="2"><label style="color:#000;">Search Stake Holders</label> <img id="inlinestaff" src="<?=base_url()?>/assets/images/button-search.png" title="Search" class="clickimage" onclick="showstaffdiv()" ></td> </tr> <tr> <th> <label style="color:#CC3300;">Brokerage Distribution</label>% </th> <th style="text-align:right"> <label style="color:#CC3300;">Amount</label> </th> </tr> <?php if (count($stakeholders)>0) { $v=1; $sumpercent=0; foreach($stakeholders as $stakeval) { $sumpercent=$sumpercent+$stakeval['percentage']; $descamount= $premium *($stakeval['percentage']/100); $descamount=number_format($descamount, 2,'.',''); $staffname=$this->mastermodel->get_data_srow('staffpersonaldetails',$stakeval['staffid'],'id'); $agent_acc=$staffname->employeeid; ?> <tr id="brockingsplit<?=$v?>"> <td><label><?=$staffname->name?></label> <input type='hidden' name='staffid[]' value="<?=$staffname->id?>"> <input type="hidden" id="agent_acc<?=$v?>" name="agent_acc[]" value="<?=$agent_acc?>"/> <input type="text" id="brockamt<?=$v?>" name="brockamt[]" value="<?=$stakeval['percentage']?>" class="auto" onchange="calcbrockamt(document.getElementById('brockamt<?=$v?>').value,<?=$v?>)"></td> <td style="text-align:right"> <label><span id="brockeramount<?=$v?>"><?=number_format($descamount,2)?></span></label> <input type="hidden" name="brokeragesplitupamt[]" value="0" id="brokeragesplitupamt<?=$v?>"></td> </tr> <?php $v++; } $brokerpercent= $brokerage - $sumpercent; $descamount= $premium *($brokerpercent/100); $countcnt=$v-1; ?> <tr id="brockingsplit0"> <td style="width:410px;"> <label>Broker</label> <input type="text" id="brockamt0" name="brockeramt[]" value='<?=$brokerpercent?>' class="auto" onchange="calcbrockamt(document.getElementById('brockamt0').value,0)"> </td> <td style="text-align:right"> <label><span id="brockeramount0"><?=number_format($descamount,2)?></span></label> <input type="hidden" name="brokeragesplitupamt[]" value="0" id="brokeragesplitupamt0"> </td> </tr> <input type="hidden" name="countbrockamount" id="countbrockamount" value="<?=$countcnt?>"> <?php } else { ?> <input type="hidden" name="countbrockamount" id="countbrockamount" value="0"> <tr id="brockingsplit0"> <td style="width:410px;"> <label style="color:#000;">Broker</label> <input type="text" id="brockamt0" name='brockeramt[]' class="auto" value="<?=$brokerage?>" onchange="calcbrockamt(document.getElementById('brockamt0').value,0)"> </td> <td style="text-align:right"> <label> <span id='brockeramount0'> </span> </label> <input type="hidden" name="brokeragesplitupamt[]" value=0 id="brokeragesplitupamt0"> <label id="bcom"><span style="display:block;" ><?=number_format($brokeragecommission,2)?></span></label> </td> </tr> <?php } ?> <?php if($paymode=='credit') { $val= 'true'; } else { $val='false'; } ?> <input type="hidden" id="hiddentext" name="hiddentext" value="<?php echo $val; ?>"/> </table> <table class="sort"> <tr><th colspan="2"></th></tr> <tr> <td style="width:410px;"> <label> </label>Total(<?=$currency_type->currencycode?>) </td> <td style="text-align:right"> <label> <span id='stotalbroker' style="display:block;"><?=number_format($brokeragecommission,2)?></span> </label> </td> </tr> </table> <br/> <table> <tr id="payment_meth"> <td> <label style="color:#000;">Payment Method</label> <select id="paymethod" name="paymethod" > <option value="credit" <?php if($paymode=="credit"){ echo "selected"; } ?>>Credit</option> </select> <span id="paymethodInfo" class="red_bold">*</span> </td> </tr> </table> <br/> <br/> <input type="hidden" name="cust_acc" value="<?=$cust_acc?>"/> <input type="hidden" name="comp_amt" value="<?=$insurercommission?>"/> <?php $coveracc= $this->accountingsmodel->get_mainaccount_setting('cover_start'); $coveracc=$coveracc+$cover_id; ?> <input type="hidden" name="covr_acc" value="<?='CVR'.$cover_id?>"/> <input type="hidden" name="covrmain_acc" value="<?=$coveracc?>"/> <button type="submit" id="button1" class="clickimage" onclick="return validateform('insurance_company_id','preamt','paymethod');" >Save</button> <div id="temp" style="display:none"></div> </fieldset> <?php echo form_close();?>