Merge pull request 'Added leak test line type in production report' (#1416) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 24s
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 24s
Reviewed-on: #1416
This commit was merged in pull request #1416.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user