1
0
forked from poc/pds

changed logic in item overview for verification

This commit is contained in:
dhanabalan
2026-10-29 11:49:04 +05:30
parent 1799cd8d9d
commit 294a96fa74

View File

@@ -159,7 +159,15 @@ class ItemOverview extends ChartWidget
->whereMonth('created_at', $startDate->month) ->whereMonth('created_at', $startDate->month)
->sum('plan_quantity'); ->sum('plan_quantity');
$hourlyPlan = round($monthlyPlanQuantity / 22.5, 2); // Calculate daily target directly
$weeksCount = (int) ceil($startDate->daysInMonth / 7);
$dailyPlan = $weeksCount > 0
? round($monthlyPlanQuantity / ($weeksCount * 7), 2)
: 0;
// Calculate hourly target
$hourlyPlan = round($dailyPlan / 22.5, 2);
// Same hourly plan value for every hour // Same hourly plan value for every hour
$planData = array_fill(0, 24, $hourlyPlan); $planData = array_fill(0, 24, $hourlyPlan);