Corrected bug in process order report page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 14s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 14s
Laravel Pint / pint (pull_request) Successful in 4m31s
Laravel Larastan / larastan (pull_request) Failing after 6m5s

This commit is contained in:
dhanabalan
2026-11-18 12:20:24 +05:30
parent 161822dbef
commit 9111eecff2

View File

@@ -180,31 +180,15 @@ class ProcessOrderChart extends ChartWidget
") ")
->first(); ->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');
return [ return [
'datasets' => [ 'datasets' => [
[ [
'label' => 'Quantity', 'label' => 'Quantity',
'data' => [ 'data' => [
// (int) ($totalOrderQuantity ?? 0),
(int) ($records->ok_count ?? 0), (int) ($records->ok_count ?? 0),
(int) ($records->not_ok_count ?? 0), (int) ($records->not_ok_count ?? 0),
], ],
'backgroundColor' => [ 'backgroundColor' => [
// '#3B82F6',
'#16A34A', '#16A34A',
'#DC2626', '#DC2626',
], ],
@@ -278,8 +262,8 @@ class ProcessOrderChart extends ChartWidget
return [ return [
'today' => 'Today', 'today' => 'Today',
'yesterday' => 'Yesterday', 'yesterday' => 'Yesterday',
'week' => 'This Week', 'this_week' => 'This Week',
'month' => 'This Month', 'this_month' => 'This Month',
]; ];
} }
} }