fitness-web/backend/models/GiroBeszedForm.php
2016-01-25 01:43:19 +01:00

183 lines
4.6 KiB
PHP

<?php
namespace backend\models;
use Yii;
use yii\base\Model;
use common\models\Card;
use common\models\Customer;
use common\models\Ticket;
use common\models\Account;
use yii\web\UploadedFile;
use common\components\giro\GiroBeszed;
use common\components\giro\GiroBeszedFej;
use common\components\giro\GiroBeszedLab;
use common\components\giro\GiroBeszedTetel;
/**
* ContactForm is the model behind the contact form.
* @property string 'fej_recordTipus'
@property string 'uzenetTipus'
@property string 'duplumKod'
@property string 'kezdemenyezoAzonosito'
@property string 'uzenetSorszam'
@property string 'kezdemenyezoBankszamla'
@property string 'ertesitesiHatarido'
@property string 'jogcim'
@property string 'kezdemenyezoCegNeve'
@property string 'fej_kozlemeny'
@property string 'lab_rekordTipus'
@property string 'tetelekSzama'
@property string 'tetelekOsszerteke'
@property string 'rekordTipus'
@property string 'tetelSorszam'
@property string 'terhelesiDatum'
@property string 'osszeg'
@property string 'kotelezettBankszamla'
@property string 'ugyfelazonositoAKezdemenyezonel'
@property string 'ugyfelNeve'
@property string 'ugyfelCime'
@property string 'szamlaTulajdonosNeve'
@property string 'kozlemeny'
*/
class GiroBeszedForm extends Model{
public $uzenet_szoveg;
/**fej*/
public $fej_recordTipus = "01";
public $uzenetTipus = "BESZED";
public $duplumKod = "1";
public $kezdemenyezoAzonosito = "A25366936T244";
// public $uzenetSorszam;
public $fej_osszeallitasDatuma ;
public $fej_sorszam = 1;
public $kezdemenyezoBankszamla = "5860025215371128";
public $ertesitesiHatarido;
public $jogcim = "BEE";
public $kezdemenyezoCegNeve = "test cég";
public $fej_kozlemeny = "Ez a közlemény a fejben";
/**lab*/
public $lab_rekordTipus = "03";
public $tetelekSzama = 1;
public $tetelekOsszerteke = 1000;
/**tetel*/
public $rekordTipus = "02";
public $tetelSorszam = 1;
public $terhelesiDatum = "";
public $osszeg = 1000;
public $kotelezettBankszamla = "5860025215371128";
public $ugyfelazonositoAKezdemenyezonel = "199991";
public $ugyfelNeve;
public $ugyfelCime;
public $szamlaTulajdonosNeve = "Schneider Roland";
public $kozlemeny ="Fitness bérlet";
public function init(){
parent::init();
$this->fej_osszeallitasDatuma = date('Ymd');
$this->ertesitesiHatarido = date('Ymd');
$this->terhelesiDatum = date('Ymd', strtotime('tomorrow'));
}
public function rules(){
return [
[ [ 'fej_recordTipus' ,
'uzenetTipus' ,
'duplumKod' ,
'kezdemenyezoAzonosito' ,
// 'uzenetSorszam' ,
'fej_osszeallitasDatuma',
'fej_sorszam',
'kezdemenyezoBankszamla' ,
'ertesitesiHatarido' ,
'jogcim' ,
'kezdemenyezoCegNeve' ,
'kozlemeny' ,
'rekordTipus' ,
'tetelekSzama' ,
'tetelekOsszerteke' ,
'rekordTipus' ,
'tetelSorszam' ,
'terhelesiDatum' ,
'osszeg' ,
'kotelezettBankszamla' ,
'ugyfelazonositoAKezdemenyezonel' ,
'ugyfelNeve' ,
'ugyfelCime' ,
'szamlaTulajdonosNeve' ,
'kozlemeny' ,] ,'string']
];
}
public function run(){
$this->validate();
$uzenet = new GiroBeszed();
$fej = new GiroBeszedFej();
$lab = new GiroBeszedLab();
$tetel = new GiroBeszedTetel();
$fej->recordTipus = $this->fej_recordTipus;
$fej->uzenetTipus = $this->uzenetTipus;
$fej->duplumKod = $this->duplumKod;
$fej->kezdemenyezoAzonosito = $this->kezdemenyezoAzonosito;
$fej->uzenetSorszam->osszeallitasDatuma = $this->fej_osszeallitasDatuma;
$fej->uzenetSorszam->sorszam = $this->fej_sorszam;
$fej->kezdemenyezoBankszamla->szamlaszam = $this->kezdemenyezoBankszamla;
$fej->ertesitesiHatarido = $this->ertesitesiHatarido;
$fej->jogcim = $this->jogcim;
$fej->kezdemenyezoCegNeve = $this->kezdemenyezoCegNeve;
$fej->kozlemeny = $this->fej_kozlemeny;
//
/***/
$lab->rekordTipus = $this->lab_rekordTipus;
$lab->tetelekSzama = $this->tetelekSzama;
$lab->tetelekOsszerteke = $this->tetelekOsszerteke;
//tetel
$tetel->rekordTipus = $this->rekordTipus;
$tetel->tetelSorszam = $this->tetelSorszam;
$tetel->terhelesiDatum = $this->terhelesiDatum;
$tetel->osszeg = $this->osszeg;
$tetel->kotelezettBankszamla->szamlaszam = $this->kotelezettBankszamla;
$tetel->ugyfelazonositoAKezdemenyezonel = $this->ugyfelazonositoAKezdemenyezonel;
$tetel->ugyfelNeve = $this->ugyfelNeve;
$tetel->ugyfelCime = $this->ugyfelCime;
$tetel->szamlaTulajdonosNeve = $this->szamlaTulajdonosNeve;
$tetel->kozlemeny = $this->kozlemeny;
$uzenet->fej = $fej;
$uzenet->tetelek[] = $tetel;
$uzenet->lab = $lab;
$this->uzenet_szoveg = $uzenet->toString();
}
}