From a8b65671f024f16af852f40653b3281137ed2d2e Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 27 Apr 2023 11:03:48 +1000 Subject: [PATCH] Allow late fee invoices for locked invoice regions --- app/Helpers/Invoice/InvoiceSumInclusive.php | 12 ++++++++++++ app/Jobs/Util/ReminderJob.php | 8 ++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/app/Helpers/Invoice/InvoiceSumInclusive.php b/app/Helpers/Invoice/InvoiceSumInclusive.php index ceb470d824..e57237bf3d 100644 --- a/app/Helpers/Invoice/InvoiceSumInclusive.php +++ b/app/Helpers/Invoice/InvoiceSumInclusive.php @@ -203,6 +203,9 @@ class InvoiceSumInclusive return $this->invoice; } + /** + * @return Invoice | RecurringInvoice | Quote | Credit | PurchaseOrder + */ public function getInvoice() { //Build invoice values here and return Invoice @@ -212,6 +215,9 @@ class InvoiceSumInclusive return $this->invoice; } + /** + * @return Invoice | RecurringInvoice | Quote | Credit | PurchaseOrder + */ public function getQuote() { //Build invoice values here and return Invoice @@ -221,6 +227,9 @@ class InvoiceSumInclusive return $this->invoice; } + /** + * @return Invoice | RecurringInvoice | Quote | Credit | PurchaseOrder + */ public function getCredit() { //Build invoice values here and return Invoice @@ -230,6 +239,9 @@ class InvoiceSumInclusive return $this->invoice; } + /** + * @return Invoice | RecurringInvoice | Quote | Credit | PurchaseOrder + */ public function getPurchaseOrder() { //Build invoice values here and return Invoice diff --git a/app/Jobs/Util/ReminderJob.php b/app/Jobs/Util/ReminderJob.php index 19bd722a65..1341e49750 100644 --- a/app/Jobs/Util/ReminderJob.php +++ b/app/Jobs/Util/ReminderJob.php @@ -110,7 +110,7 @@ class ReminderJob implements ShouldQueue } } - private function sendReminderForInvoice($invoice) + private function sendReminderForInvoice(Invoice $invoice) { App::forgetInstance('translator'); $t = app('translator'); @@ -181,6 +181,7 @@ class ReminderJob implements ShouldQueue $fee += round($over_due_invoice->balance * $percent / 100, 2); } + /** @var \App\Models\Invoice $invoice */ $invoice = InvoiceFactory::create($over_due_invoice->company_id, $over_due_invoice->user_id); $invoice->client_id = $over_due_invoice->client_id; $invoice->date = now()->format('Y-m-d'); @@ -206,10 +207,6 @@ class ReminderJob implements ShouldQueue ->markSent() ->save(); - // nlog('adjusting client balance and invoice balance by #'.$invoice->number.' '.$invoice->balance); - // $invoice->client->service()->updateBalance($invoice->balance); - // $invoice->ledger()->updateInvoiceBalance($invoice->balance, "Late Fee Adjustment for invoice {$invoice->number}"); - $invoice->service()->touchPdf(true); $enabled_reminder = 'enable_'.$reminder_template; @@ -232,7 +229,6 @@ class ReminderJob implements ShouldQueue $invoice->service()->setReminder()->save(); - } /**