add contract, add door_log

This commit is contained in:
Roland Schneider 2016-01-25 12:50:14 +01:00
parent 0c3ff2c0f3
commit 8d29f47d49
27 changed files with 726 additions and 29 deletions

View File

@ -122,6 +122,18 @@ class AdminMenuStructure{
'items' => $items
];
}
/////////////////////////////
// Kap lug megbízások
/////////////////////////////
$items = [];
$items[] = ['label' => 'Mozgások', 'url' => ['/door-log/index' , 'DoorLogSearch[start]' =>$today,'DoorLogSearch[end]' => $tomorrow ] ];
// $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'] ];
$this->menuItems[] = ['label' => 'Forgóvilla', 'url' => $this->emptyUrl,
'items' => $items
];
}

View File

@ -0,0 +1,121 @@
<?php
namespace backend\controllers;
use Yii;
use common\models\DoorLog;
use backend\models\DoorLogSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
/**
* DoorLogController implements the CRUD actions for DoorLog model.
*/
class DoorLogController extends Controller
{
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['post'],
],
],
];
}
/**
* Lists all DoorLog models.
* @return mixed
*/
public function actionIndex()
{
$searchModel = new DoorLogSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
/**
* Displays a single DoorLog model.
* @param integer $id
* @return mixed
*/
public function actionView($id)
{
return $this->render('view', [
'model' => $this->findModel($id),
]);
}
/**
* Creates a new DoorLog model.
* If creation is successful, the browser will be redirected to the 'view' page.
* @return mixed
*/
public function actionCreate()
{
$model = new DoorLog();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id_door_log]);
} else {
return $this->render('create', [
'model' => $model,
]);
}
}
/**
* Updates an existing DoorLog model.
* If update is successful, the browser will be redirected to the 'view' page.
* @param integer $id
* @return mixed
*/
public function actionUpdate($id)
{
$model = $this->findModel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id_door_log]);
} else {
return $this->render('update', [
'model' => $model,
]);
}
}
/**
* Deletes an existing DoorLog model.
* If deletion is successful, the browser will be redirected to the 'index' page.
* @param integer $id
* @return mixed
*/
public function actionDelete($id)
{
$this->findModel($id)->delete();
return $this->redirect(['index']);
}
/**
* Finds the DoorLog model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
* @param integer $id
* @return DoorLog the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
protected function findModel($id)
{
if (($model = DoorLog::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
}
}

View File

@ -0,0 +1,147 @@
<?php
namespace backend\models;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use common\models\DoorLog;
/**
* DoorLogSearch represents the model behind the search form about `common\models\DoorLog`.
*/
class DoorLogSearch extends DoorLog
{
public $searchCardNumber;
public $searchCustomerName;
public $searchKeyName;
public $start;
public $end;
public $timestampStart;
public $timestampEnd;
/**
* @inheritdoc
*/
public function rules()
{
return [
[[ 'direction', 'type'], 'integer'],
[['created_at'], 'safe'],
[['searchCardNumber','searchCustomerName','searchKeyName'], 'safe'],
[[ 'start', ], 'date' , 'timestampAttribute' => 'timestampStart' ,'timestampAttributeFormat' => 'yyyy-MM-dd' ],
[[ 'end' , ], 'date' , 'timestampAttribute' => 'timestampEnd' ,'timestampAttributeFormat' => 'yyyy-MM-dd' ],
];
}
public function attributeLabels(){
return [
'searchCardNumber' => 'Kártya szám',
'searchCustomerName' => 'Vendég',
'searchKeyName' => 'Kulcs szám',
'type' => 'Típus',
'direction' => 'Irány',
'start' => 'Időszak kezdete',
'end' => 'Időszak vége'
];
}
/**
* @inheritdoc
*/
public function scenarios()
{
// bypass scenarios() implementation in the parent class
return Model::scenarios();
}
/**
* Creates data provider instance with search query applied
*
* @param array $params
*
* @return ActiveDataProvider
*/
public function search($params)
{
$query = DoorLog::find();
$dataProvider = new ActiveDataProvider([
'query' => $query,
'sort' =>[
'attributes' => [
// 'age',
'id_card' => [
'asc' => ['card.number' => SORT_ASC ],
'desc' => ['card.number' => SORT_DESC],
],
'id_key' => [
'asc' => ['key.number' => SORT_ASC ],
'desc' => ['key.number' => SORT_DESC],
],
'id_customer' => [
'asc' => ['customer.name' => SORT_ASC ],
'desc' => ['customer.name' => SORT_DESC],
],
'direction' => [
'asc' => ['door_log.direction' => SORT_ASC ],
'desc' => ['door_log.direction' => SORT_DESC],
],
'created_at' => [
'asc' => ['door_log.created_at' => SORT_ASC ],
'desc' => ['door_log.created_at' => SORT_DESC],
],
],
]
]);
$this->load($params);
if (!$this->validate()) {
// uncomment the following line if you do not want to return any records when validation fails
// $query->where('0=1');
return $dataProvider;
}
$query->andFilterWhere([
// 'id_door_log' => $this->id_door_log,
// 'id_card' => $this->id_card,
// 'id_customer' => $this->id_customer,
// 'id_key' => $this->id_key,
'direction' => $this->direction,
// 'type' => $this->type,
// 'created_at' => $this->created_at,
]);
$query->andFilterWhere(['>=', 'door_log.created_at', $this->timestampStart]);
$query->andFilterWhere(['<', 'door_log.created_at', $this->timestampEnd]);
$query->innerJoin('card','card.id_card = door_log.id_card');
$query->leftJoin('key','key.id_key = door_log.id_key');
$query->leftJoin('customer','customer.id_customer = door_log.id_customer');
if ( !empty($this->searchCardNumber)){
$query->andWhere(['or',
['and',[ 'in','card.number' , [$this->searchCardNumber]],"trim(coalesce(card.number, '')) <>'' " ],
['and', ['in','card.rfid_key' ,[ $this->searchCardNumber] ],"trim(coalesce(card.rfid_key, '')) <>'' "],
]);
}
if ( !empty($this->searchKeyName)){
$query->andWhere(['or',
['and',[ 'in','key.number' , [$this->searchKeyName]],"trim(coalesce(key.number, '')) <>'' " ],
['and', ['in','key.rfid_key' ,[ $this->searchKeyName] ],"trim(coalesce(key.rfid_key, '')) <>'' "]
]);
}
$query->andFilterWhere(['like', 'customer.name', $this->searchCustomerName]);
return $dataProvider;
}
}

