1
0
forked from poc/pds

Added this week plan data filter logic in production dashboard

This commit is contained in:
dhanabalan
2026-10-29 10:37:57 +05:30
parent 8cf3516094
commit 92beb31874

View File

@@ -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 {