From 1b411b0e63882180b7d032abbcb92a93975dcfa2 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Mon, 31 Mar 2025 09:19:06 +0000 Subject: [PATCH] igr live fixes --- app/Controllers/Inwardgateregister.php | 30 ++++++++++++++------ app/Models/Inwardgateregister_model.php | 2 +- app/Views/editOldemppay.php | 37 +++++++++++++++++++------ app/Views/publicholidays.php | 6 ++-- app/Views/rawmaterialListing.php | 16 ++++++++--- app/Views/viewinwardgateregister.php | 2 +- 6 files changed, 67 insertions(+), 26 deletions(-) diff --git a/app/Controllers/Inwardgateregister.php b/app/Controllers/Inwardgateregister.php index a680ad47..4fa4fd29 100755 --- a/app/Controllers/Inwardgateregister.php +++ b/app/Controllers/Inwardgateregister.php @@ -658,7 +658,8 @@ class Inwardgateregister extends BaseController if ($fileupdated_count > 0) { $finalstatement .= "Number of files updated: $fileupdated_count \n"; - $finalstatement .= "Files: \n" . implode(PHP_EOL, $fileupdated_name); + // $finalstatement .= "Files: \n" . implode(PHP_EOL, $fileupdated_name); + $finalstatement .= "Files: \n" . implode(PHP_EOL, array_map(fn($file) => "• " . $file, $fileupdated_name)); } else { $finalstatement .= "No files to update"; } @@ -811,21 +812,23 @@ function viewIGRDetails() $igrarr = array('DeliveryChellanDate' => $DeliveryChellanDate, 'MaterialRcvdDate' => $MaterialRcvdDt,'VehicleNo'=>$VehicleNo,'TransporterId'=>$TransporterId,'DriverMobileNumber'=>$DriverMobileNumber,'DriverName'=>$DriverName, 'IGRStatus' => $IGRStatus,'UpdateBY' => $updateby,'DeliveryChellanOrInvoiceNo'=>$DeliveryChellanOrInvoiceNo,'Remark'=>$MasterRemarks); $MasterFile = $this->request->getfile('MasterFile'); + $fileupdated_count = 0; + $fileupdated_name = []; - if ($MasterFile) { + if (!empty($MasterFile)) { $requestMasterFileName = $MasterFile->getName(); if ($MasterFile && $MasterFile->isValid() && !$MasterFile->hasMoved()) { if (!empty($this->inwardgateregister_model->isFileExistsInIGRmaster($requestMasterFileName))) { log_message('error', 'File already exists in the database'.$requestMasterFileName); } else{ - $MasterFile->move($path, $requestMasterFileName); + $MasterFile->move($path, $requestMasterFileName); + $fileupdated_count++; + $fileupdated_name[] = $requestMasterFileName; $igrarr['MasterFile'] = $requestMasterFileName; } } } - $fileupdated_count = 0; - $fileupdated_name = []; $fileNames = $this->request->getPost('file_name'); $files = $this->request->getFileMultiple('emp_file'); @@ -913,9 +916,16 @@ function viewIGRDetails() } if ($getigrstatus == 'ST027' && ($updateigrmaster > 0 || $updateigrlineitem > 0)) { - - - $result_for_email = $this->inwardgateregister_model->getDetailsforEmail($this->session->get('userId')); + + if(session()->get('roleText') == 'System Administrator') // id is 1 + { + $roleId = 2; + } + else if(session()->get('roleText') == 'Auditor') // id is 2 + { + $roleId = 1; + } + $result_for_email = $this->inwardgateregister_model->getDetailsforEmail($this->session->get('userId'),$roleId); $result_for_history = $this->inwardgateregister_model->getHistoryDetailsforEmail($IGRNo); @@ -982,6 +992,7 @@ function viewIGRDetails() $email_response = $notification->sendEmail([ 'recipient_email' => $email, 'subject' => $result_for_email['company'].' - IGR Notification', + // 'carboncopy'=>Sales@resicoindustries.com,Factory@resicoindustries.com,Invoice@resicoindustries.com, // 'description' => 'IGR Number : '.$IGRNo.' is Edited By '.($result_for_email['full_name'] ?? $this->session->get('name'))." On ".date('d-m-Y H:i A', strtotime(get_current_date_time() . ' +30 seconds')). $history_content, 'description' => $result_for_history['first_line']."
" .$history_content, 'company' => $result_for_email['company'], @@ -1016,7 +1027,8 @@ function viewIGRDetails() if ($fileupdated_count > 0) { $finalstatement .= "Number of files updated: $fileupdated_count \n"; - $finalstatement .= "Files: \n" . implode(PHP_EOL, $fileupdated_name); + // $finalstatement .= "Files: \n" . implode(PHP_EOL, $fileupdated_name); + $finalstatement .= "Files: \n" . implode(PHP_EOL, array_map(fn($file) => "• " . $file, $fileupdated_name)); } else { $finalstatement .= "No files to update"; } diff --git a/app/Models/Inwardgateregister_model.php b/app/Models/Inwardgateregister_model.php index 57eba79c..e8c54b66 100755 --- a/app/Models/Inwardgateregister_model.php +++ b/app/Models/Inwardgateregister_model.php @@ -1300,7 +1300,7 @@ $builder = $this->db->table('t_igr_history') ]; } - public function getDetailsforEmail($userId,$roleId = 2) + public function getDetailsforEmail($userId,$roleId) { $query0 = $this->db->query(" SELECT CompanyName,EmailAddress diff --git a/app/Views/editOldemppay.php b/app/Views/editOldemppay.php index c368285c..7e92e7b8 100755 --- a/app/Views/editOldemppay.php +++ b/app/Views/editOldemppay.php @@ -127,6 +127,16 @@ if (!empty($emppay)) { .num { text-align: right; } + .btn-soft-primary { + color: white; + background-color: rgb(42, 206, 150); + border-color: rgb(42, 206, 150); + } + + .btn-soft-primary:hover { + background-color: rgb(32, 176, 130); /* Slightly darker shade for hover */ + border-color: rgb(32, 176, 130); + }
@@ -253,7 +263,12 @@ if (!empty($emppay)) {
- +
@@ -271,17 +286,23 @@ if (!empty($emppay)) {
- +
- - - - Previous Upload - - - + + +
diff --git a/app/Views/publicholidays.php b/app/Views/publicholidays.php index 7dcc8b83..117e9d85 100755 --- a/app/Views/publicholidays.php +++ b/app/Views/publicholidays.php @@ -31,15 +31,15 @@
- Holiday Name : +
- Date : +
- +
diff --git a/app/Views/rawmaterialListing.php b/app/Views/rawmaterialListing.php index bd30793f..10b57846 100755 --- a/app/Views/rawmaterialListing.php +++ b/app/Views/rawmaterialListing.php @@ -235,7 +235,7 @@