add inventory total price, rename procurement purchase price
This commit is contained in:
@@ -33,7 +33,7 @@ return [
|
||||
'Procurement' => 'Beszerzés',
|
||||
'Procurements' => 'Beszerzések',
|
||||
'Product name, product number or barcode' => 'Termék neve, termék száma vagy vonalkód',
|
||||
'Purchase Price' => 'Beszerzési ár',
|
||||
'Purchase Price' => 'Bevételezési ár(össz.)',
|
||||
'Search' => 'Keresés',
|
||||
'Stock' => 'Beszerzés előtti raktárkészlet',
|
||||
'Update' => 'Módosítás',
|
||||
|
||||
@@ -24,6 +24,8 @@ use common\components\ProductAwareBehavior;
|
||||
* @property integer $id_user
|
||||
* @property integer $id_inventory_item_prev
|
||||
* @property integer $id_user
|
||||
* @property integer $price_brutto
|
||||
* @property integer $total_price_brutto
|
||||
* @property string $created_at
|
||||
* @property string $updated_at
|
||||
*/
|
||||
@@ -155,6 +157,20 @@ class InventoryItem extends BaseFitnessActiveRecord
|
||||
}
|
||||
|
||||
|
||||
public function recalculateTotalPriceBrutto(){
|
||||
$diff = $this->difference;
|
||||
if (!isset($diff) || !is_numeric($diff)){
|
||||
$diff = 0;
|
||||
}
|
||||
|
||||
$price = $this->price_brutto;
|
||||
if (!isset($price) || !is_numeric($price)){
|
||||
$price = 0;
|
||||
}
|
||||
|
||||
$this->total_price_brutto = $price * $diff;
|
||||
}
|
||||
|
||||
public function afterSave($insert, $changedAttributes){
|
||||
if ( !$insert ){
|
||||
// if ( $this->type == 'product'){
|
||||
|
||||
Reference in New Issue
Block a user