Пример #1
0
 /**
  * Saved Data Sadetail
  * @author ptrnov  <*****@*****.**>
  * @since 1.1
  */
 public function additem_saved()
 {
     if ($this->validate()) {
         $rodetail = new Sadetail();
         $rodetail->CREATED_AT = date('Y-m-d H:i:s');
         $rodetail->KD_RO = $this->kD_SA;
         $rodetail->KD_BARANG = $this->kD_BARANG;
         $rodetail->NM_BARANG = $this->namaBarang($this->kD_BARANG);
         $rodetail->UNIT = $this->uNIT;
         $rodetail->RQTY = $this->rQTY;
         $rodetail->NOTE = $this->nOTE;
         $rodetail->STATUS = 0;
         if ($rodetail->save()) {
             return $rodetail;
         }
         return $rodetail;
     }
     return null;
 }
Пример #2
0
 public function getDetsa()
 {
     return $this->hasMany(Sadetail::className(), ['KD_SA' => 'KD_SA']);
 }
Пример #3
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Sadetail::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(['QTY' => $this->QTY, 'STATUS' => $this->STATUS, 'CREATED_AT' => $this->CREATED_AT, 'UPDATED_AT' => $this->UPDATED_AT]);
     $query->andFilterWhere(['like', 'KD_SA', $this->KD_SA])->andFilterWhere(['like', 'KD_BARANG', $this->KD_BARANG])->andFilterWhere(['like', 'NM_BARANG', $this->NM_BARANG])->andFilterWhere(['like', 'NO_URUT', $this->NO_URUT])->andFilterWhere(['like', 'NOTE', $this->NOTE]);
     return $dataProvider;
 }
Пример #4
0
 public function actionHapusro($kd)
 {
     $model = Salesorder::find()->where(['KD_SA' => $kd])->one();
     $model->STATUS = 3;
     $model->raimburseve();
     $model = Sadetail::find()->where(['KD_SA' => $kd])->one();
     $model->STATUS = 3;
     $model->raimburseve();
     return Yii::$app->getResponse()->redirect(['/accounting/raimburseles-order/index']);
 }