monthlypayslip

This commit is contained in:
venbatechnologies 2018-05-04 18:13:11 +05:30
parent 4aded94607
commit f5f7745a3a
4 changed files with 185 additions and 117 deletions

View File

@ -512,113 +512,148 @@ function phpAlert($msg) {
// $data['fresh'] = $this-> monthlypay_model->getEmpPayDetails($current);
$data['dropdownvalue'] = $current;
$data['fresh'] = $this->monthlypay_model->getEmpPayDetailsforMonthInputs($current);
//print_r( $data['fresh']);
// $employeeSalary = [];
// foreach($data['fresh'] as $value){
// //print_r($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
// $MasterIncentives=$value->MasterIncentives;//Master values get
// // echo 'master'.$MasterIncentives;
// $Allowances =$value->Allowances;
// $HRA_Rate=$value->HRA_Rate;
// $PF_Rate=$value->PF_Rate;
// $ESI_Rate=$value->ESI_Rate;
// $MonthIncentive = $value->MonthlyIncentives;//T_Monthly_Pay_Inputs,for change month
// //echo 'month'. $MonthIncentive;
// $Incentive = 0;
// if(empty($MonthIncentive))
// {
// $Incentive = $MasterIncentives;
// }
// else
// {
// $Incentive = $MonthIncentive;
// }
$employeeSalary = [];
foreach($data['fresh'] as $value){
// $daySalarys = $Days_worked + $Paid_leave;
//print_r($value);
//die();
// //echo "hra amount";print_r(array($HRA_Amount,$Basic_Pay,$totalsalary));
// //$Allowances = $allowances * $values;
// $dayFood_Allowance = $Food_Allowances * $Days_worked;
$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;// AUTO LOAN DUE
// $daySalary = $Basic_Pay / $NoofDays;
// /**per day salary working hour**/
// //echo $daySalary.'<br/>';
$Loan_Recovered = $value->Loan_Recovered; //MANUAL LOAN DUE
// $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;
// $empSalaryAdd = $currentDaySalary + $totSalayOT + $currentDayHra + $dayFood_Allowance + $Allowances + $Incentive;
// $empSalarySub = $esiAmount + $pfAmount + $Monthly_Due;
// $salaryInCurrentday= $empSalaryAdd - $empSalarySub;
// $employeeSalary []= round($salaryInCurrentday);
$MasterIncentives=$value->MasterIncentives;//Master values get
// echo 'master'.$MasterIncentives;
$Loan_amount = $value->Loan_Amount;
$Paid_Amount = $value->Paid_Amount;
$Balance_Amount = $Loan_amount - $Paid_Amount;
$loan=0;
if($Loan_Recovered =='NA'){
$loan=0.00;
}
else if($Loan_Recovered == 0.00)
{
$loan=$Monthly_Due;
}
else if($Loan_Recovered >= 0.00)
{
$loan = $Loan_Recovered;
}
if($Monthly_Due > $Balance_Amount)
{
// current= Balance_Amount - autoLoan;
//alert('hi');
$loan = $Balance_Amount;
}
// }
// $data['empSalary'] = $employeeSalary;
$Allowances =$value->Allowances;
$HRA_Rate=$value->HRA_Rate;
$PF_Rate=$value->PF_Rate;
$ESI_Rate=$value->ESI_Rate;
$MonthIncentive = $value->MonthlyIncentives;//T_Monthly_Pay_Inputs,for change month
$Incentive = 0;
if(empty($MonthIncentive))
{
$Incentive = $MasterIncentives;
}
else
{
$Incentive = $MonthIncentive;
}
// echo $Incentive;
$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;
$empSalaryAdd = $currentDaySalary + $totSalayOT + $currentDayHra + $dayFood_Allowance + $Allowances + $Incentive;
$empSalarySub = $esiAmount + $pfAmount + $loan;
$salaryInCurrentday= $empSalaryAdd - $empSalarySub;
$employeeSalary []= round($salaryInCurrentday);
}
$data['empSalary'] = $employeeSalary;
//echo sizeof($data['fresh'])."-".sizeof($data['empSalary']);die;
$this->global['pageTitle'] = 'Siddharth : Payroll Monthly Inputs';
@ -641,7 +676,8 @@ function phpAlert($msg) {
foreach($data['fresh'] as $value){
print_r($value);
//print_r($value);
//die();
$NoofDays=$value->NoofDays;//Month day 30,31,28
$HRA_Amount = $value->HRA_Amount;
@ -658,7 +694,11 @@ function phpAlert($msg) {
$MasterIncentives=$value->MasterIncentives;//Master values get
// echo 'master'.$MasterIncentives;
// $Loan_amount = $value->Loan_Amount;
$Loan_amount = $value->Loan_Amount;
$Paid_Amount = $value->Paid_Amount;
$Balance_Amount = $Loan_amount - $Paid_Amount;
@ -674,9 +714,18 @@ function phpAlert($msg) {
{
$loan = $Loan_Recovered;
}
if($Monthly_Due > $Balance_Amount)
{
// current= Balance_Amount - autoLoan;
//alert('hi');
$loan = $Balance_Amount;
}
echo 'Loan'. $loan ;

View File

@ -99,7 +99,7 @@ if(strlen($month) == 6)
//echo $lastdate;
//left join T_Payroll on T_Employee_Details.EmpID = T_Payroll.EmpID and month(T_Payroll.PayOn) = month(?) and year(T_Payroll.PayOn) = year(?)
$sql ="select T_Emp_Pay_Data.EmpID, T_Emp_Pay_Data.Incentives as MasterIncentives,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,T_Monthly_Pay_Inputs.Incentives as MonthlyIncentives,T_Monthly_Pay_Inputs.Loan_Recovered
$sql ="select T_Emp_Pay_Data.EmpID, T_Emp_Pay_Data.Incentives as MasterIncentives,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_Loan_Master.Loan_Amount,T_Loan_Master.Paid_Amount,T_Payroll.Key,T_Monthly_Pay_Inputs.Incentives as MonthlyIncentives,T_Monthly_Pay_Inputs.Loan_Recovered,T_Loan_History .Balance_Amount
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 T_Payroll.PayOn = ?
@ -107,6 +107,7 @@ if(strlen($month) == 6)
left join T_Attendance on T_Emp_Pay_Data.EmpID = T_Attendance.EmpID
left join T_Monthly_Pay_Inputs on T_Monthly_Pay_Inputs.EmpID = T_Emp_Pay_Data.EmpID and T_Monthly_Pay_Inputs.Month_Year = ?
left join T_Loan_Master on T_Emp_Pay_Data.EmpID = T_Loan_Master.EmpID and T_Loan_Master.is_Active = 1
left join T_Loan_History on T_Loan_History .Loan_ID = T_Loan_Master.Loan_ID
where T_Employee_Details.DateofJoining <= ?
and month(T_Attendance.Month_Year) = month(?) and year(T_Attendance.Month_Year) = year(?)
order by T_Employee_Details.EmpID";

View File

@ -101,7 +101,7 @@ if(!empty($MaintEdit))
<div class="col-md-3">
<label>Nature of Maintenance:</label></br>
<input type="radio" id="radiobtn1" name="radiobtn" value="0" >Maintenance &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" id="radiobtn1" name="radiobtn" value="0" >Preventive &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" id="radiobtn2" name="radiobtn" value="1" >Breakdown
</div>

View File

@ -2,18 +2,18 @@
$sample = array_merge($month,$fresh);
$show_hide_column_value = true;
// foreach($sample as $s)
// {
// if(!empty($s->Key))
// {
// $show_hide_column_value = false;
// }
// else
// {
// $show_hide_column_value = true;
// }
// break;
// }
foreach($sample as $s)
{
if(!empty($s->Key))
{
$show_hide_column_value = false;
}
else
{
$show_hide_column_value = true;
}
break;
}
$ex = explode('-',$dropdownvalue);
@ -286,7 +286,9 @@ $('html').bind('keypress', function(e)
<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 $record->Loan_amount?>">
<input type="hidden" id = "paidamt<?php echo $index?>" value="<?php echo $record->Paid_Amount?>">
<!-- <input type="hidden" id = "eid" value="<?php echo $record->TotalSalary?>">
<input type="hidden" id = "eid" value="<?php echo $record->LOP_Days?>">
@ -462,7 +464,7 @@ function isCheckKeyCode(event){
{
if(year == 1)
{
// $("#savebutton").hide();
// $("#savebutton").hide();
$("#savebutton").show();
}
else
@ -480,7 +482,7 @@ function isCheckKeyCode(event){
}
else if(year == 0)
{
// $("#savebutton").hide();
//$("#savebutton").hide();
$("#savebutton").show();
}
else
@ -537,9 +539,16 @@ function isCheckKeyCode(event){
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 loanamt =parseFloat(document.getElementById('loanamt'+sno).value);
var paidamt =parseFloat(document.getElementById('paidamt'+sno).value);
//con(incentie);
var dayWorkPaid=dayWorks+paidLeave;
// console.log("day"+dayWorkPaid);
@ -600,10 +609,19 @@ function isCheckKeyCode(event){
current_loan_amt = manualLoan;
//alert('manual');
}
else{
current_loan_amt = manualLoan;
}
var Balance_Amount = loanamt - paidamt;
if(autoLoan > Balance_Amount) {
// current= Balance_Amount - autoLoan;
current_loan_amt = Balance_Amount;
//alert('HI');
}
// console.log(current_loan_amt);