mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 06:24:30 -04:00
Fix for adding tasks/expenses to invoices
This commit is contained in:
parent
deaf39d29d
commit
f36178fc7b
@ -386,12 +386,6 @@ class InvoiceRepository extends BaseRepository
|
|||||||
$invoice->invoice_date = date_create()->format('Y-m-d');
|
$invoice->invoice_date = date_create()->format('Y-m-d');
|
||||||
$invoice->custom_taxes1 = $account->custom_invoice_taxes1 ?: false;
|
$invoice->custom_taxes1 = $account->custom_invoice_taxes1 ?: false;
|
||||||
$invoice->custom_taxes2 = $account->custom_invoice_taxes2 ?: 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
|
// set the default due date
|
||||||
if ($entityType == ENTITY_INVOICE) {
|
if ($entityType == ENTITY_INVOICE) {
|
||||||
@ -409,6 +403,13 @@ class InvoiceRepository extends BaseRepository
|
|||||||
return $invoice;
|
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)) {
|
if (isset($data['is_public']) && filter_var($data['is_public'], FILTER_VALIDATE_BOOLEAN)) {
|
||||||
$invoice->is_public = true;
|
$invoice->is_public = true;
|
||||||
if (! $invoice->isSent()) {
|
if (! $invoice->isSent()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user