public function get_aryBarang()
 {
     $sql = Barang::find()->where('KD_CORP="ESM" AND PARENT= 1 AND STATUS<>3')->all();
     return ArrayHelper::map($sql, function ($sql, $defaultValue) {
         return $sql->KD_BARANG . ',' . $sql->NM_BARANG;
     }, 'NM_BARANG');
 }
Exemplo n.º 2
0
 /**
  * ACTION INDEX
  */
 public function actionIndex()
 {
     /*CNT Barang Prodak*/
     $cntBrgProdak = "SELECT COUNT(KD_BARANG) As KD_BARANG FROM b0001 WHERE PARENT=1";
     $cntBrgPrdk = Barang::findBySql($cntBrgProdak)->one();
     /*CNT Barang Umum*/
     $cntBrgUmum = "SELECT COUNT(KD_BARANG) As KD_BARANG FROM b0001 WHERE PARENT=0";
     $cntBrgUmn = Barang::findBySql($cntBrgUmum)->one();
     /*CNT Barang Type*/
     $cntType = "SELECT  COUNT(NM_TYPE) as NM_TYPE FROM b1001";
     $cntTyp = Tipebarang::findBySql($cntType)->one();
     /*CNT Barang Kategori*/
     $cntCategory = "SELECT COUNT(NM_KATEGORI) as NM_KATEGORI FROM b1002";
     $cntCtg = Kategori::findBySql($cntCategory)->one();
     /*CNT Barang Unit*/
     $cntUnit = "SELECT COUNT(KD_UNIT) as KD_UNIT FROM ub0001";
     $cntUnt = Unitbarang::findBySql($cntUnit)->one();
     /*CNT Supplier*/
     $cntSupplier = "SELECT COUNT(KD_SUPPLIER) as KD_SUPPLIER FROM s1000";
     $cntSpl = Suplier::findBySql($cntSupplier)->one();
     /*CNT Distributor*/
     $cntDistributor = "SELECT COUNT(KD_DISTRIBUTOR) as KD_DISTRIBUTOR FROM d0001";
     $cntDist = Distributor::findBySql($cntDistributor)->one();
     /*CNT Customer*/
     $cntCustomer = "SELECT COUNT(CUST_KD) as CUST_KD FROM c0001";
     $cntCst = Customers::findBySql($cntCustomer)->one();
     //print_r($cntBrgPrdk->KD_BARANG);
     return $this->render('index', ['cntBrgPrdk' => $cntBrgPrdk->KD_BARANG, 'cntBrgUmn' => $cntBrgUmn->KD_BARANG, 'cntTyp' => $cntTyp->NM_TYPE, 'cntCtg' => $cntCtg->NM_KATEGORI, 'cntUnt' => $cntUnt->KD_UNIT, 'cntSpl' => $cntSpl->KD_SUPPLIER, 'cntDist' => $cntDist->KD_DISTRIBUTOR, 'cntCst' => $cntCst->CUST_KD]);
 }
Exemplo n.º 3
0
 /**
  * Lists all Barangalias models.
  * @return mixed
  */
 public function actionProduct()
 {
     $out = [];
     if (isset($_POST['depdrop_parents'])) {
         $parents = $_POST['depdrop_parents'];
         if ($parents != null) {
             $id = $parents[0];
             $model = Barang::find()->asArray()->where(['PARENT' => $id])->andwhere('STATUS <> 3')->all();
             // print_r($model);
             // die();
             //$out = self::getSubCatList($cat_id);
             // the getSubCatList function will query the database based on the
             // cat_id and return an array like below:
             // [
             //    ['id'=>'<sub-cat-id-1>', 'name'=>'<sub-cat-name1>'],
             //    ['id'=>'<sub-cat_id_2>', 'name'=>'<sub-cat-name2>']
             // ]
             foreach ($model as $key => $value) {
                 $out[] = ['id' => $value['KD_BARANG'], 'name' => $value['NM_BARANG']];
             }
             echo json_encode(['output' => $out, 'selected' => '']);
             return;
         }
     }
     echo Json::encode(['output' => '', 'selected' => '']);
 }
