/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function search($params) { $query = Documentodetalle::find(); $dataProvider = new ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => 10]]); $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(['like', 'numeroDocumentoEmisor', $this->numeroDocumentoEmisor])->andFilterWhere(['like', 'numeroOrdenItem', $this->numeroOrdenItem])->andFilterWhere(['like', 'serieNumero', $this->serieNumero])->andFilterWhere(['like', 'tipoDocumento', $this->tipoDocumento])->andFilterWhere(['like', 'tipoDocumentoEmisor', $this->tipoDocumentoEmisor])->andFilterWhere(['like', 'cantidad', $this->cantidad])->andFilterWhere(['like', 'codigoImporteUnitarioConImpues', $this->codigoImporteUnitarioConImpues])->andFilterWhere(['like', 'codigoProducto', $this->codigoProducto])->andFilterWhere(['like', 'codigoRazonExoneracion', $this->codigoRazonExoneracion])->andFilterWhere(['like', 'descripcion', $this->descripcion])->andFilterWhere(['like', 'importeIgv', $this->importeIgv])->andFilterWhere(['like', 'importeTotalSinImpuesto', $this->importeTotalSinImpuesto])->andFilterWhere(['like', 'importeUnitarioConImpuesto', $this->importeUnitarioConImpuesto])->andFilterWhere(['like', 'importeUnitarioSinImpuesto', $this->importeUnitarioSinImpuesto])->andFilterWhere(['like', 'unidadMedida', $this->unidadMedida]); return $dataProvider; }
/** * Finds the Documentodetalle model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param string $numeroDocumentoEmisor * @param string $numeroOrdenItem * @param string $serieNumero * @param string $tipoDocumento * @param string $tipoDocumentoEmisor * @return Documentodetalle the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($numeroDocumentoEmisor, $numeroOrdenItem, $serieNumero, $tipoDocumento, $tipoDocumentoEmisor) { if (($model = Documentodetalle::findOne(['numeroDocumentoEmisor' => $numeroDocumentoEmisor, 'numeroOrdenItem' => $numeroOrdenItem, 'serieNumero' => $serieNumero, 'tipoDocumento' => $tipoDocumento, 'tipoDocumentoEmisor' => $tipoDocumentoEmisor])) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
/** * @return \yii\db\ActiveQuery */ public function getDocumentodetalles() { return $this->hasMany(Documentodetalle::className(), ['numeroDocumentoEmisor' => 'numeroDocumentoEmisor', 'serieNumero' => 'serieNumero', 'tipoDocumento' => 'tipoDocumento', 'tipoDocumentoEmisor' => 'tipoDocumentoEmisor'])->all(); }