diff --git a/application/controllers/payslip.php b/application/controllers/payslip.php index 1ec0228d..9b588cff 100755 --- a/application/controllers/payslip.php +++ b/application/controllers/payslip.php @@ -504,9 +504,10 @@ function phpAlert($msg) { $this->loadViews("payslipupload2", $this->global, NULL); } - public function monthlyInputs() + public function monthlyInputs() { $current = date("m-Y"); + //echo $current; $data['month'] = $this->monthlypay_model->monthlyListing($current); // $data['fresh'] = $this-> monthlypay_model->getEmpPayDetails($current); $data['dropdownvalue'] = $current; @@ -526,7 +527,7 @@ foreach($data['fresh'] as $value){ $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->Incentives;//Master values get + $MasterIncentives=$value->MasterIncentives;//Master values get // echo 'master'.$MasterIncentives; $Allowances =$value->Allowances; @@ -534,21 +535,21 @@ foreach($data['fresh'] as $value){ $PF_Rate=$value->PF_Rate; $ESI_Rate=$value->ESI_Rate; - $MonthIncentive = $value->Incent;//T_Monthly_Pay_Inputs,for change month + $MonthIncentive = $value->MonthlyIncentives;//T_Monthly_Pay_Inputs,for change month //echo 'month'. $MonthIncentive; - $Incentive = 0; + // $Incentive = 0; - if(empty($MonthIncentive)) - { + // if(empty($MonthIncentive)) + // { - $Incentive = $MasterIncentives; - } - else - { - $Incentive = $MonthIncentive; + // $Incentive = $MasterIncentives; + // } + // else + // { + // $Incentive = $MonthIncentive; - } + // } //echo $Incentive; @@ -600,7 +601,7 @@ foreach($data['fresh'] as $value){ /** pf amount per day**/ //echo $totalothour;die; - $salaryInCurrentdays = $currentDaySalary + $totSalayOT + $currentDayHra + $dayFood_Allowance + $Allowances + $Incentive; + $salaryInCurrentdays = $currentDaySalary + $totSalayOT + $currentDayHra + $dayFood_Allowance + $Allowances + $MasterIncentives; $salaryInCurrentday = $salaryInCurrentdays - ($esiAmount + $pfAmount) - $Monthly_Due; $employeeSalary []= round($salaryInCurrentday); @@ -644,7 +645,7 @@ foreach($data['fresh'] as $value){ $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->Incentives;//Master values get + $MasterIncentives=$value->MasterIncentives;//Master values get // echo 'master'.$MasterIncentives; $Allowances =$value->Allowances; @@ -652,7 +653,7 @@ foreach($data['fresh'] as $value){ $PF_Rate=$value->PF_Rate; $ESI_Rate=$value->ESI_Rate; - $MonthIncentive = $value->Incent;//T_Monthly_Pay_Inputs,for change month + $MonthIncentive = $value->MonthlyIncentives;//T_Monthly_Pay_Inputs,for change month //echo 'month'. $MonthIncentive; $Incentive = 0; @@ -731,7 +732,7 @@ foreach($data['fresh'] as $value){ $this->global['pageTitle'] = 'Siddharth : Payroll Monthly Inputs'; $this->loadViews("monthlypayinputs", $this->global,$data,NULL); } - + function saveMonthlyData() { diff --git a/application/models/monthlypay_model.php b/application/models/monthlypay_model.php index a98dfc5e..0f536b38 100755 --- a/application/models/monthlypay_model.php +++ b/application/models/monthlypay_model.php @@ -10,14 +10,22 @@ class monthlypay_model extends CI_Model * @param number $segment : This is pagination limit * @return array $result : This is result */ - function monthlyListing($current="") + function monthlyListing($current="") { - //echo $current; + + $month = $current; + if(strlen($month) == 6) + { + $month = '0'.$month; + } +//echo $month; + $curr_split = explode('-',$current); $month_val = $curr_split[0]; $year_val = $curr_split[1]; $date_val =cal_days_in_month(CAL_GREGORIAN,$month_val,$year_val); $lastdate = $year_val.'-'.$month_val.'-'.$date_val; + //echo $lastdate ; // $this->db->select('T_Monthly_Pay_Inputs.*,T_Employee_Details.FirstName,T_Employee_Details.LastName,T_Payroll.Key,T_Loan_Master.Loan_ID'); // $this->db->from('T_Monthly_Pay_Inputs'); @@ -43,6 +51,7 @@ class monthlypay_model extends CI_Model return $result; } + function getEmpPayDetails($current="",$s="") { @@ -90,21 +99,22 @@ 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,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 Incent + $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 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 = ? + 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 + 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 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"; - $query = $this->db->query($sql,array($month,$lastdate,$current,$current)); + $query = $this->db->query($sql,array($month,$month,$lastdate,$current,$current)); return $query->result(); } - + function getPublicHoldays($current="") { if(!empty($current)) diff --git a/application/views/BatchcardMaintAdd.php b/application/views/BatchcardMaintAdd.php index 010bf454..02462ddc 100755 --- a/application/views/BatchcardMaintAdd.php +++ b/application/views/BatchcardMaintAdd.php @@ -49,7 +49,7 @@