mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-05 03:34:36 -04:00
Set due date when invoice is marked as sent
This commit is contained in:
parent
0485ffe912
commit
b28cdd488b
@ -62,7 +62,7 @@ class ApplyPayment extends AbstractService
|
|||||||
$this->invoice->service()->clearPartial()->setStatus(Invoice::STATUS_PARTIAL)->updateBalance($this->payment_amount*-1);
|
$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;
|
return $this->invoice;
|
||||||
}
|
}
|
||||||
|
@ -139,7 +139,12 @@ class InvoiceService
|
|||||||
/* One liners */
|
/* One liners */
|
||||||
public function setDueDate()
|
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;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,7 @@ class MarkSent extends AbstractService
|
|||||||
->service()
|
->service()
|
||||||
->setStatus(Invoice::STATUS_SENT)
|
->setStatus(Invoice::STATUS_SENT)
|
||||||
->applyNumber()
|
->applyNumber()
|
||||||
|
->setDueDate()
|
||||||
->save();
|
->save();
|
||||||
|
|
||||||
$this->client->service()->updateBalance($this->invoice->balance)->save();
|
$this->client->service()->updateBalance($this->invoice->balance)->save();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user