Merge pull request 'chnaged logic in invoice chart' (#212) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s

Reviewed-on: #212
This commit was merged in pull request #212.
This commit is contained in:
2026-01-20 13:31:09 +00:00

View File

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