/**
  * 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]);
 }
Example #2
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Distributor::find()->where('d0001.STATUS <> 3');
     $dataProvider = new ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => 20]]);
     $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, 'TLP1' => $this->TLP1, 'TLP2' => $this->TLP2, 'FAX' => $this->FAX, 'STATUS' => $this->STATUS]);
     $query->andFilterWhere(['like', 'KD_DISTRIBUTOR', $this->KD_DISTRIBUTOR])->andFilterWhere(['like', 'NM_DISTRIBUTOR', $this->NM_DISTRIBUTOR])->andFilterWhere(['like', 'ALAMAT', $this->ALAMAT])->andFilterWhere(['like', 'PIC', $this->PIC])->andFilterWhere(['like', 'EMAIL', $this->EMAIL])->andFilterWhere(['like', 'WEBSITE', $this->WEBSITE])->andFilterWhere(['like', 'NOTE', $this->NOTE])->andFilterWhere(['like', 'CREATED_BY', $this->CREATED_BY])->andFilterWhere(['like', 'CREATED_AT', $this->CREATED_AT])->andFilterWhere(['like', 'UPDATED_AT', $this->UPDATED_AT])->andFilterWhere(['like', 'DATA_ALL', $this->DATA_ALL]);
     return $dataProvider;
 }
Example #3
0
				<hr style="height:10px;margin-top: 1px; margin-bottom: 1px;color:#94cdf0">
			</div>

		</div>
	</div>

	<!-- PARTIES/PIHAK !-->
	<div class="row">
		<div class="col-xs-6 col-sm-6 col-md-6" style="font-family: tahoma ;font-size: 9pt;padding-left:30px">
			<div>
				 <!-- echo pihak($model); ?> -->
			</div>
			<dl>
				<?php 
$data = Customers::find()->where(['CUST_KD' => $model->CUST_KD])->asArray()->one();
$datadis = Distributor::find()->where(['KD_DISTRIBUTOR' => $model->DIST_KD])->asArray()->one();
$datacorp = Corp::find()->where(['CORP_ID' => $model->PRINCIPAL_KD])->asArray()->one();
?>
				<dt><h6><u><b>PARTIES/PIHAK BERSANGKUTAN :</b></u></h6></dt>

				<dd>1 :	<?php 
echo $data['CUST_NM'];
?>
</dd>


				<dd>2 :	<?php 
echo $datadis['NM_DISTRIBUTOR'];
?>
</dd>
 public function actionCetakpdf($id)
 {
     # code...
     $data = Termcustomers::find()->where(['ID_TERM' => $id])->one();
     $datainternal = Jobgrade::find()->where(['JOBGRADE_ID' => $data['JOBGRADE_ID']])->asArray()->one();
     $datacus = Customers::find()->where(['CUST_KD' => $data->CUST_KD])->asArray()->one();
     // $term = Termgeneral::find()->where(['ID'=>$data['GENERAL_TERM']])->asArray()
     //                                                     ->one();
     $datadis = Distributor::find()->where(['KD_DISTRIBUTOR' => $data->DIST_KD])->asArray()->one();
     $datacorp = Corp::find()->where(['CORP_ID' => $data->PRINCIPAL_KD])->asArray()->one();
     $sql = "SELECT c.INVES_TYPE,c.ID_TERM,c.BUDGET_PLAN,c.BUDGET_ACTUAL,c.PERIODE_START,c.PERIODE_END,b.TARGET_VALUE from c0005 c LEFT JOIN c0003 b on c.ID_TERM = b.ID_TERM   where c.ID_TERM='" . $id . "'";
     $data1 = Termbudget::findBySql($sql)->all();
     $sqlsum = "SELECT SUM(BUDGET_PLAN) as BUDGET_PLAN,SUM(BUDGET_ACTUAL) as BUDGET_ACTUAL from c0005 where ID_TERM='" . $id . "'";
     $datasum = Termbudget::findBySql($sqlsum)->one();
     $dataProvider = new ArrayDataProvider(['key' => 'ID_TERM', 'allModels' => $data1, 'pagination' => ['pageSize' => 20]]);
     $content = $this->renderPartial('_pdf', ['data' => $data, 'datainternal' => $datainternal, 'datacus' => $datacus, 'datadis' => $datadis, 'datacorp' => $datacorp, 'datasum' => $datasum, 'dataProvider' => $dataProvider]);
     $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' => 'Term-Customers', 'subject' => 'Term'], 'methods' => ['SetHeader' => ['Copyright@LukisonGroup ' . date("r")], 'SetFooter' => ['{PAGENO}']]]);
     return $pdf->render();
 }
 public function actionUpdatecus($id)
 {
     $readonly = Customers::find()->where(['CUST_KD' => $id])->asArray()->one();
     // data for view
     $model = $this->findModelcust($id);
     $model->scenario = "detail";
     $dropparentkategori = ArrayHelper::map(Kategoricus::find()->where('CUST_KTG_PARENT = CUST_KTG')->asArray()->all(), 'CUST_KTG', 'CUST_KTG_NM');
     $droppro = ArrayHelper::map(Province::find()->asArray()->all(), 'PROVINCE_ID', 'PROVINCE');
     $dropdis = ArrayHelper::map(\lukisongroup\master\models\Distributor::find()->all(), 'KD_DISTRIBUTOR', 'NM_DISTRIBUTOR');
     if ($model->load(Yii::$app->request->post())) {
         if ($model->validate()) {
             $model->UPDATED_AT = date("Y-m-d H:i:s");
             $model->UPDATED_BY = Yii::$app->user->identity->username;
             // $model->save();
             if ($model->save()) {
                 echo 1;
             } else {
                 echo 0;
             }
         }
         // print_r($model->save());
         // die();
         //  return $this->redirect(['index']);
     } else {
         return $this->renderAjax('set_detail', ['model' => $model, 'dropparentkategori' => $dropparentkategori, 'droppro' => $droppro, 'dropdis' => $dropdis, 'readonly' => $readonly]);
     }
 }
Example #6
0
 public function getDest()
 {
     return $this->hasOne(Distributor::className(), ['KD_DISTRIBUTOR' => 'DESTINATION']);
 }
Example #7
0
 public function getDis()
 {
     # code...
     return $this->hasOne(Distributor::className(), ['KD_DISTRIBUTOR' => 'DIST_KD']);
 }
Example #8
0
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use kartik\widgets\Select2;
use dosamigos\ckeditor\CKEditor;
use lukisongroup\master\models\Distributor;
$listDistibutor = ArrayHelper::map(Distributor::find()->where('STATUS<>3')->all(), 'KD_DISTRIBUTOR', 'NM_DISTRIBUTOR');
?>

<div class="purchaseorder-form">
     <?php 
$form = ActiveForm::begin(['id' => $model->formName(), 'enableClientValidation' => true]);
?>

	<?php 
echo $form->field($model, 'ID')->hiddenInput(['value' => $model->ID, 'maxlength' => true, 'readonly' => true])->label(false);
?>
	<?php 
echo $form->field($model, 'DESTINATION')->dropDownList($listDistibutor, ['promt' => 'Destination Handle'])->label('Destination Handling');
?>
	<div style="text-align: right;">
		<?php 
echo Html::submitButton('Save', ['class' => 'btn btn-primary btn-xs']);
?>
	</div>

    <?php 
ActiveForm::end();
?>
 /**
  * Finds the Distributor model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param string $id
  * @return Distributor the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Distributor::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
 /**
  * Display Single model province.
  * Display Single model Distributor.
  * Display Single model Kategoricus.
  * update Customers.
  * @author wawan
  * @since 1.1.0
  * @param string $id
  * @return mixed
  */
 public function actionViewcust($id)
 {
     /*province data*/
     $valpro = ArrayHelper::map(Province::find()->asArray()->all(), 'PROVINCE_ID', 'PROVINCE');
     /*distributor data*/
     $datadis_view = ArrayHelper::map(Distributor::find()->where('STATUS<>3')->all(), 'KD_DISTRIBUTOR', 'NM_DISTRIBUTOR');
     $kategori_view = ArrayHelper::map(Kategoricus::find()->where('CUST_KTG_PARENT = CUST_KTG')->asArray()->all(), 'CUST_KTG', 'CUST_KTG_NM');
     $model = $this->findModelcust($id);
     if ($model->load(Yii::$app->request->post())) {
         $model->UPDATED_AT = date("Y-m-d H:i:s");
         $model->UPDATED_BY = Yii::$app->user->identity->username;
         //$model->save(false);
         if ($model->save()) {
             //$model->refresh();
             return $this->redirect(['/master/customers/esm-index', 'id_prn' => $model->CUST_GRP]);
             //Yii::$app->session->setFlash('kv-detail-success', 'Success Message');
         }
     } else {
         return $this->renderAjax('_view_cus', ['model' => $model, 'valpro' => $valpro, 'datadis_view' => $datadis_view, 'kategori_view' => $kategori_view]);
     }
 }
