Change in UAN number pattern : GWM

This commit is contained in:
bitbucket 2024-08-21 14:19:01 +05:30
parent 2ccef97eb2
commit c3f406fbde
4 changed files with 785 additions and 745 deletions

View File

@ -778,7 +778,7 @@ class Payslip extends BaseController
$data['esi'] = $esi; $data['esi'] = $esi;
$data['pf'] = $pf; $data['pf'] = $pf;
$data['over_time'] = $ot; $data['over_time'] = $ot;
// dd($data);
//echo sizeof($data['fresh'])."-".sizeof($data['empSalary']);die; //echo sizeof($data['fresh'])."-".sizeof($data['empSalary']);die;
$this->global['pageTitle'] = 'Payroll Monthly Inputs'; $this->global['pageTitle'] = 'Payroll Monthly Inputs';
$this->loadViews("monthlypayinputs", $this->global, $data, NULL); $this->loadViews("monthlypayinputs", $this->global, $data, NULL);
@ -824,9 +824,9 @@ class Payslip extends BaseController
$ErrorFlag = 0; $ErrorFlag = 0;
$Emp = $j['Employee'];
$EmpID = substr($Emp, 0, 4);
$EmpID = $j['Emp ID'];
//$Name = $j['Employee Name']; //$Name = $j['Employee Name'];
//echo $EmpID; die; //echo $EmpID; die;
@ -838,7 +838,7 @@ class Payslip extends BaseController
$Loan_Recovered = $j['Manual Loan Due ₹']; $Loan_Recovered = $j['Manual Loan Due ₹'];
$Incentives = $j['Incentives in ₹']; $Incentives = $j['Incentives in ₹'];
$Festival_Bonus = $j['Festival Bonus in ₹']; $Festival_Bonus = $j['Festival Bonus in ₹'];
$Other_Deductions = $j['Other Deductions in ₹']; $Other_Deductions = $j['TDS Deductions in ₹'];
$Estimate = $j['Estimate in ₹']; $Estimate = $j['Estimate in ₹'];
$Created_By = $this->session->get('userId'); $Created_By = $this->session->get('userId');
@ -921,18 +921,13 @@ class Payslip extends BaseController
foreach ($json as $index => $j) { foreach ($json as $index => $j) {
$Emp = $j['Employee'];
// $EmpID = substr($Emp, 0, 4);
$parts = explode("-", $Emp);
$EmpID = $parts[0];
//$Name = $j['Employee'];
$EmpID = $j['Emp ID'];
$DaysWorked = $j['Days Worked']; $DaysWorked = $j['Days Worked'];
$LOP_Days = $j['LOP Days']; $LOP_Days = isset($j['LOP Days']) ? $j['LOP Days'] : 0.00;
$Paid_leave = $j['Paid Leave']; $Paid_leave = isset($j['Paid Leave']) ? $j['Paid Leave'] : 0.00;
$OT_Hrs_Worked = $j['OT Hrs']; $OT_Hrs_Worked = isset($j['OT Hrs']) ? $j['OT Hrs'] : 0.00;
$Loan_Recovered = isset($j['Manual Loan Due ₹']) ? $j['Manual Loan Due ₹'] : 0.00; $Loan_Recovered = isset($j['Manual Loan Due ₹']) ? $j['Manual Loan Due ₹'] : 0.00;
if (is_string($Loan_Recovered)) { if (is_string($Loan_Recovered)) {
$Loan_Recovered = strtoupper($Loan_Recovered); $Loan_Recovered = strtoupper($Loan_Recovered);
@ -944,7 +939,7 @@ class Payslip extends BaseController
$Created_By = $this->session->get('userId'); $Created_By = $this->session->get('userId');
$monthlypaydata = array('Month_Year' => $month, 'EmpID' => $EmpID, 'Days_worked' => $DaysWorked, 'LOP_Days' => $LOP_Days, 'Paid_leave' => $Paid_leave, 'OT_Hrs_Worked' => $OT_Hrs_Worked, 'Loan_Recovered' => $Loan_Recovered, 'Incentives' => $Incentives, 'Festival_Bonus' => $Festival_Bonus, 'Other_Deductions' => $Other_Deductions, 'Estimate' => $Estimate, 'Created_By' => $Created_By); $monthlypaydata = array('Month_Year' => $month, 'EmpID' => $EmpID, 'Days_worked' => $DaysWorked, 'LOP_Days' => $LOP_Days, 'Paid_leave' => $Paid_leave, 'OT_Hrs_Worked' => $OT_Hrs_Worked, 'Loan_Recovered' => $Loan_Recovered, 'Incentives' => $Incentives, 'Festival_Bonus' => $Festival_Bonus, 'Other_Deductions' => $Other_Deductions, 'Estimate' => $Estimate, 'Created_By' => $Created_By);
// print_r($monthlypaydata); die; //print_r($monthlypaydata); die;
$result = $this->monthlypay_model->saveMonthlyData_model($monthlypaydata); $result = $this->monthlypay_model->saveMonthlyData_model($monthlypaydata);
$total = $total + $result; $total = $total + $result;
} }
@ -993,8 +988,6 @@ class Payslip extends BaseController
$Data['Payon'] = $this->payroll_model->getPayOn(); $Data['Payon'] = $this->payroll_model->getPayOn();
$this->global['pageTitle'] = 'Payroll Generater'; $this->global['pageTitle'] = 'Payroll Generater';
$this->loadViews("payslipgenerate", $this->global, $Data, NULL); $this->loadViews("payslipgenerate", $this->global, $Data, NULL);
@ -1015,6 +1008,7 @@ class Payslip extends BaseController
$id = $this->request->getPost('id1'); $id = $this->request->getPost('id1');
$result = $this->payroll_model->getEmployeelist2($id); $result = $this->payroll_model->getEmployeelist2($id);
$HTML = ""; $HTML = "";
if (count($result) > 0) { if (count($result) > 0) {

View File

@ -394,7 +394,7 @@ function onlyAlphabets(evt) {
function validatePF() { function validatePF() {
var regpf = /^([a-zA-Z]){5}([0-9]){17}$/; var regpf = /^\d{12}$/;
var PF = $('#pfno').val(); var PF = $('#pfno').val();
@ -1005,8 +1005,8 @@ legend {
<input type="text" id="pfno" name="pfno" maxlength="22" <input type="text" id="pfno" name="pfno" maxlength="22"
onchange="validatePF();" class="form-control" onchange="validatePF();" class="form-control"
style="text-transform:uppercase" style="text-transform:uppercase"
pattern="([a-zA-Z]){5}([0-9]){17}" pattern="\d{12}"
title=" 5 Character and 17 Digit number (ex:ABCDE12345678901234567)" title="12 Digit number"
onkeypress="return alpha(event);"> onkeypress="return alpha(event);">
</div> </div>
</div> </div>

View File

@ -494,7 +494,7 @@ function validateESI() {
} }
function validatePF() { function validatePF() {
var regpf = /^([a-zA-Z]){5}([0-9]){17}?$/; var regpf = /^\d{12}$/;
var PF = $('#pfno').val(); var PF = $('#pfno').val();
@ -1307,8 +1307,8 @@ legend {
value="<?php echo $pfno; ?>" value="<?php echo $pfno; ?>"
onchange="validatePF();" class="form-control" onchange="validatePF();" class="form-control"
style="text-transform:uppercase" style="text-transform:uppercase"
pattern="([a-zA-Z]){5}([0-9]){17}" pattern="\d{12}"
title=" 5 Character and 17 Digit number (ex:ABCDE12345678901234567)" title="12 Digit number"
onkeypress="return alpha(event);"> onkeypress="return alpha(event);">
</div> </div>
</div> </div>

View File

@ -35,28 +35,24 @@
?> ?>
<script src="<?php echo base_url()?>public/assets/lightswitch/lightswitch/lib/jquery.tabletojson.js"></script> <script src="<?php echo base_url()?>public/assets/lightswitch/lightswitch/lib/jquery.tabletojson.js"></script>
<script src="<?php echo base_url()?>public/assets/lightswitch/lightswitch/lib/jquery.tabletojson.min.js"></script> <script src="<?php echo base_url()?>public/assets/lightswitch/lightswitch/lib/jquery.tabletojson.min.js"></script>
<script> <script>
$('html').bind('keypress', function(e) {
$('html').bind('keypress', function(e)
{
//alert('Key Pressed'); //alert('Key Pressed');
if(e.keyCode == 13) if (e.keyCode == 13) {
{
return false; return false;
} }
}); });
</script>
</script> <style type="text/css">
.num {
<style type="text/css"> text-align: right;
.num {
text-align:right;
} }
</style> </style>
<div class="content-wrapper"> <div class="content-wrapper">
<!-- Content Header (Page header) --> <!-- Content Header (Page header) -->
<section class="content-header"> <section class="content-header">
<h1> <h1>
@ -65,7 +61,7 @@ $('html').bind('keypress', function(e)
</section> </section>
<section class="content"> <section class="content">
<input type="hidden" id="paydate" value="<?php echo $drop;?>"/> <input type="hidden" id="paydate" value="<?php echo $drop;?>" />
<div class="row"> <div class="row">
<div class="col-xs-12"> <div class="col-xs-12">
<div class="box"> <div class="box">
@ -73,10 +69,13 @@ $('html').bind('keypress', function(e)
<!--<center><h3 class="box-title">--> <!--<center><h3 class="box-title">-->
<div class="box-tools"> <div class="box-tools">
<!-- <form action="<?php echo base_url() ?>assetListing" method="POST" id="searchList">--> <!-- <form action="<?php echo base_url() ?>assetListing" method="POST" id="searchList">-->
<p><b>The <span style="background-color:#ff4d4d;">Red</span> highlighted Employee have loan to pay. Put <span style="background-color:#66ff33;">'NA'</span> for Skip Current Month Loan Due.</b></p> <p><b>The <span style="background-color:#ff4d4d;">Red</span> highlighted Employee have loan
to pay. Put <span style="background-color:#66ff33;">'NA'</span> for Skip Current
Month Loan Due.</b></p>
<form action="<?php echo base_url() ?>monthlyListings" method="POST" id="searchList"> <form action="<?php echo base_url() ?>monthlyListings" method="POST" id="searchList">
</form> </form>
</div><!--</h3></center>--> </div>
<!--</h3></center>-->
</div><!-- /.box-header --> </div><!-- /.box-header -->
<?php <?php
@ -158,8 +157,9 @@ $('html').bind('keypress', function(e)
</div> </div>
</div> </div>
<div style="overflow-x:scroll;"> <div style="overflow-x:scroll;">
<table id="monthlylistings" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px" > <table id="monthlylistings" class="table table-bordered table-hover"
style="background-color:#fff;font-size:12px">
<thead style="background-color: #ddd;"> <thead style="background-color: #ddd;">
<tr> <tr>
@ -227,7 +227,8 @@ $('html').bind('keypress', function(e)
?> ?>
<tr class="lastvalue"> <tr class="lastvalue">
<td style="text-align:right;" style="background-color:blue;"><?php echo $index; ?></td> <td style="text-align:right;" style="background-color:blue;">
<?php echo $index; ?></td>
<td style="max-width:80px"><?php echo $record->EmpID ; ?></td> <td style="max-width:80px"><?php echo $record->EmpID ; ?></td>
<td style="max-width:80px"><?php echo $record->FirstName; ?></td> <td style="max-width:80px"><?php echo $record->FirstName; ?></td>
<td style="max-width:80px"> <td style="max-width:80px">
@ -239,19 +240,54 @@ $('html').bind('keypress', function(e)
</td> </td>
<td style="max-width:80px"><?php echo $record->Designation; ?></td> <td style="max-width:80px"><?php echo $record->Designation; ?></td>
<td style="max-width:80px"><?php echo $record->NoofDays; ?></td> <td style="max-width:80px"><?php echo $record->NoofDays; ?></td>
<td id="dayWork<?php echo $index?>"<?php if(empty($record->Key)){echo "contenteditable='false';"; } ?> <?php if(!empty($record->Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"<?php } else{?>style="text-align:right;"<?php }?> ><?php if(!empty($record->Days_worked)){echo $record->Days_worked+$record->sunday_count;}else{echo "0.00";}?></td> <td id="dayWork<?php echo $index?>"
<td id="lopDay<?php echo $index?>"<?php if(empty($record->Key)){echo "contenteditable='false';"; } ?> <?php if(!empty($record->Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"<?php } else{?>style="text-align:right;"<?php }?> ><?php if(!empty($record->LOP_Days)){echo $record->LOP_Days;}else{echo "0.00";}?></td> <?php if(empty($record->Key)){echo "contenteditable='false';"; } ?>
<td id="paidLeave<?php echo $index?>"<?php if(empty($record->Key)){echo "contenteditable='false';"; } ?> <?php if(!empty($record->Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"<?php } else{?>style="text-align:right;"<?php }?> ><?php if(!empty($record->Paid_leave)){echo number_format($record->Paid_leave,2,'.','');}else { echo number_format(0.00,2,'.','');} ?></td> <?php if(!empty($record->Key)){?> title="Payslip Calculated"
<td id="otHrsWork<?php echo $index?>"<?php if(empty($record->Key)){echo "contenteditable='false';"; } ?> <?php if(!empty($record->Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"<?php } else{?>style="text-align:right;"<?php }?> ><?php if(!empty($record->OT_Hrs_Worked)){echo $record->OT_Hrs_Worked;}else { echo number_format(0.00,2,'.','');} ?></td> style="text-align:right;color:blue;"
<?php } else{?>style="text-align:right;" <?php }?>>
<?php if(!empty($record->Days_worked)){echo $record->Days_worked+$record->sunday_count;}else{echo "0.00";}?>
</td>
<td id="lopDay<?php echo $index?>"
<?php if(empty($record->Key)){echo "contenteditable='false';"; } ?>
<?php if(!empty($record->Key)){?> title="Payslip Calculated"
style="text-align:right;color:blue;"
<?php } else{?>style="text-align:right;" <?php }?>>
<?php if(!empty($record->LOP_Days)){echo $record->LOP_Days;}else{echo "0.00";}?>
</td>
<td id="paidLeave<?php echo $index?>"
<?php if(empty($record->Key)){echo "contenteditable='false';"; } ?>
<?php if(!empty($record->Key)){?> title="Payslip Calculated"
style="text-align:right;color:blue;"
<?php } else{?>style="text-align:right;" <?php }?>>
<?php if(!empty($record->Paid_leave)){echo number_format($record->Paid_leave,2,'.','');}else { echo number_format(0.00,2,'.','');} ?>
</td>
<td id="otHrsWork<?php echo $index?>"
<?php if(empty($record->Key)){echo "contenteditable='false';"; } ?>
<?php if(!empty($record->Key)){?> title="Payslip Calculated"
style="text-align:right;color:blue;"
<?php } else{?>style="text-align:right;" <?php }?>>
<?php if(!empty($record->OT_Hrs_Worked)){echo $record->OT_Hrs_Worked;}else { echo number_format(0.00,2,'.','');} ?>
</td>
<td style="max-width:80px"><?php echo $record->TotalSalary; ?></td> <td style="max-width:80px"><?php echo $record->TotalSalary; ?></td>
<td style="max-width:80px"><?php $perDaySalary = $record->TotalSalary / $record->NoofDays; echo number_format($perDaySalary, 2); ?></td> <td style="max-width:80px">
<td style="max-width:80px"><?php $workedSalary = $perDaySalary * ($record->Days_worked+$record->sunday_count); echo number_format($workedSalary, 2); ?></td> <?php $perDaySalary = $record->TotalSalary / $record->NoofDays; echo number_format($perDaySalary, 2); ?>
<td style="max-width:80px"><?php $perHrSalary = $perDaySalary / 8; echo number_format($perHrSalary, 2); ?></td> </td>
<td style="max-width:80px">
<?php $workedSalary = $perDaySalary * ($record->Days_worked+$record->sunday_count); echo number_format($workedSalary, 2); ?>
</td>
<td style="max-width:80px">
<?php $perHrSalary = $perDaySalary / 8; echo number_format($perHrSalary, 2); ?>
</td>
<td style="max-width:80px"><?php echo number_format($workedSalary, 2); ?></td> <td style="max-width:80px"><?php echo number_format($workedSalary, 2); ?></td>
<td style="max-width:80px"><?php $basicWorked = $workedSalary * 70 / 100; echo number_format($basicWorked, 2); ?></td> <td style="max-width:80px">
<td style="max-width:80px"><?php $hraWorked = $workedSalary * 30 / 100; echo number_format($hraWorked, 2); ?></td> <?php $basicWorked = $workedSalary * 70 / 100; echo number_format($basicWorked, 2); ?>
<td style="max-width:80px"><?php echo number_format($basicWorked+$hraWorked, 2); ?></td> </td>
<td style="max-width:80px">
<?php $hraWorked = $workedSalary * 30 / 100; echo number_format($hraWorked, 2); ?>
</td>
<td style="max-width:80px">
<?php echo number_format($basicWorked+$hraWorked, 2); ?></td>
<td style="max-width:80px"> <?php echo $esi[$i]; ?> </td> <td style="max-width:80px"> <?php echo $esi[$i]; ?> </td>
<td style="max-width:80px"> <?php echo $pf[$i]; ?> </td> <td style="max-width:80px"> <?php echo $pf[$i]; ?> </td>
<td style="max-width:80px"> <?php echo $over_time[$i]; ?> </td> <td style="max-width:80px"> <?php echo $over_time[$i]; ?> </td>
@ -260,25 +296,38 @@ $('html').bind('keypress', function(e)
<td id="monthDue<?php echo $index?>" <?php if(empty($record->Key)){echo "contenteditable='false';"; } ?> <?php if(!empty($record->Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"<?php } else{?>style="text-align:right;"<?php }?> ><?php if(!empty($record->Monthly_Due)){echo $record->Monthly_Due; $totalmonthloan []=$record->Monthly_Due;}else { echo number_format(0.00,2,'.','');} ?></td> <td id="monthDue<?php echo $index?>"
<?php if(empty($record->Key)){echo "contenteditable='false';"; } ?>
<?php if(!empty($record->Key)){?> title="Payslip Calculated"
style="text-align:right;color:blue;"
<?php } else{?>style="text-align:right;" <?php }?>>
<?php if(!empty($record->Monthly_Due)){echo $record->Monthly_Due; $totalmonthloan []=$record->Monthly_Due;}else { echo number_format(0.00,2,'.','');} ?>
</td>
<td id="loanRecd<?php echo $index?>" onkeypress="return isCheckKeyCode(event);" onkeyup="changeInput(event);"<?php if(empty($record->Key) && !empty($record->Loan_ID)){ echo "contenteditable='true'; style='background-color:#ffcccc;text-align:right' title='Loan Pending'"; } ?> <?php if(!empty($record->Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"<?php } else{?>style="text-align:right;"<?php }?> > <td id="loanRecd<?php echo $index?>" onkeypress="return isCheckKeyCode(event);"
onkeyup="changeInput(event);"
<?php if(empty($record->Key) && !empty($record->Loan_ID)){ echo "contenteditable='true'; style='background-color:#ffcccc;text-align:right' title='Loan Pending'"; } ?>
<?php if(!empty($record->Key)){?> title="Payslip Calculated"
style="text-align:right;color:blue;"
<?php } else{?>style="text-align:right;" <?php }?>>
<?php if(!empty($record->Loan_Recovered)) <?php if(!empty($record->Loan_Recovered))
{if(is_numeric($record->Loan_Recovered)){echo number_format($record->Loan_Recovered,2,'.',''); $totalmanualoan[] = $record->Loan_Recovered;}else {echo $record->Loan_Recovered; $totalmanualoan[] = $record->Loan_Recovered;}}else{echo number_format(0.00,2,'.',''); $totalmanualoan[] = 0;} ?> { if(is_numeric($record->Loan_Recovered)){echo number_format($record->Loan_Recovered,2,'.',''); $totalmanualoan[] = $record->Loan_Recovered;}else {echo $record->Loan_Recovered; $totalmanualoan[] = $record->Loan_Recovered;}}else{echo number_format(0.00,2,'.',''); $totalmanualoan[] = 0;} ?>
</td> </td>
<td id="incentie<?php echo $index?>" onkeypress="return isNumber(event);" onkeyup="changeInput(event);"<?php if(empty($record->Key)){echo "contenteditable='true';"; } ?> <?php if(!empty($record->Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"<?php } else{?>style="text-align:right;"<?php }?> > <td id="incentie<?php echo $index?>" onkeypress="return isNumber(event);"
onkeyup="changeInput(event);"
<?php if(empty($record->Key)){echo "contenteditable='true';"; } ?>
<?php if(!empty($record->Key)){?> title="Payslip Calculated"
style="text-align:right;color:blue;"
<?php } else{?>style="text-align:right;" <?php }?>>
<!-- <?php if(!empty($record->MasterIncentives)){echo $record->MasterIncentives;}else {echo $record->MonthlyIncentives;} ?> --> <!-- <?php if(!empty($record->MasterIncentives)){echo $record->MasterIncentives;}else {echo $record->MonthlyIncentives;} ?> -->
<?php if(!empty($record->MonthlyIncentives)){echo $record->MonthlyIncentives; $totalinst [] = $record->MonthlyIncentives;}else {echo $record->MasterIncentives; $totalinst [] = $record->MasterIncentives;} <?php if(!empty($record->MonthlyIncentives)){echo $record->MonthlyIncentives; $totalinst [] = $record->MonthlyIncentives;}else {echo $record->MasterIncentives; $totalinst [] = $record->MasterIncentives;}
@ -291,14 +340,31 @@ $('html').bind('keypress', function(e)
<?php ?> <?php ?>
<!-- else{ echo number_format(0.00,2,'.','');;} --> <!-- else{ echo number_format(0.00,2,'.','');;} -->
<td id ="otherDet<?php echo $index?>" onkeypress="return isNumber(event);" onkeyup="changeInput(event);"<?php if(empty($record->Key)){echo "contenteditable='true';"; } ?> <?php if(!empty($record->Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"<?php } else{?>style="text-align:right;"<?php }?> ><?php if(!empty($record->Other_Deductions)){echo $record->Other_Deductions;$totalotherDet [] = $record->Other_Deductions;}else{ echo number_format(0.00,2,'.','');} ?></td> <td id="otherDet<?php echo $index?>" onkeypress="return isNumber(event);"
onkeyup="changeInput(event);"
<?php if(empty($record->Key)){echo "contenteditable='true';"; } ?>
<?php if(!empty($record->Key)){?> title="Payslip Calculated"
style="text-align:right;color:blue;"
<?php } else{?>style="text-align:right;" <?php }?>>
<?php if(!empty($record->Other_Deductions)){echo $record->Other_Deductions;$totalotherDet [] = $record->Other_Deductions;}else{ echo number_format(0.00,2,'.','');} ?>
</td>
<?php $totalotherDet [] = isset($Other_Deductions) ? $Other_Deductions : [];?> <?php $totalotherDet [] = isset($Other_Deductions) ? $Other_Deductions : [];?>
<td id="Festival<?php echo $index?>"onkeypress="return isNumber(event);" onkeyup="changeInput(event);"<?php if(empty($record->Key)){echo "contenteditable='true';"; } ?> <?php if(!empty($record->Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"<?php } else{?>style="text-align:right;"<?php }?> ><?php if(!empty($record->Festival_Bonus)){echo $record->Festival_Bonus;$totalfestival [] = $record->Festival_Bonus;}else{ echo number_format(0.00,2,'.','');;} ?></td> <td id="Festival<?php echo $index?>" onkeypress="return isNumber(event);"
onkeyup="changeInput(event);"
<?php if(empty($record->Key)){echo "contenteditable='true';"; } ?>
<?php if(!empty($record->Key)){?> title="Payslip Calculated"
style="text-align:right;color:blue;"
<?php } else{?>style="text-align:right;" <?php }?>>
<?php if(!empty($record->Festival_Bonus)){echo $record->Festival_Bonus;$totalfestival [] = $record->Festival_Bonus;}else{ echo number_format(0.00,2,'.','');;} ?>
</td>
<?php $totalfestival [] = isset($Festival_Bonus) ? $Festival_Bonus : [];?> <?php $totalfestival [] = isset($Festival_Bonus) ? $Festival_Bonus : [];?>
<td id="empsal<?php echo $index?>"<?php if(empty($record->Key)){echo "contenteditable='false';"; } ?> <?php if(!empty($record->Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"<?php }?>> <td id="empsal<?php echo $index?>"
<?php if(empty($record->Key)){echo "contenteditable='false';"; } ?>
<?php if(!empty($record->Key)){?> title="Payslip Calculated"
style="text-align:right;color:blue;" <?php }?>>
<?php if(!empty($record->Estimate)){ <?php if(!empty($record->Estimate)){
echo $record->Estimate; $estTotal [] = $record->Estimate; echo $record->Estimate; $estTotal [] = $record->Estimate;
}else { }else {
@ -316,20 +382,30 @@ $('html').bind('keypress', function(e)
<!--<input type="hidden" id = "eid" value="<?php echo $record->EmpID?>"> <!--<input type="hidden" id = "eid" value="<?php echo $record->EmpID?>">
<input type="hidden" id = "inv" value="<?php echo $record->Incentives?>"> <input type="hidden" id = "inv" value="<?php echo $record->Incentives?>">
<input type="hidden" id = "pdi" value="<?php echo $record->Pay_Data_ID?>"> --> <input type="hidden" id = "pdi" value="<?php echo $record->Pay_Data_ID?>"> -->
<input type="hidden" id = "bPay<?php echo $index?>" value="<?php echo $record->Basic_Pay?>"> <input type="hidden" id="bPay<?php echo $index?>"
<input type="hidden" id = "hraRate<?php echo $index?>" value="<?php echo $record->HRA_Rate?>"> value="<?php echo $record->Basic_Pay?>">
<input type="hidden" id = "allow<?php echo $index?>" value="<?php echo $record->Allowances?>"> <input type="hidden" id="hraRate<?php echo $index?>"
<input type="hidden" id = "fAllow<?php echo $index?>" value="<?php echo $record->Food_Allowances?>"> value="<?php echo $record->HRA_Rate?>">
<input type="hidden" id = "pfRate<?php echo $index?>" value="<?php echo $record->PF_Rate?>"> <input type="hidden" id="allow<?php echo $index?>"
<input type="hidden" id = "eslRate<?php echo $index?>" value="<?php echo $record->ESI_Rate?>"> value="<?php echo $record->Allowances?>">
<input type="hidden" id = "hraAmt<?php echo $index?>" value="<?php echo $record->HRA_Amount?>"> <input type="hidden" id="fAllow<?php echo $index?>"
value="<?php echo $record->Food_Allowances?>">
<input type="hidden" id="pfRate<?php echo $index?>"
value="<?php echo $record->PF_Rate?>">
<input type="hidden" id="eslRate<?php echo $index?>"
value="<?php echo $record->ESI_Rate?>">
<input type="hidden" id="hraAmt<?php echo $index?>"
value="<?php echo $record->HRA_Amount?>">
<input type="hidden" id = "loanamt<?php echo $index?>" value="<?php echo isset($record->Loan_amount) ? $record->Loan_amount : 0?>"> <input type="hidden" id="loanamt<?php echo $index?>"
<input type="hidden" id = "paidamt<?php echo $index?>" value="<?php echo $record->Paid_Amount?>"> value="<?php echo isset($record->Loan_amount) ? $record->Loan_amount : 0?>">
<input type="hidden" id="paidamt<?php echo $index?>"
value="<?php echo $record->Paid_Amount?>">
<input type="hidden" id = "duedate<?php echo $index?>" value="<?php echo $record->DueDate?>"> <input type="hidden" id="duedate<?php echo $index?>"
value="<?php echo $record->DueDate?>">
<!-- <input type="hidden" id = "eid" value="<?php echo $record->TotalSalary?>"> <!--<input type="hidden" id = "eid" value="<?php echo $record->TotalSalary?>">
<input type="hidden" id = "eid" value="<?php echo $record->LOP_Days?>"> <input type="hidden" id = "eid" value="<?php echo $record->LOP_Days?>">
<input type="hidden" id = "eid" value="<?php echo $record->Paid_leave?>"> <input type="hidden" id = "eid" value="<?php echo $record->Paid_leave?>">
<input type="hidden" id = "eid" value="<?php echo $record->OT_Hrs_Worked?>"> <input type="hidden" id = "eid" value="<?php echo $record->OT_Hrs_Worked?>">
@ -350,16 +426,22 @@ $('html').bind('keypress', function(e)
?> ?>
</tbody> </tbody>
<tfoot><tr> <tfoot>
<tr>
<th colspan="5"></th> <th colspan="5"></th>
<th>Total</th> <th>Total</th>
<th id="manualoan"><?php echo isset($totalmonthloan) ? array_sum($totalmonthloan) : '';?></th> <th id="manualoan">
<th id="monthloan"><?php echo isset($totalmonthloan) ? array_sum($totalmanualoan) : '' ;?></th> <?php echo isset($totalmonthloan) ? array_sum($totalmonthloan) : '';?></th>
<th id="monthloan">
<?php echo isset($totalmonthloan) ? array_sum($totalmanualoan) : '' ;?>
</th>
<th id="inst"><?php echo isset($totalins) ? array_sum($totalinst) : '' ;?></th> <th id="inst"><?php echo isset($totalins) ? array_sum($totalinst) : '' ;?></th>
<th id="other"><?php echo isset($totalotherDet) ? array_sum($totalotherDet): '' ;?></th> <th id="other">
<th id="fest"><?php echo isset($totalfestival) ? array_sum($totalfestival): '' ;?></th> <?php echo isset($totalotherDet) ? array_sum($totalotherDet): '' ;?></th>
<th id="fest">
<?php echo isset($totalfestival) ? array_sum($totalfestival): '' ;?></th>
<th id="estsal"><?php echo isset($estTotal) ? array_sum($estTotal): '' ;?></th> <th id="estsal"><?php echo isset($estTotal) ? array_sum($estTotal): '' ;?></th>
</tr> </tr>
@ -369,7 +451,8 @@ $('html').bind('keypress', function(e)
<p>&nbsp;</p> <p>&nbsp;</p>
<div class="row"> <div class="row">
<div class="col-md-3" id="savebutton"> <div class="col-md-3" id="savebutton">
<input type="button" id="submit" value = "Save" class="btn btn-success" onclick="getAllData();"> <input type="button" id="submit" value="Save" class="btn btn-success"
onclick="getAllData();">
</div> </div>
</div> </div>
</div><!-- /.box-body --> </div><!-- /.box-body -->
@ -380,52 +463,52 @@ $('html').bind('keypress', function(e)
</div> </div>
</div> </div>
</section> </section>
</div> </div>
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script> <script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
<script type="text/javascript"> <script type="text/javascript">
var estTotal = []; var estTotal = [];
var totalinst = []; var totalinst = [];
var totalotherDet =[]; var totalotherDet = [];
var totalmonthloan =[]; var totalmonthloan = [];
var totalmanualoan =[]; var totalmanualoan = [];
$(function () { $(function() {
var i = 0; var i = 0;
$('tr.lastvalue').each(function(){ $('tr.lastvalue').each(function() {
i = i+1; i = i + 1;
estTotal [i]=$(this).find('td').eq(11).text(); estTotal[i] = $(this).find('td').eq(11).text();
}); });
var i = 0; var i = 0;
$('tr.lastvalue').each(function(){ $('tr.lastvalue').each(function() {
i = i+1; i = i + 1;
totalinst [i]=$(this).find('td').eq(8).text(); totalinst[i] = $(this).find('td').eq(8).text();
}); });
var i = 0; var i = 0;
$('tr.lastvalue').each(function(){ $('tr.lastvalue').each(function() {
i = i+1; i = i + 1;
totalotherDet [i]=$(this).find('td').eq(9).text(); totalotherDet[i] = $(this).find('td').eq(9).text();
}); });
var i = 0; var i = 0;
$('tr.lastvalue').each(function(){ $('tr.lastvalue').each(function() {
i = i+1; i = i + 1;
totalmanualoan [i]=$(this).find('td').eq(6).text(); totalmanualoan[i] = $(this).find('td').eq(6).text();
}); });
//console.log(totalmanualoan); //console.log(totalmanualoan);
var i = 0; var i = 0;
$('tr.lastvalue').each(function(){ $('tr.lastvalue').each(function() {
i = i+1; i = i + 1;
totalmonthloan[i]=$(this).find('td').eq(7).text(); totalmonthloan[i] = $(this).find('td').eq(7).text();
}); });
//console.log(totalmonthloan); //console.log(totalmonthloan);
/* $('#monthlylisting').DataTable({ /* $('#monthlylisting').DataTable({
"paging": true, "paging": true,
"lengthChange": true, "lengthChange": true,
@ -448,12 +531,12 @@ $('html').bind('keypress', function(e)
// show_hide_column(11,key); // show_hide_column(11,key);
var t = $('#monthlylistings').DataTable( { var t = $('#monthlylistings').DataTable({
"columnDefs": [ { "columnDefs": [{
"searchable": false, "searchable": false,
"orderable": false, "orderable": false,
"targets": 0 "targets": 0
} ], }],
"searching": true, "searching": true,
"lengthChange": true, "lengthChange": true,
"info": true, "info": true,
@ -461,59 +544,67 @@ $('html').bind('keypress', function(e)
"autoWidth": true, "autoWidth": true,
// "scrollX": true, // "scrollX": true,
"order": [[ 1, 'asc' ]], "order": [
} ); [1, 'asc']
],
});
t.on( 'order.dt search.dt', function () { t.on('order.dt search.dt', function() {
t.column(0, {search:'applied', order:'applied'}).nodes().each( function (cell, i) { t.column(0, {
cell.innerHTML = i+1; search: 'applied',
} ); order: 'applied'
} ).draw(); }).nodes().each(function(cell, i) {
cell.innerHTML = i + 1;
});
}).draw();
var s = "<?php echo $drop; ?>"; var s = "<?php echo $drop; ?>";
$('#monthyear').val(s); $('#monthyear').val(s);
savebuttonvalidation(); savebuttonvalidation();
}); });
function isNumber(evt) { function isNumber(evt) {
//alert("hi"); //alert("hi");
var iKeyCode = (evt.which) ? evt.which : evt.keyCode var iKeyCode = (evt.which) ? evt.which : evt.keyCode
if (iKeyCode != 46 && iKeyCode > 31 && (iKeyCode < 48 || iKeyCode > 57)) if (iKeyCode != 46 && iKeyCode > 31 && (iKeyCode < 48 || iKeyCode > 57)) {
{ return false;} return false;
return true;
} }
function isCheckKeyCode(event){ return true;
}
function isCheckKeyCode(event) {
var iKeyCode = (event.which) ? event.which : event.keyCode var iKeyCode = (event.which) ? event.which : event.keyCode
if (iKeyCode != 46 && iKeyCode > 31 && (iKeyCode < 48 || iKeyCode > 57 ) && (iKeyCode ==78 && iKeyCode == 65)) if (iKeyCode != 46 && iKeyCode > 31 && (iKeyCode < 48 || iKeyCode > 57) && (iKeyCode == 78 && iKeyCode == 65)) {
{ return false;} return false;
}
return true; return true;
} }
function getAllData() function getAllData() {
{
var alldata = $("#monthlylistings").tableToJSON(); var alldata = $("#monthlylistings").tableToJSON();
//alert(JSON.stringify(alldata)); //alert(JSON.stringify(alldata));
alldata=JSON.stringify(alldata) alldata = JSON.stringify(alldata)
var month = $('#monthyear').val(); var month = $('#monthyear').val();
$('.content').loader('show'); $('.content').loader('show');
$.ajax({ $.ajax({
data:{param1:alldata,param2:month}, data: {
param1: alldata,
param2: month
},
//dataType:"json", //dataType:"json",
type:"POST", type: "POST",
url:"<?php echo base_url() ?>payslip/saveMonthlyData", url: "<?php echo base_url() ?>payslip/saveMonthlyData",
success:function(data) { success: function(data) {
if(data) if (data) {
{
$('.content').loader('hide'); $('.content').loader('hide');
alert(data); alert(data);
//console.log(data); //console.log(data);
@ -523,10 +614,10 @@ function isCheckKeyCode(event){
} }
}); });
} }
$("#monthyear").change(function(){ $("#monthyear").change(function() {
$s = $('#monthyear').val(); $s = $('#monthyear').val();
//echo $dropdownvalue; //echo $dropdownvalue;
@ -540,9 +631,9 @@ function isCheckKeyCode(event){
$('#formid').submit(); $('#formid').submit();
}); });
function savebuttonvalidation()
{ function savebuttonvalidation() {
var curselection = $("#monthyear").val(); var curselection = $("#monthyear").val();
//alert('current selection'+curselection); //alert('current selection'+curselection);
var currentdate = new Date(); var currentdate = new Date();
@ -555,123 +646,100 @@ function isCheckKeyCode(event){
var selyear = res[1]; var selyear = res[1];
//alert('current selec month '+ selmonth + 'current selec year '+ selyear); //alert('current selec month '+ selmonth + 'current selec year '+ selyear);
var savebuttonstatus = currentmonth - selmonth; var savebuttonstatus = currentmonth - selmonth;
var year = currentyear - selyear ; var year = currentyear - selyear;
//alert(selyear + currentyear); //alert(selyear + currentyear);
if(savebuttonstatus >= 2) if (savebuttonstatus >= 2) {
{ if (year == 1) {
if(year == 1)
{
$("#savebutton").hide(); $("#savebutton").hide();
// $("#savebutton").show(); // $("#savebutton").show();
} } else {
else
{
$("#savebutton").hide(); $("#savebutton").hide();
//$("#savebutton").show(); //$("#savebutton").show();
} }
} } else if (savebuttonstatus < 0) {
else if(savebuttonstatus < 0 )
{
if(year == 1) if (year == 1) {
{
$("#savebutton").show(); $("#savebutton").show();
} } else if (year == 0) {
else if(year == 0) $("#savebutton").hide();
{ // $("#savebutton").show();
} else {
$("#savebutton").hide(); $("#savebutton").hide();
// $("#savebutton").show(); // $("#savebutton").show();
} }
else } else if (savebuttonstatus == 0 && year == 0) {
{
$("#savebutton").hide(); $("#savebutton").hide();
// $("#savebutton").show(); // $("#savebutton").show();
} } else if (savebuttonstatus == 1) {
} if (year == 0 || year == 1) {
else if(savebuttonstatus == 0 && year == 0)
{
$("#savebutton").hide();
// $("#savebutton").show();
}
else if(savebuttonstatus == 1)
{
if(year == 0 || year == 1)
{
$("#savebutton").show(); $("#savebutton").show();
} } else {
else
{
$("#savebutton").show(); $("#savebutton").show();
} }
} }
} }
var totalfestival =[]; var totalfestival = [];
var totalempSal=[]; var totalempSal = [];
var grandtotal = []; var grandtotal = [];
function changeInput(event,k)
{ function changeInput(event, k) {
var str=event.target.id; var str = event.target.id;
var sno = str.substr(8); var sno = str.substr(8);
var dayWorks=parseFloat(document.getElementById('dayWork'+sno).textContent); var dayWorks = parseFloat(document.getElementById('dayWork' + sno).textContent);
var lopDay=parseFloat(document.getElementById('lopDay'+sno).textContent); var lopDay = parseFloat(document.getElementById('lopDay' + sno).textContent);
var paidLeave =parseFloat(document.getElementById('paidLeave'+sno).textContent); var paidLeave = parseFloat(document.getElementById('paidLeave' + sno).textContent);
var otHrsWork =parseFloat(document.getElementById('otHrsWork'+sno).textContent); var otHrsWork = parseFloat(document.getElementById('otHrsWork' + sno).textContent);
var monthDue =parseFloat(document.getElementById('monthDue'+sno).textContent); var monthDue = parseFloat(document.getElementById('monthDue' + sno).textContent);
var duedate = document.getElementById('duedate'+sno).value; var duedate = document.getElementById('duedate' + sno).value;
duedate = new Date(duedate); duedate = new Date(duedate);
var paydate = document.getElementById('paydate').value; var paydate = document.getElementById('paydate').value;
if(paydate.length == 6) if (paydate.length == 6) {
{ paydate = '0' + paydate;
paydate = '0'+paydate;
} }
var pmonthonly = paydate.substring(0,2); var pmonthonly = paydate.substring(0, 2);
var pyearonly = paydate.substring(3); var pyearonly = paydate.substring(3);
var pday = new Date(pyearonly, pmonthonly, 0).getDate(); var pday = new Date(pyearonly, pmonthonly, 0).getDate();
var finalpaydate = pyearonly+'-'+pmonthonly+'-'+pday; var finalpaydate = pyearonly + '-' + pmonthonly + '-' + pday;
finalpaydate = new Date(finalpaydate); finalpaydate = new Date(finalpaydate);
var loanRecd=document.getElementById('loanRecd'+sno).textContent; var loanRecd = document.getElementById('loanRecd' + sno).textContent;
console.log(loanRecd);
totalmanualoan[sno] = loanRecd;
console.log(totalmanualoan);
var incentie = parseFloat(document.getElementById('incentie' + sno).textContent);
//totalmanualoan[sno]=loanRecd; var otherDet = parseFloat(document.getElementById('otherDet' + sno).textContent);
var incentie=parseFloat(document.getElementById('incentie'+sno).textContent); totalotherDet[sno] = otherDet;
var Festival = parseFloat(document.getElementById('Festival' + sno).textContent);
totalfestival[sno] = Festival;
var empsal = parseFloat(document.getElementById('empsal' + sno).textContent);
var bpay = parseFloat(document.getElementById('bPay' + sno).value);
var hraRate = parseFloat(document.getElementById('hraRate' + sno).value);
var allow = parseFloat(document.getElementById('allow' + sno).value);
var fAllow = parseFloat(document.getElementById('fAllow' + sno).value);
var otherDet =parseFloat(document.getElementById('otherDet'+sno).textContent); var pfRate = parseFloat(document.getElementById('pfRate' + sno).value);
//totalotherDet[sno] = otherDet; var eslRate = parseFloat(document.getElementById('eslRate' + sno).value);
var hraAmt = parseFloat(document.getElementById('hraAmt' + sno).value);
var Festival =parseFloat(document.getElementById('Festival'+sno).textContent);
totalfestival[sno]= Festival ;
var empsal =parseFloat(document.getElementById('empsal'+sno).textContent);
var bpay =parseFloat(document.getElementById('bPay'+sno).value);
var hraRate=parseFloat(document.getElementById('hraRate'+sno).value);
var allow=parseFloat(document.getElementById('allow'+sno).value);
var fAllow =parseFloat(document.getElementById('fAllow'+sno).value);
var pfRate =parseFloat(document.getElementById('pfRate'+sno).value);
var eslRate =parseFloat(document.getElementById('eslRate'+sno).value);
var hraAmt =parseFloat(document.getElementById('hraAmt'+sno).value);
// var Balance_Amount =parseFloat(document.getElementById('Balance'+sno).value); // var Balance_Amount =parseFloat(document.getElementById('Balance'+sno).value);
var loanamt =parseFloat(document.getElementById('loanamt'+sno).value); var loanamt = parseFloat(document.getElementById('loanamt' + sno).value);
var paidamt =parseFloat(document.getElementById('paidamt'+sno).value); var paidamt = parseFloat(document.getElementById('paidamt' + sno).value);
@ -680,9 +748,9 @@ totalfestival[sno]= Festival ;
var dayWorkPaid=dayWorks+paidLeave; var dayWorkPaid = dayWorks + paidLeave;
// console.log("day"+dayWorkPaid); // console.log("day"+dayWorkPaid);
var NoofDays=dayWorks+paidLeave +lopDay; var NoofDays = dayWorks + paidLeave + lopDay;
// console.log("monthday"+NoofDays); // console.log("monthday"+NoofDays);
var Food_Allowances = fAllow * dayWorks; var Food_Allowances = fAllow * dayWorks;
// console.log("workedFA"+Food_Allowances); // console.log("workedFA"+Food_Allowances);
@ -693,14 +761,11 @@ totalfestival[sno]= Festival ;
// console.log("1dayHRA"+dayHra); // console.log("1dayHRA"+dayHra);
var onehoursSalary = (daySalary + dayHra) / 8; var onehoursSalary = (daySalary + dayHra) / 8;
//console.log("onehours "+onehoursSalary); //console.log("onehours "+onehoursSalary);
var totSalayOT =0; var totSalayOT = 0;
if (otHrsWork!= 0) if (otHrsWork != 0) {
{
totSalayOT = otHrsWork * onehoursSalary; totSalayOT = otHrsWork * onehoursSalary;
} } else {
else
{
totSalayOT = 0; totSalayOT = 0;
} }
//console.log(totSalayOT); //console.log(totSalayOT);
@ -713,36 +778,28 @@ totalfestival[sno]= Festival ;
var current_loan_amt = 0; var current_loan_amt = 0;
var autoLoan =parseFloat(monthDue); var autoLoan = parseFloat(monthDue);
console.log(monthDue); console.log(monthDue);
var manualLoan =parseFloat(loanRecd); var manualLoan = parseFloat(loanRecd);
// var manualLoan = Math.min.apply(null, arrayOfNumbers.filter(function(loanRecd) { return !isNaN(loanRecd); })) // var manualLoan = Math.min.apply(null, arrayOfNumbers.filter(function(loanRecd) { return !isNaN(loanRecd); }))
//alert(manualLoan); //alert(manualLoan);
if(manualLoan == 0.00){ if (manualLoan == 0.00) {
if(duedate <= finalpaydate) if (duedate <= finalpaydate) {
{
current_loan_amt = autoLoan; current_loan_amt = autoLoan;
} }
//alert('}0.00'); //alert('}0.00');
} } else if (isNaN(manualLoan)) {
else if(isNaN(manualLoan))
{
//alert('N'); //alert('N');
current_loan_amt = 0.00; current_loan_amt = 0.00;
} } else if (manualLoan == 'NA') {
else if(manualLoan == 'NA')
{
//alert('NA'); //alert('NA');
current_loan_amt = 0.00; current_loan_amt = 0.00;
} } else if (manualLoan >= 0.00) {
else if(manualLoan >= 0.00) if (duedate <= finalpaydate) {
{
if(duedate <= finalpaydate)
{
current_loan_amt = manualLoan; current_loan_amt = manualLoan;
} }
//alert('manual'); //alert('manual');
@ -752,10 +809,9 @@ totalfestival[sno]= Festival ;
var Balance_Amount = loanamt - paidamt; var Balance_Amount = loanamt - paidamt;
if(autoLoan > Balance_Amount) { if (autoLoan > Balance_Amount) {
if(duedate <= finalpaydate) if (duedate <= finalpaydate) {
{
current_loan_amt = Balance_Amount; current_loan_amt = Balance_Amount;
} }
@ -766,22 +822,22 @@ totalfestival[sno]= Festival ;
// console.log(current_loan_amt); // console.log(current_loan_amt);
if(parseFloat(incentie) == parseFloat(incentie)){ if (parseFloat(incentie) == parseFloat(incentie)) {
var incent =parseFloat(incentie); var incent = parseFloat(incentie);
//console.log("Incentives"+incent); //console.log("Incentives"+incent);
} }
if(parseFloat(Festival) == parseFloat(Festival)){ if (parseFloat(Festival) == parseFloat(Festival)) {
var Festivals =parseFloat(Festival); var Festivals = parseFloat(Festival);
//console.log("Festivals"+Festivals); //console.log("Festivals"+Festivals);
} }
if(parseFloat( otherDet) == parseFloat( otherDet)){ if (parseFloat(otherDet) == parseFloat(otherDet)) {
var otherDets =parseFloat( otherDet); var otherDets = parseFloat(otherDet);
//console.log("otherDets"+ otherDets); //console.log("otherDets"+ otherDets);
} }
@ -790,25 +846,22 @@ totalfestival[sno]= Festival ;
// console.log("pf "+currentDatePF); // console.log("pf "+currentDatePF);
// var totalsalary= empsal + hraAmt; // var totalsalary= empsal + hraAmt;
var totalsalary =currentDaySalary+currentDayHra; var totalsalary = currentDaySalary + currentDayHra;
// console.log("total"+totalsalary); // console.log("total"+totalsalary);
var esiAmount=0; var esiAmount = 0;
if (totalsalary <= 20000) if (totalsalary <= 20000) {
{
esiAmount = currentDatePF * eslRate / 100; esiAmount = currentDatePF * eslRate / 100;
/** esiamount not elgiable for 20000 **/ /** esiamount not elgiable for 20000 **/
} } else {
else
{
esiAmount = 0; esiAmount = 0;
} }
var pfAmount = currentDaySalary * pfRate / 100; var pfAmount = currentDaySalary * pfRate / 100;
// console.log("11daypf"+pfAmount); // console.log("11daypf"+pfAmount);
var empSalaryAdd= currentDaySalary + totSalayOT + currentDayHra + Food_Allowances + allow +incent+Festivals ; var empSalaryAdd = currentDaySalary + totSalayOT + currentDayHra + Food_Allowances + allow + incent + Festivals;
var empSalarySub = current_loan_amt + esiAmount + pfAmount + otherDets; var empSalarySub = current_loan_amt + esiAmount + pfAmount + otherDets;
@ -820,13 +873,13 @@ totalfestival[sno]= Festival ;
//console.log( employeeSalary); //console.log( employeeSalary);
var cals =(employeeSalary).toFixed(0); var cals = (employeeSalary).toFixed(0);
document.getElementById("empsal"+sno).innerHTML = cals; document.getElementById("empsal" + sno).innerHTML = cals;
$.each(estTotal,function(i,value){ $.each(estTotal, function(i, value) {
if(sno==i){ if (sno == i) {
estTotal[i] = cals; estTotal[i] = cals;
@ -834,8 +887,8 @@ totalfestival[sno]= Festival ;
}); });
//console.log(estTotal); //console.log(estTotal);
$.each(totalinst,function(i,value){ $.each(totalinst, function(i, value) {
if(sno==i){ if (sno == i) {
totalinst[i] = incentie; totalinst[i] = incentie;
@ -843,16 +896,16 @@ totalfestival[sno]= Festival ;
}); });
$.each(totalotherDet,function(i,value){ $.each(totalotherDet, function(i, value) {
if(sno==i){ if (sno == i) {
totalotherDet[i] = otherDet; totalotherDet[i] = otherDet;
} }
}); });
$.each(totalmonthloan,function(i,value){ $.each(totalmonthloan, function(i, value) {
if(sno==i){ if (sno == i) {
totalmonthloan[i] = loanRecd; totalmonthloan[i] = loanRecd;
@ -860,17 +913,17 @@ totalfestival[sno]= Festival ;
}); });
$.each(totalmanualoan,function(i,value){ $.each(totalmanualoan, function(i, value) {
if(sno==i){ if (sno == i) {
totalmanualoan[i] = monthDue; totalmanualoan[i] = monthDue;
console.log( totalmanualoan[i]);
} }
}); });
//console.log(totalinst);
calculategrandtotal(); calculategrandtotal();
@ -878,12 +931,12 @@ totalfestival[sno]= Festival ;
} }
var tempTotal = []; var tempTotal = [];
function calculategrandtotal(){
$.each(totalinst, function( index, value ) function calculategrandtotal() {
{
$.each(totalinst, function(index, value) {
//var res2 = value.split('-'); //var res2 = value.split('-');
tempTotal[index]=parseFloat(value); tempTotal[index] = parseFloat(value);
}); });
var sum = 0; var sum = 0;
@ -894,10 +947,9 @@ function calculategrandtotal(){
$('#inst').text(parseFloat(sum).toFixed(2)); $('#inst').text(parseFloat(sum).toFixed(2));
$.each(totalotherDet, function( index, value ) $.each(totalotherDet, function(index, value) {
{
//var res2 = value.split('-'); //var res2 = value.split('-');
tempTotal[index]=parseFloat(value); tempTotal[index] = parseFloat(value);
}); });
var sum = 0; var sum = 0;
@ -907,10 +959,9 @@ function calculategrandtotal(){
} }
$('#other').text(parseFloat(sum).toFixed(2)); $('#other').text(parseFloat(sum).toFixed(2));
$.each(totalfestival, function( index, value ) $.each(totalfestival, function(index, value) {
{
//var res2 = value.split('-'); //var res2 = value.split('-');
tempTotal[index]=parseFloat(value); tempTotal[index] = parseFloat(value);
}); });
var sum = 0; var sum = 0;
@ -922,10 +973,9 @@ function calculategrandtotal(){
$.each(estTotal, function( index, value ) $.each(estTotal, function(index, value) {
{
//var res2 = value.split('-'); //var res2 = value.split('-');
tempTotal[index]=parseFloat(value); tempTotal[index] = parseFloat(value);
}); });
var sum = 0; var sum = 0;
@ -938,10 +988,8 @@ function calculategrandtotal(){
$.each(totalmonthloan, function( index, value ) $.each(totalmonthloan, function(index, value) {
{ tempTotal[index] = parseFloat(value);
//var res2 = value.split('-');
tempTotal[index]=parseFloat(value);
}); });
var sum = 0; var sum = 0;
@ -951,11 +999,10 @@ function calculategrandtotal(){
} }
$('#monthloan').text(parseFloat(sum).toFixed(2)); $('#monthloan').text(parseFloat(sum).toFixed(2));
console.log(totalmanualoan);
$.each(totalmanualoan, function( index, value ) $.each(totalmanualoan, function(index, value) {
{
//var res2 = value.split('-'); //var res2 = value.split('-');
tempTotal[index]=parseFloat(value); tempTotal[index] = parseFloat(value);
}); });
var sum = 0; var sum = 0;
@ -967,7 +1014,7 @@ function calculategrandtotal(){
} }
function show_hide_column(col_no, do_show) { function show_hide_column(col_no, do_show) {
var rows = document.getElementById('monthlylistings').rows; var rows = document.getElementById('monthlylistings').rows;
for (var row = 0; row < rows.length; row++) { for (var row = 0; row < rows.length; row++) {
@ -977,5 +1024,4 @@ function calculategrandtotal(){
} }
} }
} }
</script>
</script>