/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = WarehouseModel::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); $this->load($params); if (!$this->validate()) { $query->where('1=0'); return $dataProvider; } $query->andFilterWhere(['id' => $this->id, 'created_at' => $this->created_at, 'created_by' => $this->created_by, 'updated_at' => $this->updated_at, 'updated_by' => $this->updated_by]); $query->andFilterWhere(['like', 'code', $this->code])->andFilterWhere(['like', 'name', $this->name]); return $dataProvider; }
/** * @return \yii\db\ActiveQuery */ public function getWarehouse() { return $this->hasOne(\backend\models\master\Warehouse::className(), ['id' => 'warehouse_id']); }
$this->params['breadcrumbs'][] = $this->title; ?> <div class="col-lg-12"> <div class='btn-group pull-right'> <?php echo Html::button('New Good Movement', ['class' => 'btn bg-aqua', 'type' => 'button']); ?> <?php echo Html::button('<span class="caret"></span><span class="sr-only">Toggle Dropdown</span>', ['class' => 'btn btn-default dropdown-toggle', 'aria-expanded' => false, 'type' => 'button', 'data-toggle' => 'dropdown']); ?> <ul class="dropdown-menu" role="menu"> <li><?php echo Html::a('Receive', ['create', 'type' => $searchModel::TYPE_RECEIVE]); ?> </li> <li><?php echo Html::a('Issue', ['create', 'type' => $searchModel::TYPE_ISSUE]); ?> </li> </ul> </div> </div> <br><br> <div class="col-lg-12 goods-movement-index"> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'tableOptions' => ['class' => 'table table-hover'], 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'number', 'nmReffType', ['attribute' => 'warehouse_id', 'value' => 'warehouse.name', 'filter' => Warehouse::selectOptions()], ['attribute' => 'vendor_id', 'value' => 'vendor.name'], 'Date', ['attribute' => 'type', 'value' => 'nmType', 'filter' => GoodsMovement::enums('TYPE_')], ['attribute' => 'status', 'value' => 'nmStatus', 'filter' => GoodsMovement::enums('STATUS_')], ['class' => 'yii\\grid\\ActionColumn']]]); ?> </div>
/** * @return \yii\db\ActiveQuery */ public function getWarehouses() { return $this->hasMany(Warehouse::className(), ['branch_id' => 'id']); }
<div class="stock-opname-form"> <?php echo Html::errorSummary($model, ['class' => 'alert alert-danger alert-dismissible']); ?> <?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]); ?> <div class="row"> <div class="col-lg-6"> <?php echo $form->field($model, 'number')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'warehouse_id')->dropDownList(Warehouse::selectOptions()); ?> <?php echo $form->field($model, 'Date')->widget('yii\\jui\\DatePicker', ['dateFormat' => 'dd-MM-yyyy', 'options' => ['class' => 'form-control', 'style' => 'width:60%;']]); ?> </div> <div class="col-lg-6"> <?php echo $form->field($model, 'description')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'operator')->textInput(['maxlength' => true]); ?>
protected function findWarehouse($id) { if (($model = \backend\models\master\Warehouse::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
<?php use yii\helpers\Html; use yii\grid\GridView; use backend\models\inventory\GoodsMovement; use backend\models\master\Warehouse; /* @var $this yii\web\View */ /* @var $searchModel GoodsMovement */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = $searchModel->type == GoodsMovement::TYPE_RECEIVE ? 'Penerimaan' : 'Mutasi'; $this->title = $searchModel->type == GoodsMovement::TYPE_ISSUE ? 'Pengeluaran' : $this->title; $this->title .= ' Barang'; $this->params['breadcrumbs'][] = $this->title; ?> <div class="col-lg-12"> <div class='btn-group pull-right'> <?php echo $searchModel->type ? Html::a($searchModel->type == GoodsMovement::TYPE_RECEIVE ? 'Penerimaan Baru' : 'Pengeluaran Baru', ['inventory/gm-manual/create', 'type' => $searchModel->type], ['class' => 'btn btn-default']) : ''; ?> </div> </div> <br><br> <div class="col-lg-12 goods-movement-index"> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'tableOptions' => ['class' => 'table table-hover'], 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'number', ['attribute' => 'type', 'value' => 'nmType', 'filter' => GoodsMovement::enums('TYPE_')], 'description', ['attribute' => 'warehouse_id', 'value' => 'warehouse.name', 'filter' => Warehouse::selectOptions()], ['attribute' => 'vendor_id', 'value' => 'vendor.name', 'filter' => \backend\models\master\Vendor::selectOptions()], 'date', ['attribute' => 'status', 'value' => 'nmStatus', 'filter' => GoodsMovement::enums('STATUS_')], ['label' => 'Invoice Number', 'format' => 'raw', 'value' => function ($model) { return $model->invoice != null ? Html::a($model->invoice->number, ['/accounting/invoice/view', 'id' => $model->invoice->id]) : ''; }], ['class' => 'yii\\grid\\ActionColumn']]]); ?> </div>
/** * @return \yii\db\ActiveQuery */ public function getWarehouse() { return $this->hasOne(Warehouse::className(), ['id' => 'warehouse_id']); }
/* @var $model backend\models\sales\Config */ /* @var $form ActiveForm */ $this->title = 'SalesPoint Config'; ?> <div class="sales-sales-x-config"> <?php $form = ActiveForm::begin(); ?> <div class="row"> <div class="col-lg-4"> <?php echo $form->field($model, 'branch_id')->dropDownList(Branch::selectAssignedOptions(), ['prompt' => '== Unit Aktif ==']); ?> <?php echo $form->field($model, 'warehouse_id')->dropDownList(Warehouse::selectAssignedOptions(), ['prompt' => '== Warehouse Aktif ==']); ?> </div> <div class="col-lg-12"> <div class="form-group"> <?php echo Html::submitButton('Submit', ['class' => 'btn btn-primary']); ?> </div> </div> </div> <?php ActiveForm::end(); ?> </div><!-- sales-sales-x-config -->
/** * @return \yii\db\ActiveQuery */ public function getWarehouses() { return $this->hasMany(Warehouse::className(), ['id' => 'warehouse_id'])->viaTable('product_stock', ['product_id' => 'id']); }