diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 99c7a60e..be11d5aa 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'); @@ -203,6 +204,7 @@ $routes->match(['GET', 'POST'], 'overTimeDetails', 'Monthlypay::overTimeDetails' $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 e43435aa..ef53544e 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/Controllers/Monthlypay.php b/app/Controllers/Monthlypay.php index 1df9c581..cbc05ff5 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, 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; ?>
+ + diff --git a/app/Views/monthlypayinputs.php b/app/Views/monthlypayinputs.php index ba839f79..f3dca305 100755 --- a/app/Views/monthlypayinputs.php +++ b/app/Views/monthlypayinputs.php @@ -212,20 +212,18 @@ - -
- -
-
- -
-
- +
+ + - + + + + + + +
@@ -1398,6 +1396,14 @@ function showMessage(msg) { }, 3000); } +$("#searchInput").on("keyup", function () { + let value = $(this).val().toLowerCase(); // Convert input to lowercase for case-insensitive search + + $("#table-responsive tbody tr").filter(function () { + $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1); + }); +}); + diff --git a/app/Views/stock/CoatingMachineDetail.php b/app/Views/stock/CoatingMachineDetail.php index a7eac7d7..ae119fc1 100644 --- a/app/Views/stock/CoatingMachineDetail.php +++ b/app/Views/stock/CoatingMachineDetail.php @@ -327,16 +327,16 @@ -
- - +
-
+
+ + + Date Filter +
-
+
-
+ @@ -499,10 +503,133 @@
+ + + + + + + + + + + + + + + +