Exemplo n.º 1
0
    }
}, 'reject' => function ($url, $model) use($poHeader) {
    if ($poHeader->STATUS !== 103) {
        return tombolReject($url, $model);
    }
}, 'cancel' => function ($url, $model) use($poHeader) {
    if ($poHeader->STATUS !== 103) {
        return tombolCancel($url, $model);
    }
}, 'delete' => function ($url, $model) use($poHeader) {
    if ($poHeader->STATUS !== 103) {
        return tombolDelete($url, $model);
    }
}], 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '100px', 'font-family' => 'verdana, arial, sans-serif', 'font-size' => '8pt', 'background-color' => 'rgba(247, 245, 64, 0.6)']], 'contentOptions' => ['style' => ['text-align' => 'center', 'width' => '100px', 'font-family' => 'verdana, arial, sans-serif', 'font-size' => '8pt', 'background-color' => 'rgba(247, 245, 64, 0.6)']]], ['attribute' => 'STATUS', 'options' => ['id' => 'test-ro'], 'label' => 'Status', 'hAlign' => 'center', 'vAlign' => 'middle', 'mergeHeader' => true, 'contentOptions' => ['style' => 'width: 100px'], 'format' => 'html', 'value' => function ($model, $key, $index, $widget) {
    return statusProcessRo($model);
}, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '50px', 'font-family' => 'verdana, arial, sans-serif', 'font-size' => '8pt', 'background-color' => 'rgba(247, 245, 64, 0.6)']], 'contentOptions' => ['style' => ['text-align' => 'center', 'width' => '50px', 'font-family' => 'verdana, arial, sans-serif', 'font-size' => '8pt', 'background-color' => 'rgba(247, 245, 64, 0.6)']]], ['class' => 'kartik\\grid\\SerialColumn', 'width' => '10px', 'header' => 'No.', 'hAlign' => 'center', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '10px', 'font-family' => 'tahoma', 'font-size' => '8pt', 'background-color' => 'rgba(0, 95, 218, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'center', 'width' => '10px', 'font-family' => 'tahoma', 'font-size' => '8pt']], 'pageSummaryOptions' => ['style' => ['border-right' => '0px']]], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'KD_COSTCENTER', 'label' => 'Cost.Center', 'vAlign' => 'middle', 'mergeHeader' => true, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '60px', 'font-family' => 'tahoma', 'font-size' => '8pt', 'background-color' => 'rgba(0, 95, 218, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'center', 'width' => '60px', 'font-family' => 'tahoma', 'font-size' => '8pt']], 'pageSummaryOptions' => ['style' => ['border-left' => '0px', 'border-right' => '0px']], 'editableOptions' => ['header' => 'Cost Center', 'inputType' => \kartik\editable\Editable::INPUT_SELECT2, 'size' => 'md', 'options' => ['data' => ArrayHelper::map(Costcenter::find()->all(), 'KD_COSTCENTER', 'NM_COSTCENTER'), 'pluginOptions' => ['allowClear' => true, 'class' => 'pull-top dropup']], 'displayValueConfig' => ArrayHelper::map(Costcenter::find()->all(), 'KD_COSTCENTER', 'KD_COSTCENTER')]], ['attribute' => 'KD_BARANG', 'label' => 'SKU', 'hAlign' => 'left', 'vAlign' => 'middle', 'mergeHeader' => true, 'format' => 'raw', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '150px', 'font-family' => 'tahoma', 'font-size' => '8pt', 'background-color' => 'rgba(0, 95, 218, 0.3)']], 'contentOptions' => ['style' => ['width' => '150px', 'font-family' => 'tahoma', 'font-size' => '8pt']], 'pageSummaryOptions' => ['style' => ['border-left' => '0px', 'border-right' => '0px']]], ['label' => 'Items Name', 'attribute' => 'NM_BARANG', 'hAlign' => 'center', 'vAlign' => 'middle', 'mergeHeader' => true, 'format' => 'raw', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '200px', 'font-family' => 'tahoma', 'font-size' => '8pt', 'background-color' => 'rgba(0, 95, 218, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '200px', 'font-family' => 'tahoma', 'font-size' => '8pt']], 'pageSummaryOptions' => ['style' => ['border-left' => '0px', 'border-right' => '0px']]], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'QTY', 'label' => 'Qty', 'vAlign' => 'middle', 'hAlign' => 'center', 'mergeHeader' => true, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '60px', 'font-family' => 'tahoma', 'font-size' => '8pt', 'background-color' => 'rgba(0, 95, 218, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'right', 'width' => '60px', 'font-family' => 'tahoma', 'font-size' => '8pt']], 'pageSummaryOptions' => ['style' => ['border-left' => '0px', 'border-right' => '0px']], 'editableOptions' => ['header' => 'Update Quantity', 'inputType' => \kartik\editable\Editable::INPUT_TEXT, 'size' => 'sm', 'options' => ['pluginOptions' => ['min' => 0, 'max' => 50000]]]], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'UNIT', 'mergeHeader' => true, 'label' => 'UoM', 'vAlign' => 'middle', 'hAlign' => 'right', 'readonly' => function ($model, $key, $index, $widget) use($poHeader) {
    //return (102=$model->STATUS || 0<> $headerStatus); // Allow Status Process = 0;
    return 102 == $poHeader->STATUS;
    // Allow Status Process = 0;
}, 'value' => function ($model) {
    $model = Unitbarang::find()->where('KD_UNIT="' . $model->UNIT . '"')->one();
    if (count($model) != 0) {
        $UnitNm = $model->NM_UNIT;
    } else {
        $UnitNm = 'Not Set';
    }
    return $UnitNm;
}, 'editableOptions' => ['header' => 'Update Unit', 'inputType' => \kartik\editable\Editable::INPUT_SELECT2, 'size' => 'md', 'options' => ['data' => ArrayHelper::map(Unitbarang::find()->orderBy('NM_UNIT')->all(), 'KD_UNIT', 'NM_UNIT'), 'pluginOptions' => ['allowClear' => true, 'class' => 'pull-top dropup']], 'displayValueConfig' => ArrayHelper::map(Unitbarang::find()->orderBy('NM_UNIT')->all(), 'KD_UNIT', 'NM_UNIT')], '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>
Exemplo n.º 2
0
        $ttlSubtotal = number_format($total, 2);
        return '<div>' . $ttlSubtotal . '</div>';
    }
}, 'pageSummaryOptions' => ['style' => ['text-align' => 'right', 'width' => '100px', 'font-family' => 'tahoma', 'font-size' => '8pt', 'border-left' => '0px']]], ['attribute' => 'budget.TARGET_VALUE', 'label' => '%', 'hAlign' => 'left', 'vAlign' => 'middle', 'value' => function ($model) {
    if ($model->budget->TARGET_VALUE == '') {
        return $model->budget->TARGET_VALUE = 0.0;
    } else {
        # code...
        return $model->BUDGET_PLAN / $model->budget->TARGET_VALUE * 100;
    }
}, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '10%', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'right', 'width' => '10%', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']], 'pageSummaryFunc' => GridView::F_SUM, 'format' => ['decimal', 2], 'pageSummary' => true, 'pageSummaryOptions' => ['style' => ['font-family' => 'tahoma', 'font-size' => '8pt', 'text-align' => 'right', 'border-left' => '0px']]], ['attribute' => 'PROGRAM', 'label' => 'PROGRAM', 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['width' => '25%', 'text-align' => 'center', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '25%', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']], 'pageSummaryOptions' => ['style' => ['border-left' => '0px', 'border-right' => '0px']]], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'KD_COSTCENTER', 'label' => 'CostCenter', 'vAlign' => 'middle', 'mergeHeader' => true, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '60px', 'font-family' => 'tahoma', 'font-size' => '8pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'center', 'width' => '60px', 'font-family' => 'tahoma', 'font-size' => '8pt']], 'pageSummary' => function ($summary, $data, $widget) {
    return '<div> Total:</div>
							 				<div> PPN :</div>
							 				<div> PPH23 :</div>
											<div> Sub Total:</div>';
}, 'pageSummaryOptions' => ['style' => ['font-family' => 'tahoma', 'font-size' => '8pt', 'text-align' => 'right', 'border-left' => '0px']], 'editableOptions' => ['header' => 'Cost Center', 'inputType' => \kartik\editable\Editable::INPUT_SELECT2, 'size' => 'sm', 'options' => ['data' => ArrayHelper::map(Costcenter::find()->where('KD_COSTCENTER IN ("1000","1001")')->all(), 'KD_COSTCENTER', 'NM_COSTCENTER'), 'pluginOptions' => ['allowClear' => true, 'class' => 'pull-top dropup']], 'displayValueConfig' => ArrayHelper::map(Costcenter::find()->all(), 'KD_COSTCENTER', 'KD_COSTCENTER')]], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'BUDGET_ACTUAL', 'label' => 'Budget Actual', 'hAlign' => 'left', 'vAlign' => 'middle', 'refreshGrid' => true, 'pageSummaryFunc' => GridView::F_SUM, 'format' => ['decimal', 2], 'pageSummary' => true, 'pageSummaryOptions' => ['style' => ['font-family' => 'tahoma', 'font-size' => '8pt', 'text-align' => 'right', 'border-left' => '0px']], 'pageSummaryFunc' => GridView::F_SUM, 'pageSummary' => true, 'format' => ['decimal', 2], 'pageSummary' => function ($summary, $data, $widget) use($dataProvider1, $model2, $modelnewaprov) {
    $model = $dataProvider1->getModels();
    /*
     * Calculate SUMMARY TOTAL
     * @author wawan
     * @since 1.0
     */
    $baris = count($model);
    if ($baris == 0) {
        $defaultppn = $model[0]['PPN'] = 0.0;
        $ppn = number_format($defaultppn, 2);
        $defaultpph23 = $model[0]['PPH23'] = 0.0;
        $pph23 = number_format($defaultpph23, 2);
        $total = $summary = 0.0;
        $ttlSubtotal = number_format($total, 2);
        $total = $summary = 0.0;
Exemplo n.º 3
0
 public function getCost()
 {
     return $this->hasOne(Costcenter::className(), ['KD_COSTCENTER' => 'KD_COSTCENTER']);
 }
Exemplo n.º 4
0
}, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '21%', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'left', 'width' => '21%', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']], 'pageSummaryOptions' => ['style' => ['border-left' => '0px', 'border-right' => '0px']], 'pageSummary' => function ($summary, $data, $widget) {
    return '<div> Total :</div>';
}, 'pageSummaryOptions' => ['style' => ['font-family' => 'tahoma', 'font-size' => '8pt', 'text-align' => 'right', 'border-left' => '0px']]], ['attribute' => 'BUDGET_PLAN', 'label' => 'Budget Plan', 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '20%', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'right', 'width' => '20%', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']], 'pageSummaryFunc' => GridView::F_SUM, 'format' => ['decimal', 2], 'pageSummary' => true, 'pageSummaryOptions' => ['style' => ['font-family' => 'tahoma', 'font-size' => '8pt', 'text-align' => 'right', 'border-left' => '0px']]], ['label' => '%', 'hAlign' => 'left', 'vAlign' => 'middle', 'value' => function ($model) {
    if ($model['TARGET_VALUE'] == '' || $model['BUDGET_PLAN'] == '') {
        return $model['TARGET_VALUE'] = 0.0;
        return $model['BUDGET_PLAN'] = 0.0;
    } else {
        # code...
        return $model['BUDGET_PLAN'] / $model['TARGET_VALUE'] * 100;
    }
}, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '7%', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'right', 'width' => '7%', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']], 'pageSummaryFunc' => GridView::F_SUM, 'format' => ['decimal', 2], 'pageSummary' => true, 'pageSummaryOptions' => ['style' => ['font-family' => 'tahoma', 'font-size' => '8pt', 'text-align' => 'right', 'border-left' => '0px']]], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'KD_COSTCENTER', 'label' => 'CostCenter', 'vAlign' => 'middle', 'mergeHeader' => true, 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '60px', 'font-family' => 'tahoma', 'font-size' => '8pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'center', 'width' => '60px', 'font-family' => 'tahoma', 'font-size' => '8pt']], 'pageSummary' => function ($summary, $data, $widget) {
    return '<div>Total:</div>
                            <div> PPN :</div>
                            <div> PPH23 :</div>
                            <div> Sub Total:</div>';
}, 'pageSummaryOptions' => ['style' => ['font-family' => 'tahoma', 'font-size' => '8pt', 'text-align' => 'right', 'border-left' => '0px']], 'editableOptions' => ['header' => 'Cost Center', 'inputType' => \kartik\editable\Editable::INPUT_SELECT2, 'size' => 'md', 'options' => ['data' => ArrayHelper::map(Costcenter::find()->where('KD_COSTCENTER IN ("1000","1001")')->all(), 'KD_COSTCENTER', 'NM_COSTCENTER'), 'pluginOptions' => ['allowClear' => true, 'class' => 'pull-top dropup']], 'displayValueConfig' => ArrayHelper::map(Costcenter::find()->all(), 'KD_COSTCENTER', 'KD_COSTCENTER')]], ['attribute' => 'BUDGET_ACTUAL', 'label' => 'Budget Actual', 'hAlign' => 'left', 'vAlign' => 'middle', 'headerOptions' => ['style' => ['text-align' => 'center', 'width' => '20%', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt', 'background-color' => 'rgba(97, 211, 96, 0.3)']], 'contentOptions' => ['style' => ['text-align' => 'right', 'width' => '20%', 'font-family' => 'tahoma, arial, sans-serif', 'font-size' => '9pt']], 'pageSummaryFunc' => GridView::F_SUM, 'format' => ['decimal', 2], 'pageSummary' => true, 'pageSummaryOptions' => ['style' => ['font-family' => 'tahoma', 'font-size' => '8pt', 'text-align' => 'right', 'border-left' => '0px']], 'pageSummary' => function ($summary, $data, $widget) use($dataProvider, $modelnewaprov) {
    $model = $dataProvider->getModels();
    /*
     * Calculate SUMMARY TOTAL
     * @author wawan
     * @since 1.0
     */
    $baris = count($model);
    if ($baris == 0) {
        $defaultppn = $model[0]['PPN'] = 0.0;
        $ppn = number_format($defaultppn, 2);
        $defaultpph23 = $model[0]['PPH23'] = 0.0;
        $pph23 = number_format($defaultpph23, 2);
        $total = $summary = 0.0;
        $ttlSubtotal = number_format($total, 2);
        $total = $summary = 0.0;