View File

@ -38,7 +38,7 @@ class TicketInstallmentRequestSearch extends TicketInstallmentRequest
public function rules()
{
return [
[['id_ticket_installment_request', 'id_ticket', 'id_customer', 'status' ,'id_ticket_type','id_ugiro'], 'integer'],
[[ 'id_contract', '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' ],
@ -83,7 +83,9 @@ class TicketInstallmentRequestSearch extends TicketInstallmentRequest
'ticket_installment_request.status as request_status',//status
'ticket_installment_request.request_sent_at as request_sent_at',//sent_at
'ticket_installment_request.priority as request_priority',//sent_at
'ticket_installment_request.number as request_number',//sent_at
'ticket_installment_request.request_processed_at as request_processed_at',//request_processed_at
'ticket_installment_request.id_contract as request_id_contract',//request_processed_at
'customer.id_customer as customer_id_customer',//id_customer
'customer.name as customer_name',//customer_name
'ticket_type.name as ticket_type_name',//ticket_type_name
@ -95,8 +97,8 @@ class TicketInstallmentRequestSearch extends TicketInstallmentRequest
]);
$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("ticket","ticket.id_ticket = ticket_installment_request.id_ticket");
$query->leftJoin("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]);
@ -107,6 +109,7 @@ class TicketInstallmentRequestSearch extends TicketInstallmentRequest
'customer.id_customer' => $this->id_customer,
'ticket_installment_request.status' => $this->status,
'ticket_type.id_ticket_type' => $this->id_ticket_type,
'ticket_installment_request.id_contract' => $this->id_contract,
]);
$query->andFilterWhere(['like', 'customer.name', $this->customer_name]);
//target time

View File

@ -80,8 +80,8 @@ class TicketInstallmentRequestSearchDownloadGiro extends TicketInstallmentReques
]);
$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("ticket","ticket.id_ticket = ticket_installment_request.id_ticket");
$query->leftJoin("ticket_type","ticket.id_ticket_type = ticket_type.id_ticket_type");
$query->andWhere(['ticket_installment_request.status' => TicketInstallmentRequest::$STATUS_MARKED_TO_SEND]);

View File

