payslip changes

This commit is contained in:
venbatechnologies 2018-04-26 17:51:40 +05:30
parent 929c86cda0
commit 38bc25667d
3 changed files with 454 additions and 37 deletions

View File

@ -504,14 +504,95 @@ function phpAlert($msg) {
$this->loadViews("payslipupload2", $this->global, NULL);
}
public function monthlyInputs()
public function monthlyInputs()
{
$current = date("m-Y");
$data['month'] = $this-> monthlypay_model->monthlyListing($current);
$data['month'] = $this->monthlypay_model->monthlyListing($current);
// $data['fresh'] = $this-> monthlypay_model->getEmpPayDetails($current);
$data['dropdownvalue'] = $current;
$data['fresh'] = $this-> monthlypay_model->getEmpPayDetailsforMonthInputs($current);
$this->global['pageTitle'] = 'Siddharth : Payroll Monthly Inputs';
$data['dropdownvalue'] = $current;
$data['fresh'] = $this->monthlypay_model->getEmpPayDetailsforMonthInputs($current);
//print_r( $data['fresh']);
$employeeSalary = [];
foreach($data['fresh'] as $value){
$NoofDays=$value->NoofDays;//Month day 30,31,28
$HRA_Amount = $value->HRA_Amount;
$Basic_Pay = $value->Basic_Pay;
$TotalSalary = $value->TotalSalary;
$Food_Allowances= $value->Food_Allowances;
$Days_worked = $value->Days_worked; // working day
$LOP_Days = $value->LOP_Days; // not working day
$Paid_leave = $value->Paid_leave; // leave day
$OT_Hrs_Worked = $value->OT_Hrs_Worked; //OT hours
$Monthly_Due= $value->Monthly_Due;// loan due amt
$Incentives=$value->Incentives;
$Allowances =$value->Allowances;
$HRA_Rate=$value->HRA_Rate;
$PF_Rate=$value->PF_Rate;
$ESI_Rate=$value->ESI_Rate;
$daySalarys = $Days_worked + $Paid_leave;
//echo "hra amount";print_r(array($HRA_Amount,$Basic_Pay,$totalsalary));
//$Allowances = $allowances * $values;
$dayFood_Allowance = $Food_Allowances * $Days_worked;
$daySalary = $Basic_Pay / $NoofDays;
/**per day salary working hour**/
//echo $daySalary.'<br/>';
$dayHra = $HRA_Amount / $NoofDays;
/** per day hra amount **/
//echo $dayHra.'<br/>';
$onehoursSalary = ($daySalary + $dayHra) / 8;
/**one hour salay ot calculation**/
if ($OT_Hrs_Worked != 0)
{
$totSalayOT = $OT_Hrs_Worked * $onehoursSalary;
}
else
{
$totSalayOT = 0;
}
$currentDaySalary = $daySalary * $daySalarys;
/** current day salary working days calculation**/
$currentDayHra = $dayHra * $daySalarys;
/** total working days hra calculations**/
// echo $currentDayHra.'<br/>';
$currentDatePF = $currentDaySalary + $currentDayHra + $totSalayOT;
/** current date pf calculation**/
if ($TotalSalary <= 20000)
{
$esiAmount = $currentDatePF * $ESI_Rate / 100;
/** esiamount not elgiable for 20000 **/
}
else
{
$esiAmount = 0;
}
$pfAmount = $currentDaySalary * $PF_Rate/ 100;
/** pf amount per day**/
//echo $totalothour;die;
$salaryInCurrentdays = $currentDaySalary + $totSalayOT + $currentDayHra + $dayFood_Allowance + $Allowances + $Incentives;
$salaryInCurrentday = $salaryInCurrentdays - ($esiAmount + $pfAmount) - $Monthly_Due;
$employeeSalary []= round($salaryInCurrentday);
}
$data['empSalary'] = $employeeSalary;
$this->global['pageTitle'] = 'Siddharth : Payroll Monthly Inputs';
$this->loadViews("monthlypayinputs", $this->global,$data,NULL);
@ -522,11 +603,92 @@ function phpAlert($msg) {
$current = $this->input->post('monthyear');
$data['month'] = $this-> monthlypay_model->monthlyListing($current);
$data['month'] = $this->monthlypay_model->monthlyListing($current);
//print_r($data['month']);
$data['dropdownvalue'] = $current;
$data['fresh'] = $this-> monthlypay_model->getEmpPayDetailsforMonthInputs($current);
$data['fresh'] = $this->monthlypay_model->getEmpPayDetailsforMonthInputs($current);
$employeeSalary = [];
foreach($data['fresh'] as $value){
$NoofDays=$value->NoofDays;//Month day 30,31,28
$HRA_Amount = $value->HRA_Amount;
$Basic_Pay = $value->Basic_Pay;
$TotalSalary = $value->TotalSalary;
$Food_Allowances= $value->Food_Allowances;
$Days_worked = $value->Days_worked; // working day
$LOP_Days = $value->LOP_Days; // not working day
$Paid_leave = $value->Paid_leave; // leave day
$OT_Hrs_Worked = $value->OT_Hrs_Worked; //OT hours
$Monthly_Due= $value->Monthly_Due;// loan due amt
$Incentives=$value->Incentives;
$Allowances =$value->Allowances;
$HRA_Rate=$value->HRA_Rate;
$PF_Rate=$value->PF_Rate;
$ESI_Rate=$value->ESI_Rate;
$daySalarys = $Days_worked + $Paid_leave;
//echo "hra amount";print_r(array($HRA_Amount,$Basic_Pay,$totalsalary));
//$Allowances = $allowances * $values;
$dayFood_Allowance = $Food_Allowances * $Days_worked;
$daySalary = $Basic_Pay / $NoofDays;
/**per day salary working hour**/
//echo $daySalary.'<br/>';
$dayHra = $HRA_Amount / $NoofDays;
/** per day hra amount **/
//echo $dayHra.'<br/>';
$onehoursSalary = ($daySalary + $dayHra) / 8;
/**one hour salay ot calculation**/
if ($OT_Hrs_Worked != 0)
{
$totSalayOT = $OT_Hrs_Worked * $onehoursSalary;
}
else
{
$totSalayOT = 0;
}
$currentDaySalary = $daySalary * $daySalarys;
/** current day salary working days calculation**/
$currentDayHra = $dayHra * $daySalarys;
/** total working days hra calculations**/
// echo $currentDayHra.'<br/>';
$currentDatePF = $currentDaySalary + $currentDayHra + $totSalayOT;
/** current date pf calculation**/
if ($TotalSalary <= 20000)
{
$esiAmount = $currentDatePF * $ESI_Rate/ 100;
/** esiamount not elgiable for 20000 **/
}
else
{
$esiAmount = 0;
}
$pfAmount = $currentDaySalary * $PF_Rate/ 100;
/** pf amount per day**/
//echo $totalothour;die;
$salaryInCurrentdays = $currentDaySalary + $totSalayOT + $currentDayHra + $dayFood_Allowance + $Allowances + $Incentives;
$salaryInCurrentday = $salaryInCurrentdays - ($esiAmount + $pfAmount) - $Monthly_Due;
$employeeSalary []= round($salaryInCurrentday);
}
$data['empSalary'] = $employeeSalary;
//echo sizeof($data['fresh'])."-".sizeof($data['empSalary']);die;
$this->global['pageTitle'] = 'Siddharth : Payroll Monthly Inputs';
$this->loadViews("monthlypayinputs", $this->global,$data,NULL);
}
@ -571,13 +733,18 @@ function phpAlert($msg) {
{
$ErrorFlag = 0;
$EmpID = $j['Employee Id'];
$Name = $j['Employee Name'];
$Emp = $j['Employee'];
$EmpID = substr($Emp,0,4);
//$Name = $j['Employee Name'];
//echo $EmpID; die;
$DaysWorked = $j['Days Worked'];
$LOP_Days = $j['LOP Days'];
$Paid_leave = $j['Paid Leave'];
$OT_Hrs_Worked = $j['OT Hours Worked in Hrs'];
$Loan_Recovered = $j['Loan Recovered in ₹'];
$OT_Hrs_Worked = $j['OT Hrs'];
$Loan_Recovered = $j['Manual Loan Due ₹'];
$Incentives = $j['Incentives in ₹'];
$Festival_Bonus = $j['Festival Bonus in ₹'];
$Other_Deductions = $j['Other Deductions in ₹'];
@ -673,13 +840,18 @@ function phpAlert($msg) {
{
foreach($json as $j)
{
$EmpID = $j['Employee Id'];
$Name = $j['Employee Name'];
$Emp = $j['Employee'];
$EmpID = substr($Emp,0,4);
//$Name = $j['Employee'];
$DaysWorked = $j['Days Worked'];
$LOP_Days = $j['LOP Days'];
$Paid_leave = $j['Paid Leave'];
$OT_Hrs_Worked = $j['OT Hours Worked in Hrs'];
$Loan_Recovered = $j['Loan Recovered in ₹'];
$OT_Hrs_Worked = $j['OT Hrs'];
$Loan_Recovered = $j['Manual Loan Due ₹'];
if(is_string($Loan_Recovered))
{
$Loan_Recovered = strtoupper($Loan_Recovered);
@ -1108,7 +1280,7 @@ function getEmployee()
$LOPDays = $sheet->getCell('D'.$x)->getValue();
$Paid_leave =$sheet->getCell('E'.$x)->getValue();
$OTHoursWorked =$sheet->getCell('F'.$x)->getValue();
$loanRecovered=$sheet->getCell('G'.$x)->getValue();
$LoanRecovered=$sheet->getCell('G'.$x)->getValue();
if(is_string($loanRecovered))
{
$loanRecovered = strtoupper($loanRecovered);

View File

@ -28,7 +28,7 @@ class monthlypay_model extends CI_Model
// $this->db->where('T_Employee_Details.DateofJoining <=',$lastdate);
// $this->db->where('Month_Year',$current);
$sql="select T_Monthly_Pay_Inputs.*,T_Employee_Details.FirstName,T_Employee_Details.LastName,T_Loan_Master.Loan_ID,T_Payroll.Key
$sql="select T_Monthly_Pay_Inputs.*,T_Employee_Details.FirstName,T_Employee_Details.LastName,T_Loan_Master.Loan_ID,T_Loan_Master.Monthly_Due,T_Payroll.Key
from T_Monthly_Pay_Inputs
left join T_Employee_Details on T_Monthly_Pay_Inputs.EmpID=T_Employee_Details.EmpID and T_Employee_Details.DateofJoining <= ?
left join T_Payroll on T_Monthly_Pay_Inputs.EmpID=T_Payroll.EmpID
@ -79,7 +79,7 @@ class monthlypay_model extends CI_Model
//$monthyear_val = date('Y-m',strtotime($current));
$lastdate = $year_val.'-'.$month_val.'-'.$date_val;
//echo $lastdate;
$sql = "select T_Emp_Pay_Data.EmpID,T_Employee_Details.FirstName,T_Employee_Details.LastName,T_Employee_Details.DateofJoining,T_Attendance.Days_Worked as Days_worked,T_Attendance.Absent as LOP_Days,T_Attendance.Paid_Leave as Paid_leave,T_Attendance.Total_OTHrs as OT_Hrs_Worked,T_Attendance.NoofDays,T_Loan_Master.Loan_ID,T_Payroll.Key from T_Emp_Pay_Data
$sql = "select T_Emp_Pay_Data.EmpID, T_Emp_Pay_Data.Incentives,T_Emp_Pay_Data.*,T_Employee_Details.FirstName,T_Employee_Details.LastName,T_Employee_Details.DateofJoining,T_Attendance.Days_Worked as Days_worked,T_Attendance.Absent as LOP_Days,T_Attendance.Paid_Leave as Paid_leave,T_Attendance.Total_OTHrs as OT_Hrs_Worked,T_Attendance.NoofDays,T_Loan_Master.Loan_ID,T_Loan_Master.Monthly_Due,T_Payroll.Key from T_Emp_Pay_Data
left join T_Employee_Details on T_Employee_Details.EmpID = T_Emp_Pay_Data.EmpID
left join T_Payroll on T_Employee_Details.EmpID = T_Payroll.EmpID and month(T_Payroll.PayOn) = month(?) and year(T_Payroll.PayOn) = year(?)
left join T_Attendance on T_Emp_Pay_Data.EmpID = T_Attendance.EmpID

View File

@ -10,8 +10,8 @@
}
else{
$ex1 = $ex[0];
}
}
}
}
else{
$ex1 = $ex[0];
}
@ -145,17 +145,23 @@ $('html').bind('keypress', function(e)
<tr>
<th>S.No</th>
<th>Employee Id</th>
<th>Employee Name</th>
<th>Employee </th>
<!-- <th>Employee Name</th> -->
<th>Days Worked</th>
<th>LOP Days</th>
<th>Paid Leave</th>
<th>OT Hours Worked in Hrs</th>
<th>Loan Recovered in </th>
<th>OT Hrs</th>
<th>Auto Loan Due </th>
<th>Manual Loan Due </th>
<th>Incentives in </th>
<th>Other Deductions in </th>
<th>Festival Bonus in </th>
<th>Estimate in </th>
</tr>
</thead>
@ -170,9 +176,13 @@ $('html').bind('keypress', function(e)
if(!empty($sample))
{
foreach($sample as $record)
//print_r($sample);
$index = 0;
$i = 0;
foreach($sample as $i=> $record)
{
$index++;
@ -194,20 +204,63 @@ $('html').bind('keypress', function(e)
<tr>
<td style="text-align:right;" style="background-color:blue;"><?php echo $index; ?></td>
<td style="text-align:right;"><?php echo $record->EmpID ?></td>
<td><?php echo $record->FirstName ." ". $record->LastName ?></td>
<td <?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;}else{echo "0.00";}?></td>
<td <?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 <?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 <?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 <?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)){if(is_numeric($record->Loan_Recovered)){echo number_format($record->Loan_Recovered,2,'.','');}else {echo $record->Loan_Recovered;}}else{echo number_format(0.00,2,'.','');} ?></td>
<td <?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->Incentives)){echo $record->Incentives;}else{ echo number_format(0.00,2,'.','');;} ?></td>
<td <?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; }else{ echo number_format(0.00,2,'.','');;} ?></td>
<td <?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; }else{ echo number_format(0.00,2,'.','');;} ?></td>
<!-- <td style="text-align:right;"><?php echo $record->EmpID ?></td> -->
<td style="max-width:80px"><?php echo $record->EmpID ."-".$record->FirstName ."". $record->LastName ?></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;}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 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;}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 }?> ><?php if(!empty($record->Loan_Recovered)){if(is_numeric($record->Loan_Recovered)){echo number_format($record->Loan_Recovered,2,'.','');}else {echo $record->Loan_Recovered;}}else{echo number_format(0.00,2,'.','');} ?></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 }?> ><?php if(!empty($record->Incentives)){echo $record->Incentives;}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; }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; }else{ echo number_format(0.00,2,'.','');;} ?></td>
<td id="empsal<?php echo $index?>"><?php echo $empSalary[$i];?></td>
<!-- <input type="hidden" id = "eid" value="<?php echo $record->EmpID?>">
<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 = "bPay<?php echo $index?>" value="<?php echo $record->Basic_Pay?>">
<input type="hidden" id = "hraRate<?php echo $index?>" value="<?php echo $record->HRA_Rate?>">
<input type="hidden" id = "allow<?php echo $index?>" value="<?php echo $record->Allowances?>">
<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 = "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->Paid_leave?>">
<input type="hidden" id = "eid" value="<?php echo $record->OT_Hrs_Worked?>">
<input type="hidden" id = "eid" value="<?php echo $record->NoofDays?>">
<input type="hidden" id = "eid" value="<?php echo $record->Monthly_Due?>"> -->
</tr>
<?php
}
}
@ -275,6 +328,25 @@ $('html').bind('keypress', function(e)
});
function isNumber(evt) {
//alert("hi");
var iKeyCode = (evt.which) ? evt.which : evt.keyCode
if (iKeyCode != 46 && iKeyCode > 31 && (iKeyCode < 48 || iKeyCode > 57))
{ return false;}
return true;
}
function isCheckKeyCode(event){
var iKeyCode = (event.which) ? event.which : event.keyCode
if (iKeyCode != 46 && iKeyCode > 31 && (iKeyCode < 48 || iKeyCode > 57 ) && (iKeyCode ==78 && iKeyCode == 65))
{ return false;}
return true;
}
function getAllData()
@ -381,4 +453,177 @@ $('html').bind('keypress', function(e)
}
function changeInput(event,k)
{
//alert("hello");
var str=event.target.id;
var sno = str.substr(8);
//alert(sno);
var dayWorks=parseFloat(document.getElementById('dayWork'+sno).textContent);
var lopDay=parseFloat(document.getElementById('lopDay'+sno).textContent);
var paidLeave =parseFloat(document.getElementById('paidLeave'+sno).textContent);
var otHrsWork =parseFloat(document.getElementById('otHrsWork'+sno).textContent);
var monthDue =parseFloat(document.getElementById('monthDue'+sno).textContent);
var loanRecd=parseFloat(document.getElementById('loanRecd'+sno).textContent);
var incentie=parseFloat(document.getElementById('incentie'+sno).textContent);
var otherDet =parseFloat(document.getElementById('otherDet'+sno).textContent);
var Festival =parseFloat(document.getElementById('Festival'+sno).textContent);
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);
//console.log(incentie);
var dayWorkPaid=dayWorks+paidLeave;
// console.log("day"+dayWorkPaid);
var NoofDays=dayWorks+paidLeave +lopDay;
// console.log("monthday"+NoofDays);
var Food_Allowances = fAllow * dayWorks;
// console.log("workedFA"+Food_Allowances);
var daySalary = bpay / NoofDays;
// console.log("1daysalary "+daySalary);
var dayHra = hraAmt / NoofDays;
// console.log("1dayHRA"+dayHra);
var onehoursSalary = (daySalary + dayHra) / 8;
//console.log("onehours "+onehoursSalary);
var totSalayOT =0;
if (otHrsWork!= 0)
{
totSalayOT = otHrsWork * onehoursSalary;
}
else
{
totSalayOT = 0;
}
//console.log(totSalayOT);
var currentDaySalary = daySalary * dayWorkPaid;
//console.log("11days salary"+currentDaySalary);
var currentDayHra = dayHra * dayWorkPaid;
// console.log("11days hra"+currentDayHra);
//------loan calculator start----------/
var current_loan_amt = 0;
// if(parseFloat(monthDue)>=parseFloat(loanRecd))
// {
// var oldloan = parseFloat(monthDue) - parseFloat(loanRecd);
// //console.log("if" + oldloan);
// var loandue = parseFloat(monthDue) - parseFloat(oldloan);
// // console.log("if "+loandue);
// }else{
// var oldloan = parseFloat(monthDue) - parseFloat(loanRecd);//Auto Due
// //console.log("else" + oldloan);
// var loandue = parseFloat(monthDue)- parseFloat(oldloan);//Manual Due
// //console.log("else"+loandue);
// }
var autoLoan =parseFloat(monthDue);
var manualLoan =parseFloat(loanRecd);
if(manualLoan == 0){
current_loan_amt = autoLoan;
}
else if(manualLoan == 'NA')
{
current_loan_amt = 0;
}
else if(manualLoan >= 0)
{
current_loan_amt = manualLoan;
}
console.log(current_loan_amt);
if(parseFloat(incentie) == parseFloat(incentie)){
var incent =parseFloat(incentie);
//console.log("Incentives"+incent);
}
if(parseFloat(Festival) == parseFloat(Festival)){
var Festivals =parseFloat(Festival);
//console.log("Festivals"+Festivals);
}
if(parseFloat( otherDet) == parseFloat( otherDet)){
var otherDets =parseFloat( otherDet);
//console.log("otherDets"+ otherDets);
}
var currentDatePF = currentDaySalary + currentDayHra + totSalayOT;
// console.log("pf "+currentDatePF);
// var totalsalary= empsal + hraAmt;
var totalsalary =currentDaySalary+currentDayHra;
// console.log("total"+totalsalary);
var esiAmount=0;
if (totalsalary <= 20000)
{
esiAmount = currentDatePF * eslRate / 100;
/** esiamount not elgiable for 20000 **/
}
else
{
esiAmount = 0;
}
var pfAmount = currentDaySalary * pfRate / 100;
// console.log("11daypf"+pfAmount);
var empSalaryAdd= currentDaySalary + totSalayOT + currentDayHra + Food_Allowances + allow +incent+Festivals;
var empSalarySub = current_loan_amt + esiAmount + pfAmount + otherDets;
var empMonthSalary = empSalaryAdd - empSalarySub
var employeeSalary = Math.round(empMonthSalary);
//console.log( employeeSalary);
var cals =(employeeSalary).toFixed(0);
document.getElementById("empsal"+sno).innerHTML = cals;
//$data['empSalary'] = $employeeSalary;
}
</script>