Update lock for lock invoice and add fees

This commit is contained in:
David Bomba 2023-07-17 07:31:36 +10:00
parent b3b3180667
commit 146559ada7

View File

@ -129,12 +129,10 @@ class ReminderJob implements ShouldQueue
$invoice->service()->touchReminder($reminder_template)->save();
$fees = $this->calcLateFee($invoice, $reminder_template);
if(in_array($invoice->client->getSetting('lock_invoices'), ['when_sent','when_paid'])) {
if($invoice->isLocked())
return $this->addFeeToNewInvoice($invoice, $reminder_template, $fees);
}
else
$invoice = $this->setLateFee($invoice, $fees[0], $fees[1]);
$invoice = $this->setLateFee($invoice, $fees[0], $fees[1]);
//20-04-2022 fixes for endless reminders - generic template naming was wrong
$enabled_reminder = 'enable_'.$reminder_template;