mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Add checks to prevent duplicate reminders from being sent
This commit is contained in:
parent
20810bd7fe
commit
fa5c364556
@ -88,6 +88,13 @@ class ReminderJob implements ShouldQueue
|
||||
})
|
||||
->with('invitations')->cursor()->each(function ($invoice) {
|
||||
if ($invoice->isPayable()) {
|
||||
|
||||
//Attempts to prevent duplicates from sending
|
||||
if($invoice->reminder_last_sent && Carbon::parse($invoice->reminder_last_sent)->startOfDay()->eq(now()->startOfDay())){
|
||||
nlog("caught a duplicate reminder for invoice {$invoice->number}");
|
||||
return;
|
||||
}
|
||||
|
||||
$reminder_template = $invoice->calculateTemplate('invoice');
|
||||
nlog("reminder template = {$reminder_template}");
|
||||
$invoice = $this->calcLateFee($invoice, $reminder_template);
|
||||
|
Loading…
x
Reference in New Issue
Block a user