From f94040e996092df4b657e0253580de5eac0fd4e1 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Mon, 12 Oct 2026 14:34:41 +0530 Subject: [PATCH] Changed logic in production target page --- app/Filament/Pages/ProductionTarget.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/app/Filament/Pages/ProductionTarget.php b/app/Filament/Pages/ProductionTarget.php index 881730a9..aa2253db 100644 --- a/app/Filament/Pages/ProductionTarget.php +++ b/app/Filament/Pages/ProductionTarget.php @@ -159,7 +159,7 @@ class ProductionTarget extends Page $month = (int) $get('month'); $category = $get('category'); - $this->dispatch('loadData',$year, $month, $plantId, $lineId, $category); + }), ]) @@ -217,7 +217,21 @@ class ProductionTarget extends Page $lineId = $this->filters['line_id'] ?? null; $year = $this->filters['year'] ?? null; $month = (int) $this->filters['month'] ?? null; - $this->dispatch('loadData',$year, $month, $plantId, $lineId, ''); + $category = $this->filters['category'] ?? null; + if($category == '' || $category == null){ + // $this->dispatch('loadData',$year, $month, $plantId, $lineId, ''); + $this->dispatch( + 'loadData', + (int) $year, + (int) $month, + (int) $plantId, + (int) $lineId + ); + } + else{ + $this->dispatch('loadDataCategory',$year, $month, $plantId, $lineId, $category); + } + } public static function canAccess(): bool