From 241059aca90df67c2441bafaf1503be0ad99f1de Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Wed, 8 Jan 2025 18:55:35 +0530 Subject: [PATCH 1/3] stock module latest today vadivel J 08-1-2025 --- app/Controllers/StockController.php | 2 +- app/Views/trpProductionStockDetails.php | 100 +++++++++++++++++++++--- 2 files changed, 90 insertions(+), 12 deletions(-) diff --git a/app/Controllers/StockController.php b/app/Controllers/StockController.php index 3ae75a20..4ddd8682 100644 --- a/app/Controllers/StockController.php +++ b/app/Controllers/StockController.php @@ -1321,7 +1321,7 @@ class StockController extends BaseController $data['month'] = $formattedDate; - // return $this->response->setJSON($data); + //return $this->response->setJSON($data); return $this->loadViews("trpProductionStockDetails", $this->global, $data, NULL); diff --git a/app/Views/trpProductionStockDetails.php b/app/Views/trpProductionStockDetails.php index f1a0ad0d..9844d960 100644 --- a/app/Views/trpProductionStockDetails.php +++ b/app/Views/trpProductionStockDetails.php @@ -1126,8 +1126,6 @@ let tr = $(tdElement).closest('tr'); - let openingTime = tr.find('td:eq(1)').text().trim(); - let closingTime = tr.find('td:eq(2)').text().trim(); let totalHours = tr.find('td:eq(3)').text().trim(); let coldStart = tr.find('td:eq(4)').text().trim(); let breakdownHours = tr.find('td:eq(5)').text().trim(); @@ -1154,6 +1152,19 @@ let ebReading = tr.find('td:eq(37)').text().trim(); let ebReadingPerUnitTon = tr.find('td:eq(38)').text().trim(); + + + + + let result = sandFeedingHours(totalHours,coldStart,breakdownHours,burnerFiringHours); + + sandFeedingHours = result[0]; + + burnerFiringHours = result[1]; + + + + @@ -1184,7 +1195,6 @@ $('.timeDropdown').change( function(){ - console.log("working") var tr = $(this).closest('tr'); @@ -1202,16 +1212,27 @@ } // Calculate the difference in milliseconds - const diffInMs = endDate - startDate; + const totalDiffInMs = endDate - startDate; - // Convert milliseconds to hours and minutes - const hours = Math.floor(diffInMs / (1000 * 60 * 60)); - const minutes = Math.floor((diffInMs % (1000 * 60 * 60)) / (1000 * 60)); + // Convert milliseconds to hours and minutes 3,600,000 + const hours = parseInt(totalDiffInMs / (1000 * 60 * 60)); - const totalHours = hours + (minutes / 60); + const hoursInMilliSeconds = hours * 60 * 60 * 1000; + + const minutesInMilliseconds = totalDiffInMs - hoursInMilliSeconds; + + const minutes = parseInt(minutesInMilliseconds / (1000 * 60)); + + const totalHours = hours +"."+ minutes; tr.find('td:eq(3)').text(totalHours); + + trpStockChange(this); + + + + } @@ -1220,10 +1241,7 @@ ); }) - - console.log("working") - function convertTo24Hour(time) { const [timePart, modifier] = time.split(" "); @@ -1247,6 +1265,66 @@ + + + From 50f425d464e3e4674b9afe9049bab94c65e6facc Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Thu, 9 Jan 2025 10:05:23 +0530 Subject: [PATCH 2/3] stock module latest today vadivel J 08-1-2025 --- app/Views/trpProductionStockDetails.php | 47 +++++++++++++++++++++---- 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/app/Views/trpProductionStockDetails.php b/app/Views/trpProductionStockDetails.php index 9844d960..bc8b8f9b 100644 --- a/app/Views/trpProductionStockDetails.php +++ b/app/Views/trpProductionStockDetails.php @@ -1162,15 +1162,40 @@ burnerFiringHours = result[1]; + trpPlusDrierGasConsumption = parseInt( parseFloat(physicalGasConsumption) - + ( parseFloat(drierGasConsumption) + parseFloat(coatingGasConsumption) ) ); + trpPhysicalGasPerTon = parseFloat(trpPlusDrierGasConsumption) / (parseFloat(trpProduction)/1000) ; + panelGasPerTon = parseFloat(panelGasConsumption) / (parseFloat(trpProduction)/1000) ; - + trpProductionPerHour = parseFloat(trpProduction) / parseFloat(sandFeedingHours) ; + ebReadingPerUnitTon = parseFloat(ebReading) / (parseFloat(trpProduction)/1000) ; + + + + + + // Final updation of value into td + + tr.find('td:eq(7)').text(sandFeedingHours); + + tr.find('td:eq(6)').text(burnerFiringHours); + + tr.find('td:eq(13)').text(trpPlusDrierGasConsumption); + + tr.find('td:eq(14)').text(trpPhysicalGasPerTon); + + tr.find('td:eq(15)').text(panelGasPerTon); + + tr.find('td:eq(28)').text(trpProductionPerHour); + + tr.find('td:eq(38)').text(ebReadingPerUnitTon); + + - - } catch(error){ @@ -1267,12 +1292,22 @@