add daily listing by paid_by, add customer cart details
This commit is contained in:
@@ -20,6 +20,7 @@ $items = [
|
||||
[ 'Befizetések', ['ticket/index', 'number' => $card->number] ],
|
||||
[ 'Kulcsok', ['key/index', 'id_card' => $card->id_card] ],
|
||||
[ 'Szerződések', ['contract/index', 'id_card' => $card->id_card ]],
|
||||
[ 'Kosár', ['transfer/customer-cart', 'id_card' => $card->id_card ]],
|
||||
];
|
||||
|
||||
|
||||
|
||||
@@ -41,4 +41,7 @@ use yii\widgets\ActiveForm;
|
||||
<div class='col-md-3 '>
|
||||
<?php echo Html::a(Yii::t('frontend/product', "Frissít"),null,[ 'class' => 'btn btn-primary btn-block' , 'onclick' => 'location.reload();']) ?>
|
||||
</div>
|
||||
<div class='col-md-3 '>
|
||||
<?php echo Html::a("Kosár részletei",['transfer/customer-cart' ,'id_card' => $model->customer->card->id_card],[ 'class' => 'btn btn-primary btn-block' , 'onclick' => 'location.reload();']) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -39,4 +39,7 @@ use kartik\widgets\ActiveForm;
|
||||
<div class='col-md-3 '>
|
||||
<?php echo Html::a(Yii::t('frontend/product', "Frissít"),null,[ 'class' => 'btn btn-primary btn-block' , 'onclick' => 'location.reload();']) ?>
|
||||
</div>
|
||||
<div class='col-md-3 '>
|
||||
<?php echo Html::a("Kosár részletei",['transfer/customer-cart' ,'id_card' => $model->customer->card->id_card],[ 'class' => 'btn btn-primary btn-block' , 'onclick' => 'location.reload();']) ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -41,4 +41,7 @@ use kartik\widgets\ActiveForm;
|
||||
<div class='col-md-3 '>
|
||||
<?php echo Html::a(Yii::t('frontend/product', "Frissít"),null,[ 'class' => 'btn btn-primary btn-block' , 'onclick' => 'location.reload();']) ?>
|
||||
</div>
|
||||
<div class='col-md-3 '>
|
||||
<?php echo Html::a(Yii::t('transfer/user-cart', "Kosár részletei"),['transfer/user-cart'],[ 'class' => 'btn btn-primary btn-block' ]) ?>
|
||||
</div>
|
||||
</div>
|
||||
@@ -66,7 +66,7 @@ $this->registerJs ( 'new TicketSell( '. json_encode($options).');' );
|
||||
</div>
|
||||
<div class='col-md-6'>
|
||||
<?php if ( $receptionForm->isCardWithCustomer() ){ ?>
|
||||
<?php echo $this->render('_customer_cart' ) ?>
|
||||
<?php echo $this->render('_customer_cart' ,['model' => $receptionForm]) ?>
|
||||
<?php }?>
|
||||
<?php echo $this->render('_user_cart' ) ?>
|
||||
</div>
|
||||
|
||||
@@ -20,10 +20,13 @@ $formatter = Yii::$app->formatter;
|
||||
|
||||
|
||||
|
||||
<dt><?php echo $model->getAttributeLabel( 'id_transfer') ?></dt>
|
||||
<dt><?php echo "Tranz. azonosító" ?></dt>
|
||||
<dd><?php echo ( Html::getAttributeValue($model, 'id_transfer') ) ?></dd>
|
||||
|
||||
<dt><?php echo $model->getAttributeLabel( 'created_at') ?></dt>
|
||||
<dt><?php echo $model->getAttributeLabel( 'payment_method') ?></dt>
|
||||
<dd><?php echo Html::getAttributeValue($model, 'paymentMethodName') ?></dd>
|
||||
|
||||
<dt><?php echo "Kiadás ideje" ?></dt>
|
||||
<dd><?php echo $formatter->asDatetime( Html::getAttributeValue($model, 'created_at') ) ?></dd>
|
||||
|
||||
<dt><?php echo $model->getAttributeLabel( 'paid_at') ?></dt>
|
||||
@@ -31,9 +34,9 @@ $formatter = Yii::$app->formatter;
|
||||
|
||||
<dt><?php echo $model->getAttributeLabel( 'status') ?></dt>
|
||||
<dd><?php echo Html::getAttributeValue($model, 'statusName') ?></dd>
|
||||
<dt><?php echo "Kassza" ?></dt>
|
||||
<dd><?php echo Html::getAttributeValue($model, 'accountName') ?></dd>
|
||||
|
||||
<dt><?php echo $model->getAttributeLabel( 'payment_method') ?></dt>
|
||||
<dd><?php echo Html::getAttributeValue($model, 'paymentMethodName') ?></dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class='col-md-4'>
|
||||
@@ -44,8 +47,10 @@ $formatter = Yii::$app->formatter;
|
||||
<dt>Megnevezés</dt>
|
||||
<dd><?php echo Html::getAttributeValue($model, 'objectName') ?></dd>
|
||||
|
||||
<dt><?php echo $model->getAttributeLabel( 'id_user') ?></dt>
|
||||
<dt><?php echo "Kiadta" ?></dt>
|
||||
<dd><?php echo Html::getAttributeValue($model, 'userName') ?></dd>
|
||||
<dt><?php echo "Fizette" ?></dt>
|
||||
<dd><?php echo Html::getAttributeValue($model, 'paidByName') ?></dd>
|
||||
|
||||
<dt><?php echo $model->getAttributeLabel( 'id_customer') ?></dt>
|
||||
<dd><?php echo Html::getAttributeValue($model, 'customerName') ?></dd>
|
||||
|
||||
114
frontend/views/transfer/customercart.php
Normal file
114
frontend/views/transfer/customercart.php
Normal file
@@ -0,0 +1,114 @@
|
||||
<?php
|
||||
use yii\data\ArrayDataProvider;
|
||||
use yii\widgets\ListView;
|
||||
use yii\base\Widget;
|
||||
use yii\grid\GridView;
|
||||
use yii\widgets\ActiveForm;
|
||||
use yii\helpers\Html;
|
||||
use common\models\Transfer;
|
||||
use yii\grid\CheckboxColumn;
|
||||
use frontend\assets\TransferUserCartAsset;
|
||||
use frontend\assets\TransferCustomerCartAsset;
|
||||
use frontend\components\CustomerTabWidget;
|
||||
?>
|
||||
<?php
|
||||
TransferCustomerCartAsset::register($this);
|
||||
|
||||
$options = [];
|
||||
|
||||
$this->registerJs ( 'new TransferCustomerCart( '. json_encode($options).');' );
|
||||
$dp = new ArrayDataProvider(
|
||||
[
|
||||
'allModels' => $model->transfers,
|
||||
'pagination' => false
|
||||
|
||||
]
|
||||
);
|
||||
$this->params['breadcrumbs'][] = "Vendég Kosár";
|
||||
|
||||
?>
|
||||
|
||||
<?php echo CustomerTabWidget::widget(['card' => $model->customer->card])?>
|
||||
|
||||
<div class="transfer-form">
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
<?php echo $form->field($model, 'payment_method')->dropDownList( ['' => 'Aktuális'] + Transfer::paymentMethods())->label("Fizetése mód") ?>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<span style="font-weight: bold;">Összesen:</span>
|
||||
<span class="selected-money"><?php echo $model->money ?></span>
|
||||
<span> Ft</span>
|
||||
<?php echo $form->field($model, "money" , [ ])->hiddenInput()->label(false); ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div style="margin-bottom: 6px;">
|
||||
<?php
|
||||
echo Html::a("Összes kiválasztása",null, ['class' => 'btn btn-primary select-all' ,'style' => 'margin-right: 6px;']);
|
||||
echo Html::a("Egyiket sem",null, ['class' => 'btn btn-primary deselect-all']);
|
||||
|
||||
?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
$formModel = $model;
|
||||
echo GridView::widget([
|
||||
"dataProvider" => $dp,
|
||||
'columns' =>[
|
||||
[
|
||||
'label' => '',
|
||||
'value' => function ($model, $key, $index, $column) use (&$form, &$formModel){
|
||||
|
||||
return Html::checkbox(Html::getInputName($formModel, 'selected[]') , in_array($model->id_transfer, $formModel->selected) , [ 'data-money' => $model->money, 'class' => 'cart-item', 'value' => $model->id_transfer] );
|
||||
},
|
||||
'format' => 'raw'
|
||||
],
|
||||
[
|
||||
'value' => 'created_at',
|
||||
'label' => 'Kiadva',
|
||||
'format' => 'datetime'
|
||||
],
|
||||
[
|
||||
'value' => 'user.username',
|
||||
'label' => 'Kiadta',
|
||||
],
|
||||
[
|
||||
'value' => 'transferTypeName',
|
||||
'label' => 'Típus'
|
||||
],
|
||||
[
|
||||
'value' => 'objectName',
|
||||
'label' => 'Megnevezés'
|
||||
],
|
||||
[
|
||||
'value' => 'item_price',
|
||||
'label' => 'Egység ár'
|
||||
],
|
||||
[
|
||||
'value' => 'count',
|
||||
'label' => 'Mennyiség'
|
||||
],
|
||||
[
|
||||
'value' => 'money',
|
||||
'label' => 'Összesen'
|
||||
],
|
||||
[
|
||||
'value' => 'paymentMethodName',
|
||||
'label' => 'Fizetési mód'
|
||||
],
|
||||
]
|
||||
]);
|
||||
|
||||
|
||||
?>
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton( "Kiválasztott elemek fizetve", ['class' => 'btn btn-primary']) ?>
|
||||
</div>
|
||||
<p>
|
||||
A kifizetés az alapértelmezett kasszához lesz elszámolva
|
||||
</p>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
</div>
|
||||
@@ -72,7 +72,8 @@ td.name {
|
||||
<th>F. mód</th>
|
||||
<th>Fizetve</th>
|
||||
<th>Kassza</th>
|
||||
<th>Felhasználó</th>
|
||||
<th>Kiadta</th>
|
||||
<th>Fizette</th>
|
||||
<th>Vásárló</th>
|
||||
<th>Kategória</th>
|
||||
<th>Termék</th>
|
||||
@@ -90,6 +91,7 @@ td.name {
|
||||
<td><?php echo $p['product_paid_at']?> </td>
|
||||
<td><?php echo $p['account_name']?> </td>
|
||||
<td><?php echo $p['user_name']?> </td>
|
||||
<td><?php echo $p['paid_by_name']?> </td>
|
||||
<td><?php echo $p['customer_name']?> </td>
|
||||
<td><?php echo $p['product_category_name'] ?></td>
|
||||
<td><?php echo $p['product_name'] ?></td>
|
||||
|
||||
@@ -71,7 +71,8 @@ td.name {
|
||||
<th>Kiadva</th>
|
||||
<th>Fizetve</th>
|
||||
<th>Kassza</th>
|
||||
<th>Felhasználó</th>
|
||||
<th>Kiadta</th>
|
||||
<th>Fizette</th>
|
||||
<th>Vendég</th>
|
||||
<th>Bérlet típus</th>
|
||||
<th>Státusz</th>
|
||||
@@ -85,15 +86,16 @@ td.name {
|
||||
<tr>
|
||||
<td><?php echo $t['ticket_id_ticket']?> </td>
|
||||
<td><?php echo $t['ticket_created_at']?> </td>
|
||||
<td><?php echo $t['ticket_paid_at']?> </td>
|
||||
<td><?php echo $t['account_name']?> </td>
|
||||
<td><?php echo $t['user_name']?> </td>
|
||||
<td><?php echo $t['customer_name']?> </td>
|
||||
<td><?php echo $t['ticket_type_name'] ?></td>
|
||||
<td><?php echo Ticket::toStatusName( $t['ticket_status'] ) ?></td>
|
||||
<td class='money'><?php echo $t['ticket_item_price']?> Ft</td>
|
||||
<td class='count'><?php echo $t['ticket_count']?> Db</td>
|
||||
<td class='money'><?php echo $t['ticket_money']?> FT</td>
|
||||
<td><?php echo $t['ticket_paid_at']?> </td>
|
||||
<td><?php echo $t['account_name']?> </td>
|
||||
<td><?php echo $t['user_name']?> </td>
|
||||
<td><?php echo $t['paid_by_name']?> </td>
|
||||
<td><?php echo $t['customer_name']?> </td>
|
||||
<td><?php echo $t['ticket_type_name'] ?></td>
|
||||
<td><?php echo Ticket::toStatusName( $t['ticket_status'] ) ?></td>
|
||||
<td class='money'><?php echo $t['ticket_item_price']?> Ft</td>
|
||||
<td class='count'><?php echo $t['ticket_count']?> Db</td>
|
||||
<td class='money'><?php echo $t['ticket_money']?> FT</td>
|
||||
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
@@ -24,7 +24,7 @@ $this->registerJs ( 'new TransferUserCart( '. json_encode($options).');' );
|
||||
);
|
||||
|
||||
?>
|
||||
<h1>Kosár</h1>
|
||||
<h1>Recepció kosár</h1>
|
||||
<div class="transfer-form">
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
<?php echo $form->field($model, 'payment_method')->dropDownList( ['' => 'Aktuális'] + Transfer::paymentMethods())->label("Fizetése mód") ?>
|
||||
@@ -33,13 +33,18 @@ $this->registerJs ( 'new TransferUserCart( '. json_encode($options).');' );
|
||||
<span>Összesen:</span>
|
||||
<span class="selected-money"><?php echo $model->money ?></span>
|
||||
<span> Ft</span>
|
||||
<?php echo $form->field($model, "money" , [ ])->hiddenInput(); ?>
|
||||
<?php echo $form->field($model, "money" , [ ])->hiddenInput()->label(false); ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div style="margin-bottom: 6px;">
|
||||
<?php
|
||||
echo Html::a("Összes kiválasztása",null, ['class' => 'btn btn-primary select-all' ,'style' => 'margin-right: 6px;']);
|
||||
echo Html::a("Egyiket sem",null, ['class' => 'btn btn-primary deselect-all']);
|
||||
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
$formModel = $model;
|
||||
|
||||
echo GridView::widget([
|
||||
@@ -53,6 +58,19 @@ echo GridView::widget([
|
||||
},
|
||||
'format' => 'raw'
|
||||
],
|
||||
[
|
||||
'value' => 'created_at',
|
||||
'label' => 'Kiadva',
|
||||
'format' => 'datetime'
|
||||
],
|
||||
[
|
||||
'value' => 'user.username',
|
||||
'label' => 'Kiadta',
|
||||
],
|
||||
[
|
||||
'value' => 'accountName',
|
||||
'label' => 'Kassza'
|
||||
],
|
||||
[
|
||||
'value' => 'transferTypeName',
|
||||
'label' => 'Típus'
|
||||
@@ -85,6 +103,8 @@ echo GridView::widget([
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton( "Kiválasztott elemek fizetve", ['class' => 'btn btn-primary']) ?>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
A kifizetés az alapértelmezett kasszához lesz elszámolva
|
||||
</p>
|
||||
<?php ActiveForm::end(); ?>
|
||||
</div>
|
||||
Reference in New Issue
Block a user