Exemplo n.º 4
0
 /**
  * Saved Data Rodetail
  * @author ptrnov  <*****@*****.**>
  * @since 1.1
  */
 public function addnewitem_saved()
 {
     if ($this->validate()) {
         $barangNew = new Barang();
         $this->kD_BARANG = Yii::$app->esmcode->kdbarangUmum(0, $this->kD_CORP, $this->kD_TYPE, $this->kD_KATEGORI, $this->uNIT);
         $barangNew->KD_BARANG = $this->kD_BARANG;
         $barangNew->NM_BARANG = $this->nM_BARANG;
         $barangNew->KD_UNIT = $this->uNIT;
         $barangNew->HARGA_SPL = $this->hARGA;
         $barangNew->PARENT = 0;
         $barangNew->KD_CORP = $this->kD_CORP;
         $barangNew->KD_TYPE = $this->kD_TYPE;
         $barangNew->KD_KATEGORI = $this->kD_KATEGORI;
         $barangNew->KD_SUPPLIER = $this->kD_SUPPLIER;
         $barangNew->STATUS = 1;
         $barangNew->CREATED_BY = Yii::$app->user->identity->username;
         $barangNew->CREATED_AT = date('Y-m-d H:i:s');
         $barangNew->UPDATED_BY = Yii::$app->user->identity->username;
         if ($barangNew->validate()) {
             $barangNew->save();
             $rodetail = new Rodetail();
             $rodetail->CREATED_AT = date('Y-m-d H:i:s');
             $rodetail->KD_RO = $this->kD_RO;
             //required
             $rodetail->KD_CORP = $this->kD_CORP;
             //required
             $rodetail->PARENT_ROSO = 0;
             // RO=1 		//required
             $rodetail->KD_BARANG = $this->kD_BARANG;
             $rodetail->NM_BARANG = $this->nM_BARANG;
             $rodetail->UNIT = $this->uNIT;
             $rodetail->RQTY = $this->rQTY;
             $rodetail->SQTY = $this->rQTY;
             $rodetail->NOTE = $this->nOTE;
             $rodetail->HARGA = $this->hARGA;
             $rodetail->STATUS = 0;
             if ($rodetail->save()) {
                 // print_r($rodetail->geterrors());
                 return $rodetail;
             }
         }
     }
     return null;
 }
Exemplo n.º 5
0
 /**
  * Check PO PLUS| kD_PO kD_BARANG =0 | Jika Ada, update Harga/QTY 
  * @author ptrnov  <*****@*****.**>
  * @since 1.1
  */
 public function findcheck($attribute, $params)
 {
     if (!$this->hasErrors()) {
         $cntDetailPo = Purchasedetail::find()->where('STATUS<>3 AND KD_PO="' . $this->kD_PO . '" AND KD_BARANG="' . $this->kD_BARANG . '"')->count();
         if ($cntDetailPo) {
             $this->addError($attribute, 'SKU Alrady Exist,Please Update Quantity or Price');
         } else {
             $brg = Barang::find()->where(['KD_BARANG' => $this->kD_BARANG])->one();
             //$roDetail = Rodetail::find()->where(['KD_RO'=>$kD_RO,'KD_BARANG'=>$this->kD_BARANG])->all();
             $brgUnit = $brg->unitb;
             $this->nM_BARANG = $brg->NM_BARANG;
             $this->hARGA = $brg->PARENT == 1 ? $brg->HARGA_PABRIK : $brg->HARGA_SPL;
             $this->nM_UNIT = $brgUnit->NM_UNIT;
             $this->qTY_UNIT = $brgUnit->QTY;
             $this->wEIGHT_UNIT = $brgUnit->WEIGHT;
         }
     }
 }
Exemplo n.º 6
0
 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']);
     }
 }
