CHANGE_in employee module : GWM
This commit is contained in:
parent
c3f406fbde
commit
cf3aeaa4be
@ -203,36 +203,7 @@ class Employeedetails extends BaseController
|
||||
function AddNewEmployee()
|
||||
{
|
||||
|
||||
$validation = \Config\Services::validation();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// $this->validator->setRules([
|
||||
// 'ContactNumber'=> 'trim|required|min_length[10]|max_length[10]',
|
||||
// 'emailid'=> 'trim|required|valid_email',
|
||||
// 'gender'=> 'callback_Gender_validate',
|
||||
// 'MartialStatus'=> 'callback_Martial_validate',
|
||||
// 'bloodgroup'=>'callback_Blood_validate',
|
||||
// 'emergencycontactnumber'=> 'trim|required|min_length[10]|max_length[10]',
|
||||
// 'desigination'=> 'callback_Des_validate',
|
||||
// 'departmentname'=> 'callback_Dep_validate',
|
||||
// 'eduqualifaction'=> 'callback_select_validate',
|
||||
// 'referrercontno'=> 'trim|min_length[10]|max_length[10]',
|
||||
// 'aadharno'=> 'trim|min_length[14]|max_length[14]',
|
||||
// 'panno'=> 'trim|min_length[10]|max_length[10]',
|
||||
// 'passportno'=> 'trim|min_length[9]|max_length[9]',
|
||||
// 'accountno'=> 'trim|min_length[10]|max_length[20]',
|
||||
// 'pfno'=> 'trim|min_length[22]|max_length[22]',
|
||||
// 'esino'=> 'trim|min_length[10]|max_length[10]']);
|
||||
|
||||
// if ($this->validator->run() == FALSE) {
|
||||
// $this->addemployee();
|
||||
// //echo 'Validate method called';
|
||||
// } else {
|
||||
//echo 'Validate not method called';
|
||||
$photo = $this->request->getFile('photo');
|
||||
$Picture = "";
|
||||
if ($photo->isValid() && !$photo->hasMoved()) {
|
||||
@ -371,15 +342,11 @@ class Employeedetails extends BaseController
|
||||
$Basic_Pay = $this->request->getPost('Basic_Pay');
|
||||
$HRA_Rate = $this->request->getPost('HRA_Rate');
|
||||
$HRA_Amount = $this->request->getPost('HRA_Amount');
|
||||
|
||||
$Allowances = $this->request->getPost('Allowances');
|
||||
$PF_Rate = $this->request->getPost('PF_Rate');
|
||||
$ESI_Rate = $this->request->getPost('ESI_Rate');
|
||||
$Food_Allowances = $this->request->getPost('Food_Allowances');
|
||||
$Incentives = $this->request->getPost('Incentives');
|
||||
$CreateBy = $this->session->get('userId');
|
||||
|
||||
$emppay = array('EmpID' => $EmpID, 'TotalSalary' => $Total_Salary, 'Basic_Pay' => $Basic_Pay, 'HRA_Rate' => $HRA_Rate, 'HRA_Amount' => $HRA_Amount, 'Allowances' => $Allowances, 'PF_Rate' => $PF_Rate, 'ESI_Rate' => $ESI_Rate, 'Food_Allowances' => $Food_Allowances, 'Incentives' => $Incentives, 'Created_By' => $CreateBy);
|
||||
$emppay = array('EmpID' => $EmpID, 'TotalSalary' => $Total_Salary, 'Basic_Pay' => $Basic_Pay, 'HRA_Rate' => $HRA_Rate, 'HRA_Amount' => $HRA_Amount, 'PF_Rate' => $PF_Rate, 'ESI_Rate' => $ESI_Rate, 'Created_By' => $CreateBy);
|
||||
|
||||
|
||||
$this->emppaydate_model->addNewemppay($emppay);
|
||||
@ -803,34 +770,21 @@ class Employeedetails extends BaseController
|
||||
$Basic_Pay = $this->request->getPost('Basic_Pay');
|
||||
$HRA_Rate = $this->request->getPost('HRA_Rate');
|
||||
$HRA_Amount = $this->request->getPost('HRA_Amount');
|
||||
$Allowances = $this->request->getPost('Allowances');
|
||||
$PF_Rate = $this->request->getPost('PF_Rate');
|
||||
$ESI_Rate = $this->request->getPost('ESI_Rate');
|
||||
$Food_Allowances = $this->request->getPost('Food_Allowances');
|
||||
$Incentives = $this->request->getPost('Incentives');
|
||||
$CreateBy = $this->session->get('userId');
|
||||
$emppay = array('EmpID' => $EmpId, 'TotalSalary' => $Total_Salary, 'Basic_Pay' => $Basic_Pay, 'HRA_Rate' => $HRA_Rate, 'HRA_Amount' => $HRA_Amount, 'Allowances' => $Allowances, 'PF_Rate' => $PF_Rate, 'ESI_Rate' => $ESI_Rate, 'Food_Allowances' => $Food_Allowances, 'Incentives' => $Incentives, 'Created_By' => $CreateBy);
|
||||
$emppay = array('EmpID' => $EmpId, 'TotalSalary' => $Total_Salary, 'Basic_Pay' => $Basic_Pay, 'HRA_Rate' => $HRA_Rate, 'HRA_Amount' => $HRA_Amount, 'PF_Rate' => $PF_Rate, 'ESI_Rate' => $ESI_Rate, 'Created_By' => $CreateBy);
|
||||
|
||||
|
||||
$empPayUpdate = $this->emppaydate_model->editemppay($emppay);
|
||||
|
||||
if ($result + $empPayUpdate > 0) {
|
||||
|
||||
|
||||
// $this->session->set_flashdata('Success', $EmpId.'Employee Updated successfully!');
|
||||
$this->session->setFlashdata('success', 'You Have Successfully updated the Employee Record!');
|
||||
// echo "<script>alert('You Have Successfully updated the Employee Record!');</script>";
|
||||
|
||||
} else {
|
||||
|
||||
// $this->session->set_flashdata('Error', $EmpId . 'Employee details not saved');
|
||||
$this->session->setFlashdata('error', 'Record Not Updated!');
|
||||
// echo "<script>alert('Record Not Updated!');</script>";
|
||||
|
||||
}
|
||||
return redirect()->route('employeeListing');
|
||||
// redirect('employeeListing');
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
function exportemployee()
|
||||
|
||||
@ -57,8 +57,8 @@ class Emppaydate extends BaseController
|
||||
function emppayListing()
|
||||
{
|
||||
$data['userRecords'] = $this->emppaydate_model->emppayListing();
|
||||
// dd($data['userRecords']);
|
||||
$this->global['pageTitle'] = 'Employee Pay List';
|
||||
|
||||
$this->global['pageTitle'] = 'Employee Loan List';
|
||||
$this->loadViews("emppayListing", $this->global, $data, NULL);
|
||||
}
|
||||
|
||||
@ -80,8 +80,8 @@ class Emppaydate extends BaseController
|
||||
{
|
||||
|
||||
|
||||
helper('form'); //$this->load->library('form_validation');
|
||||
$EmpID = $this->request->getPost('EmpID');
|
||||
|
||||
|
||||
|
||||
|
||||
$EmpID = $this->request->getPost('EmpID');
|
||||
|
||||
@ -151,7 +151,7 @@ class Monthlypay extends BaseController
|
||||
$data['datefordropdown'] = $current;
|
||||
$data['attendance'] = $this->monthlypay_model->monthlyAttendance($current);
|
||||
$data['emppay'] = $this->monthlypay_model->getEmpPayDetails($current, $string);
|
||||
|
||||
|
||||
$this->global['pageTitle'] = 'Monthly Attendance';
|
||||
$this->loadViews("attendance", $this->global, $data, NULL);
|
||||
}
|
||||
|
||||
@ -521,7 +521,6 @@ class Payslip extends BaseController
|
||||
$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
|
||||
$Sunday = $value->sunday_count; // Sunday count
|
||||
$LOP_Days = $value->NoofDays - ($Days_worked + $Sunday); // not working day
|
||||
@ -529,7 +528,6 @@ class Payslip extends BaseController
|
||||
$OT_Hrs_Worked = $value->OT_Hrs_Worked; //OT hours
|
||||
$Monthly_Due = $value->Monthly_Due; // AUTO LOAN DUE
|
||||
$Loan_Recovered = $value->Loan_Recovered; //MANUAL LOAN DUE
|
||||
$MasterIncentives = $value->MasterIncentives; //Master values get
|
||||
$due_start_date = $value->DueDate;
|
||||
$paydate = $current; //From POST parm
|
||||
|
||||
@ -561,20 +559,14 @@ class Payslip extends BaseController
|
||||
}
|
||||
|
||||
|
||||
$Allowances = $value->Allowances;
|
||||
|
||||
$PF_Rate = $value->PF_Rate;
|
||||
$ESI_Rate = $value->ESI_Rate;
|
||||
|
||||
$MonthIncentive = $value->MonthlyIncentives;
|
||||
$Incentive = 0;
|
||||
if (empty($MonthIncentive)) {
|
||||
$Incentive = $MasterIncentives;
|
||||
} else {
|
||||
$Incentive = $MonthIncentive;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$dayFood_Allowance = $Food_Allowances * ($Days_worked + $Sunday);
|
||||
|
||||
|
||||
$totalDaysWorked = ($Days_worked + $Sunday) + $Paid_leave;
|
||||
|
||||
@ -609,18 +601,18 @@ class Payslip extends BaseController
|
||||
/** pf amount per day**/
|
||||
|
||||
//echo $totalothour;die;
|
||||
$empSalaryAdd = $currentDayBasic + $currentDayHra + $totSalayOT + $dayFood_Allowance + $Allowances + $Incentive;
|
||||
// echo $totalDaysWorked .'</br>';
|
||||
// echo $currentDayBasic .'</br>';
|
||||
// echo $currentDayHra .'</br>';
|
||||
// echo $totSalayOT .'</br>';
|
||||
// echo $dayFood_Allowance .'</br>';
|
||||
// echo $Allowances .'</br>';
|
||||
// echo $Incentive .'</br>';
|
||||
// die;
|
||||
$empSalaryAdd = $currentDayBasic + $currentDayHra + $totSalayOT;
|
||||
|
||||
$empSalarySub = $esiAmount + $pfAmount + $loan;
|
||||
|
||||
$salaryInCurrentday = $empSalaryAdd - $empSalarySub;
|
||||
|
||||
// echo $esiAmount .'</br>';
|
||||
// echo $pfAmount .'</br>';
|
||||
// echo $loan .'</br>';
|
||||
// echo $empSalarySub .'</br>';
|
||||
// echo $empSalaryAdd .'</br>';
|
||||
// echo $salaryInCurrentday .'</br>';
|
||||
// die;
|
||||
|
||||
$employeeSalary[] = round($salaryInCurrentday);
|
||||
$esi[] = number_format($esiAmount,2);
|
||||
@ -632,7 +624,7 @@ class Payslip extends BaseController
|
||||
$data['pf'] = $pf;
|
||||
$data['over_time'] = $ot;
|
||||
|
||||
// dd($data);
|
||||
// dd($data);
|
||||
$this->global['pageTitle'] = 'Payroll Monthly Inputs';
|
||||
$this->loadViews("monthlypayinputs", $this->global, $data, NULL);
|
||||
}
|
||||
@ -649,7 +641,7 @@ class Payslip extends BaseController
|
||||
//dd($data['fresh']);
|
||||
|
||||
|
||||
$employeeSalary = [];
|
||||
$employeeSalary = [];
|
||||
$esi = [];
|
||||
$pf = [];
|
||||
$ot = [];
|
||||
@ -660,7 +652,6 @@ class Payslip extends BaseController
|
||||
$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
|
||||
$Sunday = $value->sunday_count; // Sunday count
|
||||
$LOP_Days = $value->NoofDays - ($Days_worked + $Sunday); // not working day
|
||||
@ -668,7 +659,6 @@ class Payslip extends BaseController
|
||||
$OT_Hrs_Worked = $value->OT_Hrs_Worked; //OT hours
|
||||
$Monthly_Due = $value->Monthly_Due; // AUTO LOAN DUE
|
||||
$Loan_Recovered = $value->Loan_Recovered; //MANUAL LOAN DUE
|
||||
$MasterIncentives = $value->MasterIncentives; //Master values get
|
||||
$due_start_date = $value->DueDate;
|
||||
$paydate = $current; //From POST parm
|
||||
|
||||
@ -704,21 +694,13 @@ 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
|
||||
$Incentive = 0;
|
||||
if (empty($MonthIncentive)) {
|
||||
$Incentive = $MasterIncentives;
|
||||
} else {
|
||||
$Incentive = $MonthIncentive;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$dayFood_Allowance = $Food_Allowances * ($Days_worked + $Sunday);
|
||||
|
||||
|
||||
$totalDaysWorked = ($Days_worked + $Sunday) + $Paid_leave;
|
||||
|
||||
@ -755,19 +737,17 @@ class Payslip extends BaseController
|
||||
/** pf amount per day**/
|
||||
|
||||
//echo $totalothour;die;
|
||||
$empSalaryAdd = $currentDayBasic + $currentDayHra + $totSalayOT + $dayFood_Allowance + $Allowances + $Incentive;
|
||||
// echo $totalDaysWorked .'</br>';
|
||||
// echo $currentDayBasic .'</br>';
|
||||
// echo $currentDayHra .'</br>';
|
||||
// echo $totSalayOT .'</br>';
|
||||
// echo $dayFood_Allowance .'</br>';
|
||||
// echo $Allowances .'</br>';
|
||||
// echo $Incentive .'</br>';
|
||||
// die;
|
||||
$empSalaryAdd = $currentDayBasic + $currentDayHra + $totSalayOT;
|
||||
$empSalarySub = $esiAmount + $pfAmount + $loan;
|
||||
|
||||
$salaryInCurrentday = $empSalaryAdd - $empSalarySub;
|
||||
|
||||
// echo $esiAmount .'</br>';
|
||||
// echo $pfAmount .'</br>';
|
||||
// echo $loan .'</br>';
|
||||
// echo $empSalarySub .'</br>';
|
||||
// echo $empSalaryAdd .'</br>';
|
||||
// echo $salaryInCurrentday .'</br>';
|
||||
// die;
|
||||
|
||||
$employeeSalary[] = round($salaryInCurrentday);
|
||||
$esi[] = number_format($esiAmount,2);
|
||||
@ -778,7 +758,7 @@ class Payslip extends BaseController
|
||||
$data['esi'] = $esi;
|
||||
$data['pf'] = $pf;
|
||||
$data['over_time'] = $ot;
|
||||
// dd($data);
|
||||
// dd($data);
|
||||
//echo sizeof($data['fresh'])."-".sizeof($data['empSalary']);die;
|
||||
$this->global['pageTitle'] = 'Payroll Monthly Inputs';
|
||||
$this->loadViews("monthlypayinputs", $this->global, $data, NULL);
|
||||
@ -835,8 +815,8 @@ class Payslip extends BaseController
|
||||
$LOP_Days = $j['LOP Days'];
|
||||
$Paid_leave = $j['Paid Leave'];
|
||||
$OT_Hrs_Worked = $j['OT Hrs'];
|
||||
$Loan_Recovered = $j['Manual Loan Due ₹'];
|
||||
$Incentives = $j['Incentives in ₹'];
|
||||
$Loan_Recovered = $j['Auto Loan Due ₹'];
|
||||
// $Incentives = $j['Incentives in ₹'];
|
||||
$Festival_Bonus = $j['Festival Bonus in ₹'];
|
||||
$Other_Deductions = $j['TDS Deductions in ₹'];
|
||||
$Estimate = $j['Estimate in ₹'];
|
||||
@ -883,11 +863,11 @@ class Payslip extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
$Incentives_first = explode(".", $Incentives);
|
||||
if (!is_numeric($Incentives) || (strlen((string)$Incentives)) > 8 || (strlen((string)$Incentives_first[0])) > 5) {
|
||||
//echo $EmpID . "-Loan Recoverd Invalid Data!";
|
||||
$ErrorFlag++;
|
||||
}
|
||||
// $Incentives_first = explode(".", $Incentives);
|
||||
// if (!is_numeric($Incentives) || (strlen((string)$Incentives)) > 8 || (strlen((string)$Incentives_first[0])) > 5) {
|
||||
// //echo $EmpID . "-Loan Recoverd Invalid Data!";
|
||||
// $ErrorFlag++;
|
||||
// }
|
||||
|
||||
$Festivalbonus_first = explode(".", $Festival_Bonus);
|
||||
if (!is_numeric($Festival_Bonus) || (strlen((string)$Festival_Bonus)) > 8 || (strlen((string)$Festivalbonus_first[0])) > 5) {
|
||||
@ -928,18 +908,18 @@ class Payslip extends BaseController
|
||||
$LOP_Days = isset($j['LOP Days']) ? $j['LOP Days'] : 0.00;
|
||||
$Paid_leave = isset($j['Paid Leave']) ? $j['Paid Leave'] : 0.00;
|
||||
$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;
|
||||
if (is_string($Loan_Recovered)) {
|
||||
$Loan_Recovered = strtoupper($Loan_Recovered);
|
||||
}
|
||||
$Incentives = isset($j['Incentives in ₹']) ? $j['Incentives in ₹'] : 0.00 ;
|
||||
$Loan_Recovered = isset($j['Auto Loan Due ₹']) ? $j['Auto Loan Due ₹'] : 0.00;
|
||||
// if (is_string($Loan_Recovered)) {
|
||||
// $Loan_Recovered = strtoupper($Loan_Recovered);
|
||||
// }
|
||||
// $Incentives = isset($j['Incentives in ₹']) ? $j['Incentives in ₹'] : 0.00 ;
|
||||
$Festival_Bonus = isset($j['Festival Bonus in ₹']) ? $j['Festival Bonus in ₹'] : 0.00;
|
||||
$Other_Deductions = isset($j['Other Deductions in ₹']) ? $j['Other Deductions in ₹'] : 0.00;
|
||||
$tds_Deductions = isset($j['TDS Deductions in ₹']) ? $j['TDS Deductions in ₹'] : 0.00;
|
||||
$Estimate = isset($j['Estimate in ₹']) ? $j['Estimate in ₹'] : 0.00;
|
||||
$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);
|
||||
//print_r($monthlypaydata); die;
|
||||
$monthlypaydata = array('Month_Year' => $month, 'EmpID' => $EmpID, 'Days_worked' => $DaysWorked, 'LOP_Days' => $LOP_Days, 'Paid_leave' => $Paid_leave, 'OT_Hrs_Worked' => $OT_Hrs_Worked, 'Festival_Bonus' => $Festival_Bonus, 'Other_Deductions' => $tds_Deductions, 'Estimate' => $Estimate, 'Created_By' => $Created_By ,'Loan_Recovered'=>$Loan_Recovered);
|
||||
// print_r($monthlypaydata); die;
|
||||
$result = $this->monthlypay_model->saveMonthlyData_model($monthlypaydata);
|
||||
$total = $total + $result;
|
||||
}
|
||||
|
||||
@ -17,10 +17,10 @@ class Emppaydate_model extends Model
|
||||
{
|
||||
$builder = $this->db->table('t_loan_master')
|
||||
->select('t_loan_master.*,t_emp_pay_data.*,t_employee_details.FirstName')
|
||||
->join('t_employee_details','t_loan_master.EmpID = t_employee_details.EmpID')
|
||||
->join('t_emp_pay_data','t_loan_master.EmpID = t_emp_pay_data.EmpID');
|
||||
->join('t_employee_details','t_loan_master.EmpID = t_employee_details.EmpID','LEFT')
|
||||
->join('t_emp_pay_data','t_loan_master.EmpID = t_emp_pay_data.EmpID','LEFT');
|
||||
$query =$builder->get();
|
||||
$result = $query->getResult();
|
||||
$result = $query->getResult();
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
@ -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.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
|
||||
$sql = "select t_emp_pay_data.EmpID,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 = ?
|
||||
@ -206,7 +206,7 @@ class Monthlypay_model extends Model
|
||||
|
||||
$count = $res[0]['count'];
|
||||
}
|
||||
// print_r($data);die;
|
||||
|
||||
|
||||
if ($count == 0) {
|
||||
$builder = $this->db->table('t_monthly_pay_inputs');
|
||||
|
||||
@ -906,44 +906,7 @@ legend {
|
||||
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<span for="Allowances">Allowances</span>
|
||||
<input type="text" name="Allowances"
|
||||
value="<?php echo set_value('Allowances'); ?>"
|
||||
class="form-control num" style="text-transform:uppercase;"
|
||||
pattern="([0-9]{1,5}([.][0-9]{1,2})?)"
|
||||
title="Enter the Valid Allowances, Minimum 1 digit, Maximum 5 digits" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<span for="Food_Allowances">Food Allowances(Per Day)</span>
|
||||
<input type="text" name="Food_Allowances"
|
||||
value="<?php echo set_value('Food_Allowances'); ?>"
|
||||
class="form-control num"
|
||||
pattern="([0-9]{1,3}([.][0-9]{1,2})?)"
|
||||
onfocusout="validateFood();"
|
||||
title="Enter the Valid Food Allowances, Minimum 1 Digit, Maximum 3 Digits" />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<span for="Incentives">Incentives</span>
|
||||
<input type="text" name="Incentives"
|
||||
value="<?php echo set_value('Incentives'); ?>"
|
||||
class="form-control num" style="text-transform:uppercase;"
|
||||
pattern="([0-9]{1,5}([.][0-9]{1,2})?)"
|
||||
title="Enter the Valid Allowances, Minimum 1 digit, Maximum 5 digits" />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3"></div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3">
|
||||
|
||||
@ -1198,47 +1198,6 @@ legend {
|
||||
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<span for="Allowances">Allowances</span>
|
||||
<input type="text" name="Allowances"
|
||||
value="<?php echo $empPay->Allowances; ?>"
|
||||
class="form-control num"
|
||||
style="text-transform:uppercase;"
|
||||
pattern="([0-9]{1,5}([.][0-9]{1,2})?)"
|
||||
title="Enter the Valid Allowances, Minimum 1 digit, Maximum 5 digits" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<span for="Food_Allowances">Food Allowances(Per Day)</span>
|
||||
<input type="text" name="Food_Allowances"
|
||||
value="<?php echo $empPay->Food_Allowances; ?>"
|
||||
class="form-control num"
|
||||
pattern="([0-9]{1,3}([.][0-9]{1,2})?)"
|
||||
onfocusout="validateFood();"
|
||||
title="Enter the Valid Food Allowances, Minimum 1 Digit, Maximum 3 Digits" />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<span for="Incentives">Incentives</span>
|
||||
<input type="text" name="Incentives"
|
||||
value="<?php echo $empPay->Incentives; ?>"
|
||||
class="form-control num"
|
||||
style="text-transform:uppercase;"
|
||||
pattern="([0-9]{1,5}([.][0-9]{1,2})?)"
|
||||
title="Enter the Valid Allowances, Minimum 1 digit, Maximum 5 digits" />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3"></div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
|
||||
@ -40,31 +40,24 @@
|
||||
|
||||
|
||||
<?php
|
||||
if(!empty($userRecords))
|
||||
{
|
||||
//print_r($userRecords);
|
||||
foreach($userRecords as $record)
|
||||
{
|
||||
?>
|
||||
<tr>
|
||||
<td style="text-align: left;"><?php echo $record->EmpID ?>-<?php echo $record->FirstName;?></td>
|
||||
<td><?php echo $record->TotalSalary; ?></td>
|
||||
<td><?php echo $record->Loan_Amount; ?></td>
|
||||
<td><?php echo $record->Loan_Issued_Date; ?></td>
|
||||
<td><?php echo $record->Monthly_Due; ?></td>
|
||||
<td><?php echo $record->No_of_Dues; ?></td>
|
||||
<td><?php echo $record->Paid_Due; ?></td>
|
||||
<td><?php echo $record->Remaining_Due; ?></td>
|
||||
<td><?php echo $record->Paid_Amount; ?></td>
|
||||
|
||||
<td>
|
||||
<a href="<?php echo base_url().'emppaydate/editOldemppay/'.$record->Pay_Data_ID; ?>"><i class="btn btn-success">EDIT</i></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
if(!empty($userRecords)) { foreach($userRecords as $record) { ?>
|
||||
<tr>
|
||||
<td style="text-align: left;"><?php echo $record->EmpID ?>-<?php echo $record->FirstName;?></td>
|
||||
<td><?php echo $record->TotalSalary; ?></td>
|
||||
<td><?php echo $record->Loan_Amount; ?></td>
|
||||
<td><?php echo $record->Loan_Issued_Date; ?></td>
|
||||
<td><?php echo $record->Monthly_Due; ?></td>
|
||||
<td><?php echo $record->No_of_Dues; ?></td>
|
||||
<td><?php echo $record->Paid_Due; ?></td>
|
||||
<td><?php echo $record->Remaining_Due; ?></td>
|
||||
<td><?php echo $record->Paid_Amount; ?></td>
|
||||
|
||||
<td>
|
||||
<a href="<?php echo base_url().'emppaydate/editOldemppay/'.$record->Pay_Data_ID; ?>"><i class="btn btn-success">EDIT</i></a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php } }?>
|
||||
</table>
|
||||
|
||||
</div><!-- /.box-body -->
|
||||
|
||||
@ -190,9 +190,7 @@ $('html').bind('keypress', function(e) {
|
||||
|
||||
<th>Auto Loan Due ₹</th>
|
||||
|
||||
<th>Manual Loan Due ₹</th>
|
||||
|
||||
<th>Incentives in ₹</th>
|
||||
<th>TDS Deductions in ₹</th>
|
||||
<th>Festival Bonus in ₹</th>
|
||||
|
||||
@ -215,15 +213,8 @@ $('html').bind('keypress', function(e) {
|
||||
$i = 0;
|
||||
foreach($sample as $i=> $record)
|
||||
{
|
||||
$index++;
|
||||
|
||||
if(in_array($record->EmpID,$testarray))
|
||||
{
|
||||
$index--;
|
||||
}else{
|
||||
|
||||
|
||||
array_push($testarray,$record->EmpID);
|
||||
$index++;
|
||||
if(in_array($record->EmpID,$testarray)) { $index--; }else{ array_push($testarray,$record->EmpID);
|
||||
?>
|
||||
|
||||
<tr class="lastvalue">
|
||||
@ -233,10 +224,10 @@ $('html').bind('keypress', function(e) {
|
||||
<td style="max-width:80px"><?php echo $record->FirstName; ?></td>
|
||||
<td style="max-width:80px">
|
||||
<?php
|
||||
$date = DateTime::createFromFormat('Y-m-d H:i:s', $record->DateofJoining);
|
||||
$newDateFormat = $date->format('d-m-Y');
|
||||
echo $newDateFormat;
|
||||
?>
|
||||
$date = DateTime::createFromFormat('Y-m-d H:i:s', $record->DateofJoining);
|
||||
$newDateFormat = $date->format('d-m-Y');
|
||||
echo $newDateFormat;
|
||||
?>
|
||||
</td>
|
||||
<td style="max-width:80px"><?php echo $record->Designation; ?></td>
|
||||
<td style="max-width:80px"><?php echo $record->NoofDays; ?></td>
|
||||
@ -288,9 +279,9 @@ $('html').bind('keypress', function(e) {
|
||||
</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 $pf[$i]; ?> </td>
|
||||
<td style="max-width:80px"> <?php echo $over_time[$i]; ?> </td>
|
||||
<td id="esiAmt<?php echo $index?>" style="max-width:80px"> <?php echo $esi[$i]; ?> </td>
|
||||
<td id="pfAmt<?php echo $index?>" style="max-width:80px"> <?php echo $pf[$i]; ?> </td>
|
||||
<td style="max-width:80px"> <?php echo $over_time[$i]; ?> </td>
|
||||
|
||||
|
||||
|
||||
@ -309,43 +300,19 @@ $('html').bind('keypress', function(e) {
|
||||
|
||||
|
||||
|
||||
<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,'.',''); $totalmanualoan[] = $record->Loan_Recovered;}else {echo $record->Loan_Recovered; $totalmanualoan[] = $record->Loan_Recovered;}}else{echo number_format(0.00,2,'.',''); $totalmanualoan[] = 0;} ?>
|
||||
|
||||
</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->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;}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
<?php ?>
|
||||
<!-- else{ echo number_format(0.00,2,'.','');;} -->
|
||||
|
||||
<td id="otherDet<?php echo $index?>" onkeypress="return isNumber(event);"
|
||||
onkeyup="changeInput(event);"
|
||||
<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>
|
||||
|
||||
@ -366,10 +333,11 @@ $('html').bind('keypress', function(e) {
|
||||
<?php if(!empty($record->Key)){?> title="Payslip Calculated"
|
||||
style="text-align:right;color:blue;" <?php }?>>
|
||||
<?php if(!empty($record->Estimate)){
|
||||
echo $record->Estimate; $estTotal [] = $record->Estimate;
|
||||
}else {
|
||||
echo $empSalary[$i]; $estTotal [] = $empSalary[$i];
|
||||
}?>
|
||||
echo $record->Estimate; $estTotal [] = $record->Estimate;
|
||||
}else {
|
||||
echo $empSalary[$i]; $estTotal [] = $empSalary[$i];
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
||||
|
||||
@ -379,9 +347,14 @@ $('html').bind('keypress', function(e) {
|
||||
|
||||
|
||||
|
||||
<!--<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="sunday<?php echo $index?>"
|
||||
value="<?php echo $record->sunday_count?>">
|
||||
<input type="hidden" id="is_management_team<?php echo $index?>"
|
||||
value="<?php echo $record->is_management_team?>">
|
||||
<input type="hidden" id="esi_applicable<?php echo $index?>"
|
||||
value="<?php echo $record->esi_applicable?>">
|
||||
<input type="hidden" id="pf_applicable<?php echo $index?>"
|
||||
value="<?php echo $record->pf_applicable?>">
|
||||
<input type="hidden" id="bPay<?php echo $index?>"
|
||||
value="<?php echo $record->Basic_Pay?>">
|
||||
<input type="hidden" id="hraRate<?php echo $index?>"
|
||||
@ -398,19 +371,14 @@ $('html').bind('keypress', function(e) {
|
||||
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?>">
|
||||
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 = "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?>"> -->
|
||||
|
||||
|
||||
|
||||
|
||||
@ -422,22 +390,22 @@ $('html').bind('keypress', function(e) {
|
||||
}
|
||||
|
||||
}
|
||||
//print_r($totalinst);
|
||||
|
||||
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="5"></th>
|
||||
<th colspan="20"></th>
|
||||
|
||||
|
||||
<th>Total</th>
|
||||
<th id="manualoan">
|
||||
<?php echo isset($totalmonthloan) ? array_sum($totalmonthloan) : '';?></th>
|
||||
|
||||
<th id="monthloan">
|
||||
<?php echo isset($totalmonthloan) ? array_sum($totalmanualoan) : '' ;?>
|
||||
<?php echo isset($totalmonthloan) ? array_sum($totalmonthloan) : '' ;?>
|
||||
</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="fest">
|
||||
@ -467,10 +435,10 @@ $('html').bind('keypress', function(e) {
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
var estTotal = [];
|
||||
var totalinst = [];
|
||||
|
||||
var totalotherDet = [];
|
||||
var totalmonthloan = [];
|
||||
var totalmanualoan = [];
|
||||
|
||||
|
||||
$(function() {
|
||||
var i = 0;
|
||||
@ -479,11 +447,7 @@ $(function() {
|
||||
estTotal[i] = $(this).find('td').eq(11).text();
|
||||
});
|
||||
|
||||
var i = 0;
|
||||
$('tr.lastvalue').each(function() {
|
||||
i = i + 1;
|
||||
totalinst[i] = $(this).find('td').eq(8).text();
|
||||
});
|
||||
|
||||
|
||||
|
||||
var i = 0;
|
||||
@ -495,13 +459,9 @@ $(function() {
|
||||
|
||||
|
||||
|
||||
var i = 0;
|
||||
$('tr.lastvalue').each(function() {
|
||||
i = i + 1;
|
||||
totalmanualoan[i] = $(this).find('td').eq(6).text();
|
||||
});
|
||||
|
||||
//console.log(totalmanualoan);
|
||||
|
||||
|
||||
|
||||
var i = 0;
|
||||
$('tr.lastvalue').each(function() {
|
||||
@ -635,26 +595,20 @@ $("#monthyear").change(function() {
|
||||
|
||||
function savebuttonvalidation() {
|
||||
var curselection = $("#monthyear").val();
|
||||
//alert('current selection'+curselection);
|
||||
var currentdate = new Date();
|
||||
var currentmonth = currentdate.getMonth();
|
||||
var currentyear = currentdate.getFullYear();
|
||||
currentmonth++;
|
||||
//alert('currentmonth'+currentmonth);
|
||||
var res = curselection.split("-");
|
||||
var selmonth = res[0];
|
||||
var selyear = res[1];
|
||||
//alert('current selec month '+ selmonth + 'current selec year '+ selyear);
|
||||
var savebuttonstatus = currentmonth - selmonth;
|
||||
var year = currentyear - selyear;
|
||||
//alert(selyear + currentyear);
|
||||
if (savebuttonstatus >= 2) {
|
||||
if (year == 1) {
|
||||
$("#savebutton").hide();
|
||||
// $("#savebutton").show();
|
||||
} else {
|
||||
$("#savebutton").hide();
|
||||
//$("#savebutton").show();
|
||||
}
|
||||
} else if (savebuttonstatus < 0) {
|
||||
|
||||
@ -662,14 +616,11 @@ function savebuttonvalidation() {
|
||||
$("#savebutton").show();
|
||||
} else if (year == 0) {
|
||||
$("#savebutton").hide();
|
||||
// $("#savebutton").show();
|
||||
} else {
|
||||
$("#savebutton").hide();
|
||||
// $("#savebutton").show();
|
||||
}
|
||||
} else if (savebuttonstatus == 0 && year == 0) {
|
||||
$("#savebutton").hide();
|
||||
// $("#savebutton").show();
|
||||
} else if (savebuttonstatus == 1) {
|
||||
if (year == 0 || year == 1) {
|
||||
$("#savebutton").show();
|
||||
@ -703,7 +654,6 @@ function changeInput(event, k) {
|
||||
var duedate = document.getElementById('duedate' + sno).value;
|
||||
duedate = new Date(duedate);
|
||||
var paydate = document.getElementById('paydate').value;
|
||||
|
||||
if (paydate.length == 6) {
|
||||
paydate = '0' + paydate;
|
||||
}
|
||||
@ -712,25 +662,12 @@ function changeInput(event, k) {
|
||||
var pday = new Date(pyearonly, pmonthonly, 0).getDate();
|
||||
var finalpaydate = pyearonly + '-' + pmonthonly + '-' + pday;
|
||||
finalpaydate = new Date(finalpaydate);
|
||||
|
||||
|
||||
|
||||
|
||||
var loanRecd = document.getElementById('loanRecd' + sno).textContent;
|
||||
console.log(loanRecd);
|
||||
totalmanualoan[sno] = loanRecd;
|
||||
console.log(totalmanualoan);
|
||||
var incentie = parseFloat(document.getElementById('incentie' + sno).textContent);
|
||||
|
||||
var otherDet = parseFloat(document.getElementById('otherDet' + 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);
|
||||
@ -740,94 +677,74 @@ function changeInput(event, k) {
|
||||
// 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);
|
||||
var sunday = parseFloat(document.getElementById('sunday' + sno).value);
|
||||
var is_management_team = parseFloat(document.getElementById('is_management_team' + sno).value);
|
||||
var esi_applicable = parseFloat(document.getElementById('esi_applicable' + sno).value);
|
||||
var pf_applicable = parseFloat(document.getElementById('pf_applicable' + sno).value);
|
||||
|
||||
var pfAmtString = document.getElementById('pfAmt' + sno).textContent;
|
||||
pfAmtString = pfAmtString.replace(/,/g, '');
|
||||
var pfAmt = parseFloat(pfAmtString);
|
||||
|
||||
var esiAmtString = document.getElementById('esiAmt' + sno).textContent;
|
||||
esiAmtString = esiAmtString.replace(/,/g, '');
|
||||
var esiAmt = parseFloat(esiAmtString);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(is_management_team == 1){
|
||||
var dayWorkPaid = dayWorks + paidLeave + lopDay;
|
||||
}else{
|
||||
var dayWorkPaid = dayWorks + paidLeave ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
var dayWorkPaid = dayWorks + paidLeave;
|
||||
// console.log("day"+dayWorkPaid);
|
||||
console.log("day" + dayWorkPaid);
|
||||
var NoofDays = dayWorks + paidLeave + lopDay;
|
||||
// console.log("monthday"+NoofDays);
|
||||
console.log("monthday"+NoofDays);
|
||||
var Food_Allowances = fAllow * dayWorks;
|
||||
// console.log("workedFA"+Food_Allowances);
|
||||
|
||||
var daySalary = bpay / NoofDays;
|
||||
// console.log("1daysalary "+daySalary);
|
||||
console.log("1daysalary "+daySalary);
|
||||
var dayHra = hraAmt / NoofDays;
|
||||
// console.log("1dayHRA"+dayHra);
|
||||
console.log("1dayHRA"+dayHra);
|
||||
var onehoursSalary = (daySalary + dayHra) / 8;
|
||||
//console.log("onehours "+onehoursSalary);
|
||||
var totSalayOT = 0;
|
||||
console.log("onehours " + onehoursSalary);
|
||||
|
||||
|
||||
var totSalayOT = 0;
|
||||
if (otHrsWork != 0) {
|
||||
totSalayOT = otHrsWork * onehoursSalary;
|
||||
} else {
|
||||
totSalayOT = 0;
|
||||
}
|
||||
//console.log(totSalayOT);
|
||||
console.log(totSalayOT);
|
||||
|
||||
|
||||
|
||||
var currentDaySalary = daySalary * dayWorkPaid;
|
||||
//console.log("11days salary"+currentDaySalary);
|
||||
console.log("11days salary"+currentDaySalary);
|
||||
|
||||
var currentDayHra = dayHra * dayWorkPaid;
|
||||
// console.log("11days hra"+currentDayHra);
|
||||
console.log("11days hra"+currentDayHra);
|
||||
|
||||
|
||||
|
||||
var current_loan_amt = 0;
|
||||
var autoLoan = parseFloat(monthDue);
|
||||
console.log(monthDue);
|
||||
var manualLoan = parseFloat(loanRecd);
|
||||
// var manualLoan = Math.min.apply(null, arrayOfNumbers.filter(function(loanRecd) { return !isNaN(loanRecd); }))
|
||||
//alert(manualLoan);
|
||||
|
||||
if (manualLoan == 0.00) {
|
||||
if (duedate <= finalpaydate) {
|
||||
current_loan_amt = autoLoan;
|
||||
}
|
||||
|
||||
//alert('}0.00');
|
||||
} else if (isNaN(manualLoan)) {
|
||||
//alert('N');
|
||||
current_loan_amt = 0.00;
|
||||
|
||||
} else if (manualLoan == 'NA') {
|
||||
//alert('NA');
|
||||
current_loan_amt = 0.00;
|
||||
|
||||
} else if (manualLoan >= 0.00) {
|
||||
if (duedate <= finalpaydate) {
|
||||
current_loan_amt = manualLoan;
|
||||
}
|
||||
//alert('manual');
|
||||
}
|
||||
|
||||
|
||||
|
||||
var Balance_Amount = loanamt - paidamt;
|
||||
|
||||
if (autoLoan > Balance_Amount) {
|
||||
|
||||
if (duedate <= finalpaydate) {
|
||||
current_loan_amt = Balance_Amount;
|
||||
}
|
||||
|
||||
|
||||
//alert('HI');
|
||||
|
||||
} else {
|
||||
current_loan_amt = autoLoan;
|
||||
}
|
||||
|
||||
// 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);
|
||||
@ -842,29 +759,33 @@ function changeInput(event, k) {
|
||||
|
||||
}
|
||||
|
||||
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;
|
||||
pfAmount = 0;
|
||||
if(pf_applicable == 1){
|
||||
pfAmount = pfAmt;
|
||||
}else{
|
||||
pfAmount = 0;
|
||||
}
|
||||
|
||||
var pfAmount = currentDaySalary * pfRate / 100;
|
||||
// console.log("11daypf"+pfAmount);
|
||||
esiAmount = 0;
|
||||
if(esi_applicable == 1){
|
||||
esiAmount = esiAmt;
|
||||
}else{
|
||||
esiAmount = 0;
|
||||
}
|
||||
|
||||
|
||||
var empSalaryAdd = currentDaySalary + totSalayOT + currentDayHra + Food_Allowances + allow + incent + Festivals;
|
||||
|
||||
|
||||
|
||||
|
||||
var empSalaryAdd = currentDaySalary + totSalayOT + currentDayHra + Festivals;
|
||||
console.log("empSalaryAdd "+empSalaryAdd);
|
||||
var empSalarySub = current_loan_amt + esiAmount + pfAmount + otherDets;
|
||||
|
||||
console.log("current_loan_amt "+current_loan_amt);
|
||||
console.log("esiAmount "+esiAmount);
|
||||
console.log("pfAmount "+pfAmount);
|
||||
console.log("otherDets "+otherDets);
|
||||
|
||||
|
||||
var empMonthSalary = empSalaryAdd - empSalarySub
|
||||
@ -880,64 +801,32 @@ function changeInput(event, k) {
|
||||
|
||||
$.each(estTotal, function(i, value) {
|
||||
if (sno == i) {
|
||||
|
||||
estTotal[i] = cals;
|
||||
|
||||
}
|
||||
});
|
||||
//console.log(estTotal);
|
||||
|
||||
$.each(totalinst, function(i, value) {
|
||||
if (sno == i) {
|
||||
|
||||
totalinst[i] = incentie;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$.each(totalotherDet, function(i, value) {
|
||||
if (sno == i) {
|
||||
|
||||
totalotherDet[i] = otherDet;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
$.each(totalmonthloan, function(i, value) {
|
||||
if (sno == i) {
|
||||
|
||||
totalmonthloan[i] = loanRecd;
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$.each(totalmanualoan, function(i, value) {
|
||||
if (sno == i) {
|
||||
totalmanualoan[i] = monthDue;
|
||||
console.log( totalmanualoan[i]);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
// $.each(totalmonthloan, function(i, value) {
|
||||
// if (sno == i) {
|
||||
// totalmonthloan[i] = loanRecd;
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
calculategrandtotal();
|
||||
|
||||
|
||||
|
||||
}
|
||||
var tempTotal = [];
|
||||
|
||||
function calculategrandtotal() {
|
||||
|
||||
$.each(totalinst, function(index, value) {
|
||||
//var res2 = value.split('-');
|
||||
tempTotal[index] = parseFloat(value);
|
||||
});
|
||||
|
||||
|
||||
var sum = 0;
|
||||
|
||||
@ -988,7 +877,7 @@ function calculategrandtotal() {
|
||||
|
||||
|
||||
|
||||
$.each(totalmonthloan, function(index, value) {
|
||||
$.each(totalmonthloan, function(index, value) {
|
||||
tempTotal[index] = parseFloat(value);
|
||||
});
|
||||
|
||||
@ -1000,17 +889,7 @@ function calculategrandtotal() {
|
||||
$('#monthloan').text(parseFloat(sum).toFixed(2));
|
||||
|
||||
|
||||
$.each(totalmanualoan, function(index, value) {
|
||||
//var res2 = value.split('-');
|
||||
tempTotal[index] = parseFloat(value);
|
||||
});
|
||||
|
||||
var sum = 0;
|
||||
|
||||
for (var i = 0; i < tempTotal.length; i++) {
|
||||
sum += tempTotal[i] << 0;
|
||||
}
|
||||
$('#manualoan').text(parseFloat(sum).toFixed(2));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user