Added leak test line type in production report #1416

Merged
jothi merged 1 commits from ranjith-dev into master 2026-11-14 05:32:40 +00:00
Showing only changes of commit 6b64a5f85d - Show all commits

View File

@@ -297,6 +297,11 @@ class SendProductionReport extends Command
->whereBetween('created_at', [$startDate, $endDate])
->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 {
$productionQuantity = ProductionQuantity::where('plant_id', $plant->id)
@@ -369,6 +374,23 @@ class SendProductionReport extends Command
->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;
$nightShiftEfficiency = $nightShiftPlanQuan > 0 ? ($nightproductionQuantity / $nightShiftPlanQuan) * 100 : 0;