Refactor invoice data query for 'Challan' distribution to handle null or empty distribution channel descriptions
This commit is contained in:
@@ -223,7 +223,11 @@ class InvoiceDataChart extends ChartWidget
|
|||||||
elseif ($selectedDistribution == 'Challan')
|
elseif ($selectedDistribution == 'Challan')
|
||||||
{
|
{
|
||||||
$totalInvoices = InvoiceDataValidation::where('plant_id', $selectedPlant)
|
$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])
|
->whereBetween('document_date', [$startDate, $endDate])
|
||||||
->distinct('document_number')
|
->distinct('document_number')
|
||||||
->pluck('document_number')
|
->pluck('document_number')
|
||||||
|
|||||||
Reference in New Issue
Block a user