Exemplo n.º 7
0
 /**
  * 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.');
     }
 }
Exemplo n.º 8
0
use yii\helpers\Url;
use kartik\builder\Form;
use kartik\widgets\TouchSpin;
use yii\web\JsExpression;
use yii\data\ActiveDataProvider;
use lukisongroup\purchasing\models\ro\RodetailSearch;
use lukisongroup\master\models\Tipebarang;
use lukisongroup\master\models\Barang;
use lukisongroup\master\models\Kategori;
use lukisongroup\master\models\Unitbarang;
use lukisongroup\hrd\models\Corp;
$userCorp = ArrayHelper::map(Corp::find()->all(), 'CORP_ID', 'CORP_NM');
$brgType = ArrayHelper::map(Tipebarang::find()->where(['PARENT' => 0])->orderBy('NM_TYPE')->all(), 'KD_TYPE', 'NM_TYPE');
$brgUnit = ArrayHelper::map(Unitbarang::find()->orderBy('NM_UNIT')->all(), 'KD_UNIT', 'NM_UNIT');
$brgKtg = ArrayHelper::map(Kategori::find()->where(['PARENT' => 0, 'STATUS' => 1])->orderBy('NM_KATEGORI')->all(), 'KD_KATEGORI', 'NM_KATEGORI');
$brgUmum = ArrayHelper::map(Barang::find()->where(['PARENT' => 0, 'STATUS' => 1])->orderBy('NM_BARANG')->all(), 'KD_BARANG', 'NM_BARANG');
?>
	<?php 
/*
 * DESCRIPTION FORM AddItem
 * Form Add Items Hanya ada pada Form Edit | ACTION addItem
 * Items Barang tidak bisa di input Duplicated. | Unix by KD_RO dan KD_BARANG
 * @author ptrnov  <*****@*****.**>
 * @since 1.1
 */
?>

	<div  style="padding-top:20">
		<!-- Render create form -->
			<?php 
/* echo $this->render('_form', [
 /**
  * actionBrgkat() select2 Kategori mendapatkan barang
  * @author ptrnov  <*****@*****.**>
  * @since 1.1
  */
 public function actionCariBrg()
 {
     $out = [];
     if (isset($_POST['depdrop_parents'])) {
         $parents = $_POST['depdrop_parents'];
         if ($parents != null) {
             $kat_id = $parents[0];
             $model = Barang::find()->asArray()->where(['KD_KATEGORI' => $kat_id])->all();
             foreach ($model as $key => $value) {
                 $out[] = ['id' => $value['KD_BARANG'], 'name' => $value['NM_BARANG']];
             }
             echo json_encode(['output' => $out, 'selected' => '']);
             return;
         }
     }
     echo Json::encode(['output' => '', 'selected' => '']);
 }
Exemplo n.º 10
0
 public function actionCreatepo()
 {
     $post = Yii::$app->request->post();
     $coall = count($post['hargaBarang']);
     $kdpo = $post['kdpo'];
     for ($i = 0; $i < $coall; $i++) {
         $kdBrg = $post['kdBarang'][$i];
         $harga = $post['hargaBarang'][$i];
         $ckBrg = explode('.', $kdBrg);
         if ($ckBrg[0] == 'BRG') {
             $nmBrg = Barang::find('NM_BARANG')->where(['KD_BARANG' => $kdBrg])->one();
             $nmBrg->HARGA = $harga;
             $nmBrg->save();
         } else {
             if ($ckBrg[0] == 'BRGU') {
                 $nmBrg = Barang::find('NM_BARANG')->where(['KD_BARANG' => $kdBrg])->one();
                 $nmBrg->HARGA = $harga;
                 $nmBrg->save();
             }
         }
         $detpo = Purchasedetail::find('ID')->where(['KD_BARANG' => $kdBrg, 'KD_PO' => $kdpo])->one();
         $cons = \Yii::$app->db_esm;
         $command = $cons->createCommand();
         $command->update('p0002', ['HARGA' => $harga], "ID='{$detpo->ID}'")->execute();
     }
     $po = Purchaseorder::find()->where(['KD_PO' => $kdpo])->one();
     $po->STATUS = '101';
     $po->PAJAK = $post['pajak'];
     $po->DISC = $post['disc'];
     $po->NOTE = $post['note'];
     $po->ETA = $post['eta'];
     $po->ETD = $post['etd'];
     $po->SHIPPING = $post['shipping'];
     $po->BILLING = $post['billing'];
     $po->DELIVERY_COST = $post['delvCost'];
     $po->save();
     return $this->redirect([' ']);
 }
Exemplo n.º 11
0
//print_r($aryProviderDataStock);
//print_r($aryProviderHeaderStock);
/*
 * === STOCK =======================
 * @author ptrnov [ptr.nov@gmail.com]
 * @since 1.2
 * ===================================
 */
