add ticket original end and original price
add helper links to related object in admin
This commit is contained in:
@@ -30,4 +30,23 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
],
|
||||
]) ?>
|
||||
|
||||
<?php
|
||||
$customer = $model->customer;
|
||||
if (isset($customer)) {
|
||||
?>
|
||||
<?= DetailView::widget(
|
||||
['model' => $customer,
|
||||
'attributes' => [
|
||||
[
|
||||
'attribute' => 'id_customer',
|
||||
'format' => 'raw',
|
||||
'value' => Html::a($customer->name, ['customer/view', 'id' => $customer->id_customer]),
|
||||
'label' => 'Vendég'
|
||||
|
||||
]
|
||||
]]) ?>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -7,6 +7,8 @@ use kartik\widgets\DateTimePicker;
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\models\LogSearch */
|
||||
/* @var $form yii\widgets\ActiveForm */
|
||||
|
||||
$userOptions = ['' => 'Mind'] + \yii\helpers\ArrayHelper::map(\common\models\User::read (), 'id', 'username');
|
||||
?>
|
||||
|
||||
<div class="log-search">
|
||||
@@ -38,6 +40,18 @@ use kartik\widgets\DateTimePicker;
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
|
||||
<?= $form->field($model, 'type')->dropDownList( ["" =>"Mind"] + \common\models\Log::getTypes()) ?>
|
||||
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<?= $form->field($model, 'id_user')->dropDownList( $userOptions ) ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -53,7 +53,19 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
// 'id_door_log',
|
||||
// 'updated_at',
|
||||
|
||||
// ['class' => 'yii\grid\ActionColumn'],
|
||||
[
|
||||
'class' => 'yii\grid\ActionColumn',
|
||||
'template' => '{view}',
|
||||
'urlCreator' => function($action, $model, $key, $index){
|
||||
$result = "";
|
||||
|
||||
if ( $action == 'view'){
|
||||
$result = \yii\helpers\Url::toRoute(['log/view','id' => $model['log_id_log']]);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
],
|
||||
],
|
||||
]); ?>
|
||||
|
||||
|
||||
@@ -13,32 +13,43 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
<div class="log-view">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<p>
|
||||
<?= Html::a(Yii::t('common/log', 'Update'), ['update', 'id' => $model->id_log], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a(Yii::t('common/log', 'Delete'), ['delete', 'id' => $model->id_log], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data' => [
|
||||
'confirm' => Yii::t('common/log', 'Are you sure you want to delete this item?'),
|
||||
'method' => 'post',
|
||||
],
|
||||
]) ?>
|
||||
</p>
|
||||
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
'id_log',
|
||||
'type',
|
||||
[
|
||||
'attribute' => 'type',
|
||||
// 'format' => 'raw',
|
||||
'value' =>$model->typeName,
|
||||
'label' => 'Típus'
|
||||
|
||||
],
|
||||
'message',
|
||||
'url:ntext',
|
||||
'app',
|
||||
'id_user',
|
||||
[
|
||||
'attribute' => 'id_user',
|
||||
'format' => 'raw',
|
||||
'value' => Html::a($model->userName, ['user/view', 'id' => $model->id_user]),
|
||||
|
||||
],
|
||||
[
|
||||
'attribute' => 'id_ticket',
|
||||
'format' => 'raw',
|
||||
'value' => Html::a($model->ticketName, ['ticket/view', 'id' => $model->id_ticket]),
|
||||
|
||||
],
|
||||
[
|
||||
'attribute' => 'id_customer',
|
||||
'format' => 'raw',
|
||||
'value' => Html::a($model->customerName, ['customer/view', 'id' => $model->id_customer]),
|
||||
|
||||
],
|
||||
'id_transfer',
|
||||
'id_money_movement',
|
||||
'id_ticket',
|
||||
|
||||
|
||||
'id_sale',
|
||||
'id_customer',
|
||||
'id_account',
|
||||
'id_account_state',
|
||||
'id_key',
|
||||
|
||||
@@ -57,6 +57,7 @@ $userOptions = ['' => 'Mind'] + ArrayHelper::map($model->users, 'id', 'userna
|
||||
<?= $form->field($model, 'card_number')->textInput()->label("Kártyaszám") ?>
|
||||
</div>
|
||||
<div class='col-md-4'>
|
||||
<?= $form->field($model, 'modified')->dropDownList( ["" =>"Mind", '1' => 'Módosított'] ) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ $this->params['breadcrumbs'][] = ['label' => Yii::t('common/ticket', 'Tickets'),
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="ticket-view">
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
<h1>Bérlet információ: #<?= Html::encode($this->title) ?></h1>
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
'attributes' => [
|
||||
@@ -23,12 +23,14 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
],
|
||||
[
|
||||
'attribute' => 'id_ticket_type',
|
||||
'value' => $model->ticketTypeName,
|
||||
'format' => 'raw',
|
||||
'value' => Html::a($model->ticketTypeName, ['ticket-type/view', 'id' => $model->id_ticket_type]),
|
||||
|
||||
],
|
||||
[
|
||||
'attribute' => 'id_account',
|
||||
'value' => $model->accountName,
|
||||
'format' => 'raw',
|
||||
'value' => Html::a($model->accountName, ['account/view', 'id' => $model->id_account]),
|
||||
|
||||
],
|
||||
[
|
||||
@@ -45,9 +47,75 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
'value' => $model->statusName
|
||||
],
|
||||
'price_brutto',
|
||||
[
|
||||
'attribute' => 'price_brutto',
|
||||
'format' => 'raw',
|
||||
'value' => Html::a($model->price_brutto, ['transfer/view', 'id' => $model->transfer->id_transfer]),
|
||||
|
||||
],
|
||||
'comment:raw',
|
||||
'created_at:datetime',
|
||||
'updated_at:datetime',
|
||||
'original_end:date',
|
||||
'original_price',
|
||||
],
|
||||
]) ?>
|
||||
|
||||
|
||||
<h3>Bérletkártya</h3>
|
||||
<?php
|
||||
|
||||
echo DetailView::widget([
|
||||
'model' => $model->card,
|
||||
'attributes' => [
|
||||
[
|
||||
'attribute' => 'number',
|
||||
'format' => 'raw',
|
||||
'value' => Html::a($model->card->number, ['card/view', 'id' => $model->card->id_card]),
|
||||
]
|
||||
]]);
|
||||
|
||||
?>
|
||||
|
||||
<h3>Vendég</h3>
|
||||
<?php
|
||||
|
||||
echo DetailView::widget([
|
||||
'model' => $model->customer,
|
||||
'attributes' => [
|
||||
[
|
||||
'attribute' => 'name',
|
||||
'format' => 'raw',
|
||||
'value' => Html::a($model->customer->name, ['customer/view', 'id' => $model->customer->id_customer]),
|
||||
]
|
||||
|
||||
]]);
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
$contract = $model->contract;
|
||||
if (isset($contract)) {
|
||||
?>
|
||||
<h3>Szerződés</h3>
|
||||
<?php
|
||||
|
||||
echo DetailView::widget([
|
||||
'model' => $contract,
|
||||
'attributes' => [
|
||||
[
|
||||
'attribute' => 'id_contract',
|
||||
'format' => 'raw',
|
||||
'value' => Html::a($contract->id_contract, ['contract/details', 'id' => $contract->id_contract]),
|
||||
]
|
||||
|
||||
]]);
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
use common\components\RoleDefinition;
|
||||
@@ -9,69 +10,109 @@ use common\models\Transfer;
|
||||
/* @var $model common\models\Transfer */
|
||||
|
||||
$this->title = $model->id_transfer;
|
||||
$this->params ['breadcrumbs'] [] = [
|
||||
'label' => Yii::t ( 'frontend/transfer', 'Transfers' ),
|
||||
'url' => [
|
||||
'index'
|
||||
]
|
||||
$this->params ['breadcrumbs'] [] = [
|
||||
'label' => Yii::t('frontend/transfer', 'Transfers'),
|
||||
'url' => [
|
||||
'index'
|
||||
]
|
||||
];
|
||||
$this->params ['breadcrumbs'] [] = $this->title;
|
||||
?>
|
||||
<div class="transfer-view">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<?=DetailView::widget (
|
||||
[ 'model' => $model,
|
||||
'attributes' => [
|
||||
[ '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 ],
|
||||
[ 'attribute' => 'id_discount','value' => $model->discountName ],
|
||||
[ 'attribute' => 'payment_method','value' => $model->paymentMethodName ],
|
||||
[ 'attribute' => 'status','value' => $model->statusName ],
|
||||
'item_price',
|
||||
'count',
|
||||
'money',
|
||||
'comment',
|
||||
'created_at',
|
||||
'paid_at' ] ] )?>
|
||||
</div>
|
||||
</div>
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<?= DetailView::widget(
|
||||
['model' => $model,
|
||||
'attributes' => [
|
||||
['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],
|
||||
['attribute' => 'id_discount', 'value' => $model->discountName],
|
||||
['attribute' => 'payment_method', 'value' => $model->paymentMethodName],
|
||||
['attribute' => 'status', 'value' => $model->statusName],
|
||||
'item_price',
|
||||
'count',
|
||||
'money',
|
||||
'comment',
|
||||
'created_at',
|
||||
'paid_at']]) ?>
|
||||
|
||||
|
||||
<?php
|
||||
if ($model->type == Transfer::TYPE_TICKET) {
|
||||
$ticket = $model->ticket;
|
||||
?>
|
||||
<?= DetailView::widget(
|
||||
['model' => $ticket,
|
||||
'attributes' => [
|
||||
[
|
||||
'attribute' => 'id_ticket_type',
|
||||
'format' => 'raw',
|
||||
'value' => Html::a($ticket->ticketTypeName, ['ticket/view', 'id' => $ticket->id_ticket]),
|
||||
'label' => 'Bérlet'
|
||||
|
||||
]
|
||||
]]) ?>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
$customer = $model->customer;
|
||||
if (isset($customer)) {
|
||||
?>
|
||||
<?= DetailView::widget(
|
||||
['model' => $customer,
|
||||
'attributes' => [
|
||||
[
|
||||
'attribute' => 'id_customer',
|
||||
'format' => 'raw',
|
||||
'value' => Html::a($customer->name, ['customer/view', 'id' => $customer->id_customer]),
|
||||
'label' => 'Vendég'
|
||||
|
||||
]
|
||||
]]) ?>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
if (RoleDefinition::isAdmin () ) {
|
||||
if (RoleDefinition::isAdmin()) {
|
||||
|
||||
if ($model->type == Transfer::TYPE_TICKET) {
|
||||
|
||||
if ($model->status == Transfer::STATUS_STORNO || $model->status == Transfer::STATUS_PAID) {
|
||||
|
||||
?>
|
||||
<p>Sztornózott vagy fizetett bérlet fizetettlenre állítása: </p>
|
||||
<ul>
|
||||
<li>A tranzakció státusza fizetetlen lesz</li>
|
||||
<li>A bérlet státusza inaktív lesz ( a bérlettel nem lehet bemenni a forgó kapun)</li>
|
||||
<li>A bérlet a vásárló kosarába kerül</li>
|
||||
</ul>
|
||||
<?php
|
||||
|
||||
echo Html::a("Bérlet fizetetlennek jelölése és vásárló kosarába helyezése", [
|
||||
'transfer/unstorno',
|
||||
'id' => $model->id_transfer
|
||||
], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data-confirm' => "Figyelem, a bérlet fizetetlennek lesz jelölve !!",
|
||||
'data-method' => 'post'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( $model->type == Transfer::TYPE_TICKET ){
|
||||
|
||||
if ($model->status == Transfer::STATUS_STORNO || $model->status == Transfer::STATUS_PAID ) {
|
||||
|
||||
?>
|
||||
<p>Sztornózott vagy fizetett bérlet fizetettlenre állítása: </p>
|
||||
<ul>
|
||||
<li>A tranzakció státusza fizetetlen lesz</li>
|
||||
<li>A bérlet státusza inaktív lesz ( a bérlettel nem lehet bemenni a forgó kapun)</li>
|
||||
<li>A bérlet a vásárló kosarába kerül</li>
|
||||
</ul>
|
||||
<?php
|
||||
|
||||
echo Html::a ( "Bérlet fizetetlennek jelölése és vásárló kosarába helyezése", [
|
||||
'transfer/unstorno',
|
||||
'id' => $model->id_transfer
|
||||
], [
|
||||
'class' => 'btn btn-danger',
|
||||
'data-confirm' => "Figyelem, a bérlet fizetetlennek lesz jelölve !!",
|
||||
'data-method' => 'post'
|
||||
] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user