From f293a63fce28d7043a63b401b87e1e6bb5bc9dea Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Wed, 12 Jun 2024 03:14:50 +0000 Subject: [PATCH] FIX_payslip : ps --- app/Config/Routes.php | 36 +- app/Controllers/Emppaydate.php | 83 ++- app/Controllers/Login.php | 5 +- app/Controllers/Monthlypay.php | 107 ++-- app/Controllers/Payslip.php | 641 ++++++++++++------------ app/Helpers/datetime_helper.php | 72 ++- app/Models/Inwardgateregister_model.php | 1 + app/Models/Monthlypay_model.php | 9 +- app/Models/Payroll_model.php | 51 +- app/Models/Purchaseorder_model.php | 4 +- app/Views/Bonusreport.php | 2 +- app/Views/Bonusreportmonthwise.php | 6 +- app/Views/attendance.php | 18 +- app/Views/createPOfromRequistion.php | 7 +- app/Views/editPayslip.php | 13 +- app/Views/editcomplaint.php | 7 +- app/Views/emppayListing.php | 4 +- app/Views/includes/header.php | 10 + app/Views/leavereports.php | 142 ++++++ app/Views/leavereportsmonthwise.php | 134 +++++ app/Views/loanreports.php | 6 +- app/Views/monthlypayinputs.php | 41 +- app/Views/ncrlist.php | 4 +- app/Views/payslipgenerateprint.php | 5 +- app/Views/paysliplist.php | 8 +- app/Views/permissionlist.php | 11 +- app/Views/permissionpdf.php | 2 +- app/Views/viewIGRDetails.php | 55 +- app/Views/viewinwardgateregister.php | 72 +-- 29 files changed, 1032 insertions(+), 524 deletions(-) create mode 100644 app/Views/leavereports.php create mode 100644 app/Views/leavereportsmonthwise.php diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 4d982feb..d5e4c76f 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -129,6 +129,9 @@ $routes->get('batchcard/getHistListing', 'Batchcard::getHistListing'); //Complaint Routes $routes->get('purchaseorder/AddComplaint','Purchaseorder::AddComplaint'); $routes->post('purchaseorder/SaveComplaint','Purchaseorder::SaveComplaint'); +$routes->get('purchaseorder/EditComplaint', 'Purchaseorder::EditComplaint'); +$routes->post('purchaseorder/UpdateComplaint', 'Purchaseorder::UpdateComplaint'); +$routes->get('purchaseorder/Savencrlist', 'Purchaseorder::Savencrlist'); $routes->get('purchaseorder/Nonconfirmativelist','Purchaseorder::Nonconfirmativelist'); //Zohobooks sync @@ -141,10 +144,29 @@ $routes->match(['get', 'post', 'put', 'delete'],'attendance', 'Monthlypay::atten $routes->match(['get', 'post', 'put', 'delete'],'publicholidays', 'Monthlypay::loadPublicholidays'); $routes->match(['get', 'post', 'put', 'delete'],'permission', 'Monthlypay::permissionslip'); $routes->match(['get', 'post', 'put', 'delete'],'permissionlist', 'Monthlypay::permissionlist'); +$routes->match(['get', 'post'],'monthlypay/permissionpdf/(:any)', 'Monthlypay::permissionpdf/$1'); +$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('emppaydate/addemppaydate', 'Emppaydate::addemppaydate'); +$routes->post('emppaydate/addNewemppay', 'Emppaydate::addNewemppay'); +$routes->get('emppaydate/editOldemppay/(:num)', 'Emppaydate::editOldemppay/$1'); +$routes->post('emppaydate/editemppay', 'Emppaydate::editemppay'); +$routes->post('emppaydate/deleteEmpPay', 'Emppaydate::deleteEmpPay'); + $routes->match(['get', 'post', 'put', 'delete'],'emppayListings', 'Emppaydate::emppayListing'); $routes->match(['get', 'post', 'put', 'delete'],'emppayListings/(:num)', 'Emppaydate::emppayListing/$1'); -$routes->match(['get', 'post', 'put', 'delete'],'loanreports', 'Payslip::loadLoanReport'); -$routes->match(['get', 'post', 'put', 'delete'],'bonusreports', 'Payslip::Bonusreport'); +$routes->match(['get', 'post'],'loanreports/(:any)/(:any)', 'Payslip::loadLoanReport/$1/$2'); +$routes->match(['get', 'post'],'loanreports/(:any)', 'Payslip::loadLoanReport/$1'); +$routes->match(['get', 'post'],'loanreports', 'Payslip::loadLoanReport'); +$routes->post('payslip/Bonusreport', 'Payslip::Bonusreport'); +$routes->get('payslip/MonthwiseBonusreport', 'Payslip::monthwiseBonusReport'); +// $routes->get('leavereports/(:any)/(:any)', 'Payslip::leaveReport/$1/$2'); +$routes->match(['get', 'post'],'leavereports', 'Payslip::leaveReport'); +$routes->match(['get', 'post'],'leavemonthlyreports/(:any)/(:any)', 'Payslip::monthwiseLeaveReport/$1/$2'); + $routes->match(['get', 'post', 'put', 'delete'],'monthlypay', 'Payslip::monthlyInputs'); $routes->match(['get', 'post', 'put', 'delete'],'ExcelUpload2', 'Payslip::viewUpload2'); $routes->match(['get', 'post', 'put', 'delete'],'FileUpload', 'Payslip::uploadExcel'); @@ -154,7 +176,14 @@ $routes->match(['get', 'post', 'put', 'delete'],'ViewPay', 'Payslip::viewGenerat $routes->match(['get', 'post', 'put', 'delete'],'updatepayroll', 'Payslip::updatepayroll'); $routes->match(['get', 'post', 'put', 'delete'],'BankReport', 'Payslip::loadBankreportScreen'); $routes->match(['get', 'post', 'put', 'delete'],'PaysilpListing', 'Payslip::payslipLisiting'); - +$routes->post('payslip/reload_paysliplist','Payslip::reload_paysliplist'); +$routes->post('payslip/changeMonth','Payslip::changeMonth'); +$routes->post('payslip/saveMonthlyData','Payslip::saveMonthlyData'); +$routes->post('payslip/getEmployee','Payslip::getEmployee'); +$routes->post('payslip/checkExistPay','Payslip::checkExistPay'); +$routes->post('payslip/callsp','Payslip::callsp'); +$routes->get('payslip/editPayslip/(:any)','Payslip::editPayslip/$1'); +$routes->post('payslip/updatePayslip','Payslip::updatePayslip'); // Application Requisition Flow Routes $routes->match(['get', 'post', 'put', 'delete'],'Requisition', 'Requisitionform::requisitionlisting'); $routes->match(['get', 'post', 'put', 'delete'],'RequisitionForm', 'Requisitionform::requisition'); @@ -315,6 +344,7 @@ $routes->match(['get', 'post', 'put', 'delete'],'Report_Material_inward_Register $routes->match(['get', 'post', 'put', 'delete'],'DeliveryPerformance', 'User::deliver_perform'); $routes->match(['get', 'post', 'put', 'delete'],'Empperform', 'Report::per'); +$routes->get('quality', 'Quality::index'); $routes->get('qualityreportlist', 'Quality::reportList'); $routes->get('qualityreportlistinward', 'Quality::reportListInward'); $routes->get('shortagematerialListing', 'Rawmaterialdetails::shortagematerialListing'); diff --git a/app/Controllers/Emppaydate.php b/app/Controllers/Emppaydate.php index 558700d4..f07b98f9 100644 --- a/app/Controllers/Emppaydate.php +++ b/app/Controllers/Emppaydate.php @@ -90,24 +90,24 @@ class Emppaydate extends BaseController helper('form'); //$this->load->library('form_validation'); $EmpID = $this->request->getPost('EmpID'); - $this->validator->setRules([ - 'ContactNumber'=> 'trim|required|min_length[10]|max_length[10]', - 'EmpID'=> 'trim|required', - 'HRA_Rate'=> 'trim|required', - 'HRA_Amount'=> 'trim|required', - 'Basic_Pay'=> 'trim|required', - 'Total_salary'=> 'trim|required', - 'Allowances'=> 'trim|required', - 'PF_Rate'=> 'trim|required', - 'ESI_Rate'=> 'trim|required', - 'Food_Allowances'=> 'trim|required', - 'Incentives'=> 'trim|required']); + // $this->validator->setRules([ + // 'ContactNumber'=> 'trim|required|min_length[10]|max_length[10]', + // 'EmpID'=> 'trim|required', + // 'HRA_Rate'=> 'trim|required', + // 'HRA_Amount'=> 'trim|required', + // 'Basic_Pay'=> 'trim|required', + // 'Total_salary'=> 'trim|required', + // 'Allowances'=> 'trim|required', + // 'PF_Rate'=> 'trim|required', + // 'ESI_Rate'=> 'trim|required', + // 'Food_Allowances'=> 'trim|required', + // 'Incentives'=> 'trim|required']); - if ($this->validator->run() == FALSE || $EmpID == -1) { - $this->addemppaydate(); - } else { + // if ($this->validator->run() == FALSE || $EmpID == -1) { + // $this->addemppaydate(); + // } else { $EmpID = $this->request->getPost('EmpID'); $Total_Salary = $this->request->getPost('Total_salary'); @@ -162,16 +162,16 @@ class Emppaydate extends BaseController } } if ($result > 0) { - - echo ""; - redirect('emppaydate/emppayListing', 'refresh'); + echo ""; } else { - echo ""; - redirect('emppaydate/emppayListing', 'refresh'); + echo ""; + } //} - } + // } } /** @@ -202,21 +202,21 @@ class Emppaydate extends BaseController $Pay_Data_ID = $this->request->getPost('Pay_Data_ID'); //'Pay_Data_ID'=>'trim|required'; - $this->validator->setRules([ - 'EmpID'=> 'trim|required', - 'Total_Salary'=> 'trim|required', - 'Basic_Pay'=> 'trim|required', - 'HRA_Rate'=> 'trim|required', - 'Allowances'=> 'trim|required', - 'PF_Rate'=> 'trim|required', - 'ESI_Rate'=> 'trim|required', - 'Food_Allowances'=> 'trim|required', - 'Incentives'=> 'trim|required']); + // $this->validator->setRules([ + // 'EmpID'=> 'trim|required', + // 'Total_Salary'=> 'trim|required', + // 'Basic_Pay'=> 'trim|required', + // 'HRA_Rate'=> 'trim|required', + // 'Allowances'=> 'trim|required', + // 'PF_Rate'=> 'trim|required', + // 'ESI_Rate'=> 'trim|required', + // 'Food_Allowances'=> 'trim|required', + // 'Incentives'=> 'trim|required']); - if ($this->validator->run() == FALSE) { + // if ($this->validator->run() == FALSE) { - $this->editOldemppay($Pay_Data_ID); - } else { + // $this->editOldemppay($Pay_Data_ID); + // } else { $Pay_Data_ID = $this->request->getPost('Pay_Data_ID'); $EmpID = $this->request->getPost('EmpID'); @@ -285,18 +285,17 @@ class Emppaydate extends BaseController $result = $this->emppaydate_model->editemppay($emppay); - - if ($result == true) { - echo ""; + echo ""; } else { - echo ""; - $this->session->set_flashdata('error', 'updation failed'); + echo ""; + } - - redirect('emppaydate/emppayListing'); - } + // redirect('emppaydate/emppayListing'); + // } } diff --git a/app/Controllers/Login.php b/app/Controllers/Login.php index 110dbdf6..5795aeb3 100644 --- a/app/Controllers/Login.php +++ b/app/Controllers/Login.php @@ -36,7 +36,8 @@ class Login extends BaseController if (!isset($isLoggedIn) || $isLoggedIn != TRUE) { return view('login'); } else { - redirect('/dashboard'); + // redirect('/dashboard'); + return redirect()->to('/dashboard'); } } @@ -52,7 +53,7 @@ class Login extends BaseController return view('login'); } else { // return view('login'); - redirect('/dashboard'); + return redirect()->to('/dashboard'); } } diff --git a/app/Controllers/Monthlypay.php b/app/Controllers/Monthlypay.php index e81227de..74deebd1 100644 --- a/app/Controllers/Monthlypay.php +++ b/app/Controllers/Monthlypay.php @@ -6,7 +6,7 @@ use App\Controllers\BaseController; use CodeIgniter\Validation\Exceptions\ValidationException; -// require APPPATH . '/third_party/mpdf/mpdf.php'; +use Mpdf\Mpdf; use App\Models\Monthlypay_model; @@ -72,7 +72,7 @@ class Monthlypay extends BaseController function savePublicHolidays() { $jsondata = $this->request->getPost('param1'); - $phpdata = json_decode($jsondata); + $phpdata = json_decode((string)$jsondata); $total = 0; foreach ($phpdata as $d) { @@ -110,13 +110,14 @@ class Monthlypay extends BaseController if ($this->request->getPost('month')) { $current = $this->request->getPost('month'); - $month = substr($current, 0, 3); - $year = substr($current, 4); - $month = date_parse($month); - $current = $year . "-" . $month['month'] . '-01'; - $monthdays = cal_days_in_month(CAL_GREGORIAN, $month['month'], $year); - $begin = new DateTime($year . '-' . $month['month'] . '-01'); - $end = new DateTime($year . '-' . $month['month'] . '-' . $monthdays); + $month_short_name = substr((string)$current, 0, 3); + $year = substr((string)$current, 4); + $month_arr = date_parse($month_short_name); + $month = $month_arr['month']; + $current = $year . "-" . $month . '-01'; + $monthdays = cal_days_in_month(CAL_GREGORIAN, $month_arr['month'], $year); + $begin = new \DateTime($year . '-' . $month . '-01'); + $end = new \DateTime($year . '-' . $month . '-' . $monthdays); } if (empty($current)) { // echo "fresh"; @@ -125,8 +126,8 @@ class Monthlypay extends BaseController $month = date("m"); $current = $current . "-01"; $monthdays = cal_days_in_month(CAL_GREGORIAN, $month, $year); - $begin = new DateTime($year . '-' . $month . '-01'); - $end = new DateTime($year . '-' . $month . '-' . $monthdays); + $begin = new \DateTime($year . '-' . $month . '-01'); + $end = new \DateTime($year . '-' . $month . '-' . $monthdays); } @@ -158,7 +159,7 @@ class Monthlypay extends BaseController $total = 0; $jsondata = $this->request->getPost('param1'); - $phpdata = json_decode($jsondata, true); + $phpdata = json_decode((string)$jsondata, true); $date = $this->request->getPost('param2'); $NoofDays = $this->request->getPost('param3'); $Month_Year = format_date($date); @@ -485,11 +486,11 @@ class Monthlypay extends BaseController // print_r($result);die; if (!empty($result)) { echo ""; } else { echo ""; //redirect('permission'); @@ -508,38 +509,82 @@ class Monthlypay extends BaseController } //this function used to pdf value display // - function permissionpdf($SNO) - { + // function permissionpdf($SNO) + // { + // $data['per'] = $this->monthlypay_model->pdf($SNO); + + // $id = ''; + // $name = ''; + // $permissionpdf = ''; + // $date = ''; + // foreach ($data['per'] as $record) { + + // $id = $record->EmpID; + // $name = $record->FirstName; + // $date = format_date($record->Date, 0, 'd-m-Y'); + // } + // $permissionpdf = $id . '-' . $name . '-' . $date; + + + // view($this->config->item('admin_folder') . '/permissionpdf', $data); + + // $mpdf = new mPDF('utf-8', 'A4-P', 10, 10, 10, 10, 10, 38, 4, 6); + // $mpdf->SetDisplayMode('fullpage'); + // $mpdf->SetHTMLHeader($HtmlHeading); + // $mpdf->SetTitle('Permission'); + // $html = view('permissionpdf', $data, true); + // $mpdf->SetDisplayMode('fullpage'); + // //$mpdf->setFooter($HTMLFooter . "Page {PAGENO} of {nb}"); + // //$mpdf->list_indent_first_level = 1; + // $mpdf->setAutoTopMargin = 'stretch'; + // $mpdf->setAutoBottomMargin = 'stretch'; + // $mpdf->WriteHTML($html); + // $mpdf->Output('Permissionslip' . $permissionpdf . '.pdf', 'I', $php); + // } + public function permissionpdf($SNO) + { $data['per'] = $this->monthlypay_model->pdf($SNO); $id = ''; $name = ''; $permissionpdf = ''; $date = ''; - foreach ($data['per'] as $record) { + foreach ($data['per'] as $record) { $id = $record->EmpID; $name = $record->FirstName; - $date = format_date($record->date, 0, 'd-m-Y'); + $date = date('d-m-Y', strtotime($record->Date)); } $permissionpdf = $id . '-' . $name . '-' . $date; + // Generate the view into a variable + $html = view('permissionpdf', $data); - view($this->config->item('admin_folder') . '/permissionpdf', $data); + // Create an instance of mPDF + $mpdf = new Mpdf([ + 'mode' => 'utf-8', + 'format' => 'A4-P', + 'margin_left' => 10, + 'margin_right' => 10, + 'margin_top' => 10, + 'margin_bottom' => 10, + 'margin_header' => 10, + 'margin_footer' => 6, + ]); - $mpdf = new mPDF('utf-8', 'A4-P', 10, 10, 10, 10, 10, 38, 4, 6); + // Set additional configurations $mpdf->SetDisplayMode('fullpage'); - $mpdf->SetHTMLHeader($HtmlHeading); $mpdf->SetTitle('Permission'); - $html = view('permissionpdf', $data, true); - $mpdf->SetDisplayMode('fullpage'); - //$mpdf->setFooter($HTMLFooter . "Page {PAGENO} of {nb}"); - //$mpdf->list_indent_first_level = 1; - $mpdf->setAutoTopMargin = 'stretch'; - $mpdf->setAutoBottomMargin = 'stretch'; + + // If you have a custom HTML header, set it here + // $mpdf->SetHTMLHeader($HtmlHeading); + + // Write the HTML to the PDF $mpdf->WriteHTML($html); - $mpdf->Output('Permissionslip' . $permissionpdf . '.pdf', 'I', $php); + + // Output the PDF to the browser + $mpdf->Output('Permissionslip' . $permissionpdf . '.pdf', 'D'); } //this function used to Production salary Details @@ -664,12 +709,12 @@ class Monthlypay extends BaseController $date = $this->request->getPost("id"); // echo $date; - $daydate = date('Y-m', strtotime($date)); + $daydate = date('Y-m', strtotime((string)$date)); //echo $date; die; $daydate = $daydate . '-01'; //$dat = date('d'); // echo $daydate; echo ""; - $WH = 'WH' . date('j', strtotime($date)); + $WH = 'WH' . date('j', strtotime((string)$date)); // echo $WH; $yesterday = $this->monthlypay_model->attyesterday($WH, $daydate); @@ -697,7 +742,7 @@ class Monthlypay extends BaseController //print_r($absentName);die; $data['today'] = $values; - $OT = 'OT' . date('j', strtotime($date)); + $OT = 'OT' . date('j', strtotime((string)$date)); $CUR_month = date('t'); diff --git a/app/Controllers/Payslip.php b/app/Controllers/Payslip.php index bdc9b65c..1d4de44d 100644 --- a/app/Controllers/Payslip.php +++ b/app/Controllers/Payslip.php @@ -10,6 +10,15 @@ use CodeIgniter\Validation\Exceptions\ValidationException; use App\Models\Monthlypay_model; use App\Models\Payroll_model; +use Mpdf\Mpdf; + +use PhpOffice\PhpSpreadsheet\Spreadsheet; + +use PhpOffice\PhpSpreadsheet\Writer\Xlsx; + +use PhpOffice\PhpSpreadsheet\Style\Alignment; +use PhpOffice\PhpSpreadsheet\IOFactory; + /** @@ -79,8 +88,8 @@ class Payslip extends BaseController $createdby = $this->session->get('userId'); $monthsoptions = array("01" => "Jan", "02" => "Feb", "03" => "Mar", "04" => "Apr", "05" => "May", "06" => "June", "07" => "July", "08" => "Aug", "09" => "Sep", "10" => "Oct", "11" => "Nov", "12" => "Dec"); - $m = substr($payon, 0, 2); - $y = substr($payon, 3); + $m = substr((string)$payon, 0, 2); + $y = substr((string)$payon, 3); $month = $monthsoptions[$m] . "-" . $y; $excel = $this->request->getPost('excel'); $HTML = ''; @@ -120,7 +129,7 @@ class Payslip extends BaseController $data['Totalamtwords'] = $totamtwords; $data['PayMonth'] = $month; $filename = 'Bank Report for' . $payon . 'pdf'; - $HTML = view("bankreportprint", $data, true); + $HTML = view("bankreportprint", $data); } if ($this->request->getPost('PF_Report')) { $data['PFESI'] = $this->payroll_model->getReportforPFESI($payon); @@ -145,98 +154,91 @@ class Payslip extends BaseController $data['Totalamtwords'] = $totamtwords; if (empty($excel)) { $filename = 'PF Report for' . $payon . 'pdf'; - $HTML = view("pfreportprint", $data, true); + $HTML = view("pfreportprint", $data); // echo "PDF PART 1"; } else { + // Create a new Spreadsheet object + $spreadsheet = new Spreadsheet(); + $sheet = $spreadsheet->getActiveSheet(); + $sheet->setTitle('Employee PF Report ' . $data['PayMonth']); - // $this->load->library('excel'); - // $this->global['pageTitle'] = $this->CompanyName.' : PF Excel Report'; - // $this->loadViews('pfexcel',$this->global,$data,NULL); - $this->excel->setActiveSheetIndex(0); - $this->excel->getActiveSheet()->setTitle('Employee PF Report ' . $data['PayMonth']); - $this->excel->getActiveSheet()->setCellValue('A1', 'Employee PF Report ' . $data['PayMonth']); + // Set headers + $sheet->setCellValue('A1', 'Employee PF Report ' . $data['PayMonth']); + $sheet->mergeCells('A1:H1'); + $sheet->getStyle('A1')->getAlignment()->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER); + $sheet->getStyle('A1')->getFont()->setBold(true)->setSize(16); + $sheet->getStyle('A1')->getFill()->getStartColor()->setARGB('#333'); + + // Set column headers + $sheet->setCellValue('A4', 'S.No.'); + $sheet->setCellValue('B4', 'Employee Name'); + $sheet->setCellValue('C4', 'PF Account No'); + $sheet->setCellValue('D4', 'Employee Contribution'); + $sheet->setCellValue('E4', 'Employer Contribution'); + $sheet->setCellValue('F4', 'No Of Days Worked'); + $sheet->setCellValue('G4', 'OT Hrs Worked'); + $sheet->setCellValue('H4', 'Total Amount'); + + // Style column headers + for ($col = ord('A'); $col <= ord('H'); $col++) { + $sheet->getColumnDimension(chr($col))->setAutoSize(true); + $sheet->getStyle(chr($col))->getFont()->setSize(12); + $sheet->getStyle(chr($col))->getAlignment()->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER); + } + - $this->excel->getActiveSheet()->setCellValue('A4', 'S.No.'); - $this->excel->getActiveSheet()->setCellValue('B4', 'Employee Name'); - $this->excel->getActiveSheet()->setCellValue('C4', 'PF Account No'); - $this->excel->getActiveSheet()->setCellValue('D4', 'Employee Contribution'); + // Populate data + $i = 6; + $j = 1; + $overall = 0; + $overallemp = 0; + $overallemr = 0; + + foreach ($data['PFESI'] as $row) { + $sheet->setCellValue('A' . $i, $j); + $sheet->setCellValue('B' . $i, $row->FName . ' ' . $row->Lname); + $sheet->setCellValue('C' . $i, $row->PFNO); + $sheet->setCellValue('D' . $i, number_format($row->PF, 2, '.', '')); + $sheet->setCellValue('E' . $i, number_format($row->CompanyPF, 2, '.', '')); + $sheet->setCellValue('F' . $i, number_format($row->NoofDaysWorked, 2, '.', '')); + $sheet->setCellValue('G' . $i, number_format($row->OTperHours, 2, '.', '')); + + $total = $row->PF + $row->CompanyPF; + $overall += $total; + $overallemp += $row->PF; + $overallemr += $row->CompanyPF; + $sheet->setCellValue('H' . $i, $total); + + $i++; + $j++; + } + + // Total + $sheet->setCellValue('C' . $i, 'Total'); + $sheet->setCellValue('D' . $i, $overallemp); + $sheet->setCellValue('E' . $i, $overallemr); + $sheet->setCellValue('H' . $i, $overall); + + // Protect the sheet + $sheet->getProtection()->setSheet(true); + $sheet->getProtection()->setSort(true); + $sheet->getProtection()->setInsertRows(true); + $sheet->getProtection()->setFormatCells(true); + + // Set the headers for file download + // $filename = 'EmployeePFReport_' . date('Ymd_His') . '.xls'; + $filename = 'EmployeePFReport' . $payon . 'xls'; - $this->excel->getActiveSheet()->setCellValue('E4', 'Employeer Contribution'); - $this->excel->getActiveSheet()->setCellValue('F4', 'No Of Days Worked'); - $this->excel->getActiveSheet()->setCellValue('G4', 'OT Hrs Worked'); - $this->excel->getActiveSheet()->setCellValue('H4', 'Total Amount'); - $this->excel->getActiveSheet()->mergeCells('A1:F1'); - $this->excel->getActiveSheet()->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); - $this->excel->getActiveSheet()->getStyle('A1')->getFont()->setBold(true); - $this->excel->getActiveSheet()->getStyle('A1')->getFont()->setSize(16); - $this->excel->getActiveSheet()->getStyle('A1')->getFill()->getStartColor()->setARGB('#333'); + header('Content-Type: application/vnd.ms-excel'); + header('Content-Disposition: attachment;filename="' . $filename . '"'); + header('Cache-Control: max-age=0'); + + // Write the file + $writer = new Xlsx($spreadsheet); + $writer->save('php://output'); + - for ($col = ord('A'); $col <= ord('H'); $col++) { - - $this->excel->getActiveSheet()->getColumnDimension(chr($col))->setAutoSize(true); - $this->excel->getActiveSheet()->getStyle(chr($col))->getFont()->setSize(12); - $this->excel->getActiveSheet()->getStyle(chr($col))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); - } - // print_r($data['PFESI']);die(); - $i = 6; - $j = 1; - $total = 0; - $overall = 0; - $totemp = 0; - $overallemp = 0; - $totemr = 0; - $overallemr = 0; - foreach ($data['PFESI'] as $row) { - - $this->excel->getActiveSheet()->setCellValue('A' . (string)($i), $j); - $this->excel->getActiveSheet()->setCellValue('B' . (string)($i), $row->FName . $row->Lname); - $this->excel->getActiveSheet()->setCellValue('C' . (string)($i), $row->PFNO); - $this->excel->getActiveSheet()->setCellValue('D' . (string)($i), number_format($row->PF, 2, '.', '')); - $this->excel->getActiveSheet()->getStyle('D' . (string)($i))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT); - $this->excel->getActiveSheet()->getStyle('D' . (string)($i))->getNumberFormat()->setFormatCode('0.00'); - $this->excel->getActiveSheet()->setCellValue('E' . (string)($i), number_format($row->CompanyPF, 2, '.', '')); - $this->excel->getActiveSheet()->getStyle('E' . (string)($i))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT); - $this->excel->getActiveSheet()->getStyle('E' . (string)($i))->getNumberFormat()->setFormatCode('0.00'); - $this->excel->getActiveSheet()->setCellValue('C' . (string)($i + 1), 'Total'); - $this->excel->getActiveSheet()->setCellValue('F' . (string)($i), number_format($row->NoofDaysWorked, 2, '.', '')); - $this->excel->getActiveSheet()->getStyle('F' . (string)($i))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT); - - - $this->excel->getActiveSheet()->setCellValue('G' . (string)($i), number_format($row->OTperHours, 2, '.', '')); - $this->excel->getActiveSheet()->getStyle('G' . (string)($i))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT); - - - $total = $row->PF + $row->CompanyPF; - $totemp = $row->PF; - $totemr = $row->CompanyPF; - $overall = $overall + $total; - $overallemp = $overallemp + $totemp; - $overallemr = $overallemr + $totemr; - $this->excel->getActiveSheet()->setCellValue('H' . (string)($i), ($total)); - //$this->excel->getActiveSheet()->setCellValue('D' . (string)($i),($totemp)); - //$this->excel->getActiveSheet()->setCellValue('E' . (string)($i),($totemr)); - $this->excel->getActiveSheet()->getStyle('H' . (string)($i))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT); - $this->excel->getActiveSheet()->getStyle('H' . (string)($i))->getNumberFormat()->setFormatCode('0.00'); - $this->excel->getActiveSheet()->setCellValue('H' . (string)($i + 1), ($overall)); - $this->excel->getActiveSheet()->setCellValue('D' . (string)($i + 1), ($overallemp)); - $this->excel->getActiveSheet()->setCellValue('E' . (string)($i + 1), ($overallemr)); - $this->excel->getActiveSheet()->getStyle('H' . (string)($i + 1))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT); - $this->excel->getActiveSheet()->getStyle('H' . (string)($i + 1))->getNumberFormat()->setFormatCode('0.00'); - //$this->excel->getActiveSheet()->setCellValue('A6','HI'); - $i++; - $j++; - } - $this->excel->getActiveSheet()->getProtection()->setSheet(true); - $this->excel->getActiveSheet()->getProtection()->setSort(true); - $this->excel->getActiveSheet()->getProtection()->setInsertRows(true); - $this->excel->getActiveSheet()->getProtection()->setFormatCells(true); - - $filename = 'EmployeePFReport' . $payon . 'xls'; - header('Content-Type: application/vnd.ms-excel'); - header('Content-Disposition: attachment;filename="' . $filename . '"'); - header('Cache-Control: max-age=0'); - $objWriter = PHPExcel_IOFactory::createWriter($this->excel, 'Excel5'); - $objWriter->save('php://output'); + } } @@ -266,149 +268,140 @@ class Payslip extends BaseController if (empty($excel)) { $filename = 'ESI Report for' . $payon . 'pdf'; - $HTML = view("esireportprint", $data, true); + $HTML = view("esireportprint", $data); // echo "PDF PART 1"; } else { + // Create a new Spreadsheet object + $spreadsheet = new Spreadsheet(); + $sheet = $spreadsheet->getActiveSheet(); + $sheet->setTitle('Employee PF Report ' . $data['PayMonth']); - // $this->load->library('excel'); + // Set headers + $sheet->setCellValue('A1', 'Employee PF Report ' . $data['PayMonth']); + $sheet->mergeCells('A1:H1'); + $sheet->getStyle('A1')->getAlignment()->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER); + $sheet->getStyle('A1')->getFont()->setBold(true)->setSize(16); + $sheet->getStyle('A1')->getFill()->getStartColor()->setARGB('#333'); - $this->excel->setActiveSheetIndex(0); - $this->excel->getActiveSheet()->setTitle('Employee ESI Report ' . $data['PayMonth']); - $this->excel->getActiveSheet()->setCellValue('A1', 'Employee ESI Report ' . $data['PayMonth']); + // Set column headers + $sheet->setCellValue('A4', 'S.No.'); + $sheet->setCellValue('B4', 'Employee Name'); + $sheet->setCellValue('C4', 'PF Account No'); + $sheet->setCellValue('D4', 'Employee Contribution'); + $sheet->setCellValue('E4', 'Employer Contribution'); + $sheet->setCellValue('F4', 'No Of Days Worked'); + $sheet->setCellValue('G4', 'OT Hrs Worked'); + $sheet->setCellValue('H4', 'Total Amount'); - $this->excel->getActiveSheet()->setCellValue('A4', 'S.No.'); - $this->excel->getActiveSheet()->setCellValue('B4', 'Employee Name'); - $this->excel->getActiveSheet()->setCellValue('C4', 'ESI Account No'); - $this->excel->getActiveSheet()->setCellValue('D4', 'Employee Contribution'); - - $this->excel->getActiveSheet()->setCellValue('E4', 'Employeer Contribution'); - $this->excel->getActiveSheet()->setCellValue('F4', 'No Of Days Worked'); - $this->excel->getActiveSheet()->setCellValue('G4', 'OT Hrs Worked'); - - $this->excel->getActiveSheet()->setCellValue('H4', 'Total Amount'); - $this->excel->getActiveSheet()->mergeCells('A1:F1'); - $this->excel->getActiveSheet()->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); - $this->excel->getActiveSheet()->getStyle('A1')->getFont()->setBold(true); - $this->excel->getActiveSheet()->getStyle('A1')->getFont()->setSize(16); - $this->excel->getActiveSheet()->getStyle('A1')->getFill()->getStartColor()->setARGB('#333'); - - for ($col = ord('A'); $col <= ord('H'); $col++) { - - $this->excel->getActiveSheet()->getColumnDimension(chr($col))->setAutoSize(true); - $this->excel->getActiveSheet()->getStyle(chr($col))->getFont()->setSize(12); - $this->excel->getActiveSheet()->getStyle(chr($col))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); - } - // print_r($data['PFESI']);die(); - $i = 6; - $j = 1; - $total = 0; - $overall = 0; - $totemp = 0; - $overallemp = 0; - $totemr = 0; - $overallemr = 0; - foreach ($data['PFESI'] as $row) { - - $this->excel->getActiveSheet()->setCellValue('A' . (string)($i), $j); - $this->excel->getActiveSheet()->setCellValue('B' . (string)($i), $row->FName . $row->Lname); - $this->excel->getActiveSheet()->setCellValue('C' . (string)($i), $row->ESI); - $this->excel->getActiveSheet()->setCellValue('D' . (string)($i), number_format($row->EmployeeESI, 2, '.', '')); - $this->excel->getActiveSheet()->getStyle('D' . (string)($i))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT); - $this->excel->getActiveSheet()->getStyle('D' . (string)($i))->getNumberFormat()->setFormatCode('0.00'); - $this->excel->getActiveSheet()->setCellValue('E' . (string)($i), number_format($row->CompanyESI, 2, '.', '')); - $this->excel->getActiveSheet()->getStyle('E' . (string)($i))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT); - $this->excel->getActiveSheet()->getStyle('E' . (string)($i))->getNumberFormat()->setFormatCode('0.00'); - $this->excel->getActiveSheet()->setCellValue('C' . (string)($i + 1), 'Total'); - $this->excel->getActiveSheet()->setCellValue('F' . (string)($i), number_format($row->NoofDaysWorked, 2, '.', '')); - $this->excel->getActiveSheet()->getStyle('F' . (string)($i))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT); + // Style column headers + for ($col = ord('A'); $col <= ord('H'); $col++) { + $sheet->getColumnDimension(chr($col))->setAutoSize(true); + $sheet->getStyle(chr($col))->getFont()->setSize(12); + $sheet->getStyle(chr($col))->getAlignment()->setHorizontal(\PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER); + } - $this->excel->getActiveSheet()->setCellValue('G' . (string)($i), number_format($row->OTperHours, 2, '.', '')); - $this->excel->getActiveSheet()->getStyle('G' . (string)($i))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT); - $total = $row->EmployeeESI + $row->CompanyESI; - $overall = $overall + $total; - $totemp = $row->EmployeeESI; - $totemr = $row->CompanyESI; - $overallemp = $overallemp + $totemp; - $overallemr = $overallemr + $totemr; - $this->excel->getActiveSheet()->setCellValue('H' . (string)($i), ($total)); - $this->excel->getActiveSheet()->getStyle('H' . (string)($i))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT); - $this->excel->getActiveSheet()->getStyle('H' . (string)($i))->getNumberFormat()->setFormatCode('0.00'); - $this->excel->getActiveSheet()->setCellValue('D' . (string)($i + 1), ($overallemp)); - $this->excel->getActiveSheet()->setCellValue('E' . (string)($i + 1), ($overallemr)); - $this->excel->getActiveSheet()->setCellValue('H' . (string)($i + 1), ($overall)); - $this->excel->getActiveSheet()->getStyle('H' . (string)($i + 1))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT); - $this->excel->getActiveSheet()->getStyle('H' . (string)($i + 1))->getNumberFormat()->setFormatCode('0.00'); - //$this->excel->getActiveSheet()->setCellValue('A6','HI'); - $i++; - $j++; - } - $this->excel->getActiveSheet()->getProtection()->setSheet(true); - $this->excel->getActiveSheet()->getProtection()->setSort(true); - $this->excel->getActiveSheet()->getProtection()->setInsertRows(true); - $this->excel->getActiveSheet()->getProtection()->setFormatCells(true); - $filename = 'EmployeeESIReport' . $payon . 'xls'; - header('Content-Type: application/vnd.ms-excel'); - header('Content-Disposition: attachment;filename="' . $filename . '"'); - header('Cache-Control: max-age=0'); - $objWriter = PHPExcel_IOFactory::createWriter($this->excel, 'Excel5'); - $objWriter->save('php://output'); + // Populate data + $i = 6; + $j = 1; + $overall = 0; + $overallemp = 0; + $overallemr = 0; + + foreach ($data['PFESI'] as $row) { + $sheet->setCellValue('A' . $i, $j); + $sheet->setCellValue('B' . $i, $row->FName . ' ' . $row->Lname); + $sheet->setCellValue('C' . $i, $row->PFNO); + $sheet->setCellValue('D' . $i, number_format($row->PF, 2, '.', '')); + $sheet->setCellValue('E' . $i, number_format($row->CompanyPF, 2, '.', '')); + $sheet->setCellValue('F' . $i, number_format($row->NoofDaysWorked, 2, '.', '')); + $sheet->setCellValue('G' . $i, number_format($row->OTperHours, 2, '.', '')); + + $total = $row->PF + $row->CompanyPF; + $overall += $total; + $overallemp += $row->PF; + $overallemr += $row->CompanyPF; + $sheet->setCellValue('H' . $i, $total); + + $i++; + $j++; + } + + // Total + $sheet->setCellValue('C' . $i, 'Total'); + $sheet->setCellValue('D' . $i, $overallemp); + $sheet->setCellValue('E' . $i, $overallemr); + $sheet->setCellValue('H' . $i, $overall); + + // Protect the sheet + $sheet->getProtection()->setSheet(true); + $sheet->getProtection()->setSort(true); + $sheet->getProtection()->setInsertRows(true); + $sheet->getProtection()->setFormatCells(true); + + // Set the headers for file download + // $filename = 'EmployeePFReport_' . date('Ymd_His') . '.xls'; + $filename = 'EmployeePFReport' . $payon . 'xls'; + + header('Content-Type: application/vnd.ms-excel'); + header('Content-Disposition: attachment;filename="' . $filename . '"'); + header('Cache-Control: max-age=0'); + + // Write the file + $writer = new Xlsx($spreadsheet); + $writer->save('php://output'); + + } } if (empty($excel)) { - // $php = $this->output->get_output(); - - // Load library - // $this->load->library('dompdf_gen'); - - // require_once(APPPATH .'third_party/dompdf/dompdf_config.inc.php'); - // $dompdf = new DOMPDF(); - // $dompdf->set_paper('A4', 'portrait'); - // $dompdf->load_html($php); - - // $dompdf->render(); - - // // add the header - // $canvas = $dompdf->get_canvas(); - // $font = Font_Metrics::get_font("helvetica", "bold"); - - // // the same call as in my previous example - // $canvas->page_text(72, 18,"", - // $font, 6, array(0,0,0)); - - // $dompdf->stream($filename); - //echo "PDF PART 2"; - - $mpdf = new mPDF('utf-8', 'A4-P', 10, 12, 12, 10, 10, 38, 4, 6); - $HTMLFooter = view('includes/bankreport_footer', $data, true); - $mpdf->SetDisplayMode('fullpage'); - $mpdf->SetHTMLHeader($HtmlHeading); - //$html = view("bankreportprint",$data,true); - $mpdf->setFooter($HTMLFooter . "Page {PAGENO} of {nb}"); - $mpdf->setTitle('Sidharthindustries:PayrollReport'); - - - // $mpdf->setFooter("Page {PAGENO} of {nb}"); - $mpdf->list_indent_first_level = 1; - $mpdf->setAutoTopMargin = 'stretch'; - $mpdf->setAutoBottomMargin = 'stretch'; - $mpdf->WriteHTML($HTML); - $mpdf->Output("" . $filename . '.pdf', 'I', $php); + // Load the HTML content for the Header,footer + $HtmlHeading = view('includes/bankreport_header', $data); + $HTMLFooter = view('includes/bankreport_footer', $data); + + // Create an instance of mPDF + $mpdf = new Mpdf([ + 'mode' => 'utf-8', + 'format' => 'A4-P', + 'margin_left' => 10, + 'margin_right' => 10, + 'margin_top' => 38, + 'margin_bottom' => 4, + 'margin_header' => 10, + 'margin_footer' => 6, + ]); + + // Set document properties + $mpdf->SetDisplayMode('fullpage'); + $mpdf->SetHTMLHeader($HtmlHeading); // You need to define $HtmlHeading somewhere in your code + $mpdf->SetHTMLFooter($HTMLFooter . 'Page {PAGENO} of {nb}'); + $mpdf->SetTitle('Resicoindustries:PayrollReport'); + + // Configure mPDF settings + $mpdf->list_indent_first_level = 1; + $mpdf->setAutoTopMargin = 'stretch'; + $mpdf->setAutoBottomMargin = 'stretch'; + + // Write HTML to PDF + $mpdf->WriteHTML($HTML); + + // Output the PDF + $filename = 'EmployeePayrollReport'; // Define your filename here + $mpdf->Output($filename . '.pdf', 'D'); } } - function loadLoanReport() + function loadLoanReport($param1 = null, $param2 = null) { - + $eid = $param1 ?? ''; + $fyr = $param2 ?? ''; $currentyear = ''; $nxtyear = ''; - $uri = service('uri'); - $eid = $uri->getSegment(3); - $fyr = $uri->getSegment(4); + if (!empty($eid) and !empty($fyr) and !is_numeric($eid) and !($fyr == 'Overall')) { //echo "EMPLOYEE WITH FINYEAR"; $currentyear = substr($fyr, 0, 4); @@ -447,8 +440,8 @@ class Payslip extends BaseController $source = $this->request->getPost('source'); $data['selsource'] = $source; $finyear = $this->request->getPost('finyear'); - $currentyear = substr($finyear, 0, 4); - $nxtyear = substr($finyear, 5, 4); + $currentyear = substr((string)$finyear, 0, 4); + $nxtyear = substr((string)$finyear, 5, 4); $data['fyear'] = $currentyear . '-' . $nxtyear; } } @@ -468,6 +461,34 @@ class Payslip extends BaseController $this->loadViews("loanreports", $this->global, $data, NULL); } + public function leaveReport() + { + $fyr = get_financial_year(); + if ($this->request->getMethod() == 'POST') { + $fyr = $this->request->getPost('fyr'); + } + // $fiscalYears = get_financial_year_list(); + $fiscalYears = get_financial_year_list(date('Y'), 8); + + $data['fiscalyears'] = $fiscalYears; + $data['selectedfiscalyears'] = $fyr; + $data['leaverecords'] = $this->payroll_model->getEmpDetailsforLeave($fyr); + // echo ''; + $this->global['pageTitle'] = 'Leave Reports'; + $this->loadViews("leavereports", $this->global, $data, NULL); + } + function monthwiseLeaveReport($param1,$param2) + { + $EmployeeID = $param1; + $Fin_year = $param2; + $data['finyear'] = $Fin_year; + + $this->global['pageTitle'] = 'Monthwise Leave Reports'; + $data['MonthwiseReport'] = $this->payroll_model->getMonthwiseEmpDetailsforLeave($Fin_year, $EmployeeID); + + $this->loadViews("leavereportsmonthwise", $this->global, $data, NULL); + } + /** * This function used to load the first screen of the user */ @@ -660,7 +681,7 @@ class Payslip extends BaseController $due_start_date = $value->DueDate; $paydate = $current; //From POST parm - if (strlen($paydate) == 6) { + if (strlen((string)$paydate) == 6) { $paydate = '0' . $paydate; } $pmonth = substr($paydate, 0, 2); @@ -787,8 +808,8 @@ class Payslip extends BaseController function saveMonthlyData() { - $month = $this->request->getPost('param2'); - $jsondata = $this->request->getPost('param1'); + $month = (string)$this->request->getPost('param2'); + $jsondata = (string)$this->request->getPost('param1'); $json = json_decode($jsondata, true); @@ -918,32 +939,32 @@ class Payslip extends BaseController if ($TotalErrorFlag == 0) { - foreach ($json as $index => $j) { $Emp = $j['Employee']; - $EmpID = substr($Emp, 0, 4); - - + // $EmpID = substr($Emp, 0, 4); + $parts = explode("-", $Emp); + $EmpID = $parts[0]; + //$Name = $j['Employee']; $DaysWorked = $j['Days Worked']; $LOP_Days = $j['LOP Days']; $Paid_leave = $j['Paid Leave']; $OT_Hrs_Worked = $j['OT Hrs']; - $Loan_Recovered = $j['Manual Loan Due ₹']; + $Loan_Recovered = isset($j['Manual Loan Due ₹']) ? $j['Manual Loan Due ₹'] : 0.00; if (is_string($Loan_Recovered)) { $Loan_Recovered = strtoupper($Loan_Recovered); } - $Incentives = $j['Incentives in ₹']; - $Festival_Bonus = $j['Festival Bonus in ₹']; - $Other_Deductions = $j['Other Deductions in ₹']; - $Estimate = $j['Estimate in ₹']; + $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; + $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); + // print_r($monthlypaydata); die; $result = $this->monthlypay_model->saveMonthlyData_model($monthlypaydata); $total = $total + $result; } @@ -998,32 +1019,27 @@ class Payslip extends BaseController $this->loadViews("payslipgenerate", $this->global, $Data, NULL); } - /* Validation for Employee Dropdown - */ - function Employee_validate($selectValue) - { - //echo 'select_validate method called'; - // 'none' is the first option and the text says something like "-Choose one-" - if ($selectValue == '-1') { - $this->validator->setMessage('Employee_validate', 'Please Select Employee.'); - return false; - } else // user picked something - { - return true; - } - } + /* Validation for Employee Dropdow */ + public function Employee_validate(string $str, string &$error = null): bool + { + if ($str == '-1') { + $error = 'Please Select Employee.'; + return false; + } + return true; + } + function getEmployee() { $id = $this->request->getPost('id1'); $result = $this->payroll_model->getEmployeelist2($id); - $HTML = ""; - if ($result->num_rows() > 0) { + if (count($result) > 0) { - foreach ($result->result() as $list) { + foreach ($result as $list) { $HTML .= ""; @@ -1032,20 +1048,16 @@ class Payslip extends BaseController echo $HTML; } - /* Validation for PayOn Dropdown - */ - function PayOn_validate($selectValue) - { - //echo 'select_validate method called'; - // 'none' is the first option and the text says something like "-Choose one-" - if ($selectValue == '-1') { - $this->validator->setMessage('PayOn_validate', 'Please Select PayOn.'); - return false; - } else // user picked something - { - return true; - } - } + /* Validation for PayOn Dropdown */ + public function PayOn_validate(string $str, string &$error = null): bool + { + if ($str == '-1') { + $error = 'Please Select PayOn.'; + return false; + } + return true; + } + /** * This function used to load the first screen of the user */ @@ -1056,20 +1068,30 @@ class Payslip extends BaseController $html = ""; $All = $this->request->getPost('All'); if ($All == '') { - $this->validator->setRules(['Employee'=> 'trim|callback_Employee_validate']); - } + $this->validator->setRules([ + 'Employee' => [ + 'label' => 'Employee', + 'rules' => 'trim|callback_Employee_validate', + ] + ]); + } - $this->validator->setRules(['PayOn'=> 'trim|callback_PayOn_validate']); + $this->validator->setRules([ + 'PayOn' => [ + 'label' => 'PayOn', + 'rules' => 'trim|callback_PayOn_validate', + ] + ]); if ($this->validator->run() == FALSE) { $this->viewGenerator(); } else { $Payon = $this->request->getPost('PayOn'); - $m = date("M", mktime(0, 0, 0, $Payon, 10)); + $m = date("M", mktime(0, 0, 0, (int)$Payon, 10)); //$y =date("Y",mktime(0, 0, 0, $Payon, 10)); //$m=date("M-Y",mktime(0,0,0,$month,1,$year)); - $y = substr($Payon, 3); + $y = substr((string)$Payon, 3); //echo "Payon" . $Payon; if ($All != '') { @@ -1095,7 +1117,7 @@ class Payslip extends BaseController // exit(); //$Data['Count'] = $i; - $html .= view("payslipgenerateprint", $Data, true); + $html .= view("payslipgenerateprint", $Data); // print_r ($Data); // exit(); @@ -1114,7 +1136,7 @@ class Payslip extends BaseController $Data['amtinwords'] = $totalsalaryinwords; //print_r ($Data); //exit(); - $html = view("payslipgenerateprint", $Data, true); + $html = view("payslipgenerateprint", $Data); } @@ -1150,18 +1172,28 @@ class Payslip extends BaseController // $dompdf->stream($filename); // } - $mpdf = new mPDF('utf-8', 'A4-P', 10, 10, 10, 10, 10, 24, 4, 6); + // $mpdf = new mPDF('utf-8', 'A4-P', 10, 10, 10, 10, 10, 24, 4, 6); + $mpdf = new Mpdf([ + 'mode' => 'utf-8', + 'format' => 'A4-P', + 'margin_left' => 10, + 'margin_right' => 10, + 'margin_top' => 10, + 'margin_bottom' => 10, + 'margin_header' => 10, + 'margin_footer' => 6, + 'setAutoTopMargin' => 'stretch', + 'setAutoBottomMargin' => 'stretch' + ]); $mpdf->SetDisplayMode('fullpage'); - $mpdf->SetHTMLHeader($HtmlHeading); - $mpdf->setFooter($HTMLFooter . "Page {PAGENO} of {nb}"); + // $mpdf->SetHTMLHeader($HtmlHeading); $mpdf->setFooter("Page {PAGENO} of {nb}"); $mpdf->list_indent_first_level = 1; - $mpdf->setAutoTopMargin = 'stretch'; - $mpdf->setAutoBottomMargin = 'stretch'; $mpdf->WriteHTML($html); - $mpdf->SetTitle('Sidharthindustries:Payslip'); - $mpdf->Output("" . $filename . '.pdf', 'I', $php); - } + $mpdf->SetTitle('Resico:Payslip'); + + $mpdf->Output("Payslip-" . $filename . ".pdf", 'D'); + } } function updatePayslip() @@ -1203,42 +1235,30 @@ class Payslip extends BaseController */ function uploadExcel2() { - + $path = ROOTPATH.'public/uploads/files/'; + if(!is_dir($path)) { mkdir($path, 0777, true); } $PayrollFileName = ''; - - //Check whether user upload picture - if (!empty($_FILES['userfile']['name'])) { - - $pathinfo = pathinfo($_FILES['userfile']['name']); - $config['upload_path'] = 'public/uploads/files/'; + $file = $this->request->getFile('userfile'); + if ($file && $file->isValid() && !$file->hasMoved()) { + + $pathinfo = pathinfo($file->getName()); + $config['upload_path'] = $path; $config['allowed_types'] = 'xls|xlsx|csv'; $config['file_name'] = $_FILES['userfile']['name']; $config['overwrite'] = true; + + if (in_array($pathinfo['extension'], ['xlsx', 'xls']) && $file->getSize() > 0) + { + $file->move($config['upload_path'], $config['file_name']); + $PayrollFileName = $file->getName(); - //Load upload library and initialize configuration - $this->load->library('upload', $config); - $this->upload->initialize($config); + $inputFileName = $path . $PayrollFileName; + // $inputFileName = $_FILES['userfile']['tmp_name']; - if (($pathinfo['extension'] == 'xlsx' || $pathinfo['extension'] == 'xls') - && $_FILES['userfile']['size'] > 0 - ) { - if ($this->upload->do_upload('userfile')) { - $uploadData = $this->upload->data(); - $PayrollFileName = $uploadData['file_name']; - } else { - $error = array('error' => $this->upload->display_errors()); - $PayrollFileName = ''; - } - - $inputFileName = $_FILES['userfile']['tmp_name']; - - require_once APPPATH . 'third_party/PHPExcel/IOFactory.php'; - $objTpl = PHPExcel_IOFactory::load($inputFileName); - - $sheet = $objTpl->getActiveSheet(0); //->toArray(null, NULL, True, True); - - $highestRow = $sheet->getHighestRow(); + $spreadsheet = IOFactory::load($inputFileName); + $sheet = $spreadsheet->getActiveSheet(); + $highestRow = $sheet->getHighestRow(); $highestColumn = $sheet->getHighestColumn(); @@ -1327,8 +1347,8 @@ class Payslip extends BaseController $Paid_leave = $sheet->getCell('E' . $x)->getValue(); $OTHoursWorked = $sheet->getCell('F' . $x)->getValue(); $LoanRecovered = $sheet->getCell('G' . $x)->getValue(); - if (is_string($loanRecovered)) { - $loanRecovered = strtoupper($loanRecovered); + if (is_string($LoanRecovered)) { + $LoanRecovered = strtoupper($LoanRecovered); } $Incentive = $sheet->getCell('G' . $x)->getValue(); $Other_Deductions = $sheet->getCell('H' . $x)->getValue(); @@ -1340,7 +1360,7 @@ class Payslip extends BaseController if ($flag != 0 && $flag2 != 0) { - $FileData = array('Month_Year' => $PayOn, 'EmpID' => $EmpId, 'Days_worked' => $Days_worked, 'LOP_Days' => $LOPDays, 'Paid_leave' => $Paid_leave, 'OT_Hrs_Worked' => $OTHoursWorked, 'Loan_Recovered' => $loanRecovered, 'Incentives' => $Incentive, 'Other_Deductions' => $Other_Deductions, 'Created_By' => $createdby, 'Created_Time' => date("Y-m-d h:i:sa")); + $FileData = array('Month_Year' => $PayOn, 'EmpID' => $EmpId, 'Days_worked' => $Days_worked, 'LOP_Days' => $LOPDays, 'Paid_leave' => $Paid_leave, 'OT_Hrs_Worked' => $OTHoursWorked, 'Loan_Recovered' => $LoanRecovered, 'Incentives' => $Incentive, 'Other_Deductions' => $Other_Deductions, 'Created_By' => $createdby, 'Created_Time' => date("Y-m-d h:i:sa")); $result = $this->payroll_model->UploadFileData2($FileData); $success++; } @@ -1369,8 +1389,8 @@ class Payslip extends BaseController - } else { - + } + else { echo ""; } } else { @@ -1478,8 +1498,11 @@ class Payslip extends BaseController function MonthwiseBonusreport() { //echo"in controller"; - $EmployeeID = $_GET['EID']; - $Fin_year = $_GET['Finyear']; + // $EmployeeID = $_GET['EID']; + // $Fin_year = $_GET['Finyear']; + $EmployeeID = $this->request->getGet('EID'); + $Fin_year = $this->request->getGet('Finyear'); + $data['finyear'] = $Fin_year; //echo $EmployeeID; //echo $Fin_year; diff --git a/app/Helpers/datetime_helper.php b/app/Helpers/datetime_helper.php index 601fee60..eae19f04 100755 --- a/app/Helpers/datetime_helper.php +++ b/app/Helpers/datetime_helper.php @@ -125,7 +125,31 @@ if (!function_exists('get_financial_year')) { return $financialYear; } } - + +if (!function_exists('get_financial_year_list')) { + function get_financial_year_list($start_year = null, $num_years = 5) + { + // If no start year is provided, use the current year + $start_year = $start_year ?: date('Y'); + + $financial_years = []; + + // Loop to generate financial years + for ($i = 0; $i < $num_years; $i++) { + $current_year = $start_year - $i; + $next_year = $current_year + 1; + + // Determine the financial year + $financial_year = $current_year . '-' . $next_year; + + // Add the financial year to the list + $financial_years[] = $financial_year; + } + + return $financial_years; + } +} + if (!function_exists('get_shorten_financial_year')) { function get_shorten_financial_year($date = null) { @@ -181,6 +205,52 @@ if (!function_exists('get_date_days_ago')) { return $newDate; } } + +if (!function_exists('get_fiscal_years')) { +function get_fiscal_years($startOn, $endOn ,$pre_year) +{ + $fiscalYearStartDate = new DateTime($startOn); + $fiscalYearEndDate = new DateTime($endOn); + + $fiscalYears = []; + + for ($i = 0; $i < $pre_year; $i++) { + $fiscalYearStartDate->sub(new DateInterval('P1Y')); + $fiscalYearEndDate->sub(new DateInterval('P1Y')); + + $startYear = $fiscalYearStartDate->format('Y'); + $endYear = $fiscalYearEndDate->format('Y'); + + $fiscalYears[] = "$startYear-$endYear"; + } + + return $fiscalYears; +} +} + +if (!function_exists('get_pre_financial_years')) { + function get_pre_financial_years($startOn, $endOn ,$pre_year) + { + $fiscalYearStartDate = new DateTime($startOn); + $fiscalYearEndDate = new DateTime($endOn); + + $fiscalYears = []; + + for ($i = 0; $i < $pre_year; $i++) { + $fiscalYearStartDate->sub(new DateInterval('P1Y')); + $fiscalYearEndDate->sub(new DateInterval('P1Y')); + + $startYear = $fiscalYearStartDate->format('Y'); + $endYear = $fiscalYearEndDate->format('Y'); + + $fiscalYears[] = "$startYear-$endYear"; + } + + return $fiscalYears; + } + } + + if (!function_exists('generate_pos_number')) { function generate_pos_number($last_pono) { diff --git a/app/Models/Inwardgateregister_model.php b/app/Models/Inwardgateregister_model.php index 0d38c759..698ee627 100755 --- a/app/Models/Inwardgateregister_model.php +++ b/app/Models/Inwardgateregister_model.php @@ -103,6 +103,7 @@ class Inwardgateregister_model extends Model ->join('T_PurchaseOrder_Master PO', 'igr.PONO = PO.PONO') ->join('T_Inwardgateregister_fileupload fileup', ' igr.IGRNO = fileup.IGRNO', 'left') ->join('T_SupplierDetailsN` sup', 'PO.SupplierID = sup.SupplierID') + ->orderBy('igr.CreatedDate','desc') ->groupBy('igr.IGRNO', 'desc'); $query = $builder->get(); $result = $query->getResult(); diff --git a/app/Models/Monthlypay_model.php b/app/Models/Monthlypay_model.php index 7033db7c..cfa1158b 100644 --- a/app/Models/Monthlypay_model.php +++ b/app/Models/Monthlypay_model.php @@ -207,7 +207,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'); @@ -217,7 +217,8 @@ class Monthlypay_model extends Model } elseif ($count == 1) { $this->db->table('T_Monthly_Pay_Inputs') - ->where('H_date', $data['H_Date']) + // ->where('H_date', $data['H_Date']) // ask velmurugan H_Date public hoilday table la irukku + ->where('EmpID', $data['EmpID']) // temp solution ->update($data); $i = $this->db->affectedRows(); @@ -363,6 +364,9 @@ join T_DepartmentDetails as Dep on Dep.DEPCode=Emp.Departmentcode where Emp.IsA function reportvalue($fin_year) { + if (empty($fin_year)) { + return []; + } else { $curr_split = explode('-', $fin_year); $pre_year = $curr_split[0]; @@ -380,6 +384,7 @@ join T_DepartmentDetails as Dep on Dep.DEPCode=Emp.Departmentcode where Emp.IsA $query = $this->db->query($sql, array($pre_year, $curr_year)); return $query->getResult(); + } } function Monthwisereportvalue($Fin_year, $EmployeeID) { diff --git a/app/Models/Payroll_model.php b/app/Models/Payroll_model.php index fecf07da..21bc2c61 100644 --- a/app/Models/Payroll_model.php +++ b/app/Models/Payroll_model.php @@ -141,7 +141,7 @@ class Payroll_model extends Model function GetPayslipdata($PayOn = '', $EmpId = '') { //echo "FROM MODEL" . $PayOn . $EmpId; - $builder = $this->db->table('T_Payroll Pay')->select('Pay.*,Emp.FirstName as FName ,Emp.LastName as Lname,Emp.DateofBirth as Dob,Emp.PANNo as Pan,Emp.BankBranchName as BankName,Emp.AadharNo,Emp.IFSCCode as IFSCCode,Emp.DateofJoining as DOJ,Emp.Designation as Designation,Dep.DepartmentName as DeptName') + $builder = $this->db->table('T_Payroll Pay')->select('Pay.*,Emp.FirstName as FName ,Emp.LastName as Lname,Emp.DateofBirth as Dob,Emp.PANNo as Pan,Emp.BankBranchName as BankName,Emp.BankAccountNo as BankAccountNumber,Emp.IFSCCode as IFSCCode,Emp.DateofJoining as DOJ,Emp.AadharNo,Emp.Designation as Designation,Dep.DepartmentName as DeptName') //->join('T_Payroll_File payfile', 'Pay.PayOn = payfile.PayOn') ->join('T_Employee_Details Emp', 'Pay.EmpID = Emp.EmpID') ->join('T_DepartmentDetails Dep', 'Emp.Departmentcode = Dep.DEPCode'); @@ -340,7 +340,7 @@ class Payroll_model extends Model $builder->orderBy("Pay.EmpID", "asc"); $query = $builder->get(); - return $query; + return $query->getResult(); } /* */ @@ -428,6 +428,53 @@ class Payroll_model extends Model $builder->insert($cheque); } + public function getFiscalYear() + { + $sql = "SELECT FiscalYearStartOn, FiscalYearEndsOn FROM T_Company_Details"; + $query = $this->db->query($sql); + $result = $query->getRow(); + return $result; + } + public function getEmpDetailsforLeave($financial_year){ + $years = explode('-', $financial_year); + + $builder = $this->db->table('T_Attendance as A'); + + $builder->select('A.EmpID, GROUP_CONCAT(A.Month_Year) AS Month_Year, SUM(A.Days_Worked) AS NoofWorkedDays, SUM(A.Absent) AS NoofAbsentDays, SUM(A.Paid_Leave) AS NoofPaidLeaveDays, CONCAT_WS(" ", E.FirstName, E.LastName) AS FullName'); + $builder->join('T_Employee_Details as E', 'A.EmpID = E.EmpID', 'left'); + $builder->where('A.Month_Year >=', $years[0].'-04-01'); + $builder->where('A.Month_Year <=', $years[1].'-03-31'); + $builder->groupBy('A.EmpID'); + $builder->orderBy('A.EmpID', 'asc'); + + $query = $builder->get(); + $results = $query->getResult(); + + return $results; + } + public function getMonthwiseEmpDetailsforLeave($financial_year, $employee_id){ + + $years = explode('-', $financial_year); + + $builder = $this->db->table('T_Attendance as A'); + + $builder->select('A.EmpID, A.Days_Worked AS NoofWorkedDays, A.Absent AS NoofAbsentDays, A.Paid_Leave AS NoofPaidLeaveDays'); + $builder->select('CONCAT_WS(" ", E.FirstName, E.LastName) AS FullName'); + $builder->select('DATE_FORMAT(A.Month_Year, "%Y-%m") AS Month_Year'); // Format as YYYY-MM + $builder->join('T_Employee_Details as E', 'A.EmpID = E.EmpID', 'left'); + $builder->where('A.Month_Year >=', $years[0].'-04-01'); + $builder->where('A.Month_Year <=', $years[1].'-03-31'); + $builder->where('A.EmpID', $employee_id); + $builder->where('A.Absent !=', 0); + $builder->groupBy('A.EmpID, Month_Year'); + $builder->orderBy('A.Month_Year'); + + $query = $builder->get(); + $results = $query->getResult(); + + return $results; + } + function getChequeInfo($bank, $payon) { diff --git a/app/Models/Purchaseorder_model.php b/app/Models/Purchaseorder_model.php index 331d3034..c4146a03 100644 --- a/app/Models/Purchaseorder_model.php +++ b/app/Models/Purchaseorder_model.php @@ -1595,8 +1595,10 @@ QuantityRejected,ROUND(Quantity-ReceivedQuantity)as PendingQty,Per, $builder->orWhere('mast.Status', PO_RELEASER_ONHOLD); $builder->orWhere('mast.Status', PO_RELEASED); $builder->orWhere('mast.Status', REQITEM_Emergency_PO_CREATED); - $builder->orderBy('mast.Status'); + // $builder->orderBy('mast.Status'); } + $builder->orderBy('mast.CreatedDate','DESC'); + $result = $builder->get(); return $result->getResult(); diff --git a/app/Views/Bonusreport.php b/app/Views/Bonusreport.php index 4038ca99..6e08141f 100644 --- a/app/Views/Bonusreport.php +++ b/app/Views/Bonusreport.php @@ -57,7 +57,7 @@
- + diff --git a/app/Views/Bonusreportmonthwise.php b/app/Views/Bonusreportmonthwise.php index 6661e6cc..1fd89e99 100644 --- a/app/Views/Bonusreportmonthwise.php +++ b/app/Views/Bonusreportmonthwise.php @@ -28,7 +28,7 @@
S.No
- + @@ -154,8 +154,8 @@ $(function () { }); /*------after reload display the value text box (fin_year text box)------- */ //if(!empty($dropdownvalue)){ - var s = ""; - $('#finyearttext').val(s); + // var s = ""; + // $('#finyearttext').val(s); ///} }); /*-----------------on ready function ends here---------------------------- */ diff --git a/app/Views/attendance.php b/app/Views/attendance.php index 997cafdb..136c5f78 100644 --- a/app/Views/attendance.php +++ b/app/Views/attendance.php @@ -45,7 +45,7 @@ $currentday = date('d'); } .fht-table td:hover { - background-color: #00d976;; + background-color: #00a65a; color:#ffffff; } @@ -125,7 +125,7 @@ $currentday = date('d'); .celda_encabezado_general { - background-color: #00d976;; + background-color: #00a65a; border: 1px solid #ccc; color: #ffffff; font-weight: bold; @@ -144,6 +144,7 @@ $currentday = date('d'); } .celda_normal { /*background-color: #fff;*/ + /* */ border: 1px solid #ccc; padding: 2px 4px; } @@ -212,7 +213,6 @@ $currentday = date('d'); -
S.NO
- + > ".$col."W";} + { echo "".$col."W";} else { echo $col."W"; } ?> - + - + @@ -754,7 +754,7 @@ function findInvalidData() p.queue(function() { p.css({"background-color":"white"}); $(ide).mouseover(function() { - $(this).css({"background-color":" #00d976;"}) + $(this).css({"background-color":" #00a65a;"}) }).mouseout(function(){ $(this).css({"background-color":"white"});}); }); flag++; @@ -771,7 +771,7 @@ function findInvalidData() p.queue(function() { p.css({"background-color":"white"}); $(ide).mouseover(function() { - $(this).css({"background-color":" #00d976;"}) + $(this).css({"background-color":" #00a65a;"}) }).mouseout(function(){ $(this).css({"background-color":"white"});}); }); flag++; diff --git a/app/Views/createPOfromRequistion.php b/app/Views/createPOfromRequistion.php index 12279363..ff7dc4fe 100644 --- a/app/Views/createPOfromRequistion.php +++ b/app/Views/createPOfromRequistion.php @@ -178,12 +178,11 @@
-
S.NoEmployee IDEmployee NameEmployee Name title = " " title = "sunday" class="celda_encabezado_general" > ".$col."OT";} else { echo $col."OT"; }?> title = " " title = "sunday" class="celda_encabezado_general" > ".$col."OT";} else { echo $col."OT"; }?>
+
+ @@ -226,7 +225,7 @@ + diff --git a/app/Views/editPayslip.php b/app/Views/editPayslip.php index 2a7a29c5..9e221ae9 100644 --- a/app/Views/editPayslip.php +++ b/app/Views/editPayslip.php @@ -50,7 +50,7 @@ $totaldeductions = ''; $monthsoptions = array("01" => "Jan", "02" => "Feb","03" => "Mar","04" => "Apr","05" => "May","06" => "June","07"=> "July","08"=> "Aug","09" => "Sep","10"=> "Oct","11" => "Nov","12"=>"Dec"); - +// print_r($PayInfo);die; if(!empty($PayInfo)) { @@ -115,7 +115,6 @@ if(!empty($PayInfo)) } } - ?> + +
+ +
+

