コード例 #1
0
 /**
  * Saved Data Purchasedetail | PO PLUS
  * @author ptrnov  <*****@*****.**>
  * @since 1.1
  */
 public function poplus_saved()
 {
     $poDetailModel = new Purchasedetail();
     if ($this->validate()) {
         $poDetailModel->KD_PO = $this->kD_PO;
         $poDetailModel->KD_RO = 'PurchasingPO';
         $poDetailModel->KD_BARANG = $this->kD_BARANG;
         $poDetailModel->NM_BARANG = $this->nM_BARANG;
         $poDetailModel->UNIT = $this->uNIT;
         $poDetailModel->NM_UNIT = $this->nM_UNIT;
         $poDetailModel->UNIT_QTY = $this->qTY_UNIT;
         $poDetailModel->UNIT_WIGHT = $this->wEIGHT_UNIT;
         $poDetailModel->QTY = $this->qTY;
         $poDetailModel->HARGA = $this->hARGA;
         $poDetailModel->STATUS = 0;
         $poDetailModel->STATUS_DATE = date("Y-m-d H:i:s");
         $poDetailModel->save();
         if ($poDetailModel->save()) {
             $this->PO_PLUS_RSLT = $poDetailModel->KD_PO;
             return $poDetailModel->KD_PO;
         }
         return $poDetailModel->KD_PO;
     }
     return null;
 }
コード例 #2
0
 /**
  * Check KD_PO Purchasdetail 
  * @author ptrnov  <*****@*****.**>
  * @since 1.1
  */
 public function findcheck($attribute, $params)
 {
     if (!$this->hasErrors()) {
         $cntDetailPo = Purchasedetail::find()->where(['KD_PO' => $this->kD_PO])->count();
         if (!$cntDetailPo) {
             $this->addError($attribute, 'Please, Input Item SKU First');
         }
     }
 }
コード例 #3
0
 /**
  * QTY SAVE VALIDATION Purchasedetail
  * SQTY RoDetail - SUM QTY Purchasedetail (sama dengan atau lebih kecil, lebih besar =error)
  * @author ptrnov  <*****@*****.**>
  * @since 1.1
  */
 public function sendpo_saved()
 {
     if ($this->validate()) {
         $poDetailModal = Purchasedetail::findOne($this->iD);
         $poDetailModal->QTY = $this->PQTY;
         if ($poDetailModal->save()) {
             return $poDetailModal;
         }
         return $poDetailModal;
     }
     return null;
 }
コード例 #4
0
ファイル: Auth1Model.php プロジェクト: adem-team/advanced
 /**
  * Password Find Oldpassword for validation
  * @author ptrnov  <*****@*****.**>
  * @since 1.1
  */
 public function findPasswords($attribute, $params)
 {
     /*
      * @author ptrnov  <*****@*****.**>
      * @since 1.1
      */
     if (!$this->hasErrors()) {
         $empid = $this->getEmpid();
         $id = $this->kdpo;
         $data = Purchasedetail::find()->where('STATUS<>3 AND KD_PO="' . $id . '"')->count();
         if (!$empid || !$empid->validateOldPasswordCheck($this->password)) {
             $this->addError($attribute, 'Incorrect password.');
         } elseif ($data == 0) {
             $this->addError($attribute, 'Sorry data PO ' . $data);
         } elseif ($this->getPermission()->BTN_SIGN1 != 1) {
             $this->addError($attribute, 'Wrong Permission');
         }
     }
 }
コード例 #5
0
 public function actionTempCetakpdf($kdpo)
 {
     $poHeader = Purchaseorder::find()->where(['KD_PO' => $kdpo])->one();
     //$poDetail = Purchasedetail::find()->where(['KD_PO'=>$kdpo])->all();
     $poDetailQry = "SELECT ID,KD_PO,KD_RO,KD_BARANG,NM_BARANG,UNIT,NM_UNIT,UNIT_QTY,UNIT_WIGHT,SUM(QTY) AS QTY,HARGA,STATUS,STATUS_DATE,NOTE\n\t\t\t\t\t\tFROM `p0002` WHERE KD_PO='" . $kdpo . "' GROUP BY KD_BARANG,NM_UNIT,HARGA";
     $poDetail = Purchasedetail::findBySql($poDetailQry)->all();
     $dataProvider = new ArrayDataProvider(['key' => 'KD_PO', 'allModels' => $poDetail, 'pagination' => ['pageSize' => 20]]);
     $content = $this->renderPartial('pdf_tmp', ['poHeader' => $poHeader, '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' => 'Form Request Order', 'subject' => 'ro'], 'methods' => ['SetHeader' => ['Copyright@LukisonGroup ' . date("r")], 'SetFooter' => ['{PAGENO}']]]);
     return $pdf->render();
     /* $mpdf=new mPDF();
        $mpdf->WriteHTML($this->renderPartial( 'pdf', [
            'model' => Purchaseorder::find()->where(['KD_PO'=>$kdpo])->one(),
        ]));
        $mpdf->Output();
        exit; */
 }
コード例 #6
0
ファイル: pdf.php プロジェクト: adem-team/advanced
use lukisongroup\master\models\Suplier;
use lukisongroup\master\models\Barangumum;
use lukisongroup\master\models\Nmperusahaan;
use lukisongroup\purchasing\models\pr\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>
						<div><b>10000,0</b></div>';