foreach ($aryProviderHeaderStock as $key => $value) {
    $colorb = 'rgba(255, 255, 142, 0.2)';
    if ($key == 'CUST_NM') {
        $lbl = "Customer Name";
        $align = "left";
        $pageSummary = 'Sub Total';
    } else {
        $kd = explode('_', $key);
        //echo $kd[1];
        $nmBrg = Barang::find()->where("KD_BARANG='" . $kd[1] . "'")->one();
        $lblR = $nmBrg['NM_BARANG'];
        $lbl = str_replace('MAXI', '', $lblR);
        $align = "center";
        $pageSummary = true;
    }
    /* Attribute Dinamik */
    $attDinamikSTCK[] = ['attribute' => $key, 'label' => $lbl, 'hAlign' => 'right', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => $align, 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt', 'background-color' => $colorb]], 'pageSummaryFunc' => GridView::F_SUM, 'pageSummary' => $pageSummary, 'pageSummaryOptions' => ['style' => ['text-align' => 'center', 'width' => '30px', 'font-family' => 'tahoma', 'font-size' => '8pt', 'border-left' => '0px']]];
}
$gvStockSummary = GridView::widget(['id' => 'gv-summary-stock', 'dataProvider' => $aryProviderDataStock, 'showPageSummary' => true, 'columns' => $attDinamikSTCK, 'pjax' => true, 'pjaxSettings' => ['options' => ['enablePushState' => false, 'id' => 'gv-summary-stock']], 'summary' => false, 'hover' => true, 'responsive' => true, 'responsiveWrap' => true, 'bordered' => true]);
?>
	<div style="font-family:tahoma, arial, sans-serif;font-size:9pt;text-align:center;color:red"><b>REVIEW - STOCK</b></div>
	<?php 
echo $gvStockSummary;
Exemplo n.º 12
0
 /**
  * BARANG PRODUCTION || Lukisongroup
  * PARENT = 1 [PRODUK]
  * @author ptrnov [piter@lukison.com]
  */
 public function searchBarangLG($params)
 {
     $query = Barang::find()->where('b0001.STATUS <> 3')->andWhere('b0001.PARENT=1 AND KD_CORP="LG"')->groupBy(['KD_BARANG', 'KD_CORP', 'KD_TYPE', 'KD_KATEGORI']);
     $query->joinWith(['unitb' => function ($q) {
         $q->where('ub0001.NM_UNIT LIKE "%' . $this->unitbrg . '%"');
     }]);
     $dataProvider = new ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => 20]]);
     $dataProvider->setSort(['attributes' => ['KD_BARANG', 'NM_BARANG', 'unitbrg' => ['asc' => ['ub0001.NM_UNIT' => SORT_ASC], 'desc' => ['ub0001.NM_UNIT' => SORT_DESC], 'label' => 'Unit Barang'], 'tipebrg' => ['asc' => ['dbc002.b1001.NM_TYPE' => SORT_ASC], 'desc' => ['dbc002.b1001.NM_TYPE' => SORT_DESC], 'label' => 'Tipe Barang'], 'nmkategori' => ['asc' => ['b1002.NM_KATEGORI' => SORT_ASC], 'desc' => ['b1002.NM_KATEGORI' => SORT_DESC], 'label' => 'Kategori']]]);
     if (!($this->load($params) && $this->validate())) {
         /**
          * The following line will allow eager loading with country data
          * to enable sorting by country on initial loading of the grid.
          */
         return $dataProvider;
     }
     $query->andFilterWhere(['like', 'b0001.STATUS', $this->STATUS])->andFilterWhere(['like', 'NM_BARANG', $this->NM_BARANG])->andFilterWhere(['like', 'b0001.KD_BARANG', $this->KD_BARANG])->andFilterWhere(['like', 'b0001.KD_TYPE', $this->tipebrg])->andFilterWhere(['like', 'b0001.KD_KATEGORI', $this->nmkategori]);
     return $dataProvider;
 }
Exemplo n.º 13
0
 public function getTbesm()
 {
     return $this->hasMany(Barang::className(), ['KD_BARANG' => 'KD_TYPE']);
 }
