Added logic for day and night production quantity in send production report
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 17s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 18s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 15s
Laravel Pint / pint (pull_request) Successful in 5m9s
Laravel Larastan / larastan (pull_request) Failing after 5m39s

This commit is contained in:
dhanabalan
2026-11-17 09:43:43 +05:30
parent a652fdf5ab
commit a9f0cf7819

View File

@@ -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;