From 7e688683d74abf0881008150de98385cc4288507 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Wed, 27 Aug 2025 08:37:21 +0530 Subject: [PATCH] corrected bundle logic for invoice quantity --- app/Console/Commands/SendInvoiceReport.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/Console/Commands/SendInvoiceReport.php b/app/Console/Commands/SendInvoiceReport.php index 24e27e6..8feb1b9 100644 --- a/app/Console/Commands/SendInvoiceReport.php +++ b/app/Console/Commands/SendInvoiceReport.php @@ -157,16 +157,14 @@ class SendInvoiceReport extends Command ->count(); $totalBundleInvoiceQuan = InvoiceValidation::where('plant_id', $plantId) - ->where('quantity', null) + ->where('quantity', '>', 1) ->whereBetween('created_at', [$startDate, $endDate]) ->count(); $scannedBundleInvoiceQuan = InvoiceValidation::where('plant_id', $plantId) - ->where('scanned_status', 'Scanned') - ->where(function($query) { - $query->whereNull('quantity') - ->orWhere('quantity', 0); - }) + ->where('quantity', '>', 1) + ->whereNotNull('serial_number') + ->where('serial_number','!=', '') ->whereBetween('updated_at', [$startDate, $endDate]) ->count();