From 61320dfae878847e30d4e6a75d49766ef84d1764 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Thu, 10 Jul 2025 17:06:59 +0530 Subject: [PATCH] issue solved for production pln in production report --- app/Console/Commands/SendProductionReport.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/Console/Commands/SendProductionReport.php b/app/Console/Commands/SendProductionReport.php index c5b24a5..2102fab 100644 --- a/app/Console/Commands/SendProductionReport.php +++ b/app/Console/Commands/SendProductionReport.php @@ -124,6 +124,9 @@ class SendProductionReport extends Command $startDate = now()->setTime(8, 0, 0); $endDate = now()->copy()->addDay()->setTime(8, 0, 0); + $PlanstartDate = now()->setTime(8, 0, 0); + $planendDate = now()->copy()->addDay()->setTime(7, 59, 00); + $tableData = []; $no = 1; @@ -133,7 +136,7 @@ class SendProductionReport extends Command $targetQuantity = ProductionPlan::where('plant_id', $plantId) ->where('line_id', $lineId) - ->whereBetween('created_at', [$startDate, $endDate]) + ->whereBetween('created_at', [$PlanstartDate, $planendDate]) ->sum('plan_quantity'); $productionQuantity = ProductionQuantity::where('plant_id', $plantId) @@ -150,10 +153,10 @@ class SendProductionReport extends Command ]; } - // $this->table( - // ['No', 'Plant', 'Line', 'Target Quantity', 'Production Quantity'], - // $tableData - // ); + $this->table( + ['No', 'Plant', 'Line', 'Target Quantity', 'Production Quantity'], + $tableData + ); if (!empty($emails)) { foreach ($emails as $email) {