?
Current Path : /home1/savoy/www/savoyglobal.net/drafthr/system/application/views/HR/ |
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/HR/viewsalpay.php |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?> <script type="text/javascript" src="<?=base_url()?>/assets/js/autonumeric.js"></script> <script type="text/javascript"> jQuery(document).ready(function () { $("input.autop").autoNumeric({ mNum: 2, mDec: 0 }); $("input.auto").autoNumeric(); }); </script> <?php $basicsalary = $salpay->basicsalary; $staffsalaryid=$salpay->id; $currency=$salpay->currencytype; $staffid=$salpay->staffid; $date = $salpay->date; $cur=$this->mastermodel->get_data_srow('country',$salpay->currencytype,'id'); $premium = 0; //foreach($premiumgen as $prem) //{ // $premium+=$prem['premium']; // // //} //$amount = 0; //foreach($premiumpay as $prempa) //{ // $amount+=$prempa['amount']; // // //} $stf=$this->mastermodel->get_data_srow('staffpersonaldetails',$staffid,'id'); $allowance=$this->mastermodel->get_data('allowdeduc','Allowance','allowdeductype'); $deduction=$this->mastermodel->get_data('allowdeduc','Deduction','allowdeductype'); $allowded=$this->mastermodel->get_data('staffsalaryallowdeduc',$staffsalaryid,'staffsalaryid'); $date=$this->mastermodel->convdatformat($date); ?> <?php $stfper=$this->mastermodel->get_data_srow('staffpersonaldetails',$staffid,'id'); $stfemp=$this->mastermodel->get_data_srow('staffemployeedetails',$staffid,'staffid'); $desg = $this->mastermodel->get_data_srow('designation',$stfemp->designationid,'id'); $dept= $this->mastermodel->get_data_srow('department',$stfemp->deptid,'id'); ?> <script type="text/javascript" src="<?=base_url()?>/assets/js/jquery.form.js"></script> <fieldset> <legend>Salary Details</legend> <?php $attributes = array('id' => 'singlesalaryform' ,'class'=>'customForm'); echo form_open('hr/addsalarypayment',$attributes); ?> <ul> <input type="hidden" name="staffsalaryid" id="staffsalaryid" value="<?=$staffsalaryid?>" /> <input type="hidden" name="currencytype" id="currencytype" value="<?=$salpay->currencytype?>" /> <input type="hidden" name="salarydate" id="salarydate" value="<?=$saldate?>" /> <input type="hidden" name="staff_id" id="staff_id" value="<?=$staffid?>" /> <?php if(!empty($desg)||!empty($dept)) { $designation=$desg->designation; $department=$dept->departmentname; } else { $designation=""; $department=""; } ?> <li id="stfinfodet"> <fieldset><ul><li><label>Employee No</label><label><?=$stfper->employeeid;?></label></li> <li><label>Designation</label><label><?=$designation;?></label></li> <li><label>Department</label><label><?=$department;?></label></li> </ul> </fieldset> </li> <li></li> <li> <table class="sort" cellpadding="0" cellspacing="0" align="left" > <tr> <th>Basic Salary</th> <th><?=$cur->currencycode ;?> <input type="text" id="basicsalary" name="basicsalary" class="auto" size="20" readonly value="<?=$basicsalary;?>" > <span id="basicsalaryInfo" class="red_bold">*</span> </th> </tr> </table> </li> <li> <table class="sort" cellpadding="0" cellspacing="0" align="left" > <caption>Allowance/Deduction Details</caption> <thead> <tr> <th>Title</th> <th>Mode</th> <th>Amount/Percentage</th> <th>Sub Total</th> <th>Type</th> </tr> </thead> <tbody> <?php $i=1; $allowanceamt = 0; foreach($allowance as $all) { $allowdeducname=$this->mastermodel->get_data_dual_srow('staffsalaryallowdeduc',$all['id'],'allowdeducid',$staffsalaryid,'staffsalaryid'); if(!empty($allowdeducname)) { $amount= $allowdeducname->amount; } else { $amount=0; } if($all['mode']==1) { $mode="Direct Amount"; $sf=1; $tamount= $amount * $sf; $subtotal= $tamount; } else { $mode="Percentage"; $sf=0.01; $tamount= $amount * $sf; $subtotal= $basicsalary *$tamount; } ?> <tr> <td ><?=$all['allowdeducname'];?><input type="hidden" value ="<?= $all['id'];?>" name="allowid_<?=$i;?>"></td> <td><?=$mode?></td> <td><input type="text" onblur="calculteallowancetotal(this.value,<?=$all['mode']?>,<?=$i?>)" name="allowvalue_<?=$i?>" value="<?=$amount?>" id="allowvalue_<?=$i?>" style="width:80%" <?php if($all['mode']==1) { ?> class="auto" <?php } else { ?> class="autop" <?php } ?> /> <?php if($all['mode']==0) { echo '%'; } ?> </td> <td><input type="text" name="alltotal_<?=$i?>" id="alltotal_<?=$i?>" value="<?=$subtotal?>" readonly /></td> <td>Allowance</td> </tr> <?php $allowanceamt += $subtotal; $i++; } ?> <input type="hidden" name="allowcount" id="allowcount" value="<?=$i?>" /> <?php $i=1; $deducamt=0; foreach($deduction as $ded) { $allowdeducname=$this->mastermodel->get_data_dual_srow('staffsalaryallowdeduc',$ded['id'],'allowdeducid',$staffsalaryid,'staffsalaryid'); if(!empty($allowdeducname)) { $amount= $allowdeducname->amount; } else { $amount=0; } if($ded['mode']==1) { $mode="Direct Amount"; $sf=1; $amount= $amount * $sf; $subtotal= $amount; } else { $mode="Percentage"; $sf=0.01; $amount= $amount * $sf; $subtotal= $basicsalary *$amount; } ?> <tr> <td><?=$ded['allowdeducname'];?><input type="hidden" value ="<?= $ded['id'];?>" name="deducid_<?=$i;?>"/></td> <td><?=$mode?></td> <td><input type="text" onblur="calcultedeductiontotal(this.value,<?=$ded['mode']?>,<?=$i?>)" name="deducvalue_<?=$i?>" value="<?=$amount?>" id="deducvalue_<?=$i?>" style="width:80%" <?php if($ded['mode']==1) { ?> class="auto" <?php } else { ?> class="autop" <?php } ?> /> <?php if($ded['mode']==0) { echo '%'; } ?> </td> <td><input type="text" name="dedtotal_<?=$i?>" id="dedtotal_<?=$i?>" value="<?=$subtotal?>" readonly /></td> <td>Deduction</td> </tr> <?php $i++; $deducamt += $subtotal; } ?> <input type="hidden" name="dedcount" id="dedcount" value="<?=$i?>" /> </tbody> </table> </li> <li> <table class="sort" cellpadding="0" cellspacing="0" align="left" > <caption>Salary Details</caption> <tr> <th>Allowance</th> <th>Deduction</th> <th>Commission</th> </tr> <tr> <td><input type="text" readonly style="width:80%" name="allowance" id="allowance" value="<?=$allowanceamt;?>"></td> <td><input type="text" style="width:80%" readonly name="deduction" id="deduction" value="<?=$deducamt;?>"></td> <td> <input type="text" style="width:80%" name="commission" class="auto" onblur="calculatepayamount(this.value)" id="commission" value="0"></td> </tr> <?php $grosssalary=$basicsalary+$allowanceamt; $netsalary=$grosssalary-$deducamt; ?> <tr> <th> Gross Salary </th> <th> Net Salary </th> <th> Pay Amount </th> </tr> <tr> <td><input type="text" readonly style="width:80%" name="grosssalary" id="grosssalary" value="<?=$grosssalary?>"></td> <td><input type="text" style="width:80%" readonly name="netsalary" id="netsalary" value="<?=$netsalary?>"></td> <td><input type="text" readonly style="width:80%" name="payamount" id="payamount" value="<?=$netsalary?>"></td> </tr> </table> </li> <?php /* if($compayable!=0) { ?> <li><label class="salary">Premium Target </label><label class="salary"> <?=$cur->currencycode ;?> <?php echo $target; ?></label> <input name="premiumtarget" value="<?php echo $target; ?>" type="hidden"> </li> <li><label class="salary">Premium Generated </label><label class="salary"><?=$cur->currencycode ;?> <?php echo $premium; ?></label> <input name="premiumgenerated" value="<?php echo $premium; ?>" type="hidden"> </li> <li><label class="salary">Premium Payment Received </label><label class="salary"><?=$cur->currencycode ;?> <?php echo $amount; ?></label> <input name="premiumpayrec" value="<?php echo $amount; ?>" type="hidden"> </li> <?php $comissionamt = ($amount - $target); ?> <li><label class="salary">Commission Entitlement on </label><label class="salary"> <?=$cur->currencycode ;?> <?php if($comissionamt > 0){ echo $comissionamt; } else echo 0;?></label> <input name="comenton" value="<?php echo $comissionamt; ?>" type="hidden"> </li> <li> <table class="sort" cellpadding="0" cellspacing="0" align="right" ><caption>Commission Earnings</caption> <thead><tr> <th>Type of Cover</th> <th>Commision(%)</th> <th>Amount Received</th> <th>Commission on (Amount Received - Target)</th> <th>Commision Amount</th> </tr> <?php $i=1; $totalpremium = 0; $flag = 0; foreach($premiumgen as $prem) { $covername=$this->mastermodel->get_data_srow('covers',$prem['cover_id'],'id'); $premiumpaid=$this->hrmodel->get_com_prempay_placinglsip($staffid,$date,$prem['placing_slip_id']); $amountpla = 0; foreach($premiumpaid as $prempai) { $amountpla+=$prempai['amount']; } ?> <tr> <td width="200px"><?=$covername->cover;?><input type="hidden" value ="<?= $prem['cover_id'];?>" name="cover_id_<?=$i;?>" </td><td><?= $prem['percentage'];?> <input type="hidden" value ="<?= $prem['percentage'];?>" name="comperc_<?=$i;?>"></td> <td><?=$amountpla;?><input type="hidden" value ="<?=$amountpla;?>" name="amtrec_<?=$i;?>" onchange="calculate();"></td> <td><input type="text" name="comon_<?=$i;?>" value="<?php if($flag == 0){ echo $comamt = ($amountpla - $target);} else { echo $comamt = $amountpla; }?>"></td> <td><input type="text" name="comamt_<?=$i;?>" value="<?php if ($comamt > 0){ echo $finprem = $comamt*$prem['percentage']/100; } else $finprem = 0;?>"> </tr> <?php $i++; if($comamt>0) $flag=1; $totalpremium += $finprem; } ?> <tr><td colspan="4">Total Commision</td><td><?=$cur->currencycode ;?> <?= $totalpremium;?></td></tr> </table> <?php } else { ?> <input name="premiumtarget" value="0" type="hidden"> <input name="premiumgenerated" value="0" type="hidden"> <input name="premiumpayrec" value="0" type="hidden"> <input name="comenton" value="0" type="hidden"> <?php } </li> */ ?> <label for="submit"> </label> <center> <button type="submit" class="clickimage" id="button1" onclick="return insertsinglesalarypayment();">Process</button> </center> </ul></fieldset> <?php echo form_close();?>