From 33d5d33405192e2738e89a1d9e5d2655238f4a8a Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Fri, 6 Nov 2026 19:54:05 +0530 Subject: [PATCH] Rounded the value in produciton target livewire page --- app/Livewire/ProductionTargetPlan.php | 20 +++++++++++++------ .../livewire/production-target-plan.blade.php | 7 ++++++- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/app/Livewire/ProductionTargetPlan.php b/app/Livewire/ProductionTargetPlan.php index 99f56bae..c5965816 100644 --- a/app/Livewire/ProductionTargetPlan.php +++ b/app/Livewire/ProductionTargetPlan.php @@ -698,12 +698,18 @@ class ProductionTargetPlan extends Component foreach ($plans as $plan) { - $row = $plan->toArray(); + //$row = $plan->toArray(); + + $row['plan_quantity'] = (int) round($row['plan_quantity']); $workingDays = (int) ($row['working_days'] ?? 0); + // $normalDailyTarget = $workingDays > 0 + // ? round((float) $row['plan_quantity'] / $workingDays, 2) + // : 0; + $normalDailyTarget = $workingDays > 0 - ? round((float) $row['plan_quantity'] / $workingDays, 2) + ? (int) round((float) $row['plan_quantity'] / $workingDays) : 0; $pendingQty = 0; @@ -728,10 +734,12 @@ class ProductionTargetPlan extends Component continue; } - $todayTarget = round( - $normalDailyTarget + $pendingQty, - 2 - ); + // $todayTarget = round( + // $normalDailyTarget + $pendingQty, + // 2 + // ); + + $todayTarget = (int) round($normalDailyTarget + $pendingQty); $producedQty = $producedData[$key][$date]->total_qty ?? 0; diff --git a/resources/views/livewire/production-target-plan.blade.php b/resources/views/livewire/production-target-plan.blade.php index 46240e86..31be24d0 100644 --- a/resources/views/livewire/production-target-plan.blade.php +++ b/resources/views/livewire/production-target-plan.blade.php @@ -138,8 +138,13 @@ {{-- {{ $record['daily_hourly_quantity'][$date] ?? '-' }} --}} - + {{-- {{ $record['daily_target_dynamic'][$date] ?? '-' }} + --}} + + {{ is_numeric($record['daily_target_dynamic'][$date] ?? null) + ? number_format($record['daily_target_dynamic'][$date], 0) + : ($record['daily_target_dynamic'][$date] ?? '-') }} {{ $record['produced_quantity'][$date] ?? '-' }} -- 2.49.1