From e3c4ada082a66449e2fb82b6248e9754bb784807 Mon Sep 17 00:00:00 2001 From: vollstock Date: Thu, 27 Nov 2025 16:50:45 +0100 Subject: [PATCH] small changes to avoid compile errors on Ubuntu?! --- app/Http/Controllers/InvoiceController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/InvoiceController.php b/app/Http/Controllers/InvoiceController.php index 501fdbc..ecaf4f7 100644 --- a/app/Http/Controllers/InvoiceController.php +++ b/app/Http/Controllers/InvoiceController.php @@ -48,8 +48,9 @@ public function summaryAll() public function summaryThisYear() { + $dt = new DateTime('first day of january this year'); $invoices = Invoice::select() - ->where('invoice_date', '>=', new DateTime('first day of january this year')->format('Y-m-d')) + ->where('invoice_date', '>=', $dt->format('Y-m-d')) ->orderBy('invoice_date', 'asc') ->orderByRaw("CAST(SUBSTRING(nr, 4) AS UNSIGNED) ASC") ->get(); @@ -61,8 +62,9 @@ public function summaryThisYear() public function summaryBeforeThisYear() { + $dt = new DateTime('first day of january this year'); $invoices = Invoice::select() - ->where('invoice_date', '<', new DateTime('first day of january this year')->format('Y-m-d')) + ->where('invoice_date', '<', $dt->format('Y-m-d')) ->orderBy('invoice_date', 'asc') ->orderByRaw("CAST(SUBSTRING(nr, 4) AS UNSIGNED) ASC") ->get();