diff --git a/app/Ninja/Repositories/InvoiceRepository.php b/app/Ninja/Repositories/InvoiceRepository.php index 4b174c05f7..0bcecd5cf2 100644 --- a/app/Ninja/Repositories/InvoiceRepository.php +++ b/app/Ninja/Repositories/InvoiceRepository.php @@ -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;