From 06edbe3f0679739a0216df3cc512c108cd919b36 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 16 Jun 2023 14:44:43 +1000 Subject: [PATCH] Revert for query --- app/Services/Scheduler/EmailStatementService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Services/Scheduler/EmailStatementService.php b/app/Services/Scheduler/EmailStatementService.php index 3ce5d5f7f7bf..e795f83b1b32 100644 --- a/app/Services/Scheduler/EmailStatementService.php +++ b/app/Services/Scheduler/EmailStatementService.php @@ -95,7 +95,7 @@ class EmailStatementService EmailStatement::THIS_YEAR => [now()->startOfDay()->firstOfYear()->format('Y-m-d'), now()->startOfDay()->lastOfYear()->format('Y-m-d')], EmailStatement::LAST_YEAR => [now()->startOfDay()->subYearNoOverflow()->firstOfYear()->format('Y-m-d'), now()->startOfDay()->subYearNoOverflow()->lastOfYear()->format('Y-m-d')], EmailStatement::ALL_TIME => [ - Invoice::withTrashed()->where('client_id', $client->id)->selectRaw('MIN(invoices.date) as start_date')->pluck('start_date')->first() + $client->invoices()->selectRaw('MIN(invoices.date) as start_date')->pluck('start_date')->first() ?: Carbon::now()->format('Y-m-d'), Carbon::now()->format('Y-m-d') ],