mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Start recurring invoice on send now
This commit is contained in:
parent
63eb2ca524
commit
7157c95ef4
@ -302,7 +302,7 @@ class BaseRepository
|
||||
/* Perform model specific tasks */
|
||||
if ($model instanceof Invoice) {
|
||||
|
||||
if (($state['finished_amount'] != $state['starting_amount']) && ($model->status_id != Invoice::STATUS_DRAFT && $model->status_id != Invoice::STATUS_PAID)) {
|
||||
if (($state['finished_amount'] != $state['starting_amount']) && ($model->status_id != Invoice::STATUS_DRAFT)) {
|
||||
|
||||
//10-07-2022
|
||||
$model->service()->updateStatus()->save();
|
||||
|
@ -123,8 +123,10 @@ class RecurringService
|
||||
public function sendNow()
|
||||
{
|
||||
|
||||
if($this->recurring_entity instanceof RecurringInvoice)
|
||||
if($this->recurring_entity instanceof RecurringInvoice && $this->recurring_entity->status_id == RecurringInvoice::STATUS_DRAFT){
|
||||
$this->start()->save();
|
||||
SendRecurring::dispatchNow($this->recurring_entity, $this->recurring_entity->company->db);
|
||||
}
|
||||
|
||||
return $this->recurring_entity;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user