1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Fix for default quote terms

This commit is contained in:
Hillel Coren 2016-04-20 11:04:54 +03:00
parent eaa4ffab0e
commit 9281cd5ba2

View File

@ -284,7 +284,14 @@ class InvoiceRepository extends BaseRepository
$invoice->end_date = null;
}
$invoice->terms = (isset($data['terms']) && trim($data['terms'])) ? trim($data['terms']) : (!$publicId && $account->invoice_terms ? $account->invoice_terms : '');
if (isset($data['terms']) && trim($data['terms'])) {
$invoice->terms = trim($data['terms']);
} elseif ($isNew && $account->{"{$entityType}_terms"}) {
$invoice->terms = $account->{"{$entityType}_terms"};
} else {
$invoice->terms = '';
}
$invoice->invoice_footer = (isset($data['invoice_footer']) && trim($data['invoice_footer'])) ? trim($data['invoice_footer']) : (!$publicId && $account->invoice_footer ? $account->invoice_footer : '');
$invoice->public_notes = isset($data['public_notes']) ? trim($data['public_notes']) : null;