@ -28,7 +28,7 @@ class TicketInstallmentRequestSearchPending extends TicketInstallmentRequest
public function rules()
{
return [
[['id_ticket_installment_request', 'id_ticket', 'id_customer', 'status' ,'id_ticket_type'], 'integer'],
[[ 'id_contract', 'id_ticket_installment_request', 'id_ticket', 'id_customer', 'status' ,'id_ticket_type'], 'integer'],
[['customer_name' ], 'safe'],
[[ 'start', ], 'date' , 'timestampAttribute' => 'timestampStart' ,'timestampAttributeFormat' => 'yyyy-MM-dd' ],
[[ 'end' , ], 'date' , 'timestampAttribute' => 'timestampEnd' ,'timestampAttributeFormat' => 'yyyy-MM-dd' ],
@ -69,6 +69,7 @@ class TicketInstallmentRequestSearchPending extends TicketInstallmentRequest
'ticket_installment_request.status as request_status',//status
'ticket_installment_request.request_sent_at as request_sent_at',//sent_at
'ticket_installment_request.priority as request_priority',//sent_at
'ticket_installment_request.id_contract as request_id_contract',//sent_at
'ticket_installment_request.request_processed_at as request_processed_at',//request_processed_at
'customer.id_customer as customer_id_customer',//id_customer
'customer.name as customer_name',//customer_name
@ -80,8 +81,8 @@ class TicketInstallmentRequestSearchPending extends TicketInstallmentRequest
]);
$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("ticket","ticket.id_ticket = ticket_installment_request.id_ticket");
$query->leftJoin("ticket_type","ticket.id_ticket_type = ticket_type.id_ticket_type");
$query->andWhere(['ticket_installment_request.status' => TicketInstallmentRequest::$STATUS_PENDING]);
@ -93,6 +94,7 @@ class TicketInstallmentRequestSearchPending extends TicketInstallmentRequest
'customer.id_customer' => $this->id_customer,
'ticket_installment_request.status' => $this->status,
'ticket_type.id_ticket_type' => $this->id_ticket_type,
'ticket_installment_request.id_contract' => $this->id_contract,
]);
$query->andFilterWhere(['like', 'customer.name', $this->customer_name]);
//target time

View File

@ -23,6 +23,7 @@ $this->params['breadcrumbs'][] = $this->title;
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
'id_customer',
[
'attribute' => 'customerCardNumber' ,
],

View File

@ -0,0 +1,33 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model common\models\DoorLog */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="door-log-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'id_card')->textInput() ?>
<?= $form->field($model, 'id_customer')->textInput() ?>
<?= $form->field($model, 'id_key')->textInput() ?>
<?= $form->field($model, 'direction')->textInput() ?>
<?= $form->field($model, 'type')->textInput() ?>
<?= $form->field($model, 'created_at')->textInput() ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? Yii::t('common/door_log', 'Create') : Yii::t('common/door_log', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@ -0,0 +1,66 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\widgets\DatePicker;
/* @var $this yii\web\View */
/* @var $model backend\models\DoorLogSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="door-log-search">
<?php $form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
]); ?>
<div class="row">
<div class="col-md-3">
<?= $form->field($model, 'searchCardNumber') ?>
</div>
<div class="col-md-3">
<?= $form->field($model, 'searchCustomerName') ?>
</div>
<div class="col-md-3">
<?= $form->field($model, 'searchKeyName') ?>
</div>
<div class="col-md-3">
<?= $form->field($model, 'direction')->dropDownList(['' => 'Mind' ] + []) ?>
</div>
</div>
<?php // echo $form->field($model, 'type') ?>
<?php // echo $form->field($model, 'created_at') ?>
<div class="row">
<div class="col-md-3">
<?= $form->field($model, 'start')->widget(DatePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd'
]
]) ?>
</div>
<div class="col-md-3">
<?= $form->field($model, 'end') ->widget(DatePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd'
]
]) ?>
</div>
</div>
<div class="form-group">
<?= Html::submitButton(Yii::t('common/door_log', 'Search'), ['class' => 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@ -0,0 +1,21 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\models\DoorLog */
$this->title = Yii::t('common/door_log', 'Create Door Log');
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/door_log', 'Door Logs'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="door-log-create">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>

View File

@ -0,0 +1,45 @@
<?php
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\DoorLogSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('common/door_log', 'Mozgások');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="door-log-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php echo $this->render('_search', ['model' => $searchModel]); ?>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
[
'attribute' => 'id_card',
'value' => 'cardNumber'
],
[
'attribute' => 'id_key',
'value' => 'keyNumber'
],
[
'attribute' => 'id_customer',
'value' => 'customerName'
],
[
'attribute' => 'direction',
'value' => 'directionName'
],
// 'type',
'created_at:datetime',
],
]); ?>
</div>