+
Leave Report
+

+
+
+ +
+
+
+
+
+
+ +
+ +
+ +
+ + +
+ +
+
+
+ +
+
SNo
Select Requistion Number
+ + + + + + + + + + + + + + NoofAbsentDays != 0){ ?> + + + + + + + + + + + + + +
S.NoEmployee NameLeave TakenPaid Leave Taken
EmpID.'/'.$selectedfiscalyears.'">'.$rec->EmpID.'-'.$rec->FullName.''; ?>EmpID.'-'.$rec->FullName ; ?>NoofAbsentDays)) { echo number_format((int)$rec->NoofAbsentDays, 0, '.', ''); } else { echo "0"; } ?>NoofPaidLeaveDays)) { echo number_format((int)$rec->NoofPaidLeaveDays, 0, '.', ''); } else { echo "0"; } ?>
+
+ + + + + + + + + \ No newline at end of file diff --git a/app/Views/leavereportsmonthwise.php b/app/Views/leavereportsmonthwise.php new file mode 100644 index 00000000..a219006d --- /dev/null +++ b/app/Views/leavereportsmonthwise.php @@ -0,0 +1,134 @@ + + + + + + +
+ +
+

+
" EmpID ?> - FullName ?> " - Monthwise Leave Reports
+

+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
S.NoEmployee IdEmployee NameMonth YearLeave TakenPaid Leave Taken
EmpID ?>FullName ?>Month_Year); + $year_val = $split_val[0]; + $month_val = $split_val[1]; + $monthName = date("M", mktime(0, 0, 0, $month_val, 10)); + echo $monthName . " , ".$year_val + ?>NoofAbsentDays)) { echo number_format((int)$record->NoofAbsentDays, 0, '.', ''); } else { echo "0"; } ?>NoofPaidLeaveDays)) { echo number_format((int)$record->NoofPaidLeaveDays, 0, '.', ''); } else { echo "0"; } ?>
+
+
+
+
+
+
+ + + + \ No newline at end of file diff --git a/app/Views/loanreports.php b/app/Views/loanreports.php index a3763c41..7dc0b6f8 100644 --- a/app/Views/loanreports.php +++ b/app/Views/loanreports.php @@ -189,7 +189,7 @@
-
+
@@ -253,9 +253,9 @@ ?> - EmpID.'/'.$fyear.'">'.$rec->EmpID.'-'.$rec->FName.'-'.$rec->Lname.'';?> + EmpID.'/'.$fyear.'">'.$rec->EmpID.'-'.$rec->FName.'-'.$rec->Lname.'';?> - Loan_ID.'">'.$rec->EmpID.'-'.$rec->FName.'-'.$rec->Lname.'';?> + Loan_ID.'">'.$rec->EmpID.'-'.$rec->FName.'-'.$rec->Lname.'';?> Loan_Amount)){$totalloangiven+=$rec->Loan_Amount; echo $rec->Loan_Amount;}else{echo "0.00";}?> diff --git a/app/Views/monthlypayinputs.php b/app/Views/monthlypayinputs.php index 911de1d9..15dad917 100644 --- a/app/Views/monthlypayinputs.php +++ b/app/Views/monthlypayinputs.php @@ -74,8 +74,7 @@ $('html').bind('keypress', function(e)

The Red highlighted Employee have loan to pay. Put 'NA' for Skip Current Month Loan Due.

- - +
@@ -150,17 +149,17 @@ $('html').bind('keypress', function(e) } ?> -
-
-
- -
-
-
- - - +
+
+
+ + +
+
+
+ + @@ -268,10 +267,10 @@ $('html').bind('keypress', function(e) - + - + @@ -294,7 +293,7 @@ $('html').bind('keypress', function(e) - + @@ -325,12 +324,12 @@ $('html').bind('keypress', function(e) - - - - - - + + + + + + diff --git a/app/Views/ncrlist.php b/app/Views/ncrlist.php index 6e01c848..d95a7ae1 100644 --- a/app/Views/ncrlist.php +++ b/app/Views/ncrlist.php @@ -18,8 +18,8 @@
-
S.No Employee Key)){echo "contenteditable='true';"; } ?> Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"style="text-align:right;" >Other_Deductions)){echo $record->Other_Deductions;$totalotherDet [] = $record->Other_Deductions;}else{ echo number_format(0.00,2,'.','');} ?> Key)){echo "contenteditable='true';"; } ?> Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"style="text-align:right;" >Festival_Bonus)){echo $record->Festival_Bonus;$totalfestival [] = $record->Festival_Bonus;}else{ echo number_format(0.00,2,'.','');;} ?> Key)){echo "contenteditable='false';"; } ?> Key)){?> title="Payslip Calculated" style="text-align:right;color:blue;"> Estimate)){echo $record->Estimate; $estTotal [] = $record->Estimate; }else { echo $empSalary[$i]; $estTotal [] = $empSalary[$i]; }?> Total
- +
+ diff --git a/app/Views/payslipgenerateprint.php b/app/Views/payslipgenerateprint.php index bc0583a1..97dde7e0 100644 --- a/app/Views/payslipgenerateprint.php +++ b/app/Views/payslipgenerateprint.php @@ -196,8 +196,9 @@ if($RecCount > 0)
Complaint Id
- + diff --git a/app/Views/paysliplist.php b/app/Views/paysliplist.php index 5021c28b..5b719136 100644 --- a/app/Views/paysliplist.php +++ b/app/Views/paysliplist.php @@ -1,11 +1,7 @@ - +
-
+ +
RESICO
Survey No: 168/1C3,Pennalur Pet Road,Goonipalyam village,
Uthukottai Taluk,Tiruvallur Dist, Chennai,Tamilnadu,Pin code : 602026.
PaySlip for the Month of