add inventory daily

This commit is contained in:
2017-03-25 22:18:27 +01:00
parent 2b5f5f60fd
commit b9c442fe22
13 changed files with 262 additions and 34 deletions

View File

@@ -5,7 +5,6 @@ namespace common\models;
use Yii;
use common\components\UserAwareBehavior;
use yii\helpers\ArrayHelper;
use yii\db\Query;
use backend\models\InventoryItemForm;
use common\components\AccountAwareBehavior;
use common\components\Helper;
@@ -17,6 +16,7 @@ use common\components\Helper;
* @property integer $id_user
* @property integer $id_account
* @property integer $status
* @property integer $type
* @property string $name
* @property string $created_at
* @property string $updated_at
@@ -28,7 +28,10 @@ class Inventory extends \common\models\BaseFitnessActiveRecord
public static $STATUS_OPEN = 10;
public static $STATUS_CLOSED = 20;
public static $TYPE_MANUAL = 1;
public static $TYPE_DAILY = 2;
/**
* @inheritdoc
@@ -84,10 +87,10 @@ class Inventory extends \common\models\BaseFitnessActiveRecord
[
'class' => UserAwareBehavior::className(),
],
[
'class' => AccountAwareBehavior::className()
]
[
'class' => AccountAwareBehavior::className()
]
], parent::behaviors());
}
@@ -99,11 +102,8 @@ class Inventory extends \common\models\BaseFitnessActiveRecord
$query->andWhere(['id_account' => $this->id_account]);
}
// $query->andWhere("product.id_inventory_group is null");
$products = $query->all();
//echo "Products found: " . count($products);
$inventoryGroups = InventoryGroup::find()->all();
@@ -130,9 +130,6 @@ class Inventory extends \common\models\BaseFitnessActiveRecord
);
$form->save();
}
}
}