public function validasiInvoce($attribute) { $kondisi = Rtdetail::find()->where(['TERM_ID' => $this->temId, 'NOMER_INVOCE' => $this->invoiceNo])->one(); if ($kondisi) { $this->addError($attribute, 'Nomer Invoce sudah ada' . ' ' . $this->invoiceNo); } }
/** * Creates data provider instance with search query applied * * @param array $params * * @return ActiveDataProvider */ public function searchExportInvestasi($params, $id) { /** *search redirect accounting only RI and RID *@author wawan */ $query = Rtdetail::find()->where(['TERM_ID' => $id])->andwhere(['<>', 'STATUS', 3])->andwhere(['LIKE', 'KD_RIB', 'RI'])->andwhere(['LIKE', 'KD_RIB', 'RID']); $dataProvider = new ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => 1000]]); $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(['STORE_ID' => $this->STORE_ID, 'NOMER_INVOCE' => $this->NOMER_INVOCE, 'NOMER_FAKTURPAJAK' => $this->NOMER_FAKTURPAJAK, 'PERIODE_START' => $this->PERIODE_START, 'PERIODE_END' => $this->PERIODE_END]); $query->andFilterWhere(['like', 'INVESTASI_TYPE', $this->nminvest])->andFilterWhere(['like', 'NOMER_FAKTURPAJAK', $this->NOMER_FAKTURPAJAK]); // ->andFilterWhere(['like', 'NM_BARANG', $this->NM_BARANG]) // ->andFilterWhere(['like', 'NO_URUT', $this->NO_URUT]) // ->andFilterWhere(['like', 'NOTE', $this->NOTE]); return $dataProvider; }
public function getDetro() { return $this->hasMany(Rtdetail::className(), ['KD_RIB' => 'KD_RIB']); }
/** *update request term detail and header *@author wawan */ public function actionActualView($id, $kd_term) { $model = Rtdetail::find()->where(['KD_RIB' => $id])->one(); $model_header = Requesttermheader::find()->with('cusheader')->where(['KD_RIB' => $id])->one(); // $cari_header_term = TermHeader::find()->where(['TERM_ID'=>$kd_term])->one(); // $cari_customers = Customers::find()->where(['CUST_GRP'=>$cari_header_term->CUST_KD_PARENT])->one(); /*array */ $data = [2 => '2 persen', 4 => '4 persen ', 10 => '10 persen', 15 => '15 persen']; if ($model->load(Yii::$app->request->post())) { $model->save(); return $this->redirect(['actual-review', 'id' => $model_header->TERM_ID]); } else { # code... return $this->renderAjax('view_actual', ['model' => $model, 'model_header' => $model_header->cusheader->CUST_NM, 'investData' => self::aryData_invest(), 'data' => $data]); } }