diff --git a/database/migrations/2017_03_16_085702_add_gateway_fee_location.php b/database/migrations/2017_03_16_085702_add_gateway_fee_location.php index 396addb245ae..70a37a88b447 100644 --- a/database/migrations/2017_03_16_085702_add_gateway_fee_location.php +++ b/database/migrations/2017_03_16_085702_add_gateway_fee_location.php @@ -18,6 +18,12 @@ class AddGatewayFeeLocation extends Migration $table->boolean('gateway_fee_enabled')->default(0); $table->date('reset_counter_date')->nullable(); }); + + // update invoice_item_type_id for task invoice items + DB::statement('update invoice_items + left join invoices on invoices.id = invoice_items.invoice_id + set invoice_item_type_id = 2 + where invoices.has_tasks = 1') } /** diff --git a/resources/views/invoices/edit.blade.php b/resources/views/invoices/edit.blade.php index 45fed0b12e21..45420bf334de 100644 --- a/resources/views/invoices/edit.blade.php +++ b/resources/views/invoices/edit.blade.php @@ -904,6 +904,7 @@ item.notes(task.description); item.qty(task.duration); item.task_public_id(task.publicId); + item.invoice_item_type_id = {{ INVOICE_ITEM_TYPE_TASK }}; } model.invoice().invoice_items.push(blank); model.invoice().has_tasks(true);