/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = GoodsMovementDtlModel::find()->select(['goods_movement_dtl.*', 'product.*'])->with(['product', 'uom', 'movement'])->joinWith(['product']); $dataProvider = new ActiveDataProvider(['query' => $query]); $this->load($params); if (!$this->validate()) { $query->where('1=0'); return $dataProvider; } $query->andFilterWhere(['movement_id' => $this->movement_id, 'product_id' => $this->product_id, 'uom_id' => $this->uom_id, 'qty' => $this->qty, 'value' => $this->value, 'cogs' => $this->cogs]); return $dataProvider; }
/** * @return \yii\db\ActiveQuery */ public function getItems() { return $this->hasMany(GoodsMovementDtl::className(), ['movement_id' => 'id']); }
/** * Finds the GoodsMovementDtl model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $movement_id * @param integer $product_id * @return GoodsMovementDtl the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($movement_id, $product_id) { if (($model = GoodsMovementDtl::findOne(['movement_id' => $movement_id, 'product_id' => $product_id])) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
?> </th> <th class="items" style="width: 10%"> Qty Trans </th> <th style="width: 10%"> Uom </th> <th style="width: 10%"> Total Line </th> </tr> </thead> <tbody> <?php echo TabularInput::widget(['id' => 'detail-grid', 'allModels' => $model->items, 'viewParams' => ['is_issue' => $model->type == $model::TYPE_ISSUE], 'model' => GoodsMovementDtl::className(), 'tag' => 'tbody', 'itemOptions' => ['tag' => 'tr'], 'itemView' => '_item_detail', 'clientOptions' => []]); ?> </tbody> </table> <!-- Modal --> <div class="modal fade" id="listPO" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="modal-title" id="myModalLabel">Modal title</h4> </div> <div class="modal-body"> ... </div>
<!-- <span class="input-group-btn"> <?php echo ''; ?> </span>--> </div> </td> <td> </td> <td> </td> <th><span class="pull-right" id="total"></span></th> </tr> </thead> <tbody> <?php echo TabularInput::widget(['id' => 'detail-grid', 'allModels' => $model->items, 'model' => GoodsMovementDtl::className(), 'tag' => 'tbody', 'itemOptions' => ['tag' => 'tr'], 'itemView' => '_item_detail', 'clientOptions' => []]); ?> </tbody> </table> <!-- Modal --> <div class="modal fade" id="listPO" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="modal-title" id="myModalLabel">Modal title</h4> </div> <div class="modal-body"> ... </div>