/**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Requisicion::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['idrequisicion' => $this->idrequisicion, 'status' => $this->status, 'fecha' => $this->fecha, 'tipo' => $this->tipo, 'numcontrol' => $this->numcontrol, 'idefiscal' => $this->idefiscal, 'idtipoproducto' => $this->idtipoproducto, 'idcoordinacion' => $this->idcoordinacion, 'idtipopago' => $this->idtipopago, 'statusinformatica' => $this->statusinformatica, 'statusadmin' => $this->statusadmin, 'fechainformatica' => $this->fechainformatica, 'fechaadmin' => $this->fechaadmin, 'bitacora' => $this->bitacora, 'idusuario' => $this->idusuario, 'idproveedor' => $this->idproveedor, 'monto' => $this->monto, 'idcuenta' => $this->idcuenta, 'idpuc' => $this->idpuc, 'idcategoriaprogramatica' => $this->idcategoriaprogramatica, 'disponible' => $this->disponible, 'iddireccion' => $this->iddireccion, 'imputacion' => $this->imputacion]);
     $query->andFilterWhere(['like', 'observaciones', $this->observaciones])->andFilterWhere(['like', 'concepto', $this->concepto])->andFilterWhere(['like', 'motivorechazo', $this->motivorechazo])->andFilterWhere(['like', 'dirip', $this->dirip])->andFilterWhere(['like', 'puc', $this->puc])->andFilterWhere(['like', 'categoriaprogramatica', $this->categoriaprogramatica])->andFilterWhere(['like', 'auxiliar', $this->auxiliar])->andFilterWhere(['like', 'secuencia', $this->secuencia]);
     return $dataProvider;
 }
 public function actionRequisicionservicios_send()
 {
     $model = new Requisicion();
     $direction = \yii::$app->user->Identity->id_direccion;
     if (\Yii::$app->request->post() && !empty($model)) {
         $fecha = Yii::$app->request->post('fecha');
         $concepto = Yii::$app->request->post('concepto');
         $idtipopago = Yii::$app->request->post('idtipopago');
         $secuencia = Yii::$app->request->post('secuencia');
         $model->numcontrol = 1;
         $model->status = 5;
         $model->tipo = 1;
         $model->fecha = $fecha;
         $model->concepto = $concepto;
         $model->idtipopago = $idtipopago;
         $model->secuencia = $secuencia;
         $model->iddireccion = $direction;
         if ($model->validate()) {
             $model->save();
             return $this->redirect(['view', 'id' => $model->idrequisicion]);
             Yii::$app->session->setFlash('success', 'Requisicion Servicios Creada con Exito....');
         }
     }
 }