Exemplo n.º 14
0
 public function getBarangs()
 {
     return $this->hasOne(Barang::className(), ['KD_BARANG' => 'BRG_ID']);
 }
Exemplo n.º 15
0
 /**
  * actionBrgkat() select2 barang mendapatkan unit barang
  * @author ptrnov  <*****@*****.**>
  * @since 1.1
  */
 public function actionBrgunit()
 {
     $out = [];
     if (isset($_POST['depdrop_parents'])) {
         $ids = $_POST['depdrop_parents'];
         $kat_id = empty($ids[0]) ? null : $ids[0];
         $brg_id = empty($ids[1]) ? null : $ids[1];
         if ($brg_id != null) {
             $brgu = new Barang();
             $model = Barang::find()->where("KD_BARANG='" . $brg_id . "'")->one();
             $brgUnit = $model->unit;
             //foreach ($brgUnit as $value) {
             //$out[] = ['id'=>$value['UNIT'],'name'=> $value['NM_UNIT']];
             $out[] = ['id' => $brgUnit->KD_UNIT, 'name' => $brgUnit->NM_UNIT];
             //$out[] = ['id'=>'E07','name'=> $value->NM_UNIT];
             // }
             echo json_encode(['output' => $out, 'selected' => '']);
             return;
         }
     }
     echo Json::encode(['output' => '', 'selected' => '']);
 }
Exemplo n.º 16
0
 protected function namaBarang($kdBarang)
 {
     $nmBarang = Barang::findOne(['KD_BARANG' => $kdBarang]);
     return $nmBarang->NM_BARANG;
 }
Exemplo n.º 17
0
 private function aryBrgID()
 {
     $dataCust = ArrayHelper::map(Barang::find()->where(['KD_CORP' => 'ESM', 'KD_TYPE' => '01', 'KD_KATEGORi' => '01'])->orderBy('NM_BARANG')->asArray()->all(), 'KD_BARANG', 'NM_BARANG');
     return $dataCust;
 }
Exemplo n.º 18
0
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use kartik\widgets\Select2;
use kartik\widgets\DepDrop;
use yii\helpers\Url;
use kartik\builder\Form;
use kartik\widgets\TouchSpin;
use yii\web\JsExpression;
use yii\data\ActiveDataProvider;
//use lukisongroup\master\models\Barangumum;
use lukisongroup\master\models\Barang;
use lukisongroup\master\models\Kategori;
use lukisongroup\master\models\Unitbarang;
$brgUnit = ArrayHelper::map(Unitbarang::find()->orderBy('NM_UNIT')->all(), 'KD_UNIT', 'NM_UNIT');
$brgKtg = ArrayHelper::map(Kategori::find()->orderBy('NM_KATEGORI')->all(), 'KD_KATEGORI', 'NM_KATEGORI');
$brgAll = ArrayHelper::map(Barang::find()->orderBy('NM_BARANG')->all(), 'KD_BARANG', 'NM_BARANG');
/* $this->registerJs("
        $.fn.modal.Constructor.prototype.enforceFocus = function() {};			
    ",$this::POS_HEAD);
 */
$aryParent = [['PARENT' => 0, 'PAREN_NM' => 'UMUM'], ['PARENT' => 1, 'PAREN_NM' => 'PRODAK']];
$valParent = ArrayHelper::map($aryParent, 'PARENT', 'PAREN_NM');
?>


    <?php 
$form = ActiveForm::begin(['id' => 'poplus-Input', 'enableClientValidation' => true, 'enableAjaxValidation' => true, 'method' => 'post', 'action' => ['/purchasing/purchase-order/poplus-additem-save']]);
?>
	<?php 
//= $form->errorSummary($model);
?>
Exemplo n.º 19
0
 public function getBrgproduksi()
 {
     return $this->hasOne(Barang::className(), ['KD_BARANG' => 'KD_BARANG']);
 }
Exemplo n.º 20
0
 protected function valuesBarang($kdBarang)
 {
     $valuesBarang = Barang::findOne(['KD_BARANG' => $kdBarang]);
     return $valuesBarang;
 }
