<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use frontend\components\HtmlHelper;

/* @var $this yii\web\View */
/* @var $model common\models\AccountState */
/* @var $form yii\widgets\ActiveForm */
/* @var $lastCassaState common\models\AccountState */
?>



<div class="account-state-form">

    <?php $form = ActiveForm::begin(); ?>
<div class='row'>
		<div class='col-md-8'>
			<div class="form-group field-accountstate-money required">
				<label class="control-label" for="accountstate-money">Kassza</label><br>
			    <?php  echo ( isset($account) ? $account->name : 'Nincs alapértelmezett kassza kiválasztva!' )?>
			</div>
    	<?php //echo $form->field($model, 'id_account')->dropDownList(  HtmlHelper::mkAccountOptions($accounts)   ) ?>
</div>
		<div class='col-md-4'>
    <?= $form->field($model, 'money')->textInput(['class' => 'form-control text-right']);  ?>
</div>
</div>

	<?php echo $this->render('_notes',[  'form' => $form, 'model' => $model])?>

	<table class="table table-striped">
			<tr>
				<th class="text-left">
					<?php echo $model->getAttributeLabel('money') ?>
				</th>
				<td class="text-right">
					<span class="money "></span> Ft
				</td>
			</tr>
			<tr>
				<th class="text-left">
					<?php echo Yii::t('frontend/account-state', "Notes total")?>
				</th>
				<td class="text-right">
					<span class="notes-total "></span> Ft
				</td>
			</tr>
			<tr>
				<th class="text-left">
					<?php echo Yii::t('frontend/account-state', "Difference total")?>
				</th>
				<td class="text-right">
					<span class="diff-total "></span> Ft
				</td>
			</tr>
	</table>

	<?= $form->field($model, 'comment')->textarea() ?>

    <div class="form-group">
        <?= Html::submitButton(  Yii::t('frontend/account-state', 'Close account'), ['class' =>   'btn btn-primary']) ?>
    </div>
    <?php ActiveForm::end(); ?>

</div>
