From d74b222aa020234b87ef49e6b428f3270efa5e87 Mon Sep 17 00:00:00 2001 From: Gowtham M Date: Wed, 26 Mar 2025 15:37:59 +0530 Subject: [PATCH 1/3] Emp and load detail export : GWM --- app/Config/Routes.php | 2 + app/Controllers/Employeedetails.php | 29 +++++++++++ app/Controllers/Emppaydate.php | 25 +++++++-- app/Views/employeeListing.php | 13 ++--- app/Views/employee_pdf_view.php | 80 +++++++++++++++++++++++++++++ app/Views/emppayListing.php | 2 + app/Views/loan_pdf.php | 49 ++++++++++++++++++ 7 files changed, 191 insertions(+), 9 deletions(-) create mode 100644 app/Views/employee_pdf_view.php create mode 100644 app/Views/loan_pdf.php diff --git a/app/Config/Routes.php b/app/Config/Routes.php index f2f7e9fa..80c93458 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -121,6 +121,7 @@ $routes->post('addNewEmployee', 'Employeedetails::AddNewEmployee'); $routes->post('deleteEmployeeFile', 'Employeedetails::deleteEmployeeFile'); $routes->get('employeeListing', 'Employeedetails::index'); $routes->get('employeedetails/ViewEmployee', 'Employeedetails::ViewEmployee'); +$routes->get('employeedetails/downloadEmployeeDetails', 'Employeedetails::downloadEmployeeDetails'); $routes->post('employeedetails/UpdateEmployee', 'Employeedetails::UpdateEmployee'); $routes->get('exportemployee', 'Employeedetails::exportemployee'); @@ -199,6 +200,7 @@ $routes->post('monthlypay/deletePublicHoliday', 'Monthlypay::deletePublicHoliday $routes->get('emppaydate/addemppaydate', 'Emppaydate::addemppaydate'); $routes->post('emppaydate/addNewemppay', 'Emppaydate::addNewemppay'); $routes->get('emppaydate/editOldemppay/(:num)', 'Emppaydate::editOldemppay/$1'); +$routes->get('emppaydate/downloadEmpLoanData/(:num)', 'Emppaydate::downloadEmpLoanData/$1'); $routes->post('emppaydate/editemppay', 'Emppaydate::editemppay'); $routes->post('emppaydate/deleteEmpPay', 'Emppaydate::deleteEmpPay'); diff --git a/app/Controllers/Employeedetails.php b/app/Controllers/Employeedetails.php index 7f0aa25a..a9a11c83 100755 --- a/app/Controllers/Employeedetails.php +++ b/app/Controllers/Employeedetails.php @@ -14,6 +14,8 @@ use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Writer\Xlsx; +use Mpdf\Mpdf; + use PhpOffice\PhpSpreadsheet\Style\Alignment; use App\Models\EmpFilesModel; use App\Models\AppConfigModel; @@ -637,6 +639,33 @@ class Employeedetails extends BaseController $this->loadViews("editEmployeenew", $this->global, $data, NULL); } + + + function downloadEmployeeDetails($EmpNO = '') + { + $EmpID = $_GET['EmpID']; + + $data['EmpDetails'] = $this->employeedetails_model->viewemployee($EmpID); + $data['emp_data'] = $this->empFiles->where('emp_id', $EmpID)->where('is_active', 1)->findAll(); + $data['empPay'] = $this->emppaydate_model->getEmpPayData($EmpID); + // dd($data); + + + // Load the HTML view and pass data + $html = view('employee_pdf_view', $data); + + + $mpdf = new Mpdf(); + $mpdf->WriteHTML($html); + + // Output the PDF + $fName = $data['EmpDetails'][0]->EmpID.'-Employee-Details.pdf'; + return $mpdf->Output($fName, "D"); + + + } + + /* To Check the email exists in the database or not for the employee*/ function checkMailEmp() { diff --git a/app/Controllers/Emppaydate.php b/app/Controllers/Emppaydate.php index fa8bc2cb..067cb80c 100755 --- a/app/Controllers/Emppaydate.php +++ b/app/Controllers/Emppaydate.php @@ -10,7 +10,7 @@ use App\Models\Emppaydate_model; use App\Models\Payroll_model; - +use Mpdf\Mpdf; /** * Module : Payslip * Emppaydate Class to control all Employee paydate related operations. @@ -142,13 +142,32 @@ class Emppaydate extends BaseController $data['loan_histoty'] = $this->emppaydate_model->getUserLoanHistoryInfo($data['emppay'][0]->Loan_ID); - // print_r($data['loan_histoty']);die; - $this->global['pageTitle'] = 'Edit Employee Pay Monthly Details '; $this->loadViews("editOldemppay", $this->global, $data, NULL); } + function downloadEmpLoanData($paydataid = "") + { + + $data['emppay'] = $this->emppaydate_model->getUserInfo($paydataid); + + $data['loan_histoty'] = $this->emppaydate_model->getUserLoanHistoryInfo($data['emppay'][0]->Loan_ID); + + + // Load HTML view + $html = view('loan_pdf', $data); + + $mpdf = new Mpdf(); + $mpdf->SetTitle("Employee Loan Report"); + $mpdf->WriteHTML($html); + + // Download the PDF + $fName = $data['emppay'][0]->PAYEMPID."-loan-details.pdf"; + return $mpdf->Output($fName, "D"); + + } + /** diff --git a/app/Views/employeeListing.php b/app/Views/employeeListing.php index 3aab43fd..12ca5569 100755 --- a/app/Views/employeeListing.php +++ b/app/Views/employeeListing.php @@ -135,13 +135,14 @@ } else { $cdate = date('d-m-Y', strtotime($record->Created_date)); } ?> - EmpID ?> - is_driver){ ?> -     - -     + + EmpID ?> + +     + + - + FirstName; ?> diff --git a/app/Views/employee_pdf_view.php b/app/Views/employee_pdf_view.php new file mode 100644 index 00000000..f2363bee --- /dev/null +++ b/app/Views/employee_pdf_view.php @@ -0,0 +1,80 @@ + + + + + + Employee Details + + + + +
+
Employee Details
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Employee ID EmpID ?? '-' ?>Name FirstName . ' ' . ($EmpDetails[0]->LastName ?? '') ?>
Gender Gender ?? '-' ?>Date of Birth DateofBirth ?? '')) ?>
Contact Number ContactNumber ?? '-' ?>Email EmailId ?? '-' ?>
Department DepartmentName ?? '-' ?>Designation Designation ?? '-' ?>
Date of Joining DateofJoining ?? '')) ?>Marital Status MartialStatus ?? '-' ?>
Blood Group BloodGroup ?? '-' ?>Father's Name FatherName ?? '-' ?>
Aadhar No AadharNo ?? '-' ?>PAN No PANNo ?? '-' ?>
Present Address PresentAddress ?? '-' ?>
Permanent Address PermanentAddress ?? '-' ?>
+ + +
Salary Details
+ + + + + + + + + + + + + +
Basic Pay Basic_Pay ?? 0, 2) ?>HRA Amount HRA_Amount ?? 0, 2) ?>
HRA Rate HRA_Rate ?? 0, 2) ?>%PF Rate PF_Rate ?? 0, 2) ?>%
ESI Rate ESI_Rate ?? 0, 2) ?>%Total Salary TotalSalary ?? 0, 2) ?>
+ +
+ + + diff --git a/app/Views/emppayListing.php b/app/Views/emppayListing.php index 276e1a45..fadad718 100755 --- a/app/Views/emppayListing.php +++ b/app/Views/emppayListing.php @@ -55,6 +55,8 @@ Remaining_Due; ?> Paid_Amount; ?> + +       diff --git a/app/Views/loan_pdf.php b/app/Views/loan_pdf.php new file mode 100644 index 00000000..29167e32 --- /dev/null +++ b/app/Views/loan_pdf.php @@ -0,0 +1,49 @@ + + + + + + Loan Report + + + +

