Merge pull request 'Added logic for day and night production quantity in send production report' (#1437) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Reviewed-on: #1437
This commit was merged in pull request #1437.
This commit is contained in:
@@ -326,7 +326,7 @@ class SendProductionReport extends Command
|
|||||||
->whereBetween('created_at', [$startDate, $endDate])
|
->whereBetween('created_at', [$startDate, $endDate])
|
||||||
->count();
|
->count();
|
||||||
}
|
}
|
||||||
else {
|
else if(strtolower($line->type) == 'base fg line'){
|
||||||
|
|
||||||
$productionQuantity = ProductionQuantity::where('plant_id', $plant->id)
|
$productionQuantity = ProductionQuantity::where('plant_id', $plant->id)
|
||||||
->where('line_id', $line->id)
|
->where('line_id', $line->id)
|
||||||
@@ -470,10 +470,28 @@ class SendProductionReport extends Command
|
|||||||
|
|
||||||
if (strtolower($line->type) == 'base fg line') {
|
if (strtolower($line->type) == 'base fg line') {
|
||||||
|
|
||||||
$productionQuantity = ProductionQuantity::where('plant_id', $plant->id)
|
$dayproductionQuantity = ProductionQuantity::where('plant_id', $plant->id)
|
||||||
->where('line_id', $line->id)
|
->where('line_id', $line->id)
|
||||||
->whereBetween('created_at', [$startDate, $endDate])
|
->whereIn('item_id', $itemIds)
|
||||||
|
->whereBetween('created_at', [
|
||||||
|
$startDate->copy()->setTime(8, 0, 0),
|
||||||
|
$startDate->copy()->setTime(19, 30, 0),
|
||||||
|
])
|
||||||
->count();
|
->count();
|
||||||
|
|
||||||
|
$nightproductionQuantity = ProductionQuantity::where('plant_id', $plant->id)
|
||||||
|
->where('line_id', $line->id)
|
||||||
|
->whereIn('item_id', $itemIds)
|
||||||
|
->whereBetween('created_at', [
|
||||||
|
$startDate->copy()->setTime(19, 30, 0),
|
||||||
|
$endDate->copy()->setTime(8, 0, 0),
|
||||||
|
])
|
||||||
|
->count();
|
||||||
|
|
||||||
|
// $productionQuantity = ProductionQuantity::where('plant_id', $plant->id)
|
||||||
|
// ->where('line_id', $line->id)
|
||||||
|
// ->whereBetween('created_at', [$startDate, $endDate])
|
||||||
|
// ->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
$dayShiftEfficiency = $dayShiftPlanQuan > 0 ? ($dayproductionQuantity / $dayShiftPlanQuan) * 100 : 0;
|
$dayShiftEfficiency = $dayShiftPlanQuan > 0 ? ($dayproductionQuantity / $dayShiftPlanQuan) * 100 : 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user