Added this week plan data filter logic in production dashboard
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 17s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 20s
Laravel Pint / pint (pull_request) Successful in 4m33s
Laravel Larastan / larastan (pull_request) Failing after 5m12s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 17s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 20s
Laravel Pint / pint (pull_request) Successful in 4m33s
Laravel Larastan / larastan (pull_request) Failing after 5m12s
This commit is contained in:
@@ -181,6 +181,28 @@ class ItemOverview extends ChartWidget
|
||||
$weeksCount,
|
||||
$weeklyPlan
|
||||
);
|
||||
}
|
||||
elseif ($activeFilter === 'this_week') {
|
||||
$weeklyPlanQuantity = \DB::table('production_plans')
|
||||
->where('plant_id', $selectedPlant)
|
||||
->where('line_id', $selectedLine)
|
||||
->whereBetween('created_at', [
|
||||
$startDate,
|
||||
$endDate
|
||||
])
|
||||
->sum('plan_quantity');
|
||||
|
||||
$daysCount = count($orderedData);
|
||||
|
||||
$dailyPlan = $daysCount > 0
|
||||
? round($weeklyPlanQuantity / $daysCount, 2)
|
||||
: 0;
|
||||
|
||||
$planData = array_fill(
|
||||
0,
|
||||
$daysCount,
|
||||
$dailyPlan
|
||||
);
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user