From 6b64a5f85da2e49a6b1306a5da4c0e40e8e2fbaf Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Sat, 14 Nov 2026 11:02:19 +0530 Subject: [PATCH] Added leak test line type in production report --- app/Console/Commands/SendProductionReport.php | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/app/Console/Commands/SendProductionReport.php b/app/Console/Commands/SendProductionReport.php index ec1b839b..1de66463 100644 --- a/app/Console/Commands/SendProductionReport.php +++ b/app/Console/Commands/SendProductionReport.php @@ -297,6 +297,11 @@ class SendProductionReport extends Command ->whereBetween('created_at', [$startDate, $endDate]) ->sum('received_quantity'); } + else if(strtolower($line->type) == 'base fg leak test line'){ + $productionQuantity = \App\Models\LeakTestReading::where('plant_id', $plant->id) + ->whereBetween('created_at', [$startDate, $endDate]) + ->count(); + } else { $productionQuantity = ProductionQuantity::where('plant_id', $plant->id) @@ -369,6 +374,23 @@ class SendProductionReport extends Command ->sum('received_quantity'); } + if (strtolower($line->type) == 'base fg leak test line') { + + $dayproductionQuantity = \App\Models\LeakTestReading::where('plant_id', $plant->id) + ->whereBetween('created_at', [ + $startDate->copy()->setTime(8, 0, 0), + $startDate->copy()->setTime(19, 30, 0), + ]) + ->count(); + + $nightproductionQuantity = \App\Models\LeakTestReading::where('plant_id', $plant->id) + ->whereBetween('created_at', [ + $startDate->copy()->setTime(19, 30, 0), + $endDate->copy()->setTime(8, 0, 0), + ]) + ->count(); + } + $dayShiftEfficiency = $dayShiftPlanQuan > 0 ? ($dayproductionQuantity / $dayShiftPlanQuan) * 100 : 0; $nightShiftEfficiency = $nightShiftPlanQuan > 0 ? ($nightproductionQuantity / $nightShiftPlanQuan) * 100 : 0; -- 2.49.1