add reception account state view and pdf export
This commit is contained in:
@@ -2,12 +2,19 @@
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
use kartik\widgets\DateTimePicker;
|
||||
use frontend\components\HtmlHelper;
|
||||
use common\models\AccountState;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model frontend\models\AccountstateSearch */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
?>
|
||||
|
||||
<?php
|
||||
$accountOptions = ['' =>'Mind']+ HtmlHelper::mkAccountOptions( $model->accounts );
|
||||
$userOptions = ['' => 'Mind'] + HtmlHelper::mkOptions($model->users,'id','username');
|
||||
$typeOptions = ['' => 'Mind'] + AccountState::types();
|
||||
?>
|
||||
<div class="account-state-search">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
@@ -15,47 +22,41 @@ use yii\widgets\ActiveForm;
|
||||
'method' => 'get',
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'id_account_state') ?>
|
||||
|
||||
<?= $form->field($model, 'id_account') ?>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'id_account')->dropDownList($accountOptions) ?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'id_user')->dropDownList($userOptions) ?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'type')->dropDownList($typeOptions) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'start')->widget(DateTimePicker::classname(), [
|
||||
'pluginOptions' => [
|
||||
'autoclose'=>true,
|
||||
'format' => 'yyyy.mm.dd hh:ii'
|
||||
]
|
||||
])->label('Időszak kezdete') ?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'end') ->widget(DateTimePicker::classname(), [
|
||||
'pluginOptions' => [
|
||||
'autoclose'=>true,
|
||||
'format' => 'yyyy.mm.dd hh:ii'
|
||||
]
|
||||
])->label("Időszak vége") ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?= $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(); ?>
|
||||
|
||||
@@ -23,7 +23,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
<div class="account-state-index">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
|
||||
<?php echo $this->render('_search', ['model' => $searchModel]); ?>
|
||||
|
||||
<p>
|
||||
<?= Html::a(Yii::t('frontend/account-state', 'Open Account State'), ['open'], ['class' => 'btn btn-success']) ?>
|
||||
|
||||
@@ -2,52 +2,117 @@
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
use common\components\total\TotalEasyWidget;
|
||||
use common\components\total\TotalDetailedProductsWidget;
|
||||
use common\components\total\TotalDetailedTicketsWidget;
|
||||
use common\components\total\TotalDetailedMoneyMovementWidget;
|
||||
use common\components\accountstate\BankNotesWidget;
|
||||
use common\components\total\TotalMediumTicketsWidget;
|
||||
use common\components\total\TotalMediumProductsWidget;
|
||||
use common\components\total\TotalMediumMoneyMovementsWidget;
|
||||
use common\components\total\TotalDifferenceWidget;
|
||||
use yii\base\Widget;
|
||||
use common\models\AccountState;
|
||||
use yii\helpers\Url;
|
||||
use common\components\accountstate\AccountStateWidget;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\AccountState */
|
||||
|
||||
$this->title = $model->id_account_state;
|
||||
if ( $model ->type == AccountState::TYPE_OPEN ){
|
||||
$this->title = "Kassza nyitás";
|
||||
}else{
|
||||
$this->title = "Kassza zárás";
|
||||
}
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('frontend/account-state', 'Account States'), 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
|
||||
<style>
|
||||
.btn-pdf{
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
td.money{
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
<div class="account-state-view">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<?php
|
||||
if ( $model->hasDifferenceToPrevState() ){
|
||||
if ( $model->hasMinus()){
|
||||
?>
|
||||
<div class="alert alert-danger" role="alert">Negatív különbözet</div>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<div class="alert alert-success" role="alert">Pozitív különbözet</div>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php echo AccountStateWidget::widget(['model' =>$model]) ?>
|
||||
|
||||
<?php
|
||||
echo Html::a( Html::tag("span","",['class' =>'glyphicon glyphicon-download-alt'])." Pdf", Url::current(['output' =>'pdf']) ,['class' => 'btn btn-primary btn-pdf']);
|
||||
?>
|
||||
|
||||
<?php if ( $model->hasDifferenceToPrevState() ){
|
||||
?>
|
||||
<h2>Különbözet</h2>
|
||||
<?php
|
||||
echo TotalDifferenceWidget::widget(['model' => $model] );
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
<?php if ( $model ->type == AccountState::TYPE_CLOSE ){?>
|
||||
<div>
|
||||
|
||||
<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>
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="active"><a href="#easy"
|
||||
aria-controls="easy" role="tab" data-toggle="tab">Egyszerű összesítő</a></li>
|
||||
<li role="presentation"><a href="#medium" aria-controls="medium"
|
||||
role="tab" data-toggle="tab">Közepes összesítő</a></li>
|
||||
<li role="presentation"><a href="#detailed" aria-controls="detailed"
|
||||
role="tab" data-toggle="tab">Részletes összesítő</a></li>
|
||||
<li role="presentation" class=""><a href="#banknotes"
|
||||
aria-controls="banknotes" role="tab" data-toggle="tab">Címletek</a></li>
|
||||
</ul>
|
||||
|
||||
<?= 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',
|
||||
],
|
||||
]) ?>
|
||||
<!-- Tab panes -->
|
||||
<div class="tab-content">
|
||||
<div role="tabpanel" class="tab-pane active" id="easy">
|
||||
<?php echo TotalEasyWidget::widget(['dailyListing' => $details]);?>
|
||||
</div>
|
||||
<div role="tabpanel" class="tab-pane " id="medium">
|
||||
<h2>Közepes összesítés</h2>
|
||||
<h3>Bérletek típus szerint</h3>
|
||||
<?php echo TotalMediumTicketsWidget::widget(['dailyListing' => $details]);?>
|
||||
<h3>Termékek név szerint</h3>
|
||||
<?php echo TotalMediumProductsWidget::widget(['dailyListing' => $details]);?>
|
||||
<h3>Pénzmozgások típus szerint</h3>
|
||||
<?php echo TotalMediumMoneyMovementsWidget::widget(['dailyListing' => $details]);?>
|
||||
</div>
|
||||
<div role="tabpanel" class="tab-pane " id="detailed">
|
||||
<h2>Részletek</h2>
|
||||
<?php echo TotalDetailedTicketsWidget::widget(['dailyListing' => $details]);?>
|
||||
<?php echo TotalDetailedProductsWidget::widget(['dailyListing' => $details]);?>
|
||||
<?php echo TotalDetailedMoneyMovementWidget::widget(['dailyListing' => $details]);?>
|
||||
</div>
|
||||
<div role="tabpanel" class="tab-pane " id="banknotes">
|
||||
<h2>Címletek</h2>
|
||||
<?php echo BankNotesWidget::widget(['model' => $model]);?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php }else{?>
|
||||
<h2>Címletek</h2>
|
||||
<?php echo BankNotesWidget::widget(['model' => $model]);?>
|
||||
<?php }?>
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user