From 5bf7783313ebc6d32e4b1a8d3b53f18c5790d4ff Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Tue, 24 Dec 2024 14:31:44 +0530 Subject: [PATCH] stock module-1 vadivel J 24-12-2024 --- app/Controllers/StockController.php | 3 +- app/Views/drierMachineDetails.php | 94 +++++++++++++++++++++++------ 2 files changed, 75 insertions(+), 22 deletions(-) diff --git a/app/Controllers/StockController.php b/app/Controllers/StockController.php index cb31f1e9..52678f66 100644 --- a/app/Controllers/StockController.php +++ b/app/Controllers/StockController.php @@ -1322,8 +1322,7 @@ class StockController extends BaseController $consumption = $row['Tot Gas Consumption']; $dateToBeInserted = $data['date']; $this->updateGasStockConsumption($dateToBeInserted, $consumption); - - + $inserts[] = $data; } diff --git a/app/Views/drierMachineDetails.php b/app/Views/drierMachineDetails.php index 6ad5fcca..ce18fbed 100644 --- a/app/Views/drierMachineDetails.php +++ b/app/Views/drierMachineDetails.php @@ -447,34 +447,58 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y'); - - +
- + @@ -621,17 +645,22 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y'); var alldata = $("#drierTable").tableToJSON(); - $('#drierTable tbody tr').each(function(index) { + console.log('alldata', alldata); + $('#drierTable tbody tr:visible').each(function(index) { + + if (alldata[index]) { let row = alldata[index]; // Get the selected values from dropdowns row['Drier On Time'] = $(this).find('.drier_on_time').val(); row['Drier Off Time'] = $(this).find('.drier_off_time').val(); row['Supplier Name'] = $(this).find('.supplier_name').val(); + } + }); - + alldata = JSON.stringify(alldata); @@ -911,7 +940,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');