<?php
use yii\widgets\ActiveForm;
use yii\helpers\Html;

/** @var $model app\models\Barang */
?>

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

<div class="modal-header">
    <h5 class="modal-title">Edit Produk</h5>
    <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
</div>

<div class="modal-body">

    <div class="row g-3">
        <div class="col-md-6">
            <?= $form->field($model, 'kode')->textInput(['maxlength'=>50]) ?>
        </div>
        <div class="col-md-6">
            <?= $form->field($model, 'nama')->textInput(['maxlength'=>150]) ?>
        </div>

        <div class="col-md-4">
            <?= $form->field($model, 'harga')->textInput(['type'=>'number', 'min'=>0]) ?>
        </div>
        <div class="col-md-4">
            <?= $form->field($model, 'stok')->textInput(['type'=>'number', 'min'=>0]) ?>
        </div>
        <div class="col-md-4">
            <?= $form->field($model, 'minimal_stok')->textInput(['type'=>'number', 'min'=>0]) ?>
        </div>

        <div class="col-md-6">
            <?= $form->field($model, 'satuan')->textInput(['maxlength'=>50]) ?>
        </div>
        <div class="col-md-6">
            <?= $form->field($model, 'diskon')->textInput(['type'=>'number', 'min'=>0,'max'=>100]) ?>
        </div>

        <div class="col-md-6">
            <?= $form->field($model, 'ppn')->checkbox(['label'=>'PPN 11%']) ?>
        </div>
        <div class="col-md-6">
            <?= $form->field($model, 'status')->dropDownList([
                'aktif'=>'Aktif',
                'nonaktif'=>'Nonaktif'
            ]) ?>
        </div>
    </div>

</div>

<div class="modal-footer">
    <?= Html::submitButton('Simpan', ['class'=>'btn btn-success']) ?>
    <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Batal</button>
</div>

<?php ActiveForm::end(); ?>
