From 4d89c27a3b7a3511bbe6116fbaaa3e1b39acdb51 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Thu, 26 Feb 2026 17:20:55 +0530 Subject: [PATCH] Added hourly quantity logic in production target plan livewire table --- app/Livewire/ProductionTargetPlan.php | 11 ++++++----- .../views/livewire/production-target-plan.blade.php | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/Livewire/ProductionTargetPlan.php b/app/Livewire/ProductionTargetPlan.php index 8cc2a5c..8c30690 100644 --- a/app/Livewire/ProductionTargetPlan.php +++ b/app/Livewire/ProductionTargetPlan.php @@ -209,8 +209,9 @@ class ProductionTargetPlan extends Component 'items.code as item_code', 'items.category as category', 'items.description as item_description', + 'items.hourly_quantity as hourly_quantity', 'lines.name as line_name', - 'lines.line_capacity as line_capacity', + // 'lines.line_capacity as line_capacity', 'plants.name as plant_name' ) ->get(); @@ -257,10 +258,10 @@ class ProductionTargetPlan extends Component $remainingDays = (int) ($row['working_days'] ?? 0); $lineCapacity = (float) ($row['line_capacity'] ?? 0); - $dailyLineCapacity = (float) ($row['line_capacity'] ?? 0); + $dailyHourlyQuantity = (float) ($row['hourly_quantity'] ?? 0); $row['category'] = $row['category'] ?? '-'; - $row['daily_line_capacity'] = []; + $row['daily_hourly_quantity'] = []; $row['daily_target_dynamic'] = []; $row['produced_quantity'] = []; @@ -270,7 +271,7 @@ class ProductionTargetPlan extends Component // Skip leave dates fast if (isset($leaveDates) && in_array($date, $leaveDates)) { - $row['daily_line_capacity'][$date] = '-'; + $row['daily_hourly_quantity'][$date] = '-'; $row['daily_target_dynamic'][$date] = '-'; $row['produced_quantity'][$date] = '-'; continue; @@ -284,7 +285,7 @@ class ProductionTargetPlan extends Component $row['daily_target_dynamic'][$date] = $todayTarget; $row['produced_quantity'][$date] = $producedQty; - $row['daily_line_capacity'][$date] = $dailyLineCapacity; + $row['daily_hourly_quantity'][$date] = $dailyHourlyQuantity * 22.5; // Carry forward remaining qty $remainingQty = max(0, $remainingQty - $producedQty); diff --git a/resources/views/livewire/production-target-plan.blade.php b/resources/views/livewire/production-target-plan.blade.php index 05a6271..a2b8a84 100644 --- a/resources/views/livewire/production-target-plan.blade.php +++ b/resources/views/livewire/production-target-plan.blade.php @@ -28,7 +28,7 @@ @foreach($dates as $date) - Line Capacity + Item Quantity Target Plan Produced Quantity @@ -61,7 +61,7 @@ @else {{-- {{ $record['daily_target'] ?? '-' }} --}} - {{ $record['daily_line_capacity'][$date] ?? '-' }} + {{ $record['daily_hourly_quantity'][$date] ?? '-' }} {{ $record['daily_target_dynamic'][$date] ?? '-' }} -- 2.49.1