From 20e0a87630ecd8b68e24330a957ca27c057472d1 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 12 Dec 2022 10:05:14 +1100 Subject: [PATCH] Quote filters for expired and upcoming --- app/Filters/QuoteFilters.php | 8 +++++++- lang/en/texts.php | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/Filters/QuoteFilters.php b/app/Filters/QuoteFilters.php index 9942ee909c29..5446c0532da7 100644 --- a/app/Filters/QuoteFilters.php +++ b/app/Filters/QuoteFilters.php @@ -80,7 +80,13 @@ class QuoteFilters extends QueryFilters if (in_array('expired', $status_parameters)) { $this->builder->where('status_id', Quote::STATUS_SENT) - ->where('due_date', '<=', now()->toDateString()); + ->where('due_date', '>=', now()->toDateString()); + } + + if (in_array('upcoming', $status_parameters)) { + $this->builder->where('status_id', Quote::STATUS_SENT) + ->where('due_date', '<=', now()->toDateString()) + ->orderBy('due_date', 'DESC'); } return $this->builder; diff --git a/lang/en/texts.php b/lang/en/texts.php index a92f17bb603f..ed0b75459202 100644 --- a/lang/en/texts.php +++ b/lang/en/texts.php @@ -4898,6 +4898,8 @@ $LANG = array( 'otp_code_message' => 'Enter the code emailed.', 'otp_code_subject' => 'Your one time passcode code', 'otp_code_body' => 'Your one time passcode is :code', + 'delete_tax_rate' => 'Delete Tax Rate', + 'restore_tax_rate' => 'Restore Tax Rate', ); return $LANG;