Ejemplo n.º 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = StockPicking::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     } else {
         $query->andFilterWhere(['id' => $this->id, 'create_uid' => $this->create_uid, 'create_date' => $this->create_date, 'write_date' => $this->write_date, 'write_uid' => $this->write_uid, 'date_done' => $this->date_done, 'min_date' => $this->min_date, 'date' => $this->date, 'partner_id' => $this->partner_id, 'stock_journal_id' => $this->stock_journal_id, 'backorder_id' => $this->backorder_id, 'location_id' => $this->location_id, 'company_id' => $this->company_id, 'location_dest_id' => $this->location_dest_id, 'max_date' => $this->max_date, 'auto_picking' => $this->auto_picking, 'purchase_id' => $this->purchase_id, 'sale_id' => $this->sale_id, 'invoice_id' => $this->invoice_id, 'number_of_packages' => $this->number_of_packages, 'carrier_id' => $this->carrier_id, 'weight' => $this->weight, 'weight_uom_id' => $this->weight_uom_id, 'weight_net' => $this->weight_net, 'volume' => $this->volume, 'note_id' => $this->note_id, 'isset_set' => $this->isset_set]);
         $query->andFilterWhere(['like', 'origin', $this->origin])->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'move_type', $this->move_type])->andFilterWhere(['like', 'invoice_state', $this->invoice_state])->andFilterWhere(['like', 'note', $this->note])->andFilterWhere(['like', 'state', $this->state])->andFilterWhere(['like', 'type', $this->type])->andFilterWhere(['like', 'carrier_tracking_ref', $this->carrier_tracking_ref])->andFilterWhere(['like', 'cust_doc_ref', $this->cust_doc_ref])->andFilterWhere(['like', 'lbm_no', $this->lbm_no]);
         return $dataProvider;
     }
 }
Ejemplo n.º 2
0
 public function getStockPicking0()
 {
     return $this->hasOne(StockPicking::className(), ['note_id' => 'id']);
 }
Ejemplo n.º 3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getPicking()
 {
     return $this->hasOne(StockPicking::className(), ['id' => 'picking_id']);
 }
Ejemplo n.º 4
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getStockPickings()
 {
     return $this->hasMany(StockPicking::className(), ['weight_uom_id' => 'id']);
 }
Ejemplo n.º 5
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getStockPickings()
 {
     return $this->hasMany(StockPicking::className(), ['invoice_id' => 'id']);
 }
Ejemplo n.º 6
0
 /**
  * Finds the StockPicking model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return StockPicking the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id, $model = 0)
 {
     switch ($model) {
         case 1:
             $modelN = 'StockMove';
             if (($model = StockMove::findOne($id)) !== null) {
                 return $model;
             } else {
                 throw new NotFoundHttpException('The requested page does not exist.');
             }
             break;
         default:
             # code...
             $modelN = 'StockPicking';
             if (($model = StockPicking::findOne($id)) !== null) {
                 return $model;
             } else {
                 throw new NotFoundHttpException('The requested page does not exist.');
             }
             break;
     }
 }