Added process order report in production mail
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 15s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 13s
Laravel Larastan / larastan (pull_request) Failing after 4m27s
Laravel Pint / pint (pull_request) Successful in 3m19s

This commit is contained in:
dhanabalan
2026-09-29 11:21:42 +05:30
parent f50f9b9060
commit c834831035

View File

@@ -235,7 +235,14 @@ class SendProductionReport extends Command
->whereBetween('created_at', [$startDate, $endDate])
->count();
} else {
}
if(strtolower($line->type) == 'process fg line'){
$productionQuantity = \App\Models\ProcessOrder::where('plant_id', $plant->id)
->where('line_id', $line->id)
->whereBetween('created_at', [$startDate, $endDate])
->count();
}
else {
$productionQuantity = ProductionQuantity::where('plant_id', $plant->id)
->where('line_id', $line->id)
@@ -272,6 +279,25 @@ class SendProductionReport extends Command
->count();
}
if (strtolower($line->type) == 'process fg line') {
$dayproductionQuantity = \App\Models\ProcessOrder::where('plant_id', $plant->id)
->where('line_id', $line->id)
->whereBetween('created_at', [
$startDate->copy()->setTime(8, 0, 0),
$startDate->copy()->setTime(19, 30, 0),
])
->sum('received_quantity');
$nightproductionQuantity = \App\Models\ProcessOrder::where('plant_id', $plant->id)
->where('line_id', $line->id)
->whereBetween('created_at', [
$startDate->copy()->setTime(19, 30, 0),
$endDate->copy()->setTime(8, 0, 0),
])
->sum('received_quantity');
}
$dayShiftEfficiency = $dayShiftPlanQuan > 0 ? ($dayproductionQuantity / $dayShiftPlanQuan) * 100 : 0;
$nightShiftEfficiency = $nightShiftPlanQuan > 0 ? ($nightproductionQuantity / $nightShiftPlanQuan) * 100 : 0;