add ticket installment

This commit is contained in:
2016-01-22 14:45:56 +01:00
parent bb5978c1df
commit a2a6b1f240
51 changed files with 1498 additions and 113 deletions

View File

@@ -3,8 +3,31 @@
use common\models\TicketInstallmentRequest;
use common\models\Ticket;
use yii\helpers\Html;
?>
<?php
$statusStyle = "";
if ( $model['request_status'] == TicketInstallmentRequest::$STATUS_ACCEPTED || $model['request_status'] == TicketInstallmentRequest::$STATUS_ACCEPTED_MANUAL ){
$statusStyle = "accepted";
}else if ($model['request_status'] == TicketInstallmentRequest::$STATUS_REJECTED ){
$statusStyle = "rejected";
}
?>
<style>
.accepted table td.status {
background-color: green;
}
.rejected table td.status {
background-color: #dd4b39;
}
</style>
<div class="panel panel-default">
<div class="panel-body">
<div class="request-view <?= $statusStyle ?>">
<table class="table table-striped">
<tr>
<th>
@@ -16,7 +39,7 @@ use common\models\Ticket;
<th>
Megbízás státusza
</th>
<td>
<td class="status">
<?php echo TicketInstallmentRequest::toStatusName( $model['request_status'] );?>
</td>
<th>
@@ -25,8 +48,7 @@ use common\models\Ticket;
<td>
<?php echo $model['request_money'] ." Ft";?>
</td>
<tr>
</tr>
<tr>
<th>
Megbízás inditására irányzott dátum
@@ -47,7 +69,7 @@ use common\models\Ticket;
<?php echo \Yii::$app->formatter->asDatetime( $model['request_processed_at'] );?>
</td>
<tr>
</tr>
<tr>
<th>
Megbízás prioritása
@@ -56,15 +78,17 @@ use common\models\Ticket;
<?php echo $model['request_priority'] ;?>
</td>
<th>
Köteg azonosító
</th>
<td>
<?php echo $model['ugiro_id_ugiro'] ;?>
</td>
<th>
</th>
<td>
</td>
<tr>
</tr>
<tr>
<th>
Vendég azonosító
@@ -82,7 +106,7 @@ use common\models\Ticket;
</th>
<td>
</td>
<tr>
</tr>
<tr>
<th>
Bérlet azonosító
@@ -102,7 +126,7 @@ use common\models\Ticket;
<td>
<?php echo Ticket::toStatusName( $model['ticket_status'] );?>
</td>
<tr>
</tr>
<tr>
<th>
Bérlet érvényességének kezdete
@@ -120,5 +144,19 @@ use common\models\Ticket;
</th>
<td>
</td>
<tr>
</table>
</tr>
</table>
<div >
<?php
if ( !empty( $model['ugiro_id_ugiro'] )){
echo Html::a("Köteg",['ugiro/view', 'id' => $model['ugiro_id_ugiro']] ,[ 'class' => 'btn btn-primary']);
}
echo Html::a("Megbízás részletek",['ticket-installment-request/view', 'id' => $model['request_id_ticket_installment_request']] ,[ 'class' => 'btn btn-primary']);
if ( !empty( $model['ticket_id_ticket'] )){
echo Html::a("Bérlet részletei",['ticket-installment-request/index', 'TicketInstallmentRequestSearch[id_ticket]' => $model['ticket_id_ticket']] ,[ 'class' => 'btn btn-primary']);
}
?>
</div>
</div>
</div>
</div>

View File

