From bf3bb5f9faa8a7a324c76d02dbceaf94389022da Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Wed, 30 Sep 2026 14:22:52 +0530 Subject: [PATCH 1/2] commented monthly plan logic in production target plan --- app/Filament/Pages/ProductionTarget.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Filament/Pages/ProductionTarget.php b/app/Filament/Pages/ProductionTarget.php index ca8c7a31..f53dce26 100644 --- a/app/Filament/Pages/ProductionTarget.php +++ b/app/Filament/Pages/ProductionTarget.php @@ -209,7 +209,7 @@ class ProductionTarget extends Page $this->dispatch('loadData1' ,$plantId, $lineId, $year, $month); - $this->dispatch('loadDataMonthly' ,$plantId, $lineId, $year, $month); + // $this->dispatch('loadDataMonthly' ,$plantId, $lineId, $year, $month); } public static function canAccess(): bool -- 2.49.1 From 53e14b5c48ac901f6b5b85d42cd3ccbc2c38d28a Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Wed, 30 Sep 2026 14:26:07 +0530 Subject: [PATCH 2/2] Changed logic in production target plan --- app/Livewire/ProductionTargetPlan.php | 12 +++++++++--- .../views/livewire/production-target-plan.blade.php | 7 +------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/Livewire/ProductionTargetPlan.php b/app/Livewire/ProductionTargetPlan.php index 9feb4a99..56c62746 100644 --- a/app/Livewire/ProductionTargetPlan.php +++ b/app/Livewire/ProductionTargetPlan.php @@ -626,16 +626,22 @@ class ProductionTargetPlan extends Component } $this->records = $records; - } - public function loadMonthlyPlan($year, $month, $plantId, $lineId){ - return ProductionPlan::where('plant_id', $plantId) + $this->monthlyRecords = ProductionPlan::where('plant_id', $plantId) ->where('line_id', $lineId) ->whereYear('created_at', $year) ->whereMonth('created_at', $month) ->sum('plan_quantity'); } + // public function loadMonthlyPlan($year, $month, $plantId, $lineId){ + // $this->monthlyRecords = ProductionPlan::where('plant_id', $plantId) + // ->where('line_id', $lineId) + // ->whereYear('created_at', $year) + // ->whereMonth('created_at', $month) + // ->sum('plan_quantity'); + // } + public function exportProductionData() { diff --git a/resources/views/livewire/production-target-plan.blade.php b/resources/views/livewire/production-target-plan.blade.php index 0d928d84..586ecc79 100644 --- a/resources/views/livewire/production-target-plan.blade.php +++ b/resources/views/livewire/production-target-plan.blade.php @@ -35,12 +35,7 @@ - {{ $this->loadMonthlyPlan( - $year, - $month, - $record['plant_id'], - $record['line_id'] - ) }} + {{ $monthlyRecords ?? 0 }} -- 2.49.1