add transaction/summary, fix transaction/index, add reception product typeahead

This commit is contained in:
2015-12-29 22:22:11 +01:00
parent 3b2f19b909
commit 6eb0e69b1b
20 changed files with 535 additions and 8 deletions

View File

@@ -0,0 +1,58 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use frontend\components\HtmlHelper;
use yii\helpers\ArrayHelper;
use common\models\Transfer;
use kartik\widgets\DatePicker;
/* @var $this yii\web\View */
/* @var $model backend\models\TransferSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<?php
?>
<div class="transfer-search">
<?php $form = ActiveForm::begin([
'action' => ['summary'],
'method' => 'get',
]); ?>
<div class='row'>
<div class='col-md-4'>
<?= $form->field($model, 'id_account')->dropDownList( ['' => Yii::t('common/transfer', 'All')] +HtmlHelper::mkAccountOptions($accounts) ) ?>
</div>
<div class='col-md-4'>
<?= $form->field($model, 'id_user')->dropDownList( ['' => Yii::t('common/transfer', 'All')] +ArrayHelper::map($users,'id' , 'username') ) ?>
</div>
</div>
<div class="row">
<div class="col-md-4">
<?= $form->field($model, 'start')->widget(DatePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd'
]
]) ?>
</div>
<div class="col-md-4">
<?= $form->field($model, 'end') ->widget(DatePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd'
]
]) ?>
</div>
</div>
<div class="form-group">
<?= Html::submitButton(Yii::t('frontend/transfer', 'Search'), ['class' => 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@@ -43,6 +43,10 @@ $this->params['breadcrumbs'][] = $this->title;
'dataProvider' => $dataProvider,
'columns' => [
[
'attribute' => 'id_transfer',
'value' => 'id_transfer'
],
[
'attribute' => 'type',
'value' => 'transferTypeName'
@@ -72,6 +76,7 @@ $this->params['breadcrumbs'][] = $this->title;
'value' => 'signedMoney'
],
'created_at:datetime',
'paid_at:datetime',
['class' => 'yii\grid\ActionColumn',
'template' => '{view}'

View File

@@ -0,0 +1,73 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\TransferSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('frontend/transfer', 'Transfers Summary');
$this->params['breadcrumbs'][] = $this->title;
?>
<style>
.table-summary th
{
width: 200px;
}
</style>
<div class="transfer-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php echo $this->render('_search_summary', ['model' => $searchModel, 'accounts' => $accounts,'users' => $users,]); ?>
<h2>Bérletek összesen</h2>
<table class="table-bordered table-striped table-summary">
<tbody>
<tr>
<th >Bérletek</th>
<td><?php echo $searchModel->ticketMoney?> FT</td>
</tr>
</tbody>
</table>
<h2>Termékek összesen</h2>
<table class="table-bordered table-striped table-summary">
<thead>
<tr>
<th>Termék kategória</th>
<th>Összeg</th>
</tr>
</thead>
<tbody>
<tr>
<?php
foreach ($searchModel->productMoneies as $pm ){
?>
<th ><?php echo $pm['category_name'] ?></th>
<td><?php echo $pm['product_money']?> FT</td>
<?php } ?>
</tr>
</tbody>
</table>
<h2>Pénzmozgások összesen</h2>
<table class="table-bordered table-striped table-summary">
<tbody>
<tr>
<th >Pénzmozgások</th>
<td><?php echo $searchModel->moneyMovementMoneis['money_movement_money']?> FT</td>
</tr>
</tbody>
</table>
<h2>Bevétel összesen</h2>
<table class="table-bordered table-striped table-summary">
<tbody>
<tr>
<th >Bérletek</th>
<td><span style='border-bottom: 1px solid black'><?php echo $searchModel->total?> FT</span></td>
</tr>
</tbody>
</table>
</div>

View File

@@ -41,6 +41,7 @@ $this->params['breadcrumbs'][] = $this->title;
'money',
'comment',
'created_at',
'paid_at',
],
]) ?>