diff --git a/app/Filament/Widgets/InvoiceChart.php b/app/Filament/Widgets/InvoiceChart.php index e495008..baae19e 100644 --- a/app/Filament/Widgets/InvoiceChart.php +++ b/app/Filament/Widgets/InvoiceChart.php @@ -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)"