add changes to account state

This commit is contained in:
2015-10-19 07:48:46 +02:00
parent b04cbda645
commit 9145f21371
50 changed files with 2139 additions and 27 deletions

View File

@@ -0,0 +1,57 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model common\models\AccountState */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="account-state-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'id_account')->textInput() ?>
<?= $form->field($model, 'type')->textInput() ?>
<?= $form->field($model, 'money')->textInput() ?>
<?= $form->field($model, 'banknote_5_ft')->textInput() ?>
<?= $form->field($model, 'banknote_10_ft')->textInput() ?>
<?= $form->field($model, 'banknote_20_ft')->textInput() ?>
<?= $form->field($model, 'banknote_50_ft')->textInput() ?>
<?= $form->field($model, 'banknote_100_ft')->textInput() ?>
<?= $form->field($model, 'banknote_200_ft')->textInput() ?>
<?= $form->field($model, 'banknote_500_ft')->textInput() ?>
<?= $form->field($model, 'banknote_1000_ft')->textInput() ?>
<?= $form->field($model, 'banknote_2000_ft')->textInput() ?>
<?= $form->field($model, 'banknote_5000_ft')->textInput() ?>
<?= $form->field($model, 'banknote_10000_ft')->textInput() ?>
<?= $form->field($model, 'banknote_20000_ft')->textInput() ?>
<?= $form->field($model, 'id_user')->textInput() ?>
<?= $form->field($model, 'created_at')->textInput() ?>
<?= $form->field($model, 'updated_at')->textInput() ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? Yii::t('frontend/account-state', 'Create') : Yii::t('frontend/account-state', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@@ -0,0 +1,63 @@
<?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 */
?>
<div class="account-state-form">
<?php $form = ActiveForm::begin(); ?>
<div class='row'>
<div class='col-md-6'>
<?= $form->field($model, 'id_account')->dropDownList( HtmlHelper::mkAccountOptions($accounts) ) ?>
</div>
<div class='col-md-6'>
<?= $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>

View File

@@ -0,0 +1,80 @@
<?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 */
?>
<div class="account-state-form">
<?php $form = ActiveForm::begin(); ?>
<?php echo Html::activeHiddenInput($model, "prev_state") ?>
<div class='row'>
<div class='col-md-6'>
<?= $form->field($model, 'id_account')->dropDownList( HtmlHelper::mkAccountOptions($accounts) ) ?>
</div>
<div class='col-md-6'>
<?= $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>
<tr>
<th class="text-left">
<?php echo Yii::t("frontend/account-state", "Last closing money")?>
</th>
<td class="text-right">
<span class="last-closing-money "></span> Ft
</td>
</tr>
<tr>
<th class="text-left">
<?php echo Yii::t('frontend/account-state', "Difference closing money")?>
</th>
<td class="text-right">
<span class="diff-closing "></span> Ft
</td>
</tr>
</table>
<?= $form->field($model, 'comment')->textarea() ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? Yii::t('frontend/account-state', 'Create') : Yii::t('frontend/account-state', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@@ -0,0 +1,13 @@
<?php
use frontend\components\AccountStateBanknoteCountWidget;
use yii\base\Widget;
?>
<?php
echo AccountStateBanknoteCountWidget::widget([
'model' => $model,
]);
?>

View File

@@ -0,0 +1,31 @@
<?php
?>
<div class='row'>
<div class='col-md-4'>
<?= $form->field($model, 'banknote_5_ft')->textInput([ 'class' => 'form-control note-input text-right', 'data-value' => '5']) ?>
<?= $form->field($model, 'banknote_10_ft')->textInput([ 'class' => 'form-control note-input text-right', 'data-value' => '10']) ?>
<?= $form->field($model, 'banknote_20_ft')->textInput([ 'class' => 'form-control note-input text-right', 'data-value' => '15']) ?>
<?= $form->field($model, 'banknote_50_ft')->textInput([ 'class' => 'form-control note-input text-right', 'data-value' => '20']) ?>
</div>
<div class='col-md-4'>
<?= $form->field($model, 'banknote_100_ft')->textInput([ 'class' => 'form-control note-input text-right', 'data-value' => '100']) ?>
<?= $form->field($model, 'banknote_200_ft')->textInput([ 'class' => 'form-control note-input text-right', 'data-value' => '200']) ?>
<?= $form->field($model, 'banknote_500_ft')->textInput([ 'class' => 'form-control note-input text-right', 'data-value' => '500']) ?>
<?= $form->field($model, 'banknote_1000_ft')->textInput([ 'class' => 'form-control note-input text-right', 'data-value' => '1000']) ?>
</div>
<div class='col-md-4'>
<?= $form->field($model, 'banknote_2000_ft')->textInput([ 'class' => 'form-control note-input text-right', 'data-value' => '2000']) ?>
<?= $form->field($model, 'banknote_5000_ft')->textInput([ 'class' => 'form-control note-input text-right', 'data-value' => '5000']) ?>
<?= $form->field($model, 'banknote_10000_ft')->textInput([ 'class' => 'form-control note-input text-right', 'data-value' => '10000']) ?>
<?= $form->field($model, 'banknote_20000_ft')->textInput([ 'class' => 'form-control note-input text-right', 'data-value' => '20000']) ?>
</div>
</div>

View File

@@ -0,0 +1,63 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model frontend\models\AccountstateSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="account-state-search">
<?php $form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
]); ?>
<?= $form->field($model, 'id_account_state') ?>
<?= $form->field($model, 'id_account') ?>
<?= $form->field($model, 'type') ?>
<?= $form->field($model, 'money') ?>
<?= $form->field($model, 'banknote_5_ft') ?>
<?php // echo $form->field($model, 'banknote_10_ft') ?>
<?php // echo $form->field($model, 'banknote_20_ft') ?>
<?php // echo $form->field($model, 'banknote_50_ft') ?>
<?php // echo $form->field($model, 'banknote_100_ft') ?>
<?php // echo $form->field($model, 'banknote_200_ft') ?>
<?php // echo $form->field($model, 'banknote_500_ft') ?>
<?php // echo $form->field($model, 'banknote_1000_ft') ?>
<?php // echo $form->field($model, 'banknote_2000_ft') ?>
<?php // echo $form->field($model, 'banknote_5000_ft') ?>
<?php // echo $form->field($model, 'banknote_10000_ft') ?>
<?php // echo $form->field($model, 'banknote_20000_ft') ?>
<?php // echo $form->field($model, 'id_user') ?>
<?php // echo $form->field($model, 'created_at') ?>
<?php // echo $form->field($model, 'updated_at') ?>
<div class="form-group">
<?= Html::submitButton(Yii::t('frontend/account-state', 'Search'), ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton(Yii::t('frontend/account-state', 'Reset'), ['class' => 'btn btn-default']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@@ -0,0 +1,28 @@
<?php
use yii\helpers\Html;
use frontend\assets\AccountStateAsset;
/* @var $this yii\web\View */
/* @var $model common\models\AccountState */
$this->title = Yii::t('frontend/account-state', 'Close Account State');
$this->params['breadcrumbs'][] = ['label' => Yii::t('frontend/account-state', 'Account States'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
AccountStateAsset::register($this);
$options = [];
$this->registerJs ( 'new AccountState( '. json_encode($options).');' );
?>
<div class="account-state-create">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form_close', [
'model' => $model,
'accounts' => $accounts,
]) ?>
</div>

View File

@@ -0,0 +1,21 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\models\AccountState */
$this->title = Yii::t('frontend/account-state', 'Create Account State');
$this->params['breadcrumbs'][] = ['label' => Yii::t('frontend/account-state', 'Account States'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="account-state-create">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>

View File

@@ -0,0 +1,38 @@
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\ListView;
use yii\base\Widget;
/* @var $this yii\web\View */
/* @var $searchModel frontend\models\AccountstateSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('frontend/account-state', 'Account States');
$this->params['breadcrumbs'][] = $this->title;
?>
<style>
.notes-view table thead th,
.notes-view table td{
text-align: right;
}
</style>
<div class="account-state-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?= Html::a(Yii::t('frontend/account-state', 'Open Account State'), ['open'], ['class' => 'btn btn-success']) ?>
<?= Html::a(Yii::t('frontend/account-state', 'Close Account State'), ['close'], ['class' => 'btn btn-success']) ?>
</p>
<?php echo ListView::widget([
'dataProvider' => $dataProvider,
'itemView' => '_item_view'
])?>
</div>

View File

@@ -0,0 +1,29 @@
<?php
use yii\helpers\Html;
use frontend\assets\AccountStateAsset;
/* @var $this yii\web\View */
/* @var $model common\models\AccountState */
$this->title = Yii::t('frontend/account-state', 'Open Account State');
$this->params['breadcrumbs'][] = ['label' => Yii::t('frontend/account-state', 'Account States'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
AccountStateAsset::register($this);
$options = [];
$options['last_states'] = $lastStates;
$options['open'] = true;
$this->registerJs ( 'new AccountState( '. json_encode($options).');' );
?>
<div class="account-state-create">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form_open', [
'model' => $model,
'accounts' => $accounts,
]) ?>
</div>

View File

@@ -0,0 +1,23 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\models\AccountState */
$this->title = Yii::t('frontend/account-state', 'Update {modelClass}: ', [
'modelClass' => 'Account State',
]) . ' ' . $model->id_account_state;
$this->params['breadcrumbs'][] = ['label' => Yii::t('frontend/account-state', 'Account States'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->id_account_state, 'url' => ['view', 'id' => $model->id_account_state]];
$this->params['breadcrumbs'][] = Yii::t('frontend/account-state', 'Update');
?>
<div class="account-state-update">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>

View File

@@ -0,0 +1,53 @@
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model common\models\AccountState */
$this->title = $model->id_account_state;
$this->params['breadcrumbs'][] = ['label' => Yii::t('frontend/account-state', 'Account States'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="account-state-view">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a(Yii::t('frontend/account-state', 'Update'), ['update', 'id' => $model->id_account_state], ['class' => 'btn btn-primary']) ?>
<?= Html::a(Yii::t('frontend/account-state', 'Delete'), ['delete', 'id' => $model->id_account_state], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => Yii::t('frontend/account-state', 'Are you sure you want to delete this item?'),
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id_account_state',
'id_account',
'type',
'money',
'banknote_5_ft',
'banknote_10_ft',
'banknote_20_ft',
'banknote_50_ft',
'banknote_100_ft',
'banknote_200_ft',
'banknote_500_ft',
'banknote_1000_ft',
'banknote_2000_ft',
'banknote_5000_ft',
'banknote_10000_ft',
'banknote_20000_ft',
'id_user',
'created_at',
'updated_at',
],
]) ?>
</div>