Merge pull request 'changed logic in producion report for night query' (#1113) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled

Reviewed-on: #1113
This commit was merged in pull request #1113.
This commit is contained in:
2026-09-29 05:16:53 +00:00

View File

@@ -267,14 +267,14 @@ class SendProductionReport extends Command
->where('line_id', $line->id) ->where('line_id', $line->id)
->whereBetween('created_at', [ ->whereBetween('created_at', [
$startDate->copy()->setTime(19, 30, 0), $startDate->copy()->setTime(19, 30, 0),
$endDate->copy()->addDay()->setTime(8, 0, 0), $endDate->copy()->setTime(8, 0, 0),
]) ])
->count(); ->count();
} }
$dayShiftEfficiency = $dayShiftPlanQuan > 0 ? ($dayproductionQuantity / $dayShiftPlanQuan) * 100 : 0; $dayShiftEfficiency = $dayShiftPlanQuan > 0 ? ($dayproductionQuantity / $dayShiftPlanQuan) * 100 : 0;
$nightShiftEfficiency = $dayShiftPlanQuan > 0 ? ($nightproductionQuantity / $nightShiftPlanQuan) * 100 : 0; $nightShiftEfficiency = $nightShiftPlanQuan > 0 ? ($nightproductionQuantity / $nightShiftPlanQuan) * 100 : 0;
$efficiency = round($efficiency, 2); $efficiency = round($efficiency, 2);