View File

@ -0,0 +1,23 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\models\DoorLog */
$this->title = Yii::t('common/door_log', 'Update {modelClass}: ', [
'modelClass' => 'Door Log',
]) . ' ' . $model->id_door_log;
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/door_log', 'Door Logs'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->id_door_log, 'url' => ['view', 'id' => $model->id_door_log]];
$this->params['breadcrumbs'][] = Yii::t('common/door_log', 'Update');
?>
<div class="door-log-update">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>

View File

@ -0,0 +1,41 @@
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model common\models\DoorLog */
$this->title = $model->id_door_log;
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/door_log', 'Door Logs'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="door-log-view">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a(Yii::t('common/door_log', 'Update'), ['update', 'id' => $model->id_door_log], ['class' => 'btn btn-primary']) ?>
<?= Html::a(Yii::t('common/door_log', 'Delete'), ['delete', 'id' => $model->id_door_log], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => Yii::t('common/door_log', 'Are you sure you want to delete this item?'),
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id_door_log',
'id_card',
'id_customer',
'id_key',
'direction',
'type',
'created_at',
],
]) ?>
</div>

View File

@ -51,7 +51,7 @@ use yii\helpers\Html;
</tr>
<tr>
<th>
Megbízás inditására irányzott dátum
Megbízás esedékességének dátuma
</th>
<td>
<?php echo \Yii::$app->formatter->asDatetime( $model['request_request_target_time_at'] );?>
@ -84,8 +84,10 @@ use yii\helpers\Html;
<?php echo $model['ugiro_id_ugiro'] ;?>
</td>
<th>
Szerződés azonosító
</th>
<td>
<?php echo $model['request_id_contract'] ;?>
</td>
</tr>
@ -145,6 +147,22 @@ use yii\helpers\Html;
<td>
</td>
</tr>
<tr>
<th>
Sorszám a kötegben belül
</th>
<td>
<?php echo ( $model['request_number'] ) ;?>
</td>
<th>
</th>
<td>
</td>
<th>
</th>
<td>
</td>
</tr>
</table>
<div >
<?php
@ -153,7 +171,7 @@ use yii\helpers\Html;
}
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']);
echo Html::a("Szerződés megbízásai",['ticket-installment-request/index', 'TicketInstallmentRequestSearch[id_contract]' => $model['request_id_contract']] ,[ 'class' => 'btn btn-primary']);
}
?>
</div>

View File

@ -47,10 +47,10 @@ use yii\helpers\Html;
<tr>
<tr>
<th>
Megbízás inditására irányzott dátum
Megbízás esedékességének dátuma
</th>
<td>
<?php echo \Yii::$app->formatter->asDatetime( $model['request_request_target_time_at'] );?>
<?php echo \Yii::$app->formatter->asDate( $model['request_request_target_time_at'] );?>
</td>
<th>
Megbízás elindításának ideje
@ -78,8 +78,10 @@ use yii\helpers\Html;
<td>
</td>
<th>
Szerződés azonosíót
</th>
<td>
<?php echo $model['request_id_contract'] ;?>
</td>
<tr>

View File

