Exemplo n.º 1
0
 public function getDetro()
 {
     return $this->hasMany(Rodetail::className(), ['KD_RO' => 'KD_RO']);
 }
Exemplo n.º 2
0
                // 0=process 1=Approved
                $title = Yii::t('app', 'approved');
                $options = ['id' => 'ro-approved'];
                $icon = '<span class="glyphicon glyphicon-ok"></span>';
                $label = $icon . ' ' . $title;
                $url = Url::toRoute(['/purchasing/request-order/proses', 'kd' => $model->KD_RO]);
                $options['tabindex'] = '-1';
                return '<li>' . Html::a($label, $url, $options) . '</li>' . PHP_EOL;
            }
        }
    }
}]], ['label' => 'Notify', 'mergeHeader' => true, 'format' => 'raw', 'hAlign' => 'center', 'value' => function ($model) {
    //$rodetail = new Rodetail();
    $dt = Rodetail::find()->where(['KD_RO' => $model->KD_RO])->andWhere('STATUS <> 3')->count();
    //ptr.nov Count RO
    $cn = Rodetail::find()->where(['KD_RO' => $model->KD_RO, 'STATUS' => 1])->count();
    //ptr.nov Count RO Disetujui
    $profile = Yii::$app->getUserOpt->Profile_user();
    if ($model->STATUS == 0) {
        return Html::label('<i class="fa fa-navicon"></i>&nbsp;Proses', '', ['class' => 'btn btn-warning btn-xs', 'title' => 'Detail']);
    } else {
        if ($model->STATUS == 101) {
            return Html::label('<i class="fa fa-check"></i> &nbsp;' . $cn . ' Dari ' . $dt, '', ['class' => 'btn btn-success btn-xs', 'title' => 'Detail']);
        }
    }
}]], 'pjax' => true, 'pjaxSettings' => ['options' => ['enablePushState' => false, 'id' => 'ro-grd-index']], 'hover' => true, 'responsive' => true, 'responsiveWrap' => true, 'bordered' => true, 'striped' => '4px', 'autoXlFormat' => true, 'export' => false, 'toolbar' => [['content' => tombolCreate() . tombolBarang() . tombolKategori()], '{toggleData}'], 'panel' => ['type' => GridView::TYPE_PRIMARY, 'heading' => "Request Order"]]);
?>
</div>

	<?php 
$this->registerJs("\r\n\t\t\t\$.fn.modal.Constructor.prototype.enforceFocus = function() {};\t\r\n\t\t\t\$('#new-ro').on('show.bs.modal', function (event) {\r\n\t\t\t\tvar button = \$(event.relatedTarget)\r\n\t\t\t\tvar modal = \$(this)\r\n\t\t\t\tvar title = button.data('title') \r\n\t\t\t\tvar href = button.attr('href') \r\n\t\t\t\tmodal.find('.modal-title').html(title)\r\n\t\t\t\tmodal.find('.modal-body').html('<i class=\"fa fa-spinner fa-spin\"></i>')\r\n\t\t\t\t\$.post(href)\r\n\t\t\t\t\t.done(function( data ) {\r\n\t\t\t\t\t\tmodal.find('.modal-body').html(data)\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t}),\t\t\t\r\n\t\t", $this::POS_READY);
Exemplo n.º 3
0
 /**
  * Action Prosess Approval Colomn Row
  * @param string $id
  * @author ptrnov  <*****@*****.**>
  * @since 1.1
  */
 public function actionApproved($kd)
 {
     /*
      * Init Models
      * @author ptrnov  <*****@*****.**>
      * @since 1.1    
      **/
     //$ro = new Requestorder();
     $roHeader = Requestorder::find()->where(['KD_RO' => $kd])->one();
     $detro = $roHeader->detro;
     $employ = $roHeader->employe;
     $dept = $roHeader->dept;
     /*
      * Convert $roHeader->detro to ArrayDataProvider | Identity 'key' => 'ID',
      * @author ptrnov  <*****@*****.**>
      * @since 1.1    
      **/
     $detroProvider = new ArrayDataProvider(['key' => 'ID', 'allModels' => $detro, 'pagination' => ['pageSize' => 10]]);
     /*
      * Process Editable Row [Columm SQTY]
      * @author ptrnov  <*****@*****.**>
      * @since 1.1    
      **/
     if (Yii::$app->request->post('hasEditable')) {
         $id = Yii::$app->request->post('editableKey');
         $model = Rodetail::findOne($id);
         $out = Json::encode(['output' => '', 'message' => '']);
         $post = [];
         $posted = current($_POST['Rodetail']);
         $post['Rodetail'] = $posted;
         if ($model->load($post)) {
             $model->save();
             $output = '';
             if (isset($posted['RQTY'])) {
                 $output = $model->RQTY;
             }
             if (isset($posted['SQTY'])) {
                 $output = $model->SQTY;
             }
             if (isset($posted['NOTE'])) {
                 // $output =  Yii::$app->formatter->asDecimal($model->EMP_NM, 2);
                 $output = $model->NOTE;
             }
             $out = Json::encode(['output' => $output, 'message' => '']);
         }
         // return ajax json encoded response and exit
         echo $out;
         return;
     }
     /*
      * Render Approved View
      * @author ptrnov  <*****@*****.**>
      * @since 1.1    
      **/
     return $this->render('approved', ['roHeader' => $roHeader, 'detro' => $detro, 'employ' => $employ, 'dept' => $dept, 'dataProvider' => $detroProvider]);
 }
 public function actionDetail($kd_ro, $kdpo)
 {
     $podet = Rodetail::find()->where(['KD_RO' => $kd_ro, 'STATUS' => 101])->all();
     return $this->renderAjax('_detail', ['po' => $podet, 'kdpo' => $kdpo, 'kd_ro' => $kd_ro]);
 }