Example #11
0
 public function getDistributor()
 {
     return $this->hasOne(Distributor::className(), ['KD_DISTRIBUTOR' => 'DIS_REF']);
 }
Example #12
0
 public function aryData_Dis()
 {
     return ArrayHelper::map(Distributor::find()->where('STATUS<>3')->all(), 'KD_DISTRIBUTOR', 'NM_DISTRIBUTOR');
 }
Example #13
0
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\widgets\DepDrop;
use lukisongroup\master\models\barangalias;
use lukisongroup\master\models\Distributor;
use yii\helpers\Url;
use kartik\widgets\Select2;
use kartik\label\LabelInPlace;
/* @var $this yii\web\View */
/* @var $model lukisongroup\master\models\Barangalias */
/* @var $form yii\widgets\ActiveForm */
$datadis = Distributor::find()->where('STATUS<>3')->all();
$todis = 'KD_DISTRIBUTOR';
$fromdis = 'NM_DISTRIBUTOR';
$config = ['template' => "{input}\n{error}\n{hint}"];
?>

<div class="barangalias-form">

    <?php 
$form = ActiveForm::begin(['id' => $model->formName(), 'enableClientValidation' => true, 'enableAjaxValidation' => true]);
?>

    <?php 
echo $form->field($model, 'KD_PARENT', ['template' => "{input}"])->hiddenInput(['value' => $parent, 'readonly' => true]);
?>

    <?php 
