From 8cb5f5c251f9133d937963a83e4b13291ead7568 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Tue, 20 Jan 2026 16:28:46 +0530 Subject: [PATCH] changed logic in invoice chart --- app/Filament/Widgets/InvoiceChart.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Filament/Widgets/InvoiceChart.php b/app/Filament/Widgets/InvoiceChart.php index 48ac176..47d370a 100644 --- a/app/Filament/Widgets/InvoiceChart.php +++ b/app/Filament/Widgets/InvoiceChart.php @@ -193,10 +193,9 @@ class InvoiceChart extends ChartWidget } elseif ($activeFilter == 'this_month') { $startOfMonth = now()->startOfMonth()->setTime(8, 0, 0); - $endOfMonth = now()->endOfMonth()->addDay()->setTime(8, 0, 0); // include full last day + $endOfMonth = now()->endOfMonth()->addDay()->setTime(23, 59, 59); // include full last day $monthName = $startOfMonth->format('M'); - // Prepare weekly labels like "May(1-7)", "May(8-14)", etc. $labels = []; $weekStart = $startOfMonth->copy(); $importedInvoicesPerWeek = []; @@ -204,7 +203,7 @@ class InvoiceChart extends ChartWidget $weekIndex = 0; while ($weekStart < $endOfMonth) { - $weekEnd = $weekStart->copy()->addDays(7); + $weekEnd = $weekStart->copy()->addDays(6); $startDay = $weekStart->format('j'); $weekEndLimit = $weekEnd->copy()->subDay(); $actualEnd = $weekEndLimit->greaterThan($endOfMonth) ? $endOfMonth : $weekEndLimit; @@ -298,6 +297,7 @@ class InvoiceChart extends ChartWidget { return 'bar'; } + public static function getDefaultName(): string { return 'invoice-chart';