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
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:
@@ -159,7 +159,15 @@ class ItemOverview extends ChartWidget
|
||||
->whereMonth('created_at', $startDate->month)
|
||||
->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
|
||||
$planData = array_fill(0, 24, $hourlyPlan);
|
||||
|
||||
Reference in New Issue
Block a user