echo $form->field($model, 'KD_BARANG')->textInput(['value' => $id->KD_BARANG, 'readonly' => true])->label('KODE_BARANG');
Example #14
0
use lukisongroup\master\models\Customers;
use lukisongroup\hrd\models\Corp;
use lukisongroup\master\models\Distributor;
use kartik\label\LabelInPlace;
use lukisongroup\master\models\Terminvest;
use kartik\money\MaskMoney;
/* @var $this yii\web\View */
/* @var $model lukisongroup\master\models\Termcustomers */
/* @var $form yii\widgets\ActiveForm */
$data = Customers::find()->where('CUST_KD = CUST_GRP')->all();
$to = "CUST_KD";
$from = "CUST_NM";
$data1 = Corp::find()->all();
$to1 = "CORP_ID";
$from1 = "CORP_NM";
$data2 = Distributor::find()->all();
$to2 = 'KD_DISTRIBUTOR';
$from2 = "NM_DISTRIBUTOR";
$config = ['template' => "{input}\n{error}\n{hint}"];
?>
<div class="termcustomers-form">

    <?php 
$form = ActiveForm::begin(['id' => $model->formName()]);
?>

    <?php 
echo $form->field($model, 'NM_TERM', $config)->widget(LabelInPlace::classname());
?>

    <?php 
<?php

