From 658354498d333555eefb40596c85878e53aa7f66 Mon Sep 17 00:00:00 2001 From: vadivel J Date: Fri, 8 Nov 2024 12:17:04 +0530 Subject: [PATCH 01/12] changes in stock module -vadivel J --- app/Views/bagStockDetails.php | 10 ++++++++++ app/Views/dustAndRoughStockDetails.php | 10 ++++++++++ app/Views/resinStockDetails.php | 10 ++++++++++ 3 files changed, 30 insertions(+) diff --git a/app/Views/bagStockDetails.php b/app/Views/bagStockDetails.php index 6a9787dd..c7ab9691 100644 --- a/app/Views/bagStockDetails.php +++ b/app/Views/bagStockDetails.php @@ -156,6 +156,16 @@ height: 20px; } + #bagStockDetailsTableId th:nth-child(1), + #bagStockDetailsTableId td:nth-child(1) { + position: sticky; + left: 0; + background-color: #00a65a; + z-index: 2; + border-right: 2px solid #ddd; + color: #ffffff; + } + .modal { padding-right: 30% ! important; } diff --git a/app/Views/dustAndRoughStockDetails.php b/app/Views/dustAndRoughStockDetails.php index 139f5370..814d488d 100644 --- a/app/Views/dustAndRoughStockDetails.php +++ b/app/Views/dustAndRoughStockDetails.php @@ -156,6 +156,16 @@ height: 20px; } + #dustAndRoughStockDetailsTableId th:nth-child(1), + #dustAndRoughStockDetailsTableId td:nth-child(1) { + position: sticky; + left: 0; + background-color: #00a65a; + z-index: 2; + border-right: 2px solid #ddd; + color: #ffffff; + } + .modal { padding-right: 30% ! important; } diff --git a/app/Views/resinStockDetails.php b/app/Views/resinStockDetails.php index 32b1ab44..9902ea0b 100644 --- a/app/Views/resinStockDetails.php +++ b/app/Views/resinStockDetails.php @@ -156,6 +156,16 @@ height: 20px; } + #resinStockDetailsTableId th:nth-child(1), + #resinStockDetailsTableId td:nth-child(1) { + position: sticky; + left: 0; + background-color: #00a65a; + z-index: 2; + border-right: 2px solid #ddd; + color: #ffffff; + } + .modal { padding-right: 30% ! important; } From c55cd0dfa3944f4c92f747c6045910bad57aad09 Mon Sep 17 00:00:00 2001 From: vadivel J Date: Fri, 8 Nov 2024 13:48:36 +0530 Subject: [PATCH 02/12] changes in stock -vadivel J --- app/Views/CoatingMachineDetail.php | 32 ------------------------- app/Views/incomingSilicaSandDetails.php | 10 +++++++- 2 files changed, 9 insertions(+), 33 deletions(-) diff --git a/app/Views/CoatingMachineDetail.php b/app/Views/CoatingMachineDetail.php index eaaf54c8..9e655b67 100644 --- a/app/Views/CoatingMachineDetail.php +++ b/app/Views/CoatingMachineDetail.php @@ -559,39 +559,7 @@ - + + + + + + + + diff --git a/app/Views/includes/new_header.php b/app/Views/includes/new_header.php index d7651d78..722c4c32 100755 --- a/app/Views/includes/new_header.php +++ b/app/Views/includes/new_header.php @@ -773,16 +773,18 @@ Coating Machine Details + Gas Stock Details + Diesel - Factory Vehicle Power Consumption - Bag Stock Details - Dust And Rough Stock Details Resin Stock Details + Bag Stock Details + From b79e3b0f3d82c7afbd03214a77b3f28ca11ee6e9 Mon Sep 17 00:00:00 2001 From: vadivel J Date: Tue, 12 Nov 2024 11:16:26 +0530 Subject: [PATCH 09/12] changes in stock module-1 12/11/024 -vadivel j --- app/Views/gasStockDetails.php | 82 +++++++++++++++++++++++++++++------ 1 file changed, 69 insertions(+), 13 deletions(-) diff --git a/app/Views/gasStockDetails.php b/app/Views/gasStockDetails.php index afff7556..6fc6ecbe 100644 --- a/app/Views/gasStockDetails.php +++ b/app/Views/gasStockDetails.php @@ -156,8 +156,9 @@ height: 20px; } - #bagStockDetailsTableId th:nth-child(1), - #bagStockDetailsTableId td:nth-child(1) { + #gasStockDetailsTableId th:nth-child(1), + #gasStockDetailsTableId td:nth-child(1), + { position: sticky; left: 0; background-color: #00a65a; @@ -220,19 +221,16 @@
- +
- - + - + + - - - - + @@ -243,8 +241,6 @@ - - @@ -269,8 +265,68 @@ + $gasStockDetail){ + ?> + + + + + + + + + + + + + + + + + modify('first day of this month')->format('Y-m-d'); + $endDate = $date->modify('last day of this month')->format('Y-m-d'); + + $datesInMonth = []; + + + $period = new DatePeriod( + new DateTime($startDate), + new DateInterval('P1D'), + (new DateTime($endDate))->modify('+1 day') + ); + + foreach ($period as $day) { + $datesInMonth[] = $day->format('Y-m-d'); + } + + foreach ($datesInMonth as $datesInMonthIndex => $dateInMonth) { + + + ?> + + + + + + + + + + + + + + + + +
RIPL
SEP- GAS CONSUMPTION-422 & 425 kg
RIPL
Gas Stock Trp Machine Sand TRP Rotary Drier
From d3fdd57fda8b56c41b6dbec8e5ffb431dd1e64b8 Mon Sep 17 00:00:00 2001 From: vadivel J Date: Wed, 13 Nov 2024 10:13:55 +0530 Subject: [PATCH 10/12] changes in gas stock module -vadivel J --- app/Controllers/StockController.php | 59 ++++++- app/Views/gasStockDetails.php | 246 ++++++++++++++++------------ app/Views/includes/new_header.php | 2 +- 3 files changed, 203 insertions(+), 104 deletions(-) diff --git a/app/Controllers/StockController.php b/app/Controllers/StockController.php index e0ea480b..b624935c 100644 --- a/app/Controllers/StockController.php +++ b/app/Controllers/StockController.php @@ -769,7 +769,7 @@ class StockController extends BaseController SUM(totalGasconsumption) AS coatingMachineGasconsumption, SUM(totalCoatingSandInKg) / 1000 AS coatedSand FROM t_coatingMachineDetails - WHERE is_active = 1 + WHERE is_active = 1 AND date >= ' . $this->db->escape($startDate) . ' AND date <= ' . $this->db->escape($endDate) . ' GROUP BY date @@ -797,7 +797,62 @@ class StockController extends BaseController } public function updateGasStockDetails(){ - echo "welcome to update Gas Stock Details"; + + $postData = $this->request->getPost(); + + $updateGasStockDetailsData = json_decode($postData['updateGasStockDetails'], true); + + $updates = []; + + $inserts = []; + + foreach($updateGasStockDetailsData as $data){ + + $date = $data['date']; + + + $dbData = [ + 'date' =>$data['date'], + 'opening' =>$data['opening'], + 'purchaseBharath' =>$data['purchaseBharath'], + 'purchaseIndian' =>$data['purchaseIndian'], + 'total' =>$data['total'], + 'consumption' =>$data['consumption'], + 'balanceStock' =>$data['balanceStock'], + ]; + + $resultExists = $this->gasStockDetails_model + ->where('date',$date) + ->first(); + + + if(empty($resultExists)){ + $inserts[] = $dbData; + }else{ + $dbData['id']=$resultExists['id']; + $updates[] = $dbData ; + } + + } + + + if (!empty($inserts)) { + $this->gasStockDetails_model->insertBatch($inserts); + } + + if (!empty($updates)) { + + $updateResult = $this->gasStockDetails_model->updateBatch($updates, 'id'); + + if ($updateResult === FALSE) { + echo "Error during update"; + } else { + echo "Data Updated Successfully"; + return; + } + } + + echo "Data Saved Successfully"; } diff --git a/app/Views/gasStockDetails.php b/app/Views/gasStockDetails.php index 6fc6ecbe..88803b65 100644 --- a/app/Views/gasStockDetails.php +++ b/app/Views/gasStockDetails.php @@ -267,22 +267,44 @@ $gasStockDetail){ + + $date = Datetime::createFromFormat('Y-m-d',$gasStockDetail['date'])->format('d-m-Y') ?> - - - - - - - - + + + + + oninput="openingStockChange(this)" + data-id="" + > + + + + + + + + - - - - + + + + $dateInMonth) { - + $dateInMonthDmYFormat = Datetime::createFromFormat('Y-m-d',$dateInMonth)->format('d-m-Y') ?> - - - - - - - - - - - - - - - + + + + + oninput="openingStockChange(this)" + data-id="" + >0 + 0 + + 0 + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 @@ -364,7 +405,7 @@ //table to json function - var updateBagStockDetails = tableToJson(); + var updateGasStockDetails = tableToJson(); alert('Updation may take a while, And we appreciate your patience..!!'); @@ -372,10 +413,10 @@ $('#loader').show(); $.ajax({ data: { - updateBagStockDetails + updateGasStockDetails }, type: "POST", - url: "updateBagStockDetails", + url: "updateGasStockDetails", success: function (data) { if (data) { @@ -406,32 +447,27 @@ diff --git a/app/Views/includes/new_header.php b/app/Views/includes/new_header.php index 722c4c32..f9909118 100755 --- a/app/Views/includes/new_header.php +++ b/app/Views/includes/new_header.php @@ -767,7 +767,7 @@ - - +
@@ -354,7 +353,7 @@ >0 0 + contenteditable="true">0 0 @@ -423,6 +422,7 @@ $('#loader').hide(); console.log(data); alert(data); + window.location.reload(); } }, From ffff9c53c0e74e5d523a881ecedd1c3515972bef Mon Sep 17 00:00:00 2001 From: vadivel J Date: Wed, 13 Nov 2024 17:53:50 +0530 Subject: [PATCH 12/12] changes in stock module-2 13/11/024 -vadivel j --- app/Controllers/StockController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Controllers/StockController.php b/app/Controllers/StockController.php index a18b3c3e..51e5b359 100644 --- a/app/Controllers/StockController.php +++ b/app/Controllers/StockController.php @@ -859,7 +859,7 @@ class StockController extends BaseController private function updateGasStockConsumption($date , $consumption){ - echo"$date"; + $resultExists = $this->gasStockDetails_model ->where('date',$date)