1
0
forked from poc/pds

Merge pull request 'changed logic in item overview' (#1347) from ranjith-dev into master

Reviewed-on: poc/pds#1347
This commit is contained in:
2026-10-29 06:14:51 +00:00

View File

@@ -159,14 +159,7 @@ class ItemOverview extends ChartWidget
->whereMonth('created_at', $startDate->month)
->sum('plan_quantity');
$weeksCount = count($orderedData);
// Split the total monthly plan equally across all weeks
$weeklyPlan = $weeksCount > 0
? round($monthlyPlanQuantity / $weeksCount, 2)
: 0;
$hourlyPlan = round($weeklyPlan / 22.5, 2);
$hourlyPlan = round($monthlyPlanQuantity / 22.5, 2);
// Same hourly plan value for every hour
$planData = array_fill(0, 24, $hourlyPlan);