From ef14f225ff68557d6bcd016156ffc282f0ef2311 Mon Sep 17 00:00:00 2001 From: Gowtham M Date: Fri, 14 Mar 2025 12:11:15 +0530 Subject: [PATCH 1/6] issue : GWM --- app/Views/stock/dustAndRoughStockDetails.php | 27 +++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/app/Views/stock/dustAndRoughStockDetails.php b/app/Views/stock/dustAndRoughStockDetails.php index 7c490cae..91088ef3 100644 --- a/app/Views/stock/dustAndRoughStockDetails.php +++ b/app/Views/stock/dustAndRoughStockDetails.php @@ -17,6 +17,19 @@ text-align: center; } + .grab { + cursor: grab; /* Default open-hand cursor */ + } + + .grab:active { + cursor: grabbing; /* Closed-hand cursor when dragging */ + } + + /* .fht-table td[contenteditable="true"] { + background-color: lightyellow; + color:rgb(13, 7, 7); + } */ + .fht-table td:hover { background-color: #50bbd9; color: #ffffff; @@ -151,14 +164,14 @@ } .celda_encabezado_total { - background-color:#ffffff !important; + background-color: #ffffff !important; border: 1px solid #ffffff; color: #ffffff !important; font-weight: bold; padding: 6px 10px; text-align: center; } - + .celda_normal { /*background-color: #fff;*/ /* */ @@ -219,19 +232,15 @@ } td { - min-width: 150px; - max-width: 150px; - } - - th { - min-width: 150px; - max-width: 150px; + min-width: 100px; + max-width: 100px; } tfoot tr { background-color:rgb(235, 236, 203); } + From a4e219760271555bcf13ab99d70ac4f92b51f212 Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Fri, 14 Mar 2025 15:38:08 +0530 Subject: [PATCH 2/6] changes in stock module 14-03-2025 --- app/Controllers/StockController.php | 154 +++++++++++------- app/Views/editCapitalAmendPO.php | 16 +- app/Views/stock/trpProductionStockDetails.php | 17 +- 3 files changed, 111 insertions(+), 76 deletions(-) diff --git a/app/Controllers/StockController.php b/app/Controllers/StockController.php index e300fe57..a96b6502 100644 --- a/app/Controllers/StockController.php +++ b/app/Controllers/StockController.php @@ -3119,111 +3119,143 @@ class StockController extends BaseController public function updateTrpProductionDetails($inserts = null, $freshEntry = false) { - + //getting values from post request $postData['updateTrpProductionDetails'] = json_decode($this->request->getPost('updateTrpProductionDetails'),true); + //checking if post data is empty data ? if (empty($postData['updateTrpProductionDetails'])) { + + //if empty data , we still check for inserts data is available or not if (empty($inserts)) { + + //if both fails return "no data found" return $this->response->setJSON(['error' => 'No data found to update']); + } else { + + //if inserts data is available , then assign to post data $postData['updateTrpProductionDetails'] = $inserts; } } $updateTrpProductionDetails = $postData['updateTrpProductionDetails']; - // Extract all dates from input data + // Extract all dates from post data $dates = array_column($updateTrpProductionDetails, 'Date'); + + //format from "d-m-Y" to db "Y-m-d" format $formattedDates = array_map(fn($date) => $this->convertToDateWithFlexibleFormats($date, ["d-m-Y", "Y-m-d", "m/d/Y", "m-d-Y"], "Y-m-d"), $dates); - // Fetch all existing records in a single query per table + + + // Fetch all existing maintenance , production and waste records for the given formatted dates + $existingMaintenance = $this->TrpProductionMaintenance_model->whereIn('date', $formattedDates)->findAll(); + $existingProduction = $this->TrpProduction_model->whereIn('date', $formattedDates)->findAll(); + $existingWaste = $this->TrpProductionWaste_model->whereIn('date', $formattedDates)->findAll(); - // Map existing records by date for quick lookup - $existingMaintenanceMap = array_column($existingMaintenance, null, 'date'); - $existingProductionMap = array_column($existingProduction, null, 'date'); - $existingWasteMap = array_column($existingWaste, null, 'date'); + + //getting list of existing dates of maintenance , production and waste records + + $existingMaintenanceDateList = array_column($existingMaintenance, null, 'date'); + + $existingProductionDateList = array_column($existingProduction, null, 'date'); + + $existingWasteDateList = array_column($existingWaste, null, 'date'); - $insertMaintenance = []; + $updateMaintenance = []; - $insertProduction = []; - $updateProduction = []; - $insertWaste = []; - $updateWaste = []; + $updateProduction = []; + $updateWaste = []; + + + $insertMaintenance = []; + $insertProduction = []; + $insertWaste = []; + foreach ($updateTrpProductionDetails as $data) { + $date = $this->convertToDateWithFlexibleFormats($data['Date'], ["d-m-Y", "Y-m-d", "m/d/Y", "m-d-Y"], "Y-m-d"); // Data arrays $dbDataTrpMaintenance = [ - 'date' => $date, - 'openingTime' => $data['openingTime'], - 'closingTime' => $data['closingTime'], - 'totalHours' => $data['totalHours'], - 'coldStart' => $data['coldStart'], - 'breakdownHours' => $data['breakdownHours'], - 'burnerFiringHours' => $data['burnerFiringHours'], - 'sandFeedingHours' => $data['sandFeedingHours'], - 'workingPersonEngineers' => $data['workingPersonEngineers'], - 'workingPersonSupervisiors' => $data['workingPersonSupervisiors'], - 'workingPersonOperators' => $data['workingPersonOperators'], - 'rollerDrivers' => $data['rollerDrivers'], - 'natureOfMaintenance' => $data['natureOfMaintenance'], - 'location' => $data['location'], - 'description' => $data['description'] + 'date' => $date, + 'openingTime' => $data['openingTime'], + 'closingTime' => $data['closingTime'], + 'totalHours' => $data['totalHours'], + 'coldStart' => $data['coldStart'], + 'breakdownHours' => $data['breakdownHours'], + 'burnerFiringHours' => $data['burnerFiringHours'], + 'sandFeedingHours' => $data['sandFeedingHours'], + 'workingPersonEngineers' => $data['workingPersonEngineers'], + 'workingPersonSupervisiors' => $data['workingPersonSupervisiors'], + 'workingPersonOperators' => $data['workingPersonOperators'], + 'rollerDrivers' => $data['rollerDrivers'], + 'natureOfMaintenance' => $data['natureOfMaintenance'], + 'location' => $data['location'], + 'description' => $data['description'] ]; $dbDataTrpProduction = [ - 'date' => $date, - 'gasReceiptBg' => $data['gasReceiptBg'], - 'gasReceiptPg' => $data['gasReceiptPg'], - 'physicalGasConsumption' => $data['physicalGasConsumption'], - 'trpPlusDrierGasConsumption' => $data['trpPlusDrierGasConsumption'], - 'trpPhysicalGasPerTon' => $data['trpPhysicalGasPerTon'], - 'panelGasConsumption' => $data['panelGasConsumption'], - 'panelGasPerTon' => $data['panelGasPerTon'], - 'edRunningHours' => $data['edRunningHours'], - 'edProduction' => $data['edProduction'], - 'edUsage' => $data['edUsage'], - 'trpProduction' => $data['trpProduction'], - 'trpProductionPerHour' => $data['trpProductionPerHour'], - 'waterReceipt' => $data['waterReceipt'], - 'waterConsumption' => $data['waterConsumption'], - 'ebReading' => $data['ebReading'], - 'ebReadingPerUnitTon' => $data['ebReadingPerUnitTon'], + 'date' => $date, + 'gasReceiptBg' => $data['gasReceiptBg'], + 'gasReceiptPg' => $data['gasReceiptPg'], + 'physicalGasConsumption' => $data['physicalGasConsumption'], + 'trpPlusDrierGasConsumption' => $data['trpPlusDrierGasConsumption'], + 'trpPhysicalGasPerTon' => $data['trpPhysicalGasPerTon'], + 'panelGasConsumption' => $data['panelGasConsumption'], + 'panelGasPerTon' => $data['panelGasPerTon'], + 'edRunningHours' => $data['edRunningHours'], + 'edProduction' => $data['edProduction'], + 'edUsage' => $data['edUsage'], + 'trpProduction' => $data['trpProduction'], + 'trpProductionPerHour' => $data['trpProductionPerHour'], + 'waterReceipt' => $data['waterReceipt'], + 'waterConsumption' => $data['waterConsumption'], + 'ebReading' => $data['ebReading'], + 'ebReadingPerUnitTon' => $data['ebReadingPerUnitTon'], ]; $dbDataTrpWaste = [ - 'date' => $date, - 'msSeperation' => $data['msSeperation'], - 'edWaste' => $data['edWaste'], - 'coolerBags' => $data['coolerBags'], - 'edPlus20Waste' => $data['edPlus20Waste'], - 'cycloneWaste' => $data['cycloneWaste'], + 'date' => $date, + 'msSeperation' => $data['msSeperation'], + 'edWaste' => $data['edWaste'], + 'coolerBags' => $data['coolerBags'], + 'edPlus20Waste' => $data['edPlus20Waste'], + 'cycloneWaste' => $data['cycloneWaste'], ]; // Check if data already exists - if (isset($existingMaintenanceMap[$date])) { - $dbDataTrpMaintenance['id'] = $existingMaintenanceMap[$date]['id']; + if (isset($existingMaintenanceDateList[$date])) { + + $dbDataTrpMaintenance['id'] = $existingMaintenanceDateList[$date]['id']; $updateMaintenance[] = $dbDataTrpMaintenance; + } else { + $insertMaintenance[] = $dbDataTrpMaintenance; + } - if (isset($existingProductionMap[$date])) { - $dbDataTrpProduction['id'] = $existingProductionMap[$date]['id']; + if (isset($existingProductionDateList[$date])) { + + $dbDataTrpProduction['id'] = $existingProductionDateList[$date]['id']; $updateProduction[] = $dbDataTrpProduction; + } else { $insertProduction[] = $dbDataTrpProduction; } - if (isset($existingWasteMap[$date])) { - $dbDataTrpWaste['id'] = $existingWasteMap[$date]['id']; + if (isset($existingWasteDateList[$date])) { + + $dbDataTrpWaste['id'] = $existingWasteDateList[$date]['id']; $updateWaste[] = $dbDataTrpWaste; + } else { $insertWaste[] = $dbDataTrpWaste; } @@ -3233,6 +3265,15 @@ class StockController extends BaseController $this->db->transBegin(); try { + + // dd($updateMaintenance); + // dd($updateProduction); + // dd($updateWaste); + + // dd($insertMaintenance); + // dd($insertProduction); + // dd($insertWaste); + // Insert new records in batch if (!empty($insertMaintenance)) { $this->TrpProductionMaintenance_model->insertBatch($insertMaintenance); @@ -3272,6 +3313,7 @@ class StockController extends BaseController public function updateAbstractDetails() { + $updateAbstractDetails = json_decode($this->request->getPost('updateAbstractDetails'), true); if (empty($updateAbstractDetails)) { diff --git a/app/Views/editCapitalAmendPO.php b/app/Views/editCapitalAmendPO.php index 88dd00ae..13e0ee49 100755 --- a/app/Views/editCapitalAmendPO.php +++ b/app/Views/editCapitalAmendPO.php @@ -533,7 +533,7 @@ if (!empty($POItem) && $CapitalRange == '1') {
- + *
- Select Delivery By + Select Delivery By *
- + * 'PlaceOforigin','value' => set_value('PlaceOforigin'),'id'=>'PlaceOforigin', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;'); @@ -755,7 +755,7 @@ if (!empty($POItem) && $CapitalRange == '1') {
- + *
-
--> +
-->
diff --git a/app/Views/stock/trpProductionStockDetails.php b/app/Views/stock/trpProductionStockDetails.php index 3a6d6b0e..3c944a95 100644 --- a/app/Views/stock/trpProductionStockDetails.php +++ b/app/Views/stock/trpProductionStockDetails.php @@ -151,14 +151,6 @@ text-align: center; } - .celda_encabezado_total { - background-color:#ffffff !important; - border: 1px solid #ffffff; - color: #ffffff !important; - font-weight: bold; - padding: 6px 10px; - text-align: center; - } .celda_normal { /*background-color: #fff;*/ @@ -349,6 +341,7 @@ $timeOtions[] = "12:00 AM";
+ @@ -443,7 +436,7 @@ $timeOtions[] = "12:00 AM"; - + @@ -465,7 +458,7 @@ $timeOtions[] = "12:00 AM"; - + @@ -1277,7 +1270,7 @@ $timeOtions[] = "12:00 AM"; -


+ @@ -1303,7 +1296,7 @@ $timeOtions[] = "12:00 AM"; -


+
From 9fdb85b453ec1454a404d2c2a6185bcaf4cb2d8c Mon Sep 17 00:00:00 2001 From: Gowtham M Date: Fri, 14 Mar 2025 16:53:20 +0530 Subject: [PATCH 3/6] Click issue in confic : GWM --- app/Views/editconfig.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Views/editconfig.php b/app/Views/editconfig.php index 1fa1a7cc..efdb48a1 100755 --- a/app/Views/editconfig.php +++ b/app/Views/editconfig.php @@ -167,7 +167,7 @@ if (!empty($master)) { ConfigValue ?> - +
@@ -553,7 +553,7 @@ if (!empty($master)) { //this click function is used for showing material codes in modal window , MC created using a particular configuration value - $(".config-category").click(function () { + $(document).on("click", ".config-category", function () { From 6be80b83e229ff58ff9209bca2cafc4a9f51777e Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Fri, 14 Mar 2025 17:07:15 +0530 Subject: [PATCH 4/6] changes in stock module 14-03-2025 --- app/Controllers/Configurationctrl.php | 2 +- app/Views/editconfig.php | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/app/Controllers/Configurationctrl.php b/app/Controllers/Configurationctrl.php index e98aa1f4..33b81260 100755 --- a/app/Controllers/Configurationctrl.php +++ b/app/Controllers/Configurationctrl.php @@ -116,7 +116,7 @@ class Configurationctrl extends BaseController function updateconfig() { - // dd($this->request->getPost()); + $ConfigId = $this->request->getPost('ConfigId'); $ConfigName = $this->request->getPost('ConfigName'); $Comments = $this->request->getPost('Remarks'); diff --git a/app/Views/editconfig.php b/app/Views/editconfig.php index 1fa1a7cc..e4b966ee 100755 --- a/app/Views/editconfig.php +++ b/app/Views/editconfig.php @@ -394,10 +394,8 @@ if (!empty($master)) { + + + + From 2259226a1d4ef1820060d2beb75202ebe8598a8b Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Sat, 15 Mar 2025 14:36:05 +0530 Subject: [PATCH 6/6] bug fixes in purchase module - 15-03-2025 --- app/Controllers/Emergencypurchaseorder.php | 2 ++ app/Views/alterpurchaseorder.php | 10 +++++++--- app/Views/editimportpo.php | 4 ++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/Controllers/Emergencypurchaseorder.php b/app/Controllers/Emergencypurchaseorder.php index cdf762e2..78b9e3e9 100755 --- a/app/Controllers/Emergencypurchaseorder.php +++ b/app/Controllers/Emergencypurchaseorder.php @@ -668,6 +668,8 @@ class Emergencypurchaseorder extends BaseController $getAvailableqty = $this->mrir_model->getItemQuantityFromStock(trim((string)$MaterialCode)); + $avlQty = 0; + if (count($getAvailableqty) > 0) { $avlQty = $getAvailableqty[0]['Quantity']; } diff --git a/app/Views/alterpurchaseorder.php b/app/Views/alterpurchaseorder.php index 0d9a2972..116ccd80 100755 --- a/app/Views/alterpurchaseorder.php +++ b/app/Views/alterpurchaseorder.php @@ -7511,8 +7511,8 @@ if (!empty($INRSYMBOL)) { return false; } else { // Submit the form using AJAX - $('#loader').show(); - // disableButtons(); + + $('#loader').show(); $.ajax({ url: "emergencypurchaseorder/addNewRevenuePurchaseOrder", type: "POST", @@ -7531,8 +7531,12 @@ if (!empty($INRSYMBOL)) { }, error: function (xhr, status, error) { // Handle errors - alert("Error: " + error); + alert("Error in ajax route - emergencypurchaseorder/addNewRevenuePurchaseOrder: " + error); // setTimeout(function() { enableButtons(); }, 2000); + }, + complete: function () { + console.log("Ajax request completed for route -post - emergencypurchaseorder/addNewRevenuePurchaseOrder ."); + $('#loader').hide(); } }); } diff --git a/app/Views/editimportpo.php b/app/Views/editimportpo.php index 258d06f6..a2e57dde 100755 --- a/app/Views/editimportpo.php +++ b/app/Views/editimportpo.php @@ -1297,7 +1297,7 @@ if (!empty($getlogpodtl)) { -
+
@@ -1372,7 +1372,7 @@ if (!empty($getlogpodtl)) {
-
+

ConfigValue; ?>