changed logic in item overview for verification
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Gemini PR Review / Gemini PR Review (pull_request) Failing after 16s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Laravel Pint / pint (pull_request) Successful in 2m49s
Laravel Larastan / larastan (pull_request) Failing after 5m52s

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);