add inventory group

This commit is contained in:
2016-02-29 20:51:54 +01:00
parent 3926498f3e
commit b196b86746
19 changed files with 589 additions and 4 deletions

View File

@@ -3,6 +3,7 @@
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use common\models\InventoryGroup;
/* @var $this yii\web\View */
/* @var $model common\models\Product */
@@ -13,6 +14,9 @@ use yii\helpers\ArrayHelper;
$account_options = ArrayHelper::map($accounts, 'id_account', 'name');
$product_category_options = ArrayHelper::map($categories, 'id_product_category', 'name');
$inventory_groups = InventoryGroup::find()->andWhere(['status' => InventoryGroup::STATUS_ACTIVE])->all();
$inventory_groups = ['' => ''] + ArrayHelper::map($inventory_groups, "id_inventory_group", "name");
?>
<div class="product-form">
@@ -23,6 +27,8 @@ $product_category_options = ArrayHelper::map($categories, 'id_product_category',
<?= $form->field($model, 'id_account')->dropDownList($account_options) ?>
<?= $form->field($model, 'id_product_category')->dropDownList($product_category_options) ?>
<?= $form->field($model, 'id_inventory_group')->dropDownList($inventory_groups) ?>
<?= $form->field($model, 'product_number')->textInput(['maxlength' => true]) ?>