} 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(['KD_PO' => $kdpo, 'KD_RO' => $model->KD_RO, '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 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]); ?>