@@ -28,7 +28,9 @@ $ticketTypeOptions = ['' => 'Mind'] + ArrayHelper::map(TicketType::read(), 'i
<div class="col-md-3">
<?= $form->field($model, 'id_ticket_installment_request')->label("Megbízás azonosító") ?>
</div>
<div class="col-md-3">
<?= $form->field($model, 'id_ugiro')->label("Köteg azonosító") ?>
</div>
<div class="col-md-3">
<?= $form->field($model, 'id_ticket')->label("Bérlet azonosító") ?>
</div>
@@ -65,6 +67,7 @@ $ticketTypeOptions = ['' => 'Mind'] + ArrayHelper::map(TicketType::read(), 'i
])->label('Megbízás inditására irányzott dátum vége ( exklúzív )') ?>
</div>
</div>
<?php /*?>
<div class="row">
<div class="col-md-3">
<?= $form->field($model, 'sentStart')->widget(DatePicker::classname(), [
@@ -83,6 +86,7 @@ $ticketTypeOptions = ['' => 'Mind'] + ArrayHelper::map(TicketType::read(), 'i
])->label('Megbízás elindításának időszak vége ( exklúzív )') ?>
</div>
</div>
<?php */ ?>
<div class="row">
<div class="col-md-3">
<?= $form->field($model, 'processedStart')->widget(DatePicker::classname(), [
@@ -128,8 +132,7 @@ $ticketTypeOptions = ['' => 'Mind'] + ArrayHelper::map(TicketType::read(), 'i
<?php // echo $form->field($model, 'updated_at') ?>
<div class="form-group">
<?= Html::submitButton(Yii::t('common/ticket_installment_request', 'Search'), ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton(Yii::t('common/ticket_installment_request', 'Reset'), ['class' => 'btn btn-default']) ?>
<?= Html::submitButton("Keresés", ['class' => 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>

View File

@@ -12,6 +12,13 @@ use yii\base\Widget;
$this->title = Yii::t('common/ticket_installment_request', 'Bérlet fizetési megbízások');
$this->params['breadcrumbs'][] = $this->title;
?>
<style>
a.btn{
margin-right: 6px;
}
</style>
<div class="ticket-installment-request-index">
<h1><?= Html::encode($this->title) ?></h1>

View File

@@ -2,49 +2,207 @@
use yii\helpers\Html;
use yii\widgets\DetailView;
use common\models\TicketInstallmentRequest;
use common\models\Ticket;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model common\models\TicketInstallmentRequest */
$this->title = $model->id_ticket_installment_request;
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/ticket_installment_request', 'Ticket Installment Requests'), 'url' => ['index']];
$this->title = "Megbízás: " . $model->id_ticket_installment_request;
$this->params['breadcrumbs'][] = ['label' => "Megbízások", 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<?php
$statusStyle = "";
if ( $model->isStatusAccepted() ){
$statusStyle = "accepted";
}else if ( $model->isStatusRejected() ){
$statusStyle = "rejected";
}
?>
<style>
.accepted table td.status {
background-color: green;
}
.rejected table td.status {
background-color: #dd4b39;
}
a.btn{
margin-right: 6px;
}
</style>
<div class="ticket-installment-request-view">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a(Yii::t('common/ticket_installment_request', 'Update'), ['update', 'id' => $model->id_ticket_installment_request], ['class' => 'btn btn-primary']) ?>
<?= Html::a(Yii::t('common/ticket_installment_request', 'Delete'), ['delete', 'id' => $model->id_ticket_installment_request], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => Yii::t('common/ticket_installment_request', 'Are you sure you want to delete this item?'),
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id_ticket_installment_request',
'id_ticket',
'id_customer',
'id_transfer',
'status',
'money',
'customer_name',
'bank_name',
'bank_address',
'bank_account',
'priority',
'request_sent_at',
'request_processed_at',
'request_target_time_at',
'created_at',
'updated_at',
],
]) ?>
<div class="panel panel-default">
<div class="panel-body">
<?php
if ( $model->isStatusRejected()){
echo Html::a("Teljesítettnek jelölés",['accept', 'id' => $model->id_ticket_installment_request] ,['data-method' =>'post', 'class' => 'btn btn-danger']);
}
?>
<div class="request-view <?= $statusStyle ?>">
<table class="table table-striped">
<tr>
<th>
Megbízás azonosító
</th>
<td>
<?php echo "".$model->id_ticket_installment_request;?>
</td>
<th>
Megbízás státusza
</th>
<td class="status">
<?php echo TicketInstallmentRequest::toStatusName( $model->status );?>
</td>
<th>
Megbízás összege
</th>
<td>
<?php echo $model->money." Ft";?>
</td>
</tr>
<tr>
<th>
Megbízás inditására irányzott dátum
</th>
<td>
<?php echo \Yii::$app->formatter->asDatetime( $model->request_target_time_at );?>
</td>
<th>
Megbízás elindításának ideje
</th>
<td>
<?php echo \Yii::$app->formatter->asDatetime( $model->request_sent_at);?>
</td>
<th>
Megbízás feldoglozásának ideje
</th>
<td>
<?php echo \Yii::$app->formatter->asDatetime( $model->request_processed_at );?>
</td>
</tr>
<tr>
<th>
Megbízás prioritása (Sorszám)
</th>
<td>
<?php echo $model->priority ;?>
</td>
<th>
Köteg azonosító
</th>
<td>
<?php echo $model->idGiro ;?>
</td>
<th>
</th>
<td>
</td>
</tr>
<tr>
<th>
Vendég azonosító
</th>
<td>
<?php echo "". $model->customer->id_customer;?>
</td>
<th>
Vendég neve
</th>
<td>
<?php echo "". $model->customer->name;?>
</td>
<th>
</th>
<td>
</td>
</tr>
<tr>
<th>
Bérlet azonosító
</th>
<td>
<?php echo "". $model->ticket->id_ticket;?>
</td>
<th>
Bérlet típus
</th>
<td>
<?php echo $model->ticket->ticketTypeName;?>
</td>
<th>
Bérlet státusza
</th>
<td>
<?php echo Ticket::toStatusName( $model->ticket->status );?>
</td>
</tr>
<tr>
<th>
Bérlet érvényességének kezdete
</th>
<td>
<?php echo \Yii::$app->formatter->asDate( $model->ticket->start) ;?>
</td>
<th>
Bérlet érvényességének vége
</th>
<td>
<?php echo \Yii::$app->formatter->asDate( $model->ticket->end ) ;?>
</td>
<th>
</th>
<td>
</td>
</tr>
<tr>
<th>
Bérlet részletek száma
</th>
<td>
<?php echo $model->ticket->part_count ;?>
</td>
<th>
Bérlet esedékes részlet
</th>
<td>
<?php echo $model->ticket->part ;?>
</td>
<th>
Bérlet utoljára fizetett részlet
</th>
<td>
<?php echo $model->ticket->part_paid ;?>
</td>
</tr>
</table>
<?php
if ( !empty( $model->idGiro )){
echo Html::a("Köteg",['ugiro/view', 'id' => $model->idGiro] ,[ 'class' => 'btn btn-primary']);
echo Html::a("Részletek a kötegben",['ticket-installment-request/index', 'TicketInstallmentRequestSearch[id_ugiro]' => $model->idGiro] ,[ 'class' => 'btn btn-primary']);
}
echo Html::a("Bérlet fizetési részletei",['ticket-installment-request/index', 'TicketInstallmentRequestSearch[id_ticket]' => $model->id_ticket] ,[ 'class' => 'btn btn-primary']);
?>
</div>
</div>
</div>
</div>

View File

@@ -4,6 +4,7 @@ use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use kartik\widgets\DatePicker;
use common\models\Ticket;
/* @var $this yii\web\View */
/* @var $model backend\models\TicketSearch */
@@ -36,6 +37,15 @@ $userOptions = ['' => 'Mind'] + ArrayHelper::map($model->users, 'id', 'userna
<?= $form->field($model, 'id_account')->dropDownList($accountOptions) ?>
</div>
</div>
<div class='row'>
<div class='col-md-4'>
<?= $form->field($model, 'status')->dropDownList( ["" =>"Mind"]+ Ticket::statuses()) ?>
</div>
<div class='col-md-4'>
</div>
<div class='col-md-4'>
</div>
</div>
<div class="row">
<div class="col-md-4">

View File

@@ -104,6 +104,10 @@ $this->params['breadcrumbs'][] = $this->title;
'attribute' => 'id_account',
'value' => 'accountName'
],
[
'attribute' => 'status',
'value' => 'statusName'
],
// 'max_usage_count',
// 'usage_count',

View File

@@ -19,17 +19,36 @@ $this->params['breadcrumbs'][] = $this->title;
'model' => $model,
'attributes' => [
'id_ticket',
'id_user',
'id_ticket_type',
'id_account',
'id_discount',
'start',
'end',
[
'attribute' => 'id_user',
'value' => $model->user->username,
],
[
'attribute' => 'id_ticket_type',
'value' => $model->ticketTypeName,
],
[
'attribute' => 'id_account',
'value' => $model->accountName,
],
[
'attribute' => 'id_discount',
'value' => $model->discountName,
],
'start:datetime',
'end:datetime',
'max_usage_count',
'usage_count',
'status',
[
'attribute' => 'status',
'value' => $model->statusName
],
'price_brutto',
'comment',
'comment:raw',
'created_at',
'updated_at',
],

View File

@@ -0,0 +1,26 @@
<?php
/* @var $this yii\web\View */
/* @var $model common\components\DetStatProcessor */
?>
detsta
<?php
echo $model->koteg->id_ugiro;
$model->run();
$megbizasok = $model->megbizasok;
echo "<br>Megbízások száma:". count($megbizasok);
foreach ($megbizasok as $m){
echo "<br>". $m->id_ticket_installment_request . " - " . ($m->detstaTetel->toString());
}
echo "<br>" . nl2br( $model->detstatUzenet->toString());
print_r($model->errors);
?>

View File

@@ -0,0 +1,27 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model common\models\Ugiro */
/* @var $form yii\widgets\ActiveForm */
?>
<h1>DetSta Fájl Feltöltés</h1>
<p>
Ezen a felületen csak a fájl feltöltés törénik meg, a fájl feldolgozása a köteg nézet-ben lehetséges
</p>
<div class="ugiro-form">
<?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]) ?>
<?= $form->field($model, 'destaFile')->fileInput() ?>
<div class="form-group">
<?= Html::submitButton( "Feltöltés" , ['class' => 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@@ -4,6 +4,7 @@ use yii\helpers\Html;
use yii\widgets\DetailView;
use yii\helpers\Url;
use common\models\Ugiro;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model common\models\Ugiro */
@@ -12,17 +13,33 @@ $this->title = "Köteg részletei";
$this->params['breadcrumbs'][] = ['label' => "Kötegek", 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<style >
.btns a{
margin-right: 6px;
}
a.btn{
margin-right: 6px;
}
</style>
<div class="ugiro-view">
<h1><?= Html::encode($this->title) ?></h1>
<?php
$attributes = [
[
'attribute' => 'id_ugiro',
'label' => 'Köteg azonosító'
],
[
'attribute' => 'number',
'label' => 'Üzenet sorszám'
],
[
'attribute' => 'datum',
'label' => 'Üzenet összeállítási dátum'
],
[
'attribute' => 'user.username',
'label' => 'Felhasználó'
@@ -38,13 +55,21 @@ $attributes = [
],
[
'attribute' => 'path',
'label' => 'Köteg Fájl',
'label' => 'Beszed Fájl',
'value' => Html::a( "Letöltés" , Url::base() ."/". $model->path , ['target' =>'_blank' ,'download' =>'CS-BESZED.' .$model->id_ugiro ] ),
'format' => 'raw'
],
];
if ( $model->status == Ugiro::$STATUS_FINISHED){
if ( $model->status == Ugiro::$STATUS_RECIEVED || $model->status == Ugiro::$STATUS_FINISHED ){
$attributes[] = [
'attribute' => 'desta_path',
'label' => 'Detsta Fájl',
'value' => Html::a( "Letöltés" , Url::base() ."/". $model->desta_path , ['target' =>'_blank' ,'download' =>'CS-BESZED.' .$model->id_ugiro ] ),
'format' => 'raw'
];
}
?>
@@ -56,3 +81,13 @@ $attributes = [
]) ?>
</div>
<div class="btns">
<?php
if ( $model->status == Ugiro::$STATUS_RECIEVED ){
echo Html::a("DetSta Fájl Feldoglozás",['view', 'id' => $model->id_ugiro] ,['data-method' =>'post', 'class' => 'btn btn-danger']);
}
echo Html::a("Megbízások a kötegben",['ticket-installment-request/index', 'TicketInstallmentRequestSearch[id_ugiro]' => $model->id_ugiro] ,[ 'class' => 'btn btn-primary']);
?>
</div>