mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 10:24:31 -04:00
Enable setting the recurring due date through the API
This commit is contained in:
parent
3d812201ea
commit
bc0ab97279
@ -247,10 +247,12 @@ class InvoiceRepository extends BaseRepository
|
|||||||
$invoice->frequency_id = $data['frequency_id'] ? $data['frequency_id'] : 0;
|
$invoice->frequency_id = $data['frequency_id'] ? $data['frequency_id'] : 0;
|
||||||
$invoice->start_date = Utils::toSqlDate($data['start_date']);
|
$invoice->start_date = Utils::toSqlDate($data['start_date']);
|
||||||
$invoice->end_date = Utils::toSqlDate($data['end_date']);
|
$invoice->end_date = Utils::toSqlDate($data['end_date']);
|
||||||
$invoice->due_date = null;
|
|
||||||
$invoice->auto_bill = isset($data['auto_bill']) && $data['auto_bill'] ? true : false;
|
$invoice->auto_bill = isset($data['auto_bill']) && $data['auto_bill'] ? true : false;
|
||||||
|
|
||||||
if (isset($data['recurring_due_date'])) {
|
if (isset($data['recurring_due_date'])) {
|
||||||
$invoice->due_date = $data['recurring_due_date'];
|
$invoice->due_date = $data['recurring_due_date'];
|
||||||
|
} elseif (isset($data['due_date'])) {
|
||||||
|
$invoice->due_date = $data['due_date'];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (isset($data['due_date']) || isset($data['due_date_sql'])) {
|
if (isset($data['due_date']) || isset($data['due_date_sql'])) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user