Added leak test line type in production report
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 18s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 17s
Laravel Pint / pint (pull_request) Successful in 5m0s
Laravel Larastan / larastan (pull_request) Failing after 6m2s

This commit is contained in:
dhanabalan
2026-11-14 11:02:19 +05:30
parent c2ba68c302
commit 6b64a5f85d

View File

@@ -297,6 +297,11 @@ class SendProductionReport extends Command
->whereBetween('created_at', [$startDate, $endDate]) ->whereBetween('created_at', [$startDate, $endDate])
->sum('received_quantity'); ->sum('received_quantity');
} }
else if(strtolower($line->type) == 'base fg leak test line'){
$productionQuantity = \App\Models\LeakTestReading::where('plant_id', $plant->id)
->whereBetween('created_at', [$startDate, $endDate])
->count();
}
else { else {
$productionQuantity = ProductionQuantity::where('plant_id', $plant->id) $productionQuantity = ProductionQuantity::where('plant_id', $plant->id)
@@ -369,6 +374,23 @@ class SendProductionReport extends Command
->sum('received_quantity'); ->sum('received_quantity');
} }
if (strtolower($line->type) == 'base fg leak test line') {
$dayproductionQuantity = \App\Models\LeakTestReading::where('plant_id', $plant->id)
->whereBetween('created_at', [
$startDate->copy()->setTime(8, 0, 0),
$startDate->copy()->setTime(19, 30, 0),
])
->count();
$nightproductionQuantity = \App\Models\LeakTestReading::where('plant_id', $plant->id)
->whereBetween('created_at', [
$startDate->copy()->setTime(19, 30, 0),
$endDate->copy()->setTime(8, 0, 0),
])
->count();
}
$dayShiftEfficiency = $dayShiftPlanQuan > 0 ? ($dayproductionQuantity / $dayShiftPlanQuan) * 100 : 0; $dayShiftEfficiency = $dayShiftPlanQuan > 0 ? ($dayproductionQuantity / $dayShiftPlanQuan) * 100 : 0;
$nightShiftEfficiency = $nightShiftPlanQuan > 0 ? ($nightproductionQuantity / $nightShiftPlanQuan) * 100 : 0; $nightShiftEfficiency = $nightShiftPlanQuan > 0 ? ($nightproductionQuantity / $nightShiftPlanQuan) * 100 : 0;