add inventory total price, rename procurement purchase price
This commit is contained in:
@@ -119,6 +119,7 @@ class InventoryItemForm extends Model{
|
||||
$item->id_user = \Yii::$app->user->id;
|
||||
|
||||
if ( $this->type == 'product'){
|
||||
$item->price_brutto = $this->product->sale_price;
|
||||
$item->type = InventoryItem::$TYPE_PRODUCT;
|
||||
$item->id_product = $this->product->id_product;
|
||||
}else{
|
||||
@@ -127,6 +128,10 @@ class InventoryItemForm extends Model{
|
||||
}
|
||||
$item->id_inventory = $this->inventory->id_inventory;
|
||||
|
||||
|
||||
$model->recalculateTotalPriceBrutto();
|
||||
|
||||
|
||||
if ( !$item->save(false) ){
|
||||
throw new \Exception("Nem sikerült a leltár végrehajtása");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user