コード例 #7
0
ファイル: _detail.php プロジェクト: adem-team/advanced
    }
    return $UnitNm;
}, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '150px', 'font-family' => 'tahoma', 'font-size' => '8pt', 'background-color' => 'rgba(0, 95, 218, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '150px', 'font-family' => 'tahoma', 'font-size' => '8pt', 'border-left' => '0px']], 'pageSummaryOptions' => ['style' => ['border-left' => '0px', 'border-right' => '0px']], 'pageSummary' => function ($summary, $data, $widget) {
    return '<div>Sub Total :</div>
										<div>Discount :</div>
										<div>TAX :</div>
										<div>Delevery.Cost :</div>
										<div><b>GRAND TOTAL :</b></div>';
}, 'pageSummaryOptions' => ['style' => ['font-family' => 'tahoma', 'font-size' => '8pt', 'text-align' => 'right', 'border-left' => '0px', 'border-right' => '0px']]], ['attribute' => 'HARGA', 'label' => 'Price', 'vAlign' => 'middle', 'hAlign' => 'center', 'mergeHeader' => true, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '100px', 'font-family' => 'tahoma', 'font-size' => '8pt', 'background-color' => 'rgba(0, 95, 218, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'right', 'width' => '100px', 'font-family' => 'tahoma', 'font-size' => '8pt']], 'pageSummaryOptions' => ['style' => ['border-left' => '0px', 'border-right' => '0px']]], ['class' => 'kartik\\grid\\CheckboxColumn', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '20px', 'font-family' => 'tahoma', 'font-size' => '8pt', 'background-color' => 'rgba(0, 95, 218, 0.3)']], 'contentOptions' => ['readonly' => true, 'style' => ['text-align' => 'center', 'width' => '20px', 'font-family' => 'tahoma', 'font-size' => '8pt', 'border-left' => '0px']], 'checkboxOptions' => ['is' => 'ck-gv', 'class' => 'simple', 'style' => ['text-align' => 'left', 'width' => '20px', 'font-family' => 'tahoma', 'font-size' => '8pt', 'border-left' => '0px']], 'rowSelectedClass' => GridView::TYPE_WARNING, 'checkboxOptions' => function ($model, $key, $index, $column) use($kdpo) {
    $poDetail = Purchasedetail::find()->where('STATUS<>3 AND KD_PO="' . $kdpo . '" AND KD_RO="' . $model->KD_RO . '" AND KD_BARANG="' . $model->KD_BARANG . '"')->one();
    if ($poDetail) {
        return ['checked' => $model->TMP_CK, 'hidden' => true];
    } else {
        /*FORMULA*/
        $pqtyTaken = "SELECT SUM(QTY) as QTY FROM p0002 WHERE STATUS<>3 AND KD_RO='" . $model->KD_RO . "' AND KD_BARANG='" . $model->KD_BARANG . "' GROUP BY KD_BARANG";
        $countQtyTaken = Purchasedetail::findBySql($pqtyTaken)->one();
        if ($countQtyTaken) {
            $qtyInPo = $countQtyTaken->QTY != '' ? $countQtyTaken->QTY : 0;
        } else {
            $qtyInPo = 0;
        }
        //$qtyInPo=$countQtyTaken!=''? $countQtyTaken->QTY :0;
        $actualQty = $model->SQTY - $qtyInPo;
        if ($actualQty > 0) {
            return ['checked' => $model->TMP_CK];
        } else {
            return ['checked' => $model->TMP_CK, 'hidden' => true];
        }
    }
}]], 'pjax' => true, 'pjaxSettings' => ['options' => ['enablePushState' => true, 'id' => 'gv-ropo']], 'hover' => true, 'responsive' => true, 'responsiveWrap' => true, 'bordered' => true, 'striped' => '4px', 'autoXlFormat' => true, 'export' => false]);
?>
コード例 #8
0
 public function actionCetakpdf($kdpo)
 {
     $poHeader = Purchaseorder::find()->where(['KD_PO' => $kdpo])->one();
     $poDetail = Purchasedetail::find()->where(['KD_PO' => $kdpo])->all();
     $dataProvider = new ArrayDataProvider(['key' => 'KD_PO', 'allModels' => $poDetail, 'pagination' => ['pageSize' => 20]]);
     $content = $this->renderPartial('pdf', ['poHeader' => $poHeader, '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' => 'Form Request Order', 'subject' => 'ro'], 'methods' => ['SetHeader' => ['Copyright@LukisonGroup ' . date("r")], 'SetFooter' => ['{PAGENO}']]]);
     return $pdf->render();
     /* $mpdf=new mPDF();
        $mpdf->WriteHTML($this->renderPartial( 'pdf', [
            'model' => Purchaseorder::find()->where(['KD_PO'=>$kdpo])->one(),
        ]));
        $mpdf->Output();
        exit; */
 }
コード例 #9
0
 public function actionDelpo($idpo, $kdpo)
 {
     $podet = Podetail::find()->where(['KD_PO' => $kdpo, 'ID' => $idpo])->one();
     $po = Purchasedetail::find()->where(['KD_PO' => $kdpo, 'ID' => $podet->ID_DET_PO])->one();
     $sisa = $po->QTY - $podet->QTY;
     if ($sisa == '0') {
         \Yii::$app->db_esm->createCommand()->update('p0002', ['QTY' => $sisa, 'STATUS' => '3'], "ID='{$po->ID}'")->execute();
     } else {
         \Yii::$app->db_esm->createCommand()->update('p0002', ['QTY' => $sisa], "ID='{$po->ID}'")->execute();
     }
     $podet->STATUS = '3';
     $podet->save();
     return $this->redirect(['create', 'kdpo' => $kdpo]);
 }