mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Set due date when invoice is marked as sent
This commit is contained in:
parent
0485ffe912
commit
b28cdd488b
@ -62,8 +62,8 @@ class ApplyPayment extends AbstractService
|
||||
$this->invoice->service()->clearPartial()->setStatus(Invoice::STATUS_PARTIAL)->updateBalance($this->payment_amount*-1);
|
||||
}
|
||||
|
||||
$this->invoice->service()->applyNumber->save();
|
||||
|
||||
$this->invoice->service()->applyNumber()->save();
|
||||
|
||||
return $this->invoice;
|
||||
}
|
||||
}
|
||||
|
@ -139,8 +139,13 @@ class InvoiceService
|
||||
/* One liners */
|
||||
public function setDueDate()
|
||||
{
|
||||
$this->invoice->due_date = Carbon::now()->addDays($this->invoice->client->getSetting('payment_terms'));
|
||||
if($this->invoice->due_date != '')
|
||||
return $this;
|
||||
|
||||
//$this->invoice->due_date = Carbon::now()->addDays($this->invoice->client->getSetting('payment_terms'));
|
||||
|
||||
$this->invoice->due_date = Carbon::parse($this->invoice->date)->addDays($this->invoice->client->getSetting('payment_terms'));
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@ -45,6 +45,7 @@ class MarkSent extends AbstractService
|
||||
->service()
|
||||
->setStatus(Invoice::STATUS_SENT)
|
||||
->applyNumber()
|
||||
->setDueDate()
|
||||
->save();
|
||||
|
||||
$this->client->service()->updateBalance($this->invoice->balance)->save();
|
||||
|
Loading…
x
Reference in New Issue
Block a user