mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 11:41:09 -04:00
Solve due date issue in recurring invoice
This commit is contained in:
@ -305,9 +305,11 @@ class RecurringInvoice extends Model
|
|||||||
->setCustomer($this->customer_id)
|
->setCustomer($this->customer_id)
|
||||||
->setNextNumbers();
|
->setNextNumbers();
|
||||||
|
|
||||||
|
$days = CompanySetting::getSetting('invoice_due_date_days', $this->company_id);
|
||||||
|
|
||||||
$newInvoice['creator_id'] = $this->creator_id;
|
$newInvoice['creator_id'] = $this->creator_id;
|
||||||
$newInvoice['invoice_date'] = Carbon::today()->format('Y-m-d');
|
$newInvoice['invoice_date'] = Carbon::today()->format('Y-m-d');
|
||||||
$newInvoice['due_date'] = Carbon::today()->addDays(7)->format('Y-m-d');
|
$newInvoice['due_date'] = Carbon::today()->addDays($days)->format('Y-m-d');
|
||||||
$newInvoice['status'] = Invoice::STATUS_DRAFT;
|
$newInvoice['status'] = Invoice::STATUS_DRAFT;
|
||||||
$newInvoice['company_id'] = $this->company_id;
|
$newInvoice['company_id'] = $this->company_id;
|
||||||
$newInvoice['paid_status'] = Invoice::STATUS_UNPAID;
|
$newInvoice['paid_status'] = Invoice::STATUS_UNPAID;
|
||||||
|
|||||||
Reference in New Issue
Block a user