Example #1
0
        return Html::a('<i class="glyphicon glyphicon-ok"></i> Approved', '', ['class' => 'btn btn-warning btn-xs', 'style' => ['width' => '100px', 'text-align' => 'left'], 'title' => 'Approved']);
    } elseif ($model['STT_PROCESS'] == 103) {
        return Html::a('<i class="glyphicon glyphicon-ok"></i> Invoice', '', ['class' => 'btn btn-warning btn-xs', 'style' => ['width' => '100px', 'text-align' => 'left'], 'title' => 'Detail']);
    } elseif ($model['STT_PROCESS'] == 104) {
        return Html::a('<i class="glyphicon glyphicon-time"></i> Shiping', '', ['class' => 'btn btn-warning btn-xs', 'style' => ['width' => '100px', 'text-align' => 'left'], 'title' => 'Detail']);
    } elseif ($model['STT_PROCESS'] == 105) {
        return Html::a('<i class="glyphicon glyphicon-time"></i> Finish', '', ['class' => 'btn btn-success btn-xs', 'style' => ['width' => '100px', 'text-align' => 'left'], 'title' => 'Detail']);
    } elseif ($model['STT_PROCESS'] == 4) {
        return Html::a('<i class="glyphicon glyphicon-remove"></i> Reject', '', ['class' => 'btn btn-danger btn-xs', 'style' => ['width' => '100px', 'text-align' => 'left'], 'title' => 'Detail']);
    }
}
$Combo_Dept = ArrayHelper::map(Dept::find()->orderBy('SORT')->asArray()->all(), 'DEP_NM', 'DEP_NM');
$columnIndexInbox = [['class' => 'kartik\\grid\\SerialColumn', 'contentOptions' => ['class' => 'kartik-sheet-style'], 'width' => '10px', 'header' => 'No.', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '10px', 'font-family' => 'verdana, arial, sans-serif', 'font-size' => '7pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'center', 'width' => '10px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt']]], ['class' => 'kartik\\grid\\ExpandRowColumn', 'width' => '50px', 'header' => 'Detail', 'value' => function ($model, $key, $index, $column) {
    return GridView::ROW_COLLAPSED;
}, 'detail' => function ($model, $key, $index, $column) {
    $searchModelDetailx = new SoDetailSearch(['KODE_REF' => $model['KODE_REF'], 'CUST_KD' => $model['CUST_KD'], 'USER_ID' => $model['USER_ID']]);
    $aryProviderSoDetailInbox = $searchModelDetailx->searchDetail1(Yii::$app->request->queryParams);
    return Yii::$app->controller->renderPartial('_indexInboxExpand1', ['model' => $model, 'aryProviderSoDetailInbox2' => $aryProviderSoDetailInbox, 'searchModelDetailx' => $searchModelDetailx]);
}, 'collapseTitle' => 'Close Exploler', 'expandTitle' => 'Click to views detail', 'expandOneOnly' => true, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '10px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt', 'background-color' => 'rgba(74, 206, 231, 1)']], 'contentOptions' => ['style' => ['text-align' => 'center', 'width' => '10px', 'height' => '10px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt']]], ['attribute' => 'KODE_REF', 'label' => 'Kode SO', 'hAlign' => 'left', 'vAlign' => 'middle', 'filter' => true, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '130px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '130px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt']]], ['attribute' => 'TGL_INBOX', 'label' => 'Create At', 'hAlign' => 'left', 'vAlign' => 'middle', 'filterType' => GridView::FILTER_DATE, 'filterOptions' => ['style' => 'id:test'], 'filterWidgetOptions' => ['pluginOptions' => ['format' => 'yyyy-mm-dd', 'autoclose' => true, 'todayHighlight' => true, 'autoWidget' => false]], 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '90px', 'font-family' => 'verdana, arial, sans-serif', 'font-size' => '7pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '90px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt']]], ['attribute' => 'CUST_NM', 'label' => 'Customer', 'hAlign' => 'left', 'vAlign' => 'middle', 'filterOptions' => ['colspan' => 3], 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '190px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '190px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt']]], ['attribute' => 'CHECKIN_TIME', 'label' => 'Time.In', 'filter' => false, 'hAlign' => 'left', 'vAlign' => 'top', 'mergeHeader' => true, 'value' => function ($model) {
    return substr($model['CHECKIN_TIME'], 8, 8);
}, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '50px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '50px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt']]], ['attribute' => 'CHECKOUT_TIME', 'label' => 'Time.Out', 'filter' => false, 'hAlign' => 'left', 'vAlign' => 'top', 'mergeHeader' => true, 'value' => function ($model) {
    return substr($model['CHECKOUT_TIME'], 8, 8);
}, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '50px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '50px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt']]], ['attribute' => 'NM_FIRST', 'label' => 'Created', 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '120px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '120px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt']]], ['attribute' => 'SIG2_NM', 'label' => 'Checked', 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '120px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '120px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt']]], ['attribute' => 'SIG3_NM', 'label' => 'Approved', 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '120px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '120px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt']]], ['class' => 'kartik\\grid\\ActionColumn', 'dropdown' => true, 'template' => '{view}{tambahEdit}{delete}{review}{closed}', 'dropdownOptions' => ['class' => 'pull-right dropup'], 'dropdownButton' => ['class' => 'btn btn-default btn-xs'], 'buttons' => ['view' => function ($url, $model) {
    //return tombolViewInbox($url, $model);
}, 'tambahEdit' => function ($url, $model) {
    //return tombolEditInbox($url, $model);
}, 'delete' => function ($url, $model) {
    //return tombolDeleteInbox($url, $model);
}, 'review' => function ($url, $model) {
    return tombolReviewInbox($url, $model);
}, 'closed' => function ($url, $model) use($getPermissionInboxCheeck) {
Example #2
0
        return Html::a('<i class="glyphicon glyphicon-retweet"></i> Pending', '#', ['class' => 'btn btn-danger btn-xs', 'style' => ['width' => '100px'], 'title' => 'Detail']);
    } elseif ($model->STATUS == 101) {
        return Html::a('<i class="glyphicon glyphicon-time"></i> Proccess', '#', ['class' => 'btn btn-warning btn-xs', 'style' => ['width' => '100px'], 'title' => 'Detail']);
    } elseif ($model->STATUS == 102) {
        return Html::a('<i class="glyphicon glyphicon-ok"></i> Checked', '#', ['class' => 'btn btn-success btn-xs', 'style' => ['width' => '100px'], 'title' => 'Detail']);
    } elseif ($model->STATUS == 103) {
        return Html::a('<i class="glyphicon glyphicon-ok"></i> Approved', '#', ['class' => 'btn btn-success btn-xs', 'style' => ['width' => '100px'], 'title' => 'Detail']);
    } else {
        return Html::a('<i class="glyphicon glyphicon-question-sign"></i> Unknown', '#', ['class' => 'btn btn-danger btn-xs', 'style' => ['width' => '100px'], 'title' => 'Detail']);
    }
}
$Combo_Dept = ArrayHelper::map(Dept::find()->orderBy('SORT')->asArray()->all(), 'DEP_NM', 'DEP_NM');
$columnIndexHistory = [['class' => 'kartik\\grid\\SerialColumn', 'contentOptions' => ['class' => 'kartik-sheet-style'], 'width' => '10px', 'header' => 'No.', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '10px', 'font-family' => 'verdana, arial, sans-serif', 'font-size' => '7pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'center', 'width' => '10px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt']]], ['class' => 'kartik\\grid\\ExpandRowColumn', 'width' => '50px', 'header' => 'Detail', 'value' => function ($model, $key, $index, $column) {
    return GridView::ROW_COLLAPSED;
}, 'detail' => function ($model, $key, $index, $column) {
    $searchModelDetail = new SoDetailSearch(['TGL' => $model['TGL'], 'CUST_KD' => $model['CUST_KD']]);
    $aryProviderSoDetailHistory = $searchModelDetail->searchDetail(Yii::$app->request->queryParams);
    return Yii::$app->controller->renderPartial('_indexHistoryExpand1', ['model' => $model, 'aryProviderSoDetailHistory' => $aryProviderSoDetailHistory]);
}, 'collapseTitle' => 'Close Exploler', 'expandTitle' => 'Click to views detail', 'expandOneOnly' => true, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '10px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt', 'background-color' => 'rgba(74, 206, 231, 1)']], 'contentOptions' => ['style' => ['text-align' => 'center', 'width' => '10px', 'height' => '10px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt']]], ['attribute' => 'KODE_REF', 'label' => 'Kode SO', 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '130px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '130px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt']]], ['attribute' => 'TGL', 'label' => 'Create At', 'hAlign' => 'left', 'vAlign' => 'middle', 'filterType' => \kartik\grid\GridView::FILTER_DATE_RANGE, 'filterWidgetOptions' => ['attribute' => 'CREATED_AT', 'presetDropdown' => TRUE, 'convertFormat' => true, 'pluginOptions' => ['id' => 'tglpo', 'format' => 'Y/m/d', 'separator' => ' - ', 'opens' => 'right']], 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '90px', 'font-family' => 'verdana, arial, sans-serif', 'font-size' => '7pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '90px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt']]], ['attribute' => 'CUST_NM', 'label' => 'Customer', 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '190px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '190px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt']]], ['attribute' => 'CHECKIN_TIME', 'label' => 'Time.IN', 'hAlign' => 'left', 'vAlign' => 'middle', 'value' => function ($model) {
    return substr($model['CHECKIN_TIME'], 8, 8);
}, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '50px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '50px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt']]], ['attribute' => 'CHECKOUT_TIME', 'label' => 'Time.IN', 'hAlign' => 'left', 'vAlign' => 'middle', 'value' => function ($model) {
    return substr($model['CHECKOUT_TIME'], 8, 8);
}, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '50px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '50px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt']]], ['attribute' => 'NM_FIRST', 'label' => 'Created', 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '120px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '120px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt']]], ['attribute' => 'SIG2_NM', 'label' => 'Checked', 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '120px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '120px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt']]], ['attribute' => 'SIG3_NM', 'label' => 'Approved', 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '120px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '120px', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '7pt']]], ['class' => 'kartik\\grid\\ActionColumn', 'dropdown' => true, 'template' => '{view}{tambahEdit}{delete}{review}{closed}', 'dropdownOptions' => ['class' => 'pull-right dropup'], 'dropdownButton' => ['class' => 'btn btn-default btn-xs'], 'buttons' => ['view' => function ($url, $model) {
    return tombolViewInbox($url, $model);
}, 'tambahEdit' => function ($url, $model) {
    return tombolEditInbox($url, $model);
}, 'delete' => function ($url, $model) {
    return tombolDeleteInbox($url, $model);
}, 'review' => function ($url, $model) {
    return tombolReviewHistory($url, $model);
}, 'closed' => function ($url, $model) use($getPermissionInboxCheeck) {
 public function actionCetakpdf($id)
 {
     $modelSoT2 = SoT2::find()->with('cust')->where("KODE_REF='" . $id . "' AND SO_TYPE=10")->one();
     $soHeaderData = SoHeader::find()->where(['KD_SO' => $id])->one();
     $getSoType = 10;
     $getTGL = $modelSoT2->TGL;
     $getCUST_KD = $modelSoT2->CUST_KD;
     $getUSER_ID = $modelSoT2->USER_ID;
     $searchModelDetail = new SoDetailSearch(['KODE_REF' => $id, 'CUST_KD' => $getCUST_KD, 'USER_ID' => $getUSER_ID]);
     $aryProviderSoDetail = $searchModelDetail->searchDetail(Yii::$app->request->queryParams);
     $content = $this->renderPartial('pdf', ['soHeaderData' => $soHeaderData, 'aryProviderSoDetail' => $aryProviderSoDetail]);
     $pdf = new Pdf(['mode' => Pdf::MODE_CORE, 'format' => Pdf::FORMAT_A4, 'orientation' => Pdf::ORIENT_PORTRAIT, 'destination' => Pdf::DEST_BROWSER, 'content' => $content, 'cssFile' => '@lukisongroup/web/widget/pdf-asset/kv-mpdf-bootstrap.min.css', 'cssInline' => '.kv-heading-1{font-size:12px}', 'options' => ['title' => 'Form Request Order', 'subject' => 'ro'], 'methods' => ['SetHeader' => ['Copyright@LukisonGroup ' . date("r")], 'SetFooter' => ['{PAGENO}']]]);
     /* KIRIM ATTACH emaiL */
     //$to=['*****@*****.**'];
     //\Yii::$app->kirim_email->pdf($contentMailAttach,'PO',$to,'Purchase-Order',$contentMailAttachBody);
     return $pdf->render();
 }
 public function actionSendmail($id)
 {
     $soHeaderData = SoHeader::find()->where(['id' => $id])->one();
     $modelSoT2 = SoT2::find()->with('cust')->where("KODE_REF='" . $soHeaderData->KD_SO . "' AND SO_TYPE=10")->one();
     $getSoType = 10;
     $getTGL = $modelSoT2->TGL;
     $getCUST_KD = $modelSoT2->CUST_KD;
     $getUSER_ID = $modelSoT2->USER_ID;
     $searchModelDetail = new SoDetailSearch(['KODE_REF' => $soHeaderData->KD_SO, 'CUST_KD' => $soHeaderData->CUST_ID, 'USER_ID' => $getUSER_ID]);
     $aryProviderSoDetail = $searchModelDetail->searchDetail(Yii::$app->request->queryParams);
     $content = $this->renderPartial('pdf', ['soHeaderData' => $soHeaderData, 'aryProviderSoDetail' => $aryProviderSoDetail]);
     /*Attachmen Content*/
     $contentMailAttach = $this->renderPartial('sendmailcontent', ['soHeaderData' => $soHeaderData, 'aryProviderSoDetail' => $aryProviderSoDetail]);
     /*Body Notify*/
     $contentMailAttachBody = $this->renderPartial('postman_body', ['soHeaderData' => $soHeaderData]);
     $pdf = new Pdf(['mode' => Pdf::MODE_CORE, 'format' => Pdf::FORMAT_A4, 'orientation' => Pdf::ORIENT_PORTRAIT, 'destination' => Pdf::DEST_BROWSER, 'content' => $content, 'cssFile' => '@lukisongroup/web/widget/pdf-asset/kv-mpdf-bootstrap.min.css', 'cssInline' => '.kv-heading-1{font-size:12px}', 'options' => ['title' => 'Form Purchase Order', 'subject' => 'po'], 'methods' => ['SetHeader' => ['Copyright@LukisonGroup ' . date("r")], 'SetFooter' => ['{PAGENO}']]]);
     /* KIRIM ATTACH emaiL */
     //$to=['*****@*****.**'];//,'*****@*****.**'];
     $url_dev = Url::base(true);
     if ($url_dev == 'http://labtest1-erp.int') {
         $to = ['*****@*****.**'];
     } else {
         //$to =['*****@*****.**'];
         $to = ['*****@*****.**'];
     }
     \Yii::$app->kirim_email->pdf($contentMailAttach, 'SO-T2', $to, 'Sales-Order-T2', $contentMailAttachBody);
 }