@ -39,6 +39,9 @@ $ticketTypeOptions = ['' => 'Mind'] + ArrayHelper::map(TicketType::read(), 'i
</div>
</div>
<div class="row">
<div class="col-md-3">
<?= $form->field($model, 'id_contract')->label("Szerződés azonosító") ?>
</div>
<div class="col-md-3">
<?= $form->field($model, 'customer_name')->label("Vendég neve") ?>
</div>
@ -56,7 +59,7 @@ $ticketTypeOptions = ['' => 'Mind'] + ArrayHelper::map(TicketType::read(), 'i
'autoclose'=>true,
'format' => 'yyyy.mm.dd'
]
])->label('Megbízás inditására irányzott kezdete ( inklúzív )') ?>
])->label('Megbízás esedékességének kezdete ( inklúzív )') ?>
</div>
<div class="col-md-3">
<?= $form->field($model, 'end') ->widget(DatePicker::classname(), [
@ -64,7 +67,7 @@ $ticketTypeOptions = ['' => 'Mind'] + ArrayHelper::map(TicketType::read(), 'i
'autoclose'=>true,
'format' => 'yyyy.mm.dd'
]
])->label('Megbízás inditására irányzott dátum vége ( exklúzív )') ?>
])->label('Megbízás esedékességének vége ( exklúzív )') ?>
</div>
</div>
<?php /*?>

View File

@ -37,6 +37,9 @@ $ticketTypeOptions = ['' => 'Mind'] + ArrayHelper::map(TicketType::read(), 'i
</div>
</div>
<div class="row">
<div class="col-md-3">
<?= $form->field($model, 'id_contract')->label("Szerződés azonosító") ?>
</div>
<div class="col-md-3">
<?= $form->field($model, 'customer_name')->label("Vendég neve") ?>
</div>
@ -68,7 +71,6 @@ $ticketTypeOptions = ['' => 'Mind'] + ArrayHelper::map(TicketType::read(), 'i
<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']) ?>
</div>
<?php ActiveForm::end(); ?>

View File

@ -48,7 +48,9 @@ $this->params['breadcrumbs'][] = $this->title;
<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']);
//echo Html::a("Teljesítettnek jelölés",['accept', 'id' => $model->id_ticket_installment_request] ,['data-method' =>'post', 'class' => 'btn btn-danger']);
echo "Teljesítettnek jelölés a recepciós felületen lehetséges!";
}
?>
<div class="request-view <?= $statusStyle ?>">
@ -132,6 +134,7 @@ $this->params['breadcrumbs'][] = $this->title;
<td>
</td>
</tr>
<?php if (isset($model->ticket)) {?>
<tr>
<th>
Bérlet azonosító
@ -170,24 +173,25 @@ $this->params['breadcrumbs'][] = $this->title;
<td>
</td>
</tr>
<?php }?>
<tr>
<th>
Bérlet részletek száma
Szerződés részletek száma
</th>
<td>
<?php echo $model->ticket->part_count ;?>
<?php echo $model->contract->part_count ;?>
</td>
<th>
Bérlet esedékes részlet
Szerződés esedékes részlet
</th>
<td>
<?php echo $model->ticket->part ;?>
<?php echo $model->contract->part_required ;?>
</td>
<th>
Bérlet utoljára fizetett részlet
Szerződés utoljára fizetett részlet
</th>
<td>
<?php echo $model->ticket->part_paid ;?>
<?php echo $model->contract->part_paid ;?>
</td>
</tr>
<tr>
@ -216,7 +220,7 @@ 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']);
echo Html::a("Szerzőés megbízásai",['ticket-installment-request/index', 'TicketInstallmentRequestSearch[id_contract]' => $model->id_contract] ,[ 'class' => 'btn btn-primary']);
?>

View File

@ -1,3 +1,6 @@
-0.0.27
- Add contract (szerződés )
- Add door_log ( mozgások )
-0.0.26
- Fix GiroUzenetsorszam case sensitive class/file name match
-0.0.25

View File

@ -66,9 +66,9 @@ class DetStatProcessor extends Object{
/*
$this->detstatUzenet = new GiroDETSTA();
$this->idKoteg = 37;
$this->idKoteg = 38;
$fej = new GiroDETSTAFej();
@ -81,8 +81,16 @@ class DetStatProcessor extends Object{
$this->detstatUzenet->tetelek[] = $tetel;
$tetel = new GiroDETSTATetel();
$tetel->tetelSorszam = 2;
$tetel->visszajelzesInformacio = "00";
$tetel->visszajelzesInformacio = "02";
$this->detstatUzenet->tetelek[] = $tetel;
$lab = new GiroDETSTALab();
$this->detstatUzenet->lab = $lab;
*/
}

View File

@ -69,7 +69,7 @@ class GiroBeszed extends GiroBase {
// $tetel->ugyfelNeve = "Schneider Roland";
// $tetel->ugyfelCime = "Mosonmagyarovar, Gardonyi 31";
$tetel->szamlaTulajdonosNeve = $customer->name;
$tetel->kozlemeny = "Berlet:" . $request->id_ticket .";MegbizasAzo:" . $request->id_ticket_installment_request;
$tetel->kozlemeny = "Fitness berlet. Megbizas azon: " . $request->id_ticket_installment_request;
return $tetel->toString();
}

View File

