1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
use hipanel\modules\finance\grid\BillGridView; |
4
|
|
|
use hipanel\modules\finance\widgets\ExchangeRatesLine; |
5
|
|
|
use hipanel\widgets\IndexPage; |
6
|
|
|
use hipanel\widgets\Pjax; |
7
|
|
|
use yii\helpers\Html; |
8
|
|
|
|
9
|
|
|
/** |
10
|
|
|
* @var \yii\web\View $this |
11
|
|
|
* @var array $billTypes |
12
|
|
|
* @var array $billGroupLabels |
13
|
|
|
* @var \hiqdev\hiart\ActiveDataProvider $dataProvider |
14
|
|
|
* @var \hiqdev\hiart\ActiveRecord $model |
15
|
|
|
* @var \hipanel\modules\finance\models\ExchangeRate[] $rates |
16
|
|
|
*/ |
17
|
|
|
$this->title = Yii::t('hipanel:finance', 'Bills'); |
18
|
|
|
$this->params['breadcrumbs'][] = $this->title; |
19
|
|
|
$subtitle = array_filter(Yii::$app->request->get($model->formName(), [])) ? Yii::t('hipanel', 'filtered list') : Yii::t('hipanel', 'full list'); |
20
|
|
|
$this->params['subtitle'] = $subtitle . ' ' . ExchangeRatesLine::widget(['rates' => $rates]); |
21
|
|
|
|
22
|
|
|
?> |
23
|
|
|
|
24
|
|
|
<?php Pjax::begin(array_merge(Yii::$app->params['pjax'], ['enablePushState' => true])) ?> |
25
|
|
|
<?php $page = IndexPage::begin(compact('model', 'dataProvider')) ?> |
26
|
|
|
|
27
|
|
|
<?php $page->setSearchFormData(compact('billTypes', 'billGroupLabels')) ?> |
28
|
|
|
|
29
|
|
|
<?php $page->beginContent('main-actions') ?> |
30
|
|
|
<?php if (Yii::$app->user->can('deposit')) : ?> |
31
|
|
|
<?= Html::a(Yii::t('hipanel:finance', 'Recharge account'), ['@pay/deposit'], ['class' => 'btn btn-sm btn-success']) ?> |
32
|
|
|
<?php endif ?> |
33
|
|
|
<?php if (Yii::$app->user->can('bill.create')) : ?> |
34
|
|
|
<?= Html::a(Yii::t('hipanel:finance', 'Add payment'), ['@bill/create'], ['class' => 'btn btn-sm btn-success']) ?> |
35
|
|
|
<?= Html::a(Yii::t('hipanel:finance', 'Add internal transfer'), ['@bill/create-transfer'], ['class' => 'btn btn-sm btn-default']) ?> |
36
|
|
|
<?php endif ?> |
37
|
|
|
<?= Html::a(Yii::t('hipanel:finance', 'Currency exchange'), ['@bill/create-exchange'], ['class' => 'btn btn-sm btn-default']) ?> |
38
|
|
|
<?php if (Yii::$app->user->can('bill.import')) : ?> |
39
|
|
|
<?= Html::a(Yii::t('hipanel:finance', 'Import payments'), ['@bill/import'], ['class' => 'btn btn-sm btn-default']) ?> |
40
|
|
|
<?php endif ?> |
41
|
|
|
<?php $page->endContent() ?> |
42
|
|
|
|
43
|
|
|
<?php $page->beginContent('sorter-actions') ?> |
44
|
|
|
<?= $page->renderSorter([ |
45
|
|
|
'attributes' => array_filter([ |
46
|
|
|
'sum', 'balance', |
47
|
|
|
'type', 'descr', |
48
|
|
|
'time', 'no', |
49
|
|
|
Yii::$app->user->can('resell') ? 'client' : null, |
50
|
|
|
Yii::$app->user->can('support') ? 'seller' : null |
51
|
|
|
]), |
52
|
|
|
]) ?> |
53
|
|
|
<?php $page->endContent() ?> |
54
|
|
|
|
55
|
|
|
<?php $page->beginContent('bulk-actions') ?> |
56
|
|
|
<?php if (Yii::$app->user->can('bill.create')) : ?> |
57
|
|
|
<?= $page->renderBulkButton('copy', Yii::t('hipanel', 'Copy')) ?> |
58
|
|
|
<?php endif ?> |
59
|
|
|
<?php if (Yii::$app->user->can('bill.update')) : ?> |
60
|
|
|
<?= $page->renderBulkButton('@bill/update', Yii::t('hipanel', 'Update')) ?> |
61
|
|
|
<?php endif ?> |
62
|
|
|
<?php if (Yii::$app->user->can('bill.delete')) : ?> |
63
|
|
|
<?= $page->renderBulkDeleteButton('delete') ?> |
64
|
|
|
<?php endif ?> |
65
|
|
|
<?php $page->endContent() ?> |
66
|
|
|
|
67
|
|
|
<?php $page->beginContent('table') ?> |
68
|
|
|
<?php $page->beginBulkForm() ?> |
69
|
|
|
<?= BillGridView::widget([ |
70
|
|
|
'boxed' => false, |
71
|
|
|
'dataProvider' => $dataProvider, |
72
|
|
|
'filterModel' => $model, |
73
|
|
|
'currencies' => $this->context->getCurrencyTypes(), |
74
|
|
|
'columns' => $representationCollection->getByName($uiModel->representation)->getColumns(), |
75
|
|
|
]) ?> |
76
|
|
|
<?php $page->endBulkForm() ?> |
77
|
|
|
<?php $page->endContent() ?> |
78
|
|
|
<?php $page->end() ?> |
79
|
|
|
<?php Pjax::end() ?> |
|
|
|
|
80
|
|
|
|
Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.
A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.