<?php

use home\assets\MainAsset;
use yii\widgets\ActiveForm;
use yii\helpers\Html;
use yii\helpers\Url;
use home\modules\statement\models\StatementAccount;
use home\modules\receivable\models\Account;
use home\modules\receivable\models\Bank;
use home\models\PaymentMethod;
use common\widgets\DatePicker;

/* @var $this \yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \home\modules\reimbursement\models\Application */

$attrLabels = $model->attributeLabels();

$form = ActiveForm::begin([
        'id' => 'main-form',
        'options' => ['class' => 'informationform f14'],
        'action' => $action,
        'fieldConfig' => [
            'options' => ['tag' => 'td'],
            'template' => "{input}{hint}{error}",
            'errorOptions' => ["class" => "error"]
        ]
    ]);
?>

<table cellpadding="0" cellspacing="10" width="100%">
    <tbody>
        <tr>
            <td align="right"><?= $model->getAttributeLabel('serial_number') ?>：</td>
            <?= $form->field($model, 'serial_number')->textInput(['class' => 'form-control']) ?>
            <td><span class="redstar"></span></td>
            <td align="right"><?= $model->getAttributeLabel('payment_time') ?>：</td>
            <?= DatePicker::widget(['model' => $model, 'form' => $form, 'attribute' => 'payment_time', 'inputConfig' => ['class' => 'form-control'], 'dateConfig' => ['maxDate' => '%y-%M-%d']]) ?>
            <td><span class="redstar"></span>*</td>
        </tr>
        <tr>
            <td align="right"><?= $model->getAttributeLabel('type') ?>：</td>
            <?= $form->field($model, 'type')->dropDownList(StatementAccount::getTypeList(), ['class' => 'form-control']) ?>
            <td><span class="redstar"></span>*</td>
            <td align="right"><?= $model->getAttributeLabel('remark') ?>：</td>
            <?= $form->field($model, 'remark')->textInput(['class' => 'form-control']) ?>
            <td><span class="redstar"></span></td>
        </tr>
        <tr>
            <td align="right"><?= $model->getAttributeLabel('bank_id') ?>：</td>
            <?= $form->field($model, 'bank_id')->dropDownList(Bank::getBankList(), ['class' => 'form-control select_bank']) ?>
            <td><span class="redstar"></span></td>
            <td align="right"><?= $model->getAttributeLabel('account_no') ?>：</td>
            <td><select class="form-control select_account"   name="StatementAccount[account_no]"></select></td>
            <td><span class="redstar"></span></td>
        </tr>
        <tr>
            <td align="right"><?= $model->getAttributeLabel('remittance_user') ?>：</td>
            <?= $form->field($model, 'remittance_user')->textInput(['class' => 'form-control']) ?>
            <td><span class="redstar"></span></td>
            <td align="right"><?= $model->getAttributeLabel('remittance_bank') ?>：</td>
            <?= $form->field($model, 'remittance_bank')->textInput(['class' => 'form-control']) ?>
            <td><span class="redstar"></span></td>
        </tr>
        <tr>
            <td align="right"><?= $model->getAttributeLabel('remittance_no') ?>：</td>
            <?= $form->field($model, 'remittance_no')->textInput(['class' => 'form-control']) ?>
            <td><span class="redstar"></span></td>
        </tr>
        <tr>
            <td align="right"><?= $model->getAttributeLabel('account_debit') ?>：</td>
            <?= $form->field($model, 'account_debit')->textInput(['class' => 'form-control']) ?>
            <td><span class="redstar"></span></td>
            <td align="right"><?= $model->getAttributeLabel('account_credit') ?>：</td>
            <?= $form->field($model, 'account_credit')->textInput(['class' => 'form-control']) ?>
            <td><span class="redstar"></span></td>
        </tr>
    </tbody>
</table>
<?= ($model->isNewRecord) ? '' : Html::hiddenInput('id', $model->statement_id); ?>
<?php ActiveForm::end(); ?>
