diff --git a/app/Controllers/Payslip.php b/app/Controllers/Payslip.php index 28566e81..2c5fb4ff 100755 --- a/app/Controllers/Payslip.php +++ b/app/Controllers/Payslip.php @@ -593,8 +593,7 @@ class Payslip extends BaseController public function monthlyInputs() { - $current = date("m-Y"); - + $current = $this->request->getPost('monthyear') ? $this->request->getPost('monthyear') :date("m-Y"); $data['month'] = $this->monthlypay_model->monthlyListing($current); $data['dropdownvalue'] = $current; @@ -627,6 +626,11 @@ class Payslip extends BaseController $Loan_Recovered = $value->Loan_Recovered; //MANUAL LOAN DUE $due_start_date = $value->DueDate; $paydate = $current; //From POST parm + if (strlen((string)$paydate) == 6) { + $paydate = '0' . $paydate; + } + $pmonth = substr($paydate, 0, 2); + $pyear = substr($paydate, -4); $pmonth = substr($paydate, 0, 2); $pyear = substr($paydate, -4); diff --git a/app/Models/Driver_model.php b/app/Models/Driver_model.php index 55965a99..cfea2b94 100755 --- a/app/Models/Driver_model.php +++ b/app/Models/Driver_model.php @@ -115,8 +115,7 @@ class Driver_model extends Model ->join('t_loan_history','t_loan_history.Loan_ID = t_loan_master.Loan_ID','Left') ->join('t_driver_monthly_pay_inputs','t_driver_monthly_pay_inputs.driver_id = driver_details.EmpID','Left') ->where('t_driver_attendance.date BETWEEN "'.$from.'" AND "'.$to.'"') - ->groupBy('DATE_FORMAT(t_driver_attendance.date, "%M-%Y")'); - + ->groupBy('DATE_FORMAT(t_driver_attendance.date, "%M-%Y"),t_driver_attendance.driver_id'); $query = $builder->get(); // $last_query = $this->db->getLastQuery(); // echo $last_query;die; diff --git a/app/Views/monthlypayinputs.php b/app/Views/monthlypayinputs.php index c2f76f8c..fac621c9 100755 --- a/app/Views/monthlypayinputs.php +++ b/app/Views/monthlypayinputs.php @@ -904,7 +904,7 @@ $(document).ready(function () { $("#formid").attr("method", "post"); //alert($s); - $("#formid").attr("action", "payslip/changeMonth"); + $("#formid").attr("action", "monthlypay"); $('#formid').submit();