diff --git a/app/Jobs/Util/ReminderJob.php b/app/Jobs/Util/ReminderJob.php index e4240b49ac82..b468fb097c48 100644 --- a/app/Jobs/Util/ReminderJob.php +++ b/app/Jobs/Util/ReminderJob.php @@ -184,8 +184,12 @@ class ReminderJob implements ShouldQueue $invoice->fresh(); $invoice->service()->deletePdf(); + /* Refresh the client here to ensure the balance is fresh */ + $client = $invoice->client; + $client = $client->fresh(); + nlog("adjusting client balance and invoice balance by ". ($invoice->balance - $temp_invoice_balance)); - $invoice->client->service()->updateBalance($invoice->balance - $temp_invoice_balance)->save(); + $client->service()->updateBalance($invoice->balance - $temp_invoice_balance)->save(); $invoice->ledger()->updateInvoiceBalance($invoice->balance - $temp_invoice_balance, "Late Fee Adjustment for invoice {$invoice->number}"); return $invoice;