changed logic in item overview for verification #1348
@@ -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