mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-09-20 08:21:34 +02:00
Fixes for updating a product on invoice save (#3372)
This commit is contained in:
parent
1ac2a73b2a
commit
62fc7edbae
@ -63,7 +63,7 @@ class UpdateOrCreateProduct implements ShouldQueue
|
|||||||
$product->product_key = $item->product_key;
|
$product->product_key = $item->product_key;
|
||||||
$product->notes = isset($item->notes) ? $item->notes : '';
|
$product->notes = isset($item->notes) ? $item->notes : '';
|
||||||
//$product->cost = isset($item->cost) ? $item->cost : 0; //this value shouldn't be updated.
|
//$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->quantity = isset($item->quantity) ? $item->quantity : 0;
|
||||||
$product->tax_name1 = isset($item->tax_name1) ? $item->tax_name1 : '';
|
$product->tax_name1 = isset($item->tax_name1) ? $item->tax_name1 : '';
|
||||||
$product->tax_rate1 = isset($item->tax_rate1) ? $item->tax_rate1 : 0 ;
|
$product->tax_rate1 = isset($item->tax_rate1) ? $item->tax_rate1 : 0 ;
|
||||||
|
@ -204,7 +204,8 @@ class CreateUsersTable extends Migration
|
|||||||
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');
|
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');
|
||||||
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
|
||||||
// $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
// $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
|
||||||
|
|
||||||
|
$table->unique(['company_id', 'user_id']);
|
||||||
$table->index(['account_id', 'company_id']);
|
$table->index(['account_id', 'company_id']);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user