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

5
backend/0209ch7z.det Normal file
View File

@@ -0,0 +1,5 @@
01DETSTA8A24237545 201501270001201502094542162957
020000010000014097201501270020150204201502031104 03916201502031001307001595 0015520150127321538700000000000000000000000340
020000020000015240201501275020150204 1117 73377201502033417908001595 0015520150127321538800000000000000000000000347
020000030000015240201501270020150204201502031120 94002201502030005151001595 0015520150127321538900000000000000000000000176
03000002000000000002933700000100000000000152400000000000000000000000

View File

@@ -111,6 +111,8 @@ class AdminMenuStructure{
$items[] = ['label' => 'Giro kötegbe jelölés', 'url' => ['/ticket-installment-request/pending' , 'TicketInstallmentRequestSearchPending[end]' => $tomorrow ] ];
$items[] = ['label' => 'GIRO köteg létrehozás', 'url' => ['/ticket-installment-request/download-giro' ] ];
$items[] = ['label' => 'GIRO kötegek', 'url' => ['/ugiro/index' ] ];
$items[] = ['label' => 'Detsta feltöltés', 'url' => ['/ugiro/upload' ] ];
$items[] = ['label' => 'Részletek aktiválása', 'url' => ['/ugiro/parts' ] ];
// $items[] = ['label' => 'Bevétel', 'url' => ['/transfer/summary' , 'TransferSummarySearch[start]' =>$today,'TransferSummarySearch[end]' => $tomorrow ] ];
// $items[] = ['label' => 'Napi bevételek', 'url' => ['/transfer/list', 'TransferListSearch[start]' =>$todayDatetime,'TransferListSearch[end]' => $tomorrowDatetime ] ];
// $items[] = ['label' => 'Kassza müveletek', 'url' => ['/account-state/index'] ];

View File

@@ -25,6 +25,7 @@ class TicketInstallmentRequestController extends Controller
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['post'],
'accept' => ['post'],
],
],
];
@@ -65,6 +66,25 @@ class TicketInstallmentRequestController extends Controller
]);
}
public function actionAccept( $id )
{
$model = $this->findModel($id);
if ( !$model->isStatusAccepted() ){
$model->applyStatus(TicketInstallmentRequest::$STATUS_ACCEPTED_MANUAL,true);
\Yii::$app->session->setFlash('success',"Megbízás teljesítve");
}
// else{
// }
// echo "asdff";
return $this->redirect(['ticket-installment-request/view',
'id' => $model->id_ticket_installment_request,
]);
}
/**
* Lists pending TicketInstallmentRequest models.
* @return mixed

View File

@@ -8,6 +8,9 @@ use backend\models\UgiroSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use common\components\DetStatProcessor;
use backend\models\DestaUploadForm;
use yii\web\UploadedFile;
/**
* UgiroController implements the CRUD actions for Ugiro model.
@@ -40,7 +43,25 @@ class UgiroController extends Controller
'dataProvider' => $dataProvider,
]);
}
/**
* Lists all Ugiro models.
* @return mixed
*/
public function actionItems($id)
{
$searchModel = new UgiroSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
public function actionActivate(){
}
/**
* Displays a single Ugiro model.
* @param integer $id
@@ -48,6 +69,20 @@ class UgiroController extends Controller
*/
public function actionView($id)
{
$model = $this->findModel($id);
if (Yii::$app->request->isPost) {
if ($model->status == Ugiro::$STATUS_RECIEVED){
set_time_limit(1200);//20 perc
$processor = new DetStatProcessor(
['koteg' => $model]
);
$processor->run();
}else{
\Yii::$app->session->setFlash('danger','Nem lehet futtatni a fájlt');
\Yii::error("a koteg státusza nem STATUS_RECIEVED. A koteg azonosíótja:" . $model->id_ugiro );
}
}
return $this->render('view', [
'model' => $this->findModel($id),
]);
@@ -102,6 +137,35 @@ class UgiroController extends Controller
return $this->redirect(['index']);
}
public function actionDetsta(){
$ugiro = Ugiro::findOne(31);
$model = new DetStatProcessor(
['koteg' => $ugiro]
);
return $this->render('detsta', [
'model' => $model,
]);
}
public function actionUpload(){
$model = new DestaUploadForm();
if (Yii::$app->request->isPost) {
$model->destaFile = UploadedFile::getInstance($model, 'destaFile');
if ($model->upload()) {
// file is uploaded successfully
return $this->redirect(['view', 'id' => $model->koteg->id_ugiro]);
}
}
return $this->render('upload', ['model' => $model]);
}
/**
* Finds the Ugiro model based on its primary key value.

5
backend/detsta.txt Normal file
View File

@@ -0,0 +1,5 @@
01DETSTA8A24237545 201501270001201502094542162957
020000010000014097201501270020150204201502031104 03916201502031001307001595 0015520150127321538700000000000000000000000340
020000020000015240201501275020150204 1117 73377201502033417908001595 0015520150127321538800000000000000000000000347
020000030000015240201501270020150204201502031120 94002201502030005151001595 0015520150127321538900000000000000000000000176
03000002000000000002933700000100000000000152400000000000000000000000

View File

@@ -0,0 +1,68 @@
<?php
namespace backend\models;
use yii\base\Model;
use yii\web\UploadedFile;
use common\components\giro\GiroDETSTA;
use common\models\Ugiro;
class DestaUploadForm extends Model
{
/**
* @var UploadedFile
*/
public $destaFile;
public $koteg;
public function rules()
{
return [
[['destaFile'], 'file', 'skipOnEmpty' => false, ],
[['destaFile'], 'validateKoteg', ],
];
}
public function attributeLabels(){
return [
"destaFile" => "Desta fájl"
];
}
public function validateKoteg($attribute,$params){
if ( !$this->hasErrors()){
$content = file_get_contents($this->destaFile->tempName);
$destaUzenet = GiroDETSTA::parse($content);
$number = $destaUzenet->fej->csoportosUzenetSorszam->sorszam;
$datum = $destaUzenet->fej->csoportosUzenetSorszam->osszeallitasDatuma;
$koteg = Ugiro::find()->andWhere(['number' =>$number,'datum' => $datum ])->one();
$this->koteg = $koteg;
$idKoteg = $this->koteg->id_ugiro;
if (!isset($koteg)){
$this->addError($attribute,"Nincs ilyen köteg! ( Datum: $datum, Sorszam: $number )");
}else{
if ( $koteg->status != Ugiro::$STATUS_SENT ){
$this->addError($attribute,"A köteg detsta fájl-ja már fel van töltve !( Köteg azonosító: $idKoteg )");
}
}
}
}
public function upload()
{
if ($this->validate()) {
$path = 'giro/valasz/' . $this->destaFile->baseName . '.' . $this->destaFile->extension;
$this->destaFile->saveAs( $path );
$this->koteg->desta_path = $path;
$this->koteg->status = Ugiro::$STATUS_RECIEVED;
$this->koteg->save(false);
return true;
} else {
return false;
}
}
}

