Change in emp pay summary : GWM

This commit is contained in:
bitbucket 2024-08-20 09:56:01 +05:30
parent 0fac14441e
commit 1e937257f5
3 changed files with 32 additions and 19 deletions

View File

@ -523,11 +523,11 @@ class Payslip extends BaseController
$TotalSalary = $value->TotalSalary;
$Food_Allowances = $value->Food_Allowances;
$Days_worked = $value->Days_worked; // working day
$LOP_Days = $value->LOP_Days; // not working day
$Sunday = $value->sunday_count; // Sunday count
$LOP_Days = $value->NoofDays - ($Days_worked + $Sunday); // 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
$Sunday = $value->sunday_count; // Sunday count
$Loan_Recovered = $value->Loan_Recovered; //MANUAL LOAN DUE
$MasterIncentives = $value->MasterIncentives; //Master values get
$due_start_date = $value->DueDate;
@ -562,11 +562,10 @@ class Payslip extends BaseController
$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
$MonthIncentive = $value->MonthlyIncentives;
$Incentive = 0;
if (empty($MonthIncentive)) {
$Incentive = $MasterIncentives;
@ -592,15 +591,22 @@ class Payslip extends BaseController
//current day basic and hra salary
$currentDayBasic = $dayBasic * $totalDaysWorked;
$currentDayHra = $dayHra * $totalDaysWorked;
if ($value->is_management_team == 1)
{
$currentDayBasic = $dayBasic * $NoofDays;
$currentDayHra = $dayHra * $NoofDays;
} else {
$currentDayBasic = $dayBasic * $totalDaysWorked;
$currentDayHra = $dayHra * $totalDaysWorked;
}
//$totalSalary = $currentDayBasic + $currentDayHra + $totSalayOT;
if ($TotalSalary <= 20000) { $esiAmount = $currentDayBasic * $ESI_Rate / 100; } else { $esiAmount = 0;}
$pfAmount = $currentDayBasic * $PF_Rate / 100;
if ($value->esi_applicable == 1) { $esiAmount = $currentDayBasic * $ESI_Rate / 100; } else { $esiAmount = 0; }
if ($value->pf_applicable == 1) { $pfAmount = $currentDayBasic * $PF_Rate / 100; } else { $pfAmount = 0; }
/** pf amount per day**/
//echo $totalothour;die;
@ -614,7 +620,6 @@ class Payslip extends BaseController
// echo $Incentive .'</br>';
// die;
$empSalarySub = $esiAmount + $pfAmount + $loan;
$salaryInCurrentday = $empSalaryAdd - $empSalarySub;
@ -643,7 +648,7 @@ class Payslip extends BaseController
$data['month'] = $this->monthlypay_model->monthlyListing($current);
$data['dropdownvalue'] = $current;
$data['fresh'] = $this->monthlypay_model->getEmpPayDetailsforMonthInputs($current);
//dd($data['fresh']);
$employeeSalary = [];
@ -659,11 +664,11 @@ class Payslip extends BaseController
$TotalSalary = $value->TotalSalary;
$Food_Allowances = $value->Food_Allowances;
$Days_worked = $value->Days_worked; // working day
$LOP_Days = $value->LOP_Days; // not working day
$Sunday = $value->sunday_count; // Sunday count
$LOP_Days = $value->NoofDays - ($Days_worked + $Sunday); // 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
$Sunday = $value->sunday_count; // Sunday count
$Loan_Recovered = $value->Loan_Recovered; //MANUAL LOAN DUE
$MasterIncentives = $value->MasterIncentives; //Master values get
$due_start_date = $value->DueDate;
@ -732,15 +737,23 @@ class Payslip extends BaseController
//current day basic and hra salary
$currentDayBasic = $dayBasic * $totalDaysWorked;
$currentDayHra = $dayHra * $totalDaysWorked;
if ($value->is_management_team == 1)
{
$currentDayBasic = $dayBasic * $NoofDays;
$currentDayHra = $dayHra * $NoofDays;
} else {
$currentDayBasic = $dayBasic * $totalDaysWorked;
$currentDayHra = $dayHra * $totalDaysWorked;
}
//$totalSalary = $currentDayBasic + $currentDayHra + $totSalayOT;
if ($TotalSalary <= 20000) { $esiAmount = $currentDayBasic * $ESI_Rate / 100; } else { $esiAmount = 0;}
$pfAmount = $currentDayBasic * $PF_Rate / 100;
if ($value->esi_applicable == 1) { $esiAmount = $currentDayBasic * $ESI_Rate / 100; } else { $esiAmount = 0;}
if ($value->pf_applicable == 1) { $pfAmount = $currentDayBasic * $PF_Rate / 100; } else { $pfAmount = 0;}
/** pf amount per day**/
//echo $totalothour;die;
@ -767,7 +780,7 @@ class Payslip extends BaseController
$data['esi'] = $esi;
$data['pf'] = $pf;
$data['over_time'] = $ot;
//echo sizeof($data['fresh'])."-".sizeof($data['empSalary']);die;
$this->global['pageTitle'] = 'Payroll Monthly Inputs';
$this->loadViews("monthlypayinputs", $this->global, $data, NULL);

View File

@ -100,7 +100,7 @@ class Monthlypay_model extends Model
//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_employee_details.Designation,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_attendance.sunday_count,t_loan_master.Loan_ID,t_loan_master.Monthly_Due,t_loan_master.Due_Start_Date as DueDate,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_monthly_pay_inputs.Estimate,t_monthly_pay_inputs.Festival_Bonus,t_monthly_pay_inputs.Other_Deductions,t_loan_history .Balance_Amount
$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.DateofJoining,t_employee_details.Designation,t_employee_details.esi_applicable,t_employee_details.pf_applicable,t_employee_details.is_management_team,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_attendance.sunday_count,t_loan_master.Loan_ID,t_loan_master.Monthly_Due,t_loan_master.Due_Start_Date as DueDate,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_monthly_pay_inputs.Estimate,t_monthly_pay_inputs.Festival_Bonus,t_monthly_pay_inputs.Other_Deductions,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 = ?

View File

@ -193,7 +193,7 @@ $('html').bind('keypress', function(e)
<th>Manual Loan Due </th>
<th>Incentives in </th>
<th>Other Deductions in </th>
<th>TDS Deductions in </th>
<th>Festival Bonus in </th>
<th>Estimate in </th>