From 161822dbef0afd02fb824f40929d6cd3d6fe3e18 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Wed, 18 Nov 2026 12:13:20 +0530 Subject: [PATCH] changed logic in process order report --- app/Filament/Widgets/ProcessOrderChart.php | 32 +++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/app/Filament/Widgets/ProcessOrderChart.php b/app/Filament/Widgets/ProcessOrderChart.php index 7f7a5a9c..8906bd53 100644 --- a/app/Filament/Widgets/ProcessOrderChart.php +++ b/app/Filament/Widgets/ProcessOrderChart.php @@ -180,37 +180,37 @@ class ProcessOrderChart extends ChartWidget ") ->first(); - $totalOrderQuantity = DB::table('process_orders') - ->where('plant_id', $selectedPlant) - ->where('line_id', $selectedLine) - ->whereIn('process_order', function ($query) use ($selectedPlant, $selectedLine) { - $query->select('process_order') - ->from('characteristic_values') - ->where('plant_id', $selectedPlant) - ->where('line_id', $selectedLine) - ->distinct(); - }) - ->where('created_at', '>=', $startDate) - ->where('created_at', '<', $endDate) - ->sum('order_quantity'); + // $totalOrderQuantity = DB::table('process_orders') + // ->where('plant_id', $selectedPlant) + // ->where('line_id', $selectedLine) + // ->whereIn('process_order', function ($query) use ($selectedPlant, $selectedLine) { + // $query->select('process_order') + // ->from('characteristic_values') + // ->where('plant_id', $selectedPlant) + // ->where('line_id', $selectedLine) + // ->distinct(); + // }) + // ->where('created_at', '>=', $startDate) + // ->where('created_at', '<', $endDate) + // ->sum('order_quantity'); return [ 'datasets' => [ [ 'label' => 'Quantity', 'data' => [ - (int) ($totalOrderQuantity ?? 0), + // (int) ($totalOrderQuantity ?? 0), (int) ($records->ok_count ?? 0), (int) ($records->not_ok_count ?? 0), ], 'backgroundColor' => [ - '#3B82F6', + // '#3B82F6', '#16A34A', '#DC2626', ], ], ], - 'labels' => ['Order Quantity', 'OK', 'Not OK'], + 'labels' => ['OK', 'Not OK'], ]; } -- 2.49.1