From 7e66c8f2ea894e35aca3aff19a9322d39d95a103 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Wed, 5 Nov 2025 14:44:49 +0530 Subject: [PATCH] Refactor invoice data query for 'Challan' distribution to handle null or empty distribution channel descriptions --- app/Filament/Widgets/InvoiceDataChart.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Filament/Widgets/InvoiceDataChart.php b/app/Filament/Widgets/InvoiceDataChart.php index f41e0b7..dc195e7 100644 --- a/app/Filament/Widgets/InvoiceDataChart.php +++ b/app/Filament/Widgets/InvoiceDataChart.php @@ -223,7 +223,11 @@ class InvoiceDataChart extends ChartWidget elseif ($selectedDistribution == 'Challan') { $totalInvoices = InvoiceDataValidation::where('plant_id', $selectedPlant) - ->where('distribution_channel_desc', $selectedDistribution) + //->where('distribution_channel_desc', $selectedDistribution) + ->where(function ($query) { + $query->whereNull('distribution_channel_desc') + ->orWhere('distribution_channel_desc', ''); + }) ->whereBetween('document_date', [$startDate, $endDate]) ->distinct('document_number') ->pluck('document_number')