Esempio n. 1
0
 protected function namaBarang($kdBarang)
 {
     $nmBarang = Barang::findOne(['KD_BARANG' => $kdBarang]);
     return $nmBarang->NM_BARANG;
 }
 /**
  * Finds the Barang model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param string $ID
  * @return Barang the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($ID)
 {
     if (($model = Barang::findOne($ID)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
 public function actionSimpantambah()
 {
     $roDetail = new Sodetail();
     if ($roDetail->load(Yii::$app->request->post()) && $roDetail->validate()) {
         $hsl = \Yii::$app->request->post();
         $kdro = $hsl['Sodetail']['KD_RO'];
         $kdBarang = $hsl['Sodetail']['KD_BARANG'];
         $nmBarang = Barang::findOne(['KD_BARANG' => $kdBarang]);
         $kdUnit = $hsl['Sodetail']['UNIT'];
         $rqty = $hsl['Sodetail']['RQTY'];
         $note = $hsl['Sodetail']['NOTE'];
         /*
          * Detail Request Order
          **/
         $roDetail->KD_RO = $kdro;
         $roDetail->CREATED_AT = date('Y-m-d H:i:s');
         $roDetail->NM_BARANG = $nmBarang->NM_BARANG;
         $roDetail->KD_BARANG = $kdBarang;
         $roDetail->UNIT = $kdUnit;
         $roDetail->RQTY = $rqty;
         $roDetail->NOTE = $note;
         $roDetail->STATUS = 0;
         $roDetail->save();
         return $this->redirect(['index?SalesorderSearch[KD_RO]=' . $kdro]);
     } else {
         return $this->redirect(['index']);
     }
 }
Esempio n. 4
0
 protected function valuesBarang($kdBarang)
 {
     $valuesBarang = Barang::findOne(['KD_BARANG' => $kdBarang]);
     return $valuesBarang;
 }