add backend transfer list changes

This commit is contained in:
2015-10-13 09:27:56 +02:00
parent fda450b801
commit b04cbda645
20 changed files with 677 additions and 222 deletions

View File

@@ -2,52 +2,68 @@
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' => ['index'],
'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, 'type')->dropDownList( ['' => Yii::t('common/transfer', 'All')] + Transfer::types() ) ?>
</div>
<div class='col-md-4'>
<?= $form->field($model, 'id_user')->dropDownList( ['' => Yii::t('common/transfer', 'All')] +ArrayHelper::map($users,'id' , 'username') ) ?>
</div>
</div>
<?= $form->field($model, 'id_transfer') ?>
<?= $form->field($model, 'id_discount') ?>
<?= $form->field($model, 'id_currency') ?>
<?= $form->field($model, 'id_object') ?>
<?= $form->field($model, 'status') ?>
<div class="row">
<div class='col-md-4'>
<?php echo $form->field($model, 'searchObjectName') ?>
</div>
<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>
<?php // echo $form->field($model, 'type') ?>
<?php // echo $form->field($model, 'item_price') ?>
<?php // echo $form->field($model, 'count') ?>
<?php // echo $form->field($model, 'money') ?>
<?php // echo $form->field($model, 'money_currency') ?>
<?php // echo $form->field($model, 'rate') ?>
<?php // echo $form->field($model, 'id_user') ?>
<?php // echo $form->field($model, 'comment') ?>
<?php // echo $form->field($model, 'created_at') ?>
<?php // echo $form->field($model, 'updated_at') ?>
<div class="form-group">
<?= Html::submitButton(Yii::t('frontend/transfer', 'Search'), ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton(Yii::t('frontend/transfer', 'Reset'), ['class' => 'btn btn-default']) ?>
</div>
<?php ActiveForm::end(); ?>

View File

@@ -2,6 +2,10 @@
use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\DetailView;
use yii\base\Widget;
use yii\base\Object;
use yii\data\ArrayDataProvider;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\TransferSearch */
@@ -13,30 +17,68 @@ $this->params['breadcrumbs'][] = $this->title;
<div class="transfer-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?= Html::a(Yii::t('frontend/transfer', 'Create Transfer'), ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?php echo $this->render('_search', ['model' => $searchModel, 'accounts' => $accounts,'users' => $users,]); ?>
<?php
?>
<h2>Összesen</h2>
<?php
echo DetailView::widget([
'model' => $searchModel->fullTotal,
'attributes' => [
[
'value' => $searchModel->fullTotal['money'],
'label' => $searchModel->fullTotal['label'],
],
]
])
?>
<h2>Kasszák összesen</h2>
<?php
echo GridView::widget([
'dataProvider' => new ArrayDataProvider([
'allModels' => $searchModel->accountTotals,
'sort' => false,
'pagination' => false,
]) ,
'columns' => [
[
'label' => Yii::t('common/transfer','Account'),
'value' => 'label'
],
[
'label' => Yii::t('common/transfer','Money total'),
'value' => 'money'
],
]
]
);
?>
<h2>Pénzmozgások</h2>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
'id_discount',
'id_currency',
'id_object',
'status',
// 'type',
// 'item_price',
// 'count',
// 'money',
// 'money_currency',
// 'rate',
// 'id_user',
// 'comment',
[
'attribute' => 'type',
'value' => 'transferTypeName'
],
[
'attribute' => 'id_object',
'value' => 'objectName'
],
[
'attribute' => 'id_user',
'value' => 'userName'
],
[
'attribute' => 'id_account',
'value' => 'accountName'
],
'item_price',
'count',
'money',
'created_at:datetime',
'updated_at:datetime',
['class' => 'yii\grid\ActionColumn',
'template' => '{view}'

View File

@@ -14,35 +14,33 @@ $this->params['breadcrumbs'][] = $this->title;
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a(Yii::t('frontend/transfer', 'Update'), ['update', 'id' => $model->id_transfer], ['class' => 'btn btn-primary']) ?>
<?= Html::a(Yii::t('frontend/transfer', 'Delete'), ['delete', 'id' => $model->id_transfer], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => Yii::t('frontend/transfer', 'Are you sure you want to delete this item?'),
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id_transfer',
'id_discount',
'id_currency',
'id_object',
'status',
'type',
[
'attribute' => 'id_transfer',
],
[
'attribute' => 'id_account',
'value' => $model->accountName
],
[
'attribute' => 'type',
'value' => $model->transferTypeName,
],
[
'attribute' => 'id_object',
'value' => $model->objectName,
],
[
'attribute' => 'id_user',
'value' => $model->userName,
],
'item_price',
'count',
'money',
'money_currency',
'rate',
'id_user',
'comment',
'created_at',
'updated_at',
],
]) ?>