add contract, add door_log

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

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 ();