Exemplo n.º 21
0
use kartik\widgets\DepDrop;
use yii\helpers\Url;
use kartik\builder\Form;
use kartik\widgets\TouchSpin;
use yii\web\JsExpression;
use yii\data\ActiveDataProvider;
use lukisongroup\master\models\Tipebarang;
use lukisongroup\master\models\Kategori;
use lukisongroup\master\models\Unitbarang;
use lukisongroup\master\models\Barang;
use lukisongroup\hrd\models\Corp;
$userCorp = ArrayHelper::map(Corp::find()->where('CORP_STS<>3')->all(), 'CORP_ID', 'CORP_NM');
$brgUnit = ArrayHelper::map(Unitbarang::find()->where('STATUS<>3')->orderBy('NM_UNIT')->all(), 'KD_UNIT', 'NM_UNIT');
$brgType = ArrayHelper::map(Tipebarang::find()->where('PARENT=1 AND STATUS<>3')->orderBy('NM_TYPE')->all(), 'KD_TYPE', 'NM_TYPE');
$brgKtg = ArrayHelper::map(Kategori::find()->where('PARENT=1 AND STATUS<>3')->orderBy('NM_KATEGORI')->all(), 'KD_KATEGORI', 'NM_KATEGORI');
$brgProdak = ArrayHelper::map(Barang::find()->where('PARENT=1 AND STATUS<>3')->orderBy('NM_BARANG')->all(), 'KD_BARANG', 'NM_BARANG');
?>


    <?php 
$form = ActiveForm::begin(['id' => 'roInput', 'enableClientValidation' => true, 'method' => 'post', 'action' => ['/purchasing/request-order/simpanfirst']]);
?>
	<?php 
//= $form->errorSummary($model);
?>
	
    <?php 
echo $form->field($roDetail, 'CREATED_AT', ['template' => "{input}"])->hiddenInput(['value' => date('Y-m-d H:i:s'), 'readonly' => true]);
?>

    <?php 
Exemplo n.º 22
0
use lukisongroup\master\models\Kategori;
use lukisongroup\master\models\Unitbarang;
use lukisongroup\hrd\models\Corp;
use kartik\money\MaskMoney;
use yii\helpers\Url;
// $userCorp = ArrayHelper::map(Corp::find()->where('CORP_STS<>3')->all(), 'CORP_ID', 'CORP_NM');
$brgUnit = ArrayHelper::map(Unitbarang::find()->where('STATUS<>3')->orderBy('NM_UNIT')->all(), 'KD_UNIT', 'NM_UNIT');
// $brgType = ArrayHelper::map(Tipebarang::find()->where('PARENT=0 AND STATUS<>3')->orderBy('NM_TYPE')->all(), 'KD_TYPE', 'NM_TYPE');
// $brgKtg  = ArrayHelper::map(Kategori::find()->where('PARENT=0 AND STATUS<>3')->orderBy('NM_KATEGORI')->all(), 'KD_KATEGORI', 'NM_KATEGORI');
// $brgUmum = ArrayHelper::map(Barang::find()->where('PARENT=0 AND STATUS<>3')->orderBy('NM_BARANG')->all(), 'KD_BARANG', 'NM_BARANG');
/* $this->registerJs("
        $.fn.modal.Constructor.prototype.enforceFocus = function() {};
    ",$this::POS_HEAD);
 */
$corp = Yii::$app->getUserOpt->Profile_user()->emp->EMP_CORP_ID;
$data = ArrayHelper::map(Barang::find()->where(['KD_CORP' => $corp])->all(), 'KD_BARANG', 'NM_BARANG');
?>


    <?php 
$form = ActiveForm::begin(['id' => $roDetail->formName(), 'enableClientValidation' => true, 'enableAjaxValidation' => true, 'method' => 'post', 'action' => ['/purchasing/request-order/simpanfirst'], 'validationUrl' => Url::toRoute('/purchasing/request-order/valid')]);
?>
	<?php 
//= $form->errorSummary($model);
?>

    <!-- $form->field($roDetail, 'CREATED_AT',['template' => "{input}"])->hiddenInput(['value'=>date('Y-m-d H:i:s'),'readonly' => true]) ?> -->

    <?php 
echo $form->field($roDetail, 'NEW')->radioList(['1' => 'New ', '2' => ' Search'], ['item' => function ($index, $label, $name, $checked, $value) {
    $return = '<label class="modal-radio">';