@ -4,7 +4,7 @@ return [
'supportEmail' => 'rocho02@gmail.com',
'infoEmail' => 'info@rocho-net.hu',
'user.passwordResetTokenExpire' => 3600,
'version' => 'v0.0.26',
'version' => 'v0.0.27',
'company' => 'movar',//gyor
'company_name' => "Freimann Kft.",
'product_visiblity' => 'account',// on reception which products to display. account or global

96
common/models/DoorLog.php Normal file
View File

@ -0,0 +1,96 @@
<?php
namespace common\models;
use Yii;
/**
* This is the model class for table "door_log".
*
* @property integer $id_door_log
* @property integer $id_card
* @property integer $id_customer
* @property integer $id_key
* @property integer $direction
* @property integer $type
* @property string $created_at
*/
class DoorLog extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'door_log';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['id_card', 'id_customer', 'id_key', 'direction', 'type'], 'integer'],
[['created_at'], 'required'],
[['created_at'], 'safe']
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id_door_log' => Yii::t('common/door_log', 'Id Door Log'),
'id_card' => Yii::t('common/door_log', 'Bérlet kártya'),
'id_customer' => Yii::t('common/door_log', 'Vendég'),
'id_key' => Yii::t('common/door_log', 'Kulcs'),
'direction' => Yii::t('common/door_log', 'Irány'),
'type' => Yii::t('common/door_log', 'Típus'),
'created_at' => Yii::t('common/door_log', 'Időpont'),
];
}
public function getCustomer(){
return $this->hasOne( Customer::className(), ["id_customer" =>"id_customer" ] );
}
public function getCustomerName(){
$result = "";
if (isset($this->customer)){
$result = $this->customer->name;
}
return $result;
}
public function getCard(){
return $this->hasOne( Card::className(), ["id_card" =>"id_card" ] );
}
public function getCardNumber(){
$result = "";
if (isset($this->card)){
$result = $this->card->number;
}
return $result;
}
public function getKey(){
return $this->hasOne( Key::className(), ["id_key" =>"id_key" ] );
}
public function getKeyNumber(){
$result = "";
if (isset($this->key)){
$result = $this->key->number;
}
return $result;
}
public function getDirectionName(){
$result = "";
if (isset($this->direction)){
$result = $this->direction;
}
return $result;
}
}

View File

@ -192,6 +192,7 @@ class TicketInstallmentRequest extends \yii\db\ActiveRecord
$this->comment = $comment;
$this->request_processed_at = Helper::getDateTimeString();
$this->save(false);
$contract->status = Contract::$STATUS_NOT_PAID;
$contract->save(false);
// $this->applyNewTicketState($partRequired);
\Yii::info("Megbízás visszautasítva: " . $this->id_ticket_installment_request);
@ -257,7 +258,7 @@ class TicketInstallmentRequest extends \yii\db\ActiveRecord
public static function createInstallment($ticket,$type,$customer,$contract,$money,$ticketCreated,$index){
$request = new TicketInstallmentRequest();
$request->id_ticket = $ticket->id_ticket;
// $request->id_ticket = $ticket->id_ticket;
$request->id_customer = $customer->id_customer;
$request->status = TicketInstallmentRequest::$STATUS_PENDING;
$request->priority = $index;

View File

@ -977,7 +977,7 @@ class Transfer extends \common\models\BaseFitnessActiveRecord {
$ticket->price_brutto = $request->money;
$ticket->id_card = $card->id_card;
$ticket->part = $request->priority;
$this->id_contract = $contract->id_contract;
$ticket->id_contract = $contract->id_contract;
$ticket->save ( false );
$transfer = new Transfer ();

View File

@ -0,0 +1,44 @@
<?php
use yii\db\Schema;
use yii\db\Migration;
class m160125_094224_add__table__door_log extends Migration
{
public function up()
{
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
// http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
}
$this->createTable('{{%door_log}}', [
'id_door_log' => $this->primaryKey(),
'id_card' => $this->integer(11),
'id_customer' => $this->integer(11),
'id_key' => $this->integer(11),
'direction' => $this->integer(11),
'type' => $this->integer(11),
'created_at' => $this->dateTime()->notNull(),
], $tableOptions);
}
public function down()
{
echo "m160125_094224_add__table__door_log cannot be reverted.\n";
return false;
}
/*
// Use safeUp/safeDown to run migration code within a transaction
public function safeUp()
{
}
public function safeDown()
{
}
*/
}

View File

@ -178,6 +178,7 @@ class ContractController extends Controller {
$part->status = TicketInstallmentRequest::$STATUS_ACCEPTED_MANUAL;
$part->id_transfer = $transfer->id_transfer;
$part->request_processed_at = Helper::getDateTimeString ();
$part->id_ticket = $ticket->id_ticket;
$part->save ( false );
$transaction->commit ();