From c0c818d918f017ec52858bd80b070fdce46c9ea9 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 11 May 2024 09:22:59 +1000 Subject: [PATCH] Fixes for credits on statements --- app/Services/Client/Statement.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Services/Client/Statement.php b/app/Services/Client/Statement.php index 8c4bea787849..a1a93fc900f4 100644 --- a/app/Services/Client/Statement.php +++ b/app/Services/Client/Statement.php @@ -375,7 +375,8 @@ class Statement ->whereIn('status_id', [Credit::STATUS_SENT, Credit::STATUS_PARTIAL, Credit::STATUS_APPLIED]) ->whereBetween('date', [Carbon::parse($this->options['start_date']), Carbon::parse($this->options['end_date'])]) ->where(function ($query) { - $query->whereDate('due_date', '>=', $this->options['end_date']) + // $query->whereDate('due_date', '>=', $this->options['end_date']) + $query->whereDate('due_date', '>=', now()) ->orWhereNull('due_date'); }) ->orderBy('date', 'ASC');