Exemplo n.º 5
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Rodetail::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(['ID' => $this->ID, 'QTY' => $this->QTY, 'STATUS' => $this->STATUS, 'CREATED_AT' => $this->CREATED_AT, 'UPDATED_AT' => $this->UPDATED_AT]);
     $query->andFilterWhere(['like', 'KD_RO', $this->KD_RO])->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;
 }
Exemplo n.º 6
0
 /**
  * Finds the Rodetail model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param string $id
  * @return Rodetail the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Rodetail::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
 /**
  * Prosess Agree Manager
  * @param string $id
  * @return mixed
  * @author ptrnov  <*****@*****.**>
  * @since 1.1
  */
 public function actionSimpanproses()
 {
     //$rodetails = new Rodetail();
     $ts = Yii::$app->request->post();
     if (count($ts) == 0) {
         return $this->redirect([' ']);
     }
     $kd = $ts['kd'];
     foreach ($ts['ck'] as $ts) {
         $rodetail = Rodetail::findOne($ts);
         $rodetail->STATUS = 1;
         if ($rodetail->save()) {
             $reqro = Requestorder::find()->where(['KD_RO' => $kd])->one();
             $reqro->STATUS = 1;
             $reqro->save();
         }
     }
     return $this->redirect(['proses', 'kd' => $kd]);
     //$rodetail->save();
 }
Exemplo n.º 8
0
?>

<!-- Stack the columns on mobile by making one full-width and the other half-width -->
<div class="row">

<?php 
if ($quer->STATUS != 102) {
    if ($kr == 'HR-02') {
        ?>
	<div class="col-xs-12 col-md-3">
    <?php 
        Pjax::begin(['id' => 'pjax-users']);
        ?>
    <?php 
        echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['KD_RO', ['format' => 'raw', 'value' => function ($data) {
            $count = Rodetail::find()->where(['KD_RO' => $data->KD_RO])->count();
            if (!empty($count)) {
                return Html::a('<button type="button" class="btn btn-primary btn-xs">View</button>', ['detail', 'kd_ro' => $data->KD_RO, 'kdpo' => $_GET['kdpo']], ['data-toggle' => "modal", 'data-target' => "#myModal", 'data-title' => $data->KD_RO]);
                // ubah ini
            } else {
                return '<button type="button" class="btn btn-danger btn-xs">No Data</button>';
            }
        }]]]);
        ?>
    <?php 
        Pjax::end();
        ?>
	
	<?php 
        $this->registerJs("\n\t\t    \$('#myModal').on('show.bs.modal', function (event) {\n\t\t        var button = \$(event.relatedTarget)\n\t\t        var modal = \$(this)\n\t\t        var title = button.data('title') \n\t\t        var href = button.attr('href') \n\t\t        modal.find('.modal-title').html(title)\n\t\t        modal.find('.modal-body').html('<i class=\"fa fa-spinner fa-spin\"></i>')\n\t\t        \$.post(href)\n\t\t            .done(function( data ) {\n\t\t                modal.find('.modal-body').html(data)\n\t\t            });\n\t\t        })\n\t\t");
        Modal::begin(['id' => 'myModal', 'header' => '<h4 class="modal-title">...</h4>']);