add changes to procurement

This commit is contained in:
2015-09-25 08:57:05 +02:00
parent e2fe006899
commit 28caac03dc
12 changed files with 609 additions and 0 deletions

View File

@@ -82,5 +82,21 @@ class Warehouse extends \yii\db\ActiveRecord
}
return $result;
}
/**
* $param int $forceIncludeAccount id warehouse, that should be included in list, even if it is inactive
* */
public static function read($forceIncludeObjectWithId = null){
$warehouses = null;
if ( $forceIncludeObjectWithId == null){
$warehouses = Warehouse::find()->andWhere(['status' => Warehouse::STATUS_ACTIVE])->all();
}else{
$warehouses = Warehouse::find()->andWhere( ['or', ['status' => Warehouse::STATUS_ACTIVE], ['id_warehouse' => $forceIncludeObjectWithId ] ])->all();
}
return $warehouses;
}
}