1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 00:11:35 +02:00

Fixes for updating a product on invoice save (#3372)

This commit is contained in:
David Bomba 2020-02-25 20:17:04 +11:00 committed by GitHub
parent 1ac2a73b2a
commit 62fc7edbae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -63,7 +63,7 @@ class UpdateOrCreateProduct implements ShouldQueue
$product->product_key = $item->product_key;
$product->notes = isset($item->notes) ? $item->notes : '';
//$product->cost = isset($item->cost) ? $item->cost : 0; //this value shouldn't be updated.
$product->price = isset($item->price) ? $item->cost : 0;
$product->price = isset($item->cost) ? $item->cost : 0;
$product->quantity = isset($item->quantity) ? $item->quantity : 0;
$product->tax_name1 = isset($item->tax_name1) ? $item->tax_name1 : '';
$product->tax_rate1 = isset($item->tax_rate1) ? $item->tax_rate1 : 0 ;

View File

@ -204,7 +204,8 @@ class CreateUsersTable extends Migration
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
// $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->unique(['company_id', 'user_id']);
$table->index(['account_id', 'company_id']);
});