mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Set conditionals for recurring invoices that are being restarted
This commit is contained in:
parent
14b5770a0a
commit
53b1f4911c
@ -227,12 +227,21 @@ class RecurringInvoice extends BaseModel
|
||||
if (!$this->next_send_date) {
|
||||
return null;
|
||||
}
|
||||
|
||||
nlog("frequency = $this->frequency_id");
|
||||
nlog("frequency = $this->next_send_date");
|
||||
|
||||
$offset = $this->client->timezone_offset();
|
||||
|
||||
/* If this setting is enabled, the recurring invoice may be set in the past */
|
||||
|
||||
if($this->company->stop_on_unpaid_recurring) {
|
||||
|
||||
/* Lets set the next send date to now so we increment from today, rather than in the past*/
|
||||
if(Carbon::parse($this->next_send_date)->lt(now()->subDays(3)))
|
||||
$this->next_send_date = now()->format('Y-m-d');
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
As we are firing at UTC+0 if our offset is negative it is technically firing the day before so we always need
|
||||
to add ON a day - a day = 86400 seconds
|
||||
|
Loading…
x
Reference in New Issue
Block a user