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

Fix for adding tasks/expenses to invoices

This commit is contained in:
Hillel Coren 2017-09-24 12:50:44 +03:00
parent deaf39d29d
commit f36178fc7b

View File

@ -386,12 +386,6 @@ class InvoiceRepository extends BaseRepository
$invoice->invoice_date = date_create()->format('Y-m-d');
$invoice->custom_taxes1 = $account->custom_invoice_taxes1 ?: false;
$invoice->custom_taxes2 = $account->custom_invoice_taxes2 ?: false;
if (isset($data['has_tasks']) && filter_var($data['has_tasks'], FILTER_VALIDATE_BOOLEAN)) {
$invoice->has_tasks = true;
}
if (isset($data['has_expenses']) && filter_var($data['has_expenses'], FILTER_VALIDATE_BOOLEAN)) {
$invoice->has_expenses = true;
}
// set the default due date
if ($entityType == ENTITY_INVOICE) {
@ -409,6 +403,13 @@ class InvoiceRepository extends BaseRepository
return $invoice;
}
if (isset($data['has_tasks']) && filter_var($data['has_tasks'], FILTER_VALIDATE_BOOLEAN)) {
$invoice->has_tasks = true;
}
if (isset($data['has_expenses']) && filter_var($data['has_expenses'], FILTER_VALIDATE_BOOLEAN)) {
$invoice->has_expenses = true;
}
if (isset($data['is_public']) && filter_var($data['is_public'], FILTER_VALIDATE_BOOLEAN)) {
$invoice->is_public = true;
if (! $invoice->isSent()) {