Employee Loan Report

+ + + + + + + + + + + +
Employee IDPAYEMPID; ?>
Employee NameFirstName; ?>
Basic PayBasic_Pay; ?>
Total SalaryTotalSalary; ?>
Loan AmountLoan_Amount; ?>
Loan Issued DateLoan_Issued_Date; ?>
Monthly DueMonthly_Due; ?>
Remaining DuesRemaining_Due; ?>
Paid AmountPaid_Amount; ?>
+ +

Loan History

+ + + + + + + + $value) { ?> + + + + + + + + +
Due AmountBalance AmountDue DateEntry Date
Due_Amount; ?>Balance_Amount; ?>Due_Date; ?>Entry_Date; ?>
+ + From f37b278c7f029ac0de006bb1b2b7ba2894e58822 Mon Sep 17 00:00:00 2001 From: Gowtham M Date: Wed, 26 Mar 2025 15:44:13 +0530 Subject: [PATCH 2/3] Emp and load detail export : GWM --- app/Controllers/Monthlypay.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Controllers/Monthlypay.php b/app/Controllers/Monthlypay.php index 623fed57..77302e3e 100755 --- a/app/Controllers/Monthlypay.php +++ b/app/Controllers/Monthlypay.php @@ -261,12 +261,12 @@ class Monthlypay extends BaseController } else { $W31OT = null; } - $totalworkinghrs = $data['Total Hrs']; + $totalworkinghrs = $data['Worked Hrs']; $totalothrs = $data['OT Hrs']; $paidleave = $data['Paid Leave']; $daysworked = $data['Days Worked']; $absent = $data['Absent']; - $sundayCount = $data['Total Sunday']; + $sundayCount = $data['Sunday']; $monthattendance = array( 'Month_Year' => $Month_Year, 'NoofDays' => $NoofDays, 'EmpID' => $EmpID, 'WH1' => $W1H, 'OT1' => $W1OT, 'WH2' => $W2H, 'OT2' => $W2OT, 'WH3' => $W3H, 'OT3' => $W3OT, From c34cb64325314dca2072bbe7fd2b64bd9b226f4f Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Wed, 26 Mar 2025 12:51:42 +0000 Subject: [PATCH 3/3] overtime listing and leave application --- app/Config/Routes.php | 4 + app/Controllers/Driver.php | 1 + app/Controllers/Employeedetails.php | 4 +- app/Controllers/Monthlypay.php | 75 ++++ app/Models/Driver_model.php | 17 +- app/Models/Monthlypay_model.php | 84 ++++ app/Views/driverAttendance.php | 10 +- app/Views/editEmployeenew.php | 9 +- app/Views/employeeLeaveApplicationForm.php | 491 +++++++++++++++++++++ app/Views/includes/new_header.php | 15 +- app/Views/monthlypayinputs.php | 17 +- app/Views/overTimeDetails.php | 397 +++++++++++++++++ 12 files changed, 1097 insertions(+), 27 deletions(-) create mode 100755 app/Views/employeeLeaveApplicationForm.php create mode 100755 app/Views/overTimeDetails.php diff --git a/app/Config/Routes.php b/app/Config/Routes.php index f2f7e9fa..99c7a60e 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -195,6 +195,10 @@ $routes->post('monthlypay/addper', 'Monthlypay::addper'); $routes->post('monthlypay/saveAttendance', 'Monthlypay::saveAttendance'); $routes->post('monthlypay/savePublicHolidays', 'Monthlypay::savePublicHolidays'); $routes->post('monthlypay/deletePublicHoliday', 'Monthlypay::deletePublicHoliday'); +$routes->get('leaveApplicationForm', 'Monthlypay::leaveApplicationForm'); +$routes->post('fetchLeaveApplicationForm', 'Monthlypay::fetchLeaveApplicationForm'); +$routes->get('deleteLeaveApplicationForm', 'Monthlypay::deleteLeaveApplicationForm'); +$routes->match(['GET', 'POST'], 'overTimeDetails', 'Monthlypay::overTimeDetails'); $routes->get('emppaydate/addemppaydate', 'Emppaydate::addemppaydate'); $routes->post('emppaydate/addNewemppay', 'Emppaydate::addNewemppay'); diff --git a/app/Controllers/Driver.php b/app/Controllers/Driver.php index 6cc47a6d..625175e4 100755 --- a/app/Controllers/Driver.php +++ b/app/Controllers/Driver.php @@ -174,6 +174,7 @@ class Driver extends BaseController $data['input_driver_id'] = $input_driver_id; $data['input_diesel_amount'] = isset($amount->diesel_amount) ? $amount->diesel_amount : 0 ; $data['input_shed_amount'] = isset($amount->shed_amount) ? $amount->shed_amount : 0 ; + $data['payslip_id'] = $this->driver_model->checkPayslipDetails($input_driver_id,"$month-$year"); $this->global['pageTitle'] = 'Driver Attendance List'; $this->loadViews("driverAttendance", $this->global, $data, NULL); diff --git a/app/Controllers/Employeedetails.php b/app/Controllers/Employeedetails.php index 7f0aa25a..e43435aa 100755 --- a/app/Controllers/Employeedetails.php +++ b/app/Controllers/Employeedetails.php @@ -871,8 +871,8 @@ class Employeedetails extends BaseController $HRA_Amount = $this->request->getPost('HRA_Amount'); $PF_Rate = $this->request->getPost('PF_Rate'); $ESI_Rate = $this->request->getPost('ESI_Rate'); - $CreateBy = $this->session->get('userId'); - $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); + $Last_Mod_By = $this->session->get('userId'); + $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, 'Last_Mod_By' => $Last_Mod_By); $empPayUpdate = $this->emppaydate_model->editemppay($emppay); diff --git a/app/Controllers/Monthlypay.php b/app/Controllers/Monthlypay.php index 623fed57..1df9c581 100755 --- a/app/Controllers/Monthlypay.php +++ b/app/Controllers/Monthlypay.php @@ -927,4 +927,79 @@ class Monthlypay extends BaseController $data['productionsalary'] = $this->monthlypay_model->cost($ab, $from, $to); $this->loadviews('salarycostforproduction', $this->global, $data, NULL); } + + + function leaveApplicationForm(){ + $this->global['pageTitle'] = 'Employee Leave Application Form'; + $data['leave_info'] = $this->monthlypay_model->getheringleaveApplicationForm(); + $data['employee_info'] = $this->monthlypay_model->getheringemployeeinformation(); + $data['status_info'] = ["Draft","Approved"]; + $this->loadviews('employeeLeaveApplicationForm', $this->global, $data, NULL); + } + + public function fetchLeaveApplicationForm(){ + $userId = $this->session->get('userId'); + $id = $this->request->getPost('leave_application_id'); + $emp_id = $this->request->getPost('emp_id'); + $start_date = $this->request->getPost('start_date'); + $end_date = $this->request->getPost('end_date'); + $no_of_days = $this->request->getPost('no_of_days'); + $reason = $this->request->getPost('reason'); + $status = $this->request->getPost('status'); + + $data = ['status' => false, 'message' => 'An error occurred while creating Leave Applicationform details']; + $leave_details = ['emp_id' => $emp_id,'start_date' =>$start_date,'end_date' =>$end_date,'no_of_days' =>$no_of_days,'reason' =>$reason,'status' => $status]; + + if ((int)$id == 0) { + + $leave_details['created_by'] = $userId; + $affectedRows = $this->monthlypay_model->saveleaveApplicationForm($leave_details,$id); + if ($affectedRows > 0) { + $data = ['status' => true, 'message' => 'Leave Applicationform details created successfully.']; + } + } else { + $leave_details['leave_application_id'] = $id; + $leave_details['updated_by'] = $userId; + $affectedRows = $this->monthlypay_model->saveleaveApplicationForm($leave_details,$id); + if ($affectedRows > 0) { + $data = ['status' => true, 'message' => 'Leave Applicationform details updated successfully.']; + }else{ + $data = ['status' => true, 'message' => 'There is no changes in Leave Applicationform details.']; + } + + } + + return $this->response->setJSON($data); + } + + function deleteLeaveApplicationForm() + { + $leave_application_id = $this->request->getGet('leave_application_id') ? $this->request->getGet('leave_application_id') : ''; + + if(!empty($leave_application_id)){ + $data = ['isactive' => 0,'updated_by' => $this->session->get('userId')]; + $affectedRows = $this->monthlypay_model->saveleaveApplicationForm($data,$leave_application_id); + $message = ($affectedRows > 0) ? "Leave Applicationform deleted successfully." : "Leave Applicationform already deleted."; + }else{ + $message = "Leave Applicationform details not available."; + } + $this->session->setFlashdata('success', $message); + + return redirect()->to(base_url('leaveApplicationForm')); + + + } + + public function overTimeDetails() + { + $current = $this->request->getPost('monthyear') ? $this->request->getPost('monthyear') :date("m-Y"); + $data['month'] = $this->monthlypay_model->monthlyListing($current); + + $data['dropdownvalue'] = $current; + $data['fresh'] = $this->monthlypay_model->getEmpPayDetailsforOTListing($current); + + $this->global['pageTitle'] = 'OverTime Details'; + $this->loadviews('overTimeDetails', $this->global, $data, NULL); + } + } diff --git a/app/Models/Driver_model.php b/app/Models/Driver_model.php index fc0d982a..5fee3b33 100755 --- a/app/Models/Driver_model.php +++ b/app/Models/Driver_model.php @@ -47,15 +47,13 @@ class Driver_model extends Model return $this->table . '.' . $field; }, $this->allowedFields)); - $selectFields = "CONCAT_WS(' ', t_employee_details.FirstName, t_employee_details.LastName) AS FullName, t_employee_details.IsActive as employee_isactive, CONCAT_WS(' ', driver.FirstName, driver.LastName) AS driver_name,ip_clients.client_name as customer,ip_invoices.received_qty as quantity,t_driver_payroll.id as payroll_id,t_driver_payroll.PayOn," . $fields; + $selectFields = "CONCAT_WS(' ', t_employee_details.FirstName, t_employee_details.LastName) AS FullName, t_employee_details.IsActive as employee_isactive, CONCAT_WS(' ', driver.FirstName, driver.LastName) AS driver_name,t_driver_payroll.id as payroll_id,t_driver_payroll.PayOn," . $fields; $month_year = get_date_time_dynamical_format('Y-m-d','m-Y',"$from"); return $this->select($selectFields) ->join('t_employee_details as driver', 'driver.EmpID = ' . $this->table . '.driver_id', 'left') ->join('tbl_users', 'tbl_users.userId = ' . $this->table . '.created_by', 'left') ->join('t_employee_details', 'tbl_users.EmpID = t_employee_details.EmpID', 'left') - ->join('ip_invoices', 'ip_invoices.invoice_number = ' . $this->table . '.invoice_number', 'left') - ->join('ip_clients', 'ip_clients.client_id = ip_invoices.client_id', 'left') ->join('t_driver_payroll', 't_driver_payroll.driver_id = '.$this->table.'.driver_id and t_driver_payroll.PayOn = "'.$month_year.'"', 'left') ->where($this->table.'.date BETWEEN "'.$from.'" AND "'.$to.'"') ->where($this->table . '.driver_id', $driver_id) @@ -64,6 +62,19 @@ class Driver_model extends Model ->findAll(); } + + function checkPayslipDetails($input_driver_id,$month_year){ + $builder = $this->db->table('t_driver_payroll') + ->where('t_driver_payroll.driver_id', $input_driver_id) + ->where('t_driver_payroll.PayOn', $month_year); + $query = $builder->get(); + $result = $query->getRowArray(); + if (!empty($result['id'])) { + return $result['id']; + }else{ + return 0; + } + } function getInvoiceInfo() { $builder = $this->db->table('ip_invoices') diff --git a/app/Models/Monthlypay_model.php b/app/Models/Monthlypay_model.php index 0cb0d3ae..50f42d6c 100755 --- a/app/Models/Monthlypay_model.php +++ b/app/Models/Monthlypay_model.php @@ -518,4 +518,88 @@ where Month_Year = ? and att.EmpID in (select EmpID from t_attendance)"; $query = $this->db->query($sql); return $query->getResult(); } + public function getheringleaveApplicationForm(){ + $sql = "select leavetable.* ,Dep.DepartmentName as department,Emp.Designation as designation, + CONCAT_WS(' ', Emp.FirstName, Emp.LastName) AS employeeFullName , + CONCAT_WS(' ', Emp2.FirstName, Emp2.LastName) AS creatorFullName + from t_employee_leave_application_form as leavetable + left join tbl_users as user on user.userId = leavetable.created_by + left join t_employee_details as Emp2 on Emp2.EmpID = user.EmpID + left join t_employee_details as Emp on Emp.EmpID = leavetable.emp_id + left join t_departmentdetails as Dep on Emp.Departmentcode = Dep.DEPCode + where leavetable.isactive = 1"; + $query = $this->db->query($sql); + return $query->getResultArray(); + } + public function getheringemployeeinformation(){ + $builder = $this->db->table("t_employee_details as Emp") + ->select("Emp.EmpID,Emp.Designation,Emp.Departmentcode,Dep.DEPCode,Emp.Designation,Emp.Departmentcode,Dep.DEPCode,Dep.DepartmentName as DepartmentNamee,Dep.DepartmentName as DepartmentName") + ->select("CONCAT_WS(' ', Emp.FirstName, Emp.LastName) AS FullName") + ->join("t_departmentdetails as Dep", "Emp.Departmentcode = Dep.DEPCode", "left") + ->orderBy("Emp.EmpID", "asc"); + + $query = $builder->get(); + + $result = $query->getResult(); + return $result; + } + public function saveleaveApplicationForm($data,$id){ + if ($id == 0) { + $builder = $this->db->table('t_employee_leave_application_form'); + $builder->insert($data); + return $this->db->affectedRows(); + } else if ($id != 0) { + $this->db->table('t_employee_leave_application_form') + ->where('leave_application_id', $id) + ->update($data); + return $this->db->affectedRows(); + } + } + + function getEmpPayDetailsforOTListing($current = "") + { + + //$month = '0'.$current; + + $month = $current; + if (strlen($month) == 6) { + $month = '0' . $month; + } + + + + $current = '01-' . $current; + //echo $current; + + $current = format_date($current);//3rd + + //echo 'Final'.$current; + $month_val = date('m', strtotime($current)); + $year_val = date('Y', strtotime($current)); + $date_val = cal_days_in_month(CAL_GREGORIAN, $month_val, $year_val); + //$monthyear_val = date('Y-m',strtotime($current)); + $lastdate = $year_val . '-' . $month_val . '-' . $date_val; + //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.*,t_employee_details.FirstName,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_employee_details.is_management_team + from t_emp_pay_data + left join t_employee_details on t_employee_details.EmpID = t_emp_pay_data.EmpID + 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 = ? + where t_employee_details.DateofJoining <= ? + and month(t_attendance.Month_Year) = month(?) and year(t_attendance.Month_Year) = year(?) + and t_attendance.Total_OTHrs != '0.00' + and t_employee_details.is_driver = 0 + order by t_employee_details.EmpID"; + + $query = $this->db->query($sql, array($month, $lastdate, $current, $current)); + // Get the last executed query + // $last_query = $this->db->getLastQuery(); + // echo $last_query; + // die; + return $query->getResult(); + } + + } \ No newline at end of file diff --git a/app/Views/driverAttendance.php b/app/Views/driverAttendance.php index 78b67715..4be0a29a 100755 --- a/app/Views/driverAttendance.php +++ b/app/Views/driverAttendance.php @@ -73,10 +73,14 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
- + + + + + Payslip Generated

@@ -161,7 +165,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y'); Diesel - + > @@ -175,7 +179,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y'); Shed Amount - + > diff --git a/app/Views/editEmployeenew.php b/app/Views/editEmployeenew.php index d99f6725..b67a6c30 100755 --- a/app/Views/editEmployeenew.php +++ b/app/Views/editEmployeenew.php @@ -1736,11 +1736,16 @@ if (!empty($EmpDetails)) { } $(document).ready(function () { + var driverChecked = ""; - if (driverChecked) { + if (driverChecked == "1") { $('#Total_salary').prop('required', false); $('#Total_salary').prop('readonly', true); - } + } + else{ + $('#Total_salary').prop('required', true); + $('#Total_salary').prop('readonly', false); + } if ($("#currentaddress").val().trim() === $("#permanentaddress").val().trim()) { $("#checksame").prop("disabled", false); // Enable checkbox $("#checksame").prop("checked", true); // Optionally check it diff --git a/app/Views/employeeLeaveApplicationForm.php b/app/Views/employeeLeaveApplicationForm.php new file mode 100755 index 00000000..5c6b6bd7 --- /dev/null +++ b/app/Views/employeeLeaveApplicationForm.php @@ -0,0 +1,491 @@ +
+ + +
+
+ +
+ + +
+
+
+
+ +
+ + Add Leave Application Form +
+
+
+ +
+
+
+ + + + + + +
+ +
+
+
+
+
+
+
+ + + + + + + + + + + + + format('d-m-Y'); + $crtime = $createdat->format('h:i A'); + ?> + + + + + + + + + + + +
Create DateCreate ByEmployee NameNumber Of DaysStatusAction
+ '> +     + + + + +     + + +
+
+

 

+
+
+
+
+
+
+ +
+
+
+ + + + + + + + + + + + + + diff --git a/app/Views/includes/new_header.php b/app/Views/includes/new_header.php index 43fb58e4..2b66ce48 100755 --- a/app/Views/includes/new_header.php +++ b/app/Views/includes/new_header.php @@ -779,21 +779,10 @@ PaySlip Generator Employee Loan Details - + OverTime Details
- - diff --git a/app/Views/monthlypayinputs.php b/app/Views/monthlypayinputs.php index b97620a9..ba839f79 100755 --- a/app/Views/monthlypayinputs.php +++ b/app/Views/monthlypayinputs.php @@ -577,8 +577,10 @@ - + + + @@ -703,9 +705,16 @@ - - - + + + + + + + + + + diff --git a/app/Views/overTimeDetails.php b/app/Views/overTimeDetails.php new file mode 100755 index 00000000..5374c0bb --- /dev/null +++ b/app/Views/overTimeDetails.php @@ -0,0 +1,397 @@ + + + + + + + + +
+ +
+

+
+

+
+
+ + +
+
+ +
+
+
+
+ + +
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ + +
+
+ +
+ + +
+ "Jan", "2" => "Feb", "3" => "Mar", "4" => "Apr", "5" => "May", "6" => "June", "7" => "July", "8" => "Aug", "9" => "Sep", "10" => "Oct", "11" => "Nov", "12" => "Dec"); + + $currentmontharray = array(array($month . "-" . $year => $monthsoptions[$month] . "-" . $year)); + // For find out Next and previous month and year from current year + $aftersix = array(); + for ($i = 0; $i < 3; $i++) { + + $month++; + if ($month > 12) { + $month = 1; + $year = $year + 1; + } + + $aftersix[] = array($month . "-" . $year => $monthsoptions[$month] . "-" . $year); + } + + $year = date("Y"); + $month = date("m"); + + $beforesix = array(); + for ($i = 3; $i > 0; $i--) { + + $month--; + if ($month < 1) { + $month = 12; + $year = $year - 1; + } + + $beforesix[] = array($month . "-" . $year => $monthsoptions[$month] . "-" . $year); + } + + $beforesix = array_reverse($beforesix); + + + $options = array_merge($options, $beforesix); + //echo count($options); + + $options = array_merge($options, $currentmontharray); + $options = array_merge($options, $aftersix); + + $ot = array(); + foreach ($options as $o) { + + foreach ($o as $key => $value) { + + $ot[$key] = $value; + } + } + ?> +
+
+
+
+ +
+
+ +
+
+
+
+ +
+ + + + + + + + + + + + + + + + $record) { + // print_r($record); + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
S.NoEmp ID Employee SalaryPer Day SalaryPer hr SalaryOver Time HrsOver Time Amount
EmpID; ?>FirstName; ?> + TotalSalary; + $totalsalary[] = $record->TotalSalary; ?> + + TotalSalary / $record->NoofDays; + echo number_format($perDaySalary, 2, '.', ''); + $totalperdaySalary[] = $perDaySalary; ?> + + + + OT_Hrs_Worked; + echo $OT; + $totalovertimehrs[] = $record->OT_Hrs_Worked; + ?> + + NoofDays; + // $HRA_Amount = $record->HRA_Amount; + // $Basic_Pay = $record->Basic_Pay; + // $OT_Hrs_Worked = $record->OT_Hrs_Worked; + // $dayBasic = $Basic_Pay / $NoofDays; + // $dayHra = $HRA_Amount / $NoofDays; + // $oneHoursSalary = ($dayBasic + $dayHra) / 8; + // $OTSalary = ($OT_Hrs_Worked != 0) ? $OT_Hrs_Worked * $oneHoursSalary : 0; + $OTSalary = $OT * $perHrSalary; + echo number_format($OTSalary, 2); + $totalovertimeamounts[] = $OTSalary; + + ?> +
Total + + + +
+
+

 

+ +
+
+
+
+
+
+
+
+
+
+ + + + + + \ No newline at end of file