1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Support clearing due date

This commit is contained in:
Hillel Coren 2017-07-09 21:34:41 +03:00
parent 787c7e2d95
commit de53a2ec6f

View File

@ -448,7 +448,9 @@ class InvoiceRepository extends BaseRepository
$invoice->due_date = $data['due_date'];
}
} else {
if (! empty($data['due_date']) || ! empty($data['due_date_sql'])) {
if ($isNew && empty($data['due_date']) && $invoice->due_date) {
// do nothing
} elseif (isset($data['due_date']) || isset($data['due_date_sql'])) {
$invoice->due_date = isset($data['due_date_sql']) ? $data['due_date_sql'] : Utils::toSqlDate($data['due_date']);
}
$invoice->frequency_id = 0;