From 241059aca90df67c2441bafaf1503be0ad99f1de Mon Sep 17 00:00:00 2001 From: vadivelJ96 Date: Wed, 8 Jan 2025 18:55:35 +0530 Subject: [PATCH] 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 @@ + + +