From b054f572862d5bc8106dd047032285646eb310dd Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 4 Jun 2024 07:42:11 +1000 Subject: [PATCH] Updates for invoice service auto bill standard invoices --- app/Filters/ExpenseFilters.php | 3 +++ app/Services/Invoice/InvoiceService.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Filters/ExpenseFilters.php b/app/Filters/ExpenseFilters.php index 6c580cb719..0d133e96ce 100644 --- a/app/Filters/ExpenseFilters.php +++ b/app/Filters/ExpenseFilters.php @@ -44,6 +44,9 @@ class ExpenseFilters extends QueryFilters }) ->orWhereHas('vendor', function ($q) use ($filter) { $q->where('name', 'like', '%'.$filter.'%'); + }) + ->orWhereHas('client', function ($q) use ($filter) { + $q->where('name', 'like', '%'.$filter.'%'); }); }); } diff --git a/app/Services/Invoice/InvoiceService.php b/app/Services/Invoice/InvoiceService.php index 0476aae980..9c8de34a26 100644 --- a/app/Services/Invoice/InvoiceService.php +++ b/app/Services/Invoice/InvoiceService.php @@ -570,7 +570,7 @@ class InvoiceService $this->invoice->exchange_rate = $this->invoice->client->setExchangeRate(); } - if ($is_recurring && $this->invoice->client->getSetting('auto_bill_standard_invoices')) { + if (!$is_recurring && $this->invoice->client->getSetting('auto_bill_standard_invoices')) { $this->invoice->auto_bill_enabled = true; }