예제 #1
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]);
 }
예제 #2
0
 public function kdsupplier($crp)
 {
     $ck = Suplier::find()->where('STATUS <> 3')->where(['KD_CORP' => $crp])->max('KD_SUPPLIER');
     if (count($ck) != 0) {
         $nw = explode('.', $ck);
         $nm = $nw[2] + 1;
     } else {
         $nm = 1;
     }
     $nn = str_pad($nm, "5", "0", STR_PAD_LEFT);
     $kd = 'SPL.' . $crp . "." . $nn;
     return $kd;
 }
예제 #3
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Suplier::find()->where('STATUS <> 3');
     $query->joinWith(['corp' => function ($q) {
         $q->where('u0001.CORP_NM LIKE "%' . $this->nmgroup . '%"');
     }]);
     $dataProvider = new ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => 20]]);
     $dataProvider->setSort(['attributes' => ['KD_SUPPLIER', 'NM_SUPPLIER', 'ALAMAT', 'KOTA', 'nmgroup' => ['asc' => ['u0001.CORP_NM' => SORT_ASC], 'desc' => ['u0001.CORP_NM' => SORT_DESC], 'label' => 'Group Perusahaan']]]);
     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.
          */
         $query->joinWith(['corp']);
         return $dataProvider;
     }
     $query->andFilterWhere(['like', 'KD_SUPPLIER', $this->KD_SUPPLIER])->andFilterWhere(['like', 'NM_SUPPLIER', $this->NM_SUPPLIER])->andFilterWhere(['like', 'ALAMAT', $this->ALAMAT])->andFilterWhere(['like', 'KOTA', $this->KOTA]);
     return $dataProvider;
 }
