Added logic for day and night production quantity in send production report #1437
@@ -326,7 +326,7 @@ class SendProductionReport extends Command
|
||||
->whereBetween('created_at', [$startDate, $endDate])
|
||||
->count();
|
||||
}
|
||||
else {
|
||||
else if(strtolower($line->type) == 'base fg line'){
|
||||
|
||||
$productionQuantity = ProductionQuantity::where('plant_id', $plant->id)
|
||||
->where('line_id', $line->id)
|
||||
@@ -470,10 +470,28 @@ class SendProductionReport extends Command
|
||||
|
||||
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)
|
||||
->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();
|
||||
|
||||
$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;
|
||||
|
||||
Reference in New Issue
Block a user