chnaged logic in invoice chart #212

Merged
jothi merged 1 commits from ranjith-dev into master 2026-01-20 13:31:10 +00:00

View File

@@ -80,7 +80,7 @@ class InvoiceChart extends ChartWidget
$completedInvoicesCount = InvoiceValidation::select('invoice_number')
->where('plant_id', $selectedPlant)
->whereNull('quantity')
->whereBetween('updated_at', [$startDate, $endDate])
->whereBetween('created_at', [$startDate, $endDate])
->groupBy('invoice_number')
->havingRaw(
"COUNT(*) = SUM(CASE WHEN scanned_status = 'Scanned' THEN 1 ELSE 0 END)"
@@ -99,7 +99,7 @@ class InvoiceChart extends ChartWidget
$completedInvoicesCount = InvoiceValidation::select('invoice_number')
->where('plant_id', $selectedPlant)
->where('quantity', '>', 1)
->whereBetween('updated_at', [$startDate, $endDate])
->whereBetween('created_at', [$startDate, $endDate])
->groupBy('invoice_number')
->havingRaw(
"COUNT(*) = SUM(CASE WHEN serial_number IS NOT NULL AND serial_number != '' THEN 1 ELSE 0 END)"