Merge pull request 'Solved bug in production mail report' (#1190) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s

Reviewed-on: #1190
This commit was merged in pull request #1190.
This commit is contained in:
2026-10-07 02:59:30 +00:00

View File

@@ -258,13 +258,17 @@ class SendProductionReport extends Command
$productionQuantity = \App\Models\QualityValidation::where('plant_id', $plant->id)
->where('line_id', $line->id)
->whereIn('item_id', $itemIds)
->whereHas('stickerMaster', function ($query) use ($itemIds) {
$query->whereIn('item_id', $itemIds);
})
->whereBetween('created_at', [$startDate, $endDate])
->count();
$nonPlannedproductionQuantity = \App\Models\QualityValidation::where('plant_id', $plant->id)
->where('line_id', $line->id)
->whereNotIn('item_id', $itemIds)
->whereHas('stickerMaster', function ($query) use ($itemIds) {
$query->whereIn('item_id', $itemIds);
})
->whereBetween('created_at', [$startDate, $endDate])
->count();
@@ -297,7 +301,9 @@ class SendProductionReport extends Command
$dayproductionQuantity = \App\Models\QualityValidation::where('plant_id', $plant->id)
->where('line_id', $line->id)
->whereIn('item_id', $itemIds)
->whereHas('stickerMaster', function ($query) use ($itemIds) {
$query->whereIn('item_id', $itemIds);
})
->whereBetween('created_at', [
$startDate->copy()->setTime(8, 0, 0),
$startDate->copy()->setTime(19, 30, 0),
@@ -306,7 +312,9 @@ class SendProductionReport extends Command
$nightproductionQuantity = \App\Models\QualityValidation::where('plant_id', $plant->id)
->where('line_id', $line->id)
->whereIn('item_id', $itemIds)
->whereHas('stickerMaster', function ($query) use ($itemIds) {
$query->whereIn('item_id', $itemIds);
})
->whereBetween('created_at', [
$startDate->copy()->setTime(19, 30, 0),
$endDate->copy()->setTime(8, 0, 0),