View File

@@ -16,6 +16,7 @@ use yii\helpers\FileHelper;
use yii\helpers\Inflector;
use yii\helpers\BaseInflector;
use common\models\UgiroRequestAssignment;
use yii\db\Query;
/**
* ContactForm is the model behind the contact form.
@@ -91,14 +92,31 @@ class GiroKotegForm extends Model{
$this->koteg = new Ugiro();
$this->koteg->status = Ugiro::$STATUS_SENT;
$this->koteg->id_user = \Yii::$app->user->id;
$this->koteg->datum = date('Ymd');
$lastNumber = $this->loadLastNumber($this->koteg->datum);
$nextNumber = $lastNumber+1;
$this->koteg->number = $nextNumber;
$this->success &= $this->koteg->save(false);
}
public function loadLastNumber($datum){
$query = new Query();
$query->select(['coalesce(max(number),0)']);
$query->from('ugiro');
$query->andWhere(["datum" => $datum]);
return $query->scalar();
}
public function readRequests(){
$this->requests = TicketInstallmentRequest::find()->andWhere(['status' => TicketInstallmentRequest::$STATUS_MARKED_TO_SEND])->all();
}
public function generateFileContent(){
$this->content = GiroBeszed::createFileContent($this->koteg->id_ugiro, $this->requests);
$this->content = GiroBeszed::createFileContent($this->koteg->number, $this->koteg->datum, $this->requests);
}
public function saveFile( ) {

View File

@@ -30,13 +30,15 @@ class TicketInstallmentRequestSearch extends TicketInstallmentRequest
public $customer_name;
public $id_ticket_type;
public $id_ugiro;
/**
* @inheritdoc
*/
public function rules()
{
return [
[['id_ticket_installment_request', 'id_ticket', 'id_customer', 'status' ,'id_ticket_type'], 'integer'],
[['id_ticket_installment_request', 'id_ticket', 'id_customer', 'status' ,'id_ticket_type','id_ugiro'], 'integer'],
[['customer_name' ], 'safe'],
[[ 'start', ], 'date' , 'timestampAttribute' => 'timestampStart' ,'timestampAttributeFormat' => 'yyyy-MM-dd' ],
[[ 'end' , ], 'date' , 'timestampAttribute' => 'timestampEnd' ,'timestampAttributeFormat' => 'yyyy-MM-dd' ],
@@ -89,11 +91,13 @@ class TicketInstallmentRequestSearch extends TicketInstallmentRequest
'ticket.start as ticket_start',//ticket_start
'ticket.end as ticket_end',//ticket_send
'ticket.id_ticket as ticket_id_ticket',//id_ticket
'ugiro_request_assignment.id_ugiro as ugiro_id_ugiro' ,//köteg azonosító
]);
$query->from("ticket_installment_request");
$query->innerJoin("customer","customer.id_customer = ticket_installment_request.id_customer");
$query->innerJoin("ticket","ticket.id_ticket = ticket_installment_request.id_ticket");
$query->innerJoin("ticket_type","ticket.id_ticket_type = ticket_type.id_ticket_type");
$query->leftJoin("ugiro_request_assignment","ticket_installment_request.id_ticket_installment_request = ugiro_request_assignment.id_request");
$query->orderBy(["ticket_installment_request.request_target_time_at" => SORT_ASC]);
@@ -115,6 +119,10 @@ class TicketInstallmentRequestSearch extends TicketInstallmentRequest
$query->andFilterWhere(['>=', 'ticket_installment_request.request_processed_at', $this->timestampProcessedStart]);
$query->andFilterWhere(['<', 'ticket_installment_request.request_processed_at', $this->timestampProcessedEnd]);
if ( isset($this->id_ugiro ) && !empty($this->id_ugiro)){
$query->andWhere(["ugiro_request_assignment.id_ugiro" => $this->id_ugiro]);
}
$dataProvider = new ArrayDataProvider([
'allModels' => $query->all(),
// 'sort' => [

View File

@@ -37,7 +37,7 @@ class TicketSearch extends Ticket
public function rules()
{
return [
[[ 'id_ticket', 'id_user', 'id_ticket_type', 'id_account'], 'integer'],
[[ 'id_ticket', 'id_user', 'id_ticket_type', 'id_account','status'], 'integer'],
[[ 'start', ], 'date' , 'timestampAttribute' => 'timestampStart' ,'timestampAttributeFormat' => 'yyyy-MM-dd' ],
[[ 'end' , ], 'date' , 'timestampAttribute' => 'timestampEnd' ,'timestampAttributeFormat' => 'yyyy-MM-dd' ],
[['valid_in_interval','created_in_interval','expire_in_interval'],'boolean'] ,
@@ -117,7 +117,8 @@ class TicketSearch extends Ticket
'id_ticket_type' => $this->id_ticket_type,
'id_account' => $this->id_account,
'id_card' => $this->id_card,
'id_ticket' => $this->id_ticket
'id_ticket' => $this->id_ticket,
'status' => $this->status
]);

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>

View File

View File