add wate to inventory

This commit is contained in:
2017-04-27 20:53:35 +02:00
parent ec5968511b
commit 567592b73e
6 changed files with 164 additions and 37 deletions

View File

@@ -17,6 +17,7 @@ use common\components\ProductAwareBehavior;
* @property integer $id_inventory
* @property integer $count_in
* @property integer $count_sold
* @property integer $count_waste
* @property integer $count
* @property integer $count_prev
* @property integer $count_system
@@ -229,6 +230,7 @@ class InventoryItem extends BaseFitnessActiveRecord
$count_prev = 0;
$count_in = 0;
$count_sold = 0;
$count_waste = 0;
$price = 0;
if (isset($price) && is_numeric($price)){
@@ -255,10 +257,14 @@ class InventoryItem extends BaseFitnessActiveRecord
$count_sold = $this->count_sold;
}
if ( isset($this->count_waste)){
$count_waste = $this->count_waste;
}
//netto készlet érték
$this->net_stock_money = $count * $purchase_price_net;
//leltárhiány db
$this->stock_missing_count = $this->count - ($count_prev + $count_in - $count_sold) ;
$this->stock_missing_count = $this->count - ($count_prev + $count_in - $count_sold - $count_waste) ;
//leltárhiány összeg
$this->stock_missing_money = $price * $this->stock_missing_count;
}