use kartik\helpers\Html;
use kartik\grid\GridView;
use yii\helpers\ArrayHelper;
use yii\widgets\Breadcrumbs;
use kartik\widgets\Spinner;
use yii\bootstrap\Modal;
use yii\helpers\Url;
use kartik\widgets\FileInput;
use yii\helpers\Json;
use yii\web\Response;
use yii\widgets\Pjax;
use kartik\widgets\ActiveForm;
use kartik\tabs\TabsX;
use kartik\date\DatePicker;
use app\models\hrd\Dept;
use lukisongroup\master\models\Distributor;
$dropDist = ArrayHelper::map(Distributor::find()->all(), 'KD_DISTRIBUTOR', 'NM_DISTRIBUTOR');
$aryField = [['ID' => 0, 'ATTR' => ['FIELD' => 'TGL', 'SIZE' => '50px', 'label' => 'Date', 'align' => 'center', 'vAlign' => 'middle', 'warna' => '255, 255, 48, 4', 'warnaFilter' => '255, 255, 255, 1', 'filter' => false, 'filterType' => false, 'mergeHeader' => false, 'filterColspn' => 0]], ['ID' => 1, 'ATTR' => ['FIELD' => 'NM_BARANG', 'SIZE' => '250px', 'label' => 'SKU NM', 'align' => 'left', 'vAlign' => 'top', 'warna' => '255, 255, 48, 4', 'warnaFilter' => '255, 255, 255, 1', 'filter' => true, 'filterType' => false, 'mergeHeader' => false, 'filterColspn' => 7]], ['ID' => 2, 'ATTR' => ['FIELD' => 'SO_QTY', 'SIZE' => '50px', 'label' => 'QTY.PCS', 'align' => 'right', 'vAlign' => 'top', 'warna' => '255, 255, 48, 4', 'warnaFilter' => '255, 255, 255, 1', 'filter' => true, 'filterType' => false, 'mergeHeader' => true, 'filterColspn' => 0]], ['ID' => 3, 'ATTR' => ['FIELD' => 'UNIT_BARANG', 'SIZE' => '50px', 'label' => 'UNIT', 'align' => 'center', 'vAlign' => 'top', 'warna' => '255, 255, 48, 4', 'warnaFilter' => '255, 255, 255, 1', 'filter' => true, 'filterType' => false, 'mergeHeader' => true, 'filterColspn' => 0]], ['ID' => 4, 'ATTR' => ['FIELD' => 'kartonqty', 'SIZE' => '50px', 'label' => 'QTY.KARTON', 'align' => 'right', 'vAlign' => 'top', 'warna' => '255, 255, 48, 4', 'warnaFilter' => '255, 255, 255, 1', 'filter' => true, 'filterType' => false, 'mergeHeader' => true, 'filterColspn' => 0]], ['ID' => 5, 'ATTR' => ['FIELD' => 'beratunit', 'SIZE' => '50px', 'label' => 'WEIGHT.GRAM', 'align' => 'right', 'vAlign' => 'top', 'warna' => '255, 255, 48, 4', 'warnaFilter' => '255, 255, 255, 1', 'filter' => true, 'filterType' => false, 'mergeHeader' => true, 'filterColspn' => 0]], ['ID' => 6, 'ATTR' => ['FIELD' => 'HARGA_DIS', 'SIZE' => '50px', 'label' => 'DIST.PRICE', 'align' => 'right', 'vAlign' => 'top', 'warna' => '255, 255, 48, 4', 'warnaFilter' => '255, 255, 255, 1', 'filter' => true, 'filterType' => false, 'mergeHeader' => true, 'filterColspn' => 0]], ['ID' => 7, 'ATTR' => ['FIELD' => 'subtotaldist', 'SIZE' => '50px', 'label' => 'SUB.TTL', 'align' => 'right', 'vAlign' => 'top', 'warna' => '255, 255, 48, 4', 'warnaFilter' => '255, 255, 255, 1', 'filter' => true, 'filterType' => false, 'mergeHeader' => true, 'filterColspn' => 0]], ['ID' => 8, 'ATTR' => ['FIELD' => 'disNm', 'SIZE' => '100px', 'label' => 'DISTRIBUTION', 'align' => 'left', 'vAlign' => 'top', 'warna' => '255, 255, 48, 4', 'warnaFilter' => '255, 255, 255, 1', 'filter' => $dropDist, 'filterType' => 'GridView::FILTER_SELECT2', 'mergeHeader' => false, 'filterColspn' => 0]], ['ID' => 9, 'ATTR' => ['FIELD' => 'USER_ID', 'SIZE' => '50px', 'label' => 'IMPORT.BY', 'align' => 'left', 'vAlign' => 'top', 'warna' => '255, 255, 48, 4', 'warnaFilter' => '255, 255, 255, 1', 'filter' => true, 'filterType' => false, 'mergeHeader' => false, 'filterColspn' => 0]]];
$valFieldsAll = ArrayHelper::map($aryField, 'ID', 'ATTR');
$actionClass = 'btn btn-info btn-xs';
$actionLabel = 'Update';
$attDinamik = [];
foreach ($valFieldsAll as $key => $value[]) {
    $attDinamik[] = ['attribute' => $value[$key]['FIELD'], 'label' => $value[$key]['label'], 'filterType' => $value[$key]['filterType'], 'filter' => $value[$key]['filter'], 'filterOptions' => ['style' => 'background-color:rgba(' . $value[$key]['warnaFilter'] . '); align:center', 'colspan' => $value[$key]['filterColspn']], 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true, 'contentOptions' => ['style' => ['text-align' => 'left', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt']]]], 'hAlign' => 'right', 'vAlign' => $value[$key]['vAlign'], 'mergeHeader' => $value[$key]['mergeHeader'], 'noWrap' => true, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => $value[$key]['SIZE'], 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt', 'background-color' => 'rgba(' . $value[$key]['warna'] . ')']], 'contentOptions' => ['style' => ['text-align' => $value[$key]['align'], 'width' => $value[$key]['SIZE'], 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '8pt']]];
}
$gvDataAllGudang = GridView::widget(['id' => 'gv-data-all-gudang', 'dataProvider' => $dataProviderAllDataImport, 'filterModel' => $searchModelViewImport, 'columns' => $attDinamik, 'pjax' => true, 'pjaxSettings' => ['options' => ['enablePushState' => false, 'id' => 'gv-data-all-gudang']], 'hover' => true, 'responsive' => true, 'responsiveWrap' => true, 'bordered' => true, 'striped' => '4px', 'autoXlFormat' => true, 'export' => false, 'panel' => [''], 'toolbar' => [''], 'panel' => ['heading' => 'GUDANG -  ALL Stok Data Gudang <i class="fa fa fa-shield fa-1x"></i>', 'type' => 'info', 'before' => Html::a('<i class="fa fa-clone"></i> ' . Yii::t('app', 'Export Data'), '/sales/import-gudang/export_datagudang', ['id' => 'export-datagudang-id', 'data-pjax' => true, 'class' => 'btn btn-info btn-sm']), 'showFooter' => false]]);
echo $gvDataAllGudang;
Example #16
0
 public function getCustdis()
 {
     return $this->hasOne(Distributor::className(), ['KD_DISTRIBUTOR' => 'KD_DISTRIBUTOR']);
 }
use yii\widgets\ActiveForm;
use kartik\widgets\Select2;
use yii\helpers\ArrayHelper;
use kartik\widgets\DatePicker;
use kartik\label\LabelInPlace;
use lukisongroup\master\models\Kategoricus;
use lukisongroup\master\models\Province;
use lukisongroup\master\models\Kota;
use yii\web\JsExpression;
use yii\bootstrap\Modal;
use yii\helpers\Url;
use kartik\widgets\DepDrop;
/* @var $this yii\web\View */
/* @var $model lukisongroup\master\models\Customerskat */
/* @var $form yii\widgets\ActiveForm */
$dropdis = ArrayHelper::map(\lukisongroup\master\models\Distributor::find()->all(), 'KD_DISTRIBUTOR', 'NM_DISTRIBUTOR');
$config = ['template' => "{input}\n{error}\n{hint}"];
// $dropparent = ArrayHelper::map(\lukisongroup\master\models\Kategori::find()->all(),'CUST_KTG_PARENT', 'CUST_KTG_NM');
$no = 0;
$dropparentkategori = ArrayHelper::map(Kategoricus::find()->where(['CUST_KTG_PARENT' => $no])->asArray()->all(), 'CUST_KTG', 'CUST_KTG_NM');
$droppro = ArrayHelper::map(Province::find()->asArray()->all(), 'PROVINCE_ID', 'PROVINCE');
// $dropcity = ArrayHelper::map(Kota::find()->all(),'POSTAL_CODE','CITY_NAME');
// print_r( $dropparentkategori);
// die();
// Modal::begin([
//          'header'=>'<h4>Vlookup</h4>',
//          'id'=> 'modal',
//          'size'=>'modal-lg',
//      ]);
//      echo"<div id='modalcalon'></div>";
//      modal::end();