예제 #4
0
파일: view.php 프로젝트: adem-team/advanced
use yii\helpers\Url;
use lukisongroup\master\models\Suplier;
use lukisongroup\master\models\Barangumum;
use lukisongroup\master\models\Nmperusahaan;
use lukisongroup\purchasing\models\Purchasedetail;
use lukisongroup\esm\models\Barang;
/* @var $this yii\web\View */
/* @var $poHeader lukisongroup\poHeaders\esm\po\Purchaseorder */
$this->title = 'Detail PO';
$this->params['breadcrumbs'][] = ['label' => 'Purchaseorders', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
$y = 4;
?>

 <?php 
$sup = Suplier::find()->where(['KD_SUPPLIER' => $poHeader->KD_SUPPLIER])->one();
//$pod = Purchasedetail::find()->where(['KD_PO'=>$poHeader->KD_PO])->all();
$ship = Nmperusahaan::find()->where(['ID' => $poHeader->SHIPPING])->one();
$bill = Nmperusahaan::find()->where(['ID' => $poHeader->BILLING])->one();
/* $x=10;
		function ax(){
			return '10';
		}
		 */
/* function formulaAmount($summary, $data, $widget){
				//$calculate = dataCell($model, $key, $index);
				//$p = compact('model', 'key', 'index');
				return '<div>'.$summary * $this->model().',</div>
						<div>'.min($data).'</div>
						<div>'.$summary.'</div>
						<div>100,0</div>
예제 #5
0
	<div class="modal fade" id="new-po" tabindex="-1" role="dialog" aria-labelledby="create-poLabel">
	  <div class="modal-dialog" role="document">
		<div class="modal-content">
		
			  <div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4 class="modal-title" id="create-poLabel">OPTION CREATE PO</h4>
			  </div>
			  
			<?php 
$form = ActiveForm::begin(['type' => ActiveForm::TYPE_HORIZONTAL, 'method' => 'post', 'action' => ['/purchasing/purchase-order/simpanpo']]);
?>
			  <div class="modal-body">
				
			<?php 
$drop = ArrayHelper::map(Suplier::find()->where(['STATUS' => 1])->all(), 'KD_SUPPLIER', 'NM_SUPPLIER');
?>
			<?php 
echo $form->field($model, 'KD_SUPPLIER')->dropDownList($drop, ['prompt' => ' -- Pilih Salah Satu --'])->label('Supplier');
?>
			  </div>
			  <div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
				<button type="submit" class="btn btn-primary" >Save changes</button>
			  </div> 
			<?php 
ActiveForm::end();
?>
		</div>
	  </div>
	</div>	
예제 #6
0
<?php

use yii\helpers\Html;
use kartik\widgets\ActiveForm;
use kartik\widgets\DatePicker;
use yii\helpers\ArrayHelper;
use kartik\widgets\Select2;
use lukisongroup\master\models\Suplier;
$addressCorp = ArrayHelper::map(Suplier::find()->orderBy('NM_SUPPLIER')->all(), 'KD_SUPPLIER', 'NM_SUPPLIER');
?>

	<?php 
$form = ActiveForm::begin(['id' => 'frm-spl-proccess', 'enableClientValidation' => true, 'enableAjaxValidation' => true, 'method' => 'post', 'action' => ['/purchasing/purchase-order/supplier-save']]);
?>
	
		<?php 
//echo  $form->field($poHeaderVal, 'kD_SUPPLIER')->textInput()->label('Supplier');
echo $form->field($poHeaderVal, 'kD_SUPPLIER')->widget(Select2::classname(), ['data' => $addressCorp, 'options' => ['placeholder' => 'Select Address for Supplier ...'], 'pluginOptions' => ['allowClear' => true]]);
?>
		<?php 
echo $form->field($poHeaderVal, 'kD_PO')->hiddenInput(['value' => $poHeader->KD_PO, 'maxlength' => true, 'readonly' => true])->label(false);
?>
		
		<div style="text-align: right;"">
			<?php 
echo Html::submitButton('simpan', ['class' => 'btn btn-primary']);
?>
		</div>

    
	<?php 
예제 #7
0
파일: pdf.php 프로젝트: adem-team/advanced
	.tbl {
		border:1px solid #B2B2B2 !important;
	}
}
</style>

<div class="ttl">
	<center>
		<?php 
echo Html::img('@web/upload/lukison.png', ['class' => 'pnjg']);
?>
	</center>
<br/>

    <?php 
$sup = Suplier::find()->where(['KD_SUPPLIER' => $model->KD_SUPPLIER])->one();
$pod = Purchasedetail::find()->where(['KD_PO' => $model->KD_PO])->all();
?>

    <div style="font-size:12pt;">
        <center>
            <h3 style="margin:0px;"><u>Purchase Order</u></h3>
            <h4 style="margin:0px;">No. <?php 
echo $model->KD_PO;
?>
</h4>
        </center>
    </div>
    <br/><br/><br/>
</div>
예제 #8
0
use kartik\form\ActiveForm;
use yii\helpers\ArrayHelper;
use kartik\widgets\Select2;
use kartik\widgets\FileInput;
use kartik\widgets\DepDrop;
use yii\helpers\Url;
use lukisongroup\master\models\Tipebarang;
use lukisongroup\master\models\Kategori;
use lukisongroup\master\models\Unitbarang;
use lukisongroup\master\models\Suplier;
use lukisongroup\hrd\models\Corp;
$drop = ArrayHelper::map(Corp::find()->where('CORP_STS=1 AND CORP_ID="GSN"')->all(), 'CORP_ID', 'CORP_NM');
$droptype = ArrayHelper::map(Tipebarang::find()->where('STATUS<>3 and PARENT=1')->all(), 'KD_TYPE', 'NM_TYPE');
$dropkat = ArrayHelper::map(Kategori::find()->where('STATUS<>3 and PARENT=1')->all(), 'KD_KATEGORI', 'NM_KATEGORI');
$dropunit = ArrayHelper::map(Unitbarang::find()->all(), 'KD_UNIT', 'NM_UNIT');
$dropsup = ArrayHelper::map(Suplier::find()->all(), 'KD_SUPPLIER', 'NM_SUPPLIER');
?>

<div class="barang-form">

    <?php 
$form = ActiveForm::begin(['type' => ActiveForm::TYPE_HORIZONTAL, 'method' => 'post', 'id' => 'form-prodak-id', 'enableClientValidation' => true, 'options' => ['enctype' => 'multipart/form-data']]);
?>
		<?php 
echo $form->field($model, 'PARENT')->hiddenInput(['value' => 1, 'maxlength' => true])->label(false);
?>
		<?php 
echo $form->field($model, 'KD_CORP')->dropDownList($drop, ['id' => 'barang-kd_corp', 'readonly' => true])->label('Perusahaan');
echo $form->field($model, 'KD_TYPE')->widget(DepDrop::classname(), ['type' => DepDrop::TYPE_SELECT2, 'data' => $droptype, 'options' => ['id' => 'barang-kd_type'], 'pluginOptions' => ['depends' => ['barang-kd_corp'], 'url' => Url::to(['/dashboard/gsn-product/prodak-corp-type']), 'initialize' => true]]);
echo $form->field($model, 'KD_KATEGORI')->widget(DepDrop::classname(), ['type' => DepDrop::TYPE_SELECT2, 'data' => $dropkat, 'options' => ['id' => 'barang-kd_kategori'], 'pluginOptions' => ['depends' => ['barang-kd_corp', 'barang-kd_type'], 'url' => Url::to(['/dashboard/gsn-product/prodak-type-kat']), 'initialize' => true]]);
?>
예제 #9
0
 public function getSuplier()
 {
     return $this->hasOne(Suplier::className(), ['KD_SUPPLIER' => 'KD_SUPPLIER']);
 }
예제 #10
0
	? -->
<form  id="cpo" method="post" action="../purchase-order/createpo">

	<div class="col-xs-12 <?php 
if ($kr == 'HR-02') {
    echo 'col-md-9';
} else {
    echo 'col-md-12';
}
?>
">
	  	<?php 
echo Yii::$app->session->getFlash('error');
?>
		<?php 
$brg = Suplier::find()->where(['KD_SUPPLIER' => $quer->KD_SUPPLIER])->one();
$kdpo = $_GET['kdpo'];
?>
	  	<br/>
		<div class="row">
		  	<div class="col-xs-6 col-sm-6 col-md-6">
		  	<b><?php 
echo $brg->NM_SUPPLIER;
?>
</b><br/>
		  	<?php 
echo $brg->ALAMAT;
?>
<br/>
		  	<?php 
echo $brg->KOTA;
예제 #11
0
 /**
  * Finds the Suplier model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param string $id
  * @param string $kd_supplier
  * @return Suplier the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($ID, $KD_SUPPLIER)
 {
     if (($model = Suplier::findOne(['ID' => $ID, 'KD_SUPPLIER' => $KD_SUPPLIER])) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }