add kulcsok, add tartós beszedés, add ticket type with intallments
This commit is contained in:
@@ -252,6 +252,10 @@ class DailyListing
|
||||
$query->andFilterWhere(['or' , $created_condition , $paid_condition]);
|
||||
|
||||
$query->andWhere(['transfer.status' => Transfer::STATUS_PAID]);
|
||||
|
||||
if ( $this->isModeReception() || $this->isModeAccountState() ){
|
||||
$query->andWhere(['transfer.payment_method' => Transfer::PAYMENT_METHOD_CASH]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
16
common/components/giro/GiroBankszamla.php
Normal file
16
common/components/giro/GiroBankszamla.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
namespace common\components\giro;
|
||||
|
||||
use common\components\giro\GiroBase;
|
||||
|
||||
class GiroBankszamla extends GiroBase{
|
||||
|
||||
// public $bankszerv;
|
||||
public $szamlaszam;
|
||||
|
||||
|
||||
public function toString(){
|
||||
return $this->szovegKitolt( $this->szamlaszam, 24 );
|
||||
}
|
||||
|
||||
}
|
||||
43
common/components/giro/GiroBase.php
Normal file
43
common/components/giro/GiroBase.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace common\components\giro;
|
||||
|
||||
use backend\models\GiroKotegForm;
|
||||
class GiroBase {
|
||||
|
||||
public function mezoKitolt($input, $hossz, $pad_string = "") {
|
||||
return str_pad($input, $hossz, $pad_string, STR_PAD_LEFT);
|
||||
}
|
||||
|
||||
|
||||
public function szamKitolt($input, $hossz, $pad_string = "0") {
|
||||
return str_pad($input, $hossz, $pad_string, STR_PAD_LEFT);
|
||||
}
|
||||
public function szamKitoltJobb($input, $hossz, $pad_string = "0") {
|
||||
return str_pad($input, $hossz, $pad_string, STR_PAD_RIGHT);
|
||||
}
|
||||
|
||||
public function szovegKitolt($input, $hossz, $pad_string = " ") {
|
||||
$data = $input;
|
||||
$data = GiroKotegForm::transliterate($data);
|
||||
if ( strlen($data) > $hossz){
|
||||
$data = substr($data, 0, $hossz );
|
||||
}
|
||||
$data = str_pad($data, $hossz, $pad_string, STR_PAD_RIGHT);
|
||||
echo $data;
|
||||
// echo strlen($data);
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function szovegOlvas($row,$start,$length, $padchar = " "){
|
||||
return rtrim(substr($row, $start,$length),$padchar);
|
||||
}
|
||||
|
||||
public function szamOlvas($row,$start,$length, $padchar = "0"){
|
||||
return ltrim(substr($row, $start,$length),$padchar);
|
||||
}
|
||||
|
||||
public function rekordVege(){
|
||||
return "\r\n";
|
||||
}
|
||||
}
|
||||
80
common/components/giro/GiroBeszed.php
Normal file
80
common/components/giro/GiroBeszed.php
Normal file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
namespace common\components\giro;
|
||||
|
||||
use common\components\giro\GiroBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @property common\components\giro\GiroUzenetsorszam $uzenetSorszam
|
||||
* @property common\components\giro\GiroBankszamla $kezdemenyezoBankszamla
|
||||
*
|
||||
*/
|
||||
class GiroBeszed extends GiroBase {
|
||||
|
||||
|
||||
public function __construct() {
|
||||
}
|
||||
public static function createFileContent($id, $requests) {
|
||||
$s = self::createFej($id);
|
||||
$s .= self::createTetelek($requests);
|
||||
$s .= self::createLab($requests);
|
||||
return $s;
|
||||
}
|
||||
|
||||
public static function createFej($id) {
|
||||
$fej = new GiroBeszedFej ();
|
||||
$fej->duplumKod = \Yii::$app->params['ugiro_duplom_kod'];
|
||||
$fej->kezdemenyezoAzonosito = \Yii::$app->params['ugiro_kezdemenyezo_azonosito'];//"A25366936T244"; // "66658092128";
|
||||
$fej->uzenetSorszam->osszeallitasDatuma = date('Ymd' );
|
||||
$fej->uzenetSorszam->sorszam = $id;
|
||||
$fej->kezdemenyezoBankszamla->szamlaszam = \Yii::$app->params['ugiro_kezdemenyezo_szamlaszam']; // "5860025215371128";
|
||||
// $fej->kezdemenyezoBankszamla->bankszerv = "58600252"; // "TAKBHUHB";
|
||||
$fej->ertesitesiHatarido = "";
|
||||
$fej->kezdemenyezoCegNeve = \Yii::$app->params['company'];
|
||||
|
||||
return $fej->toString ();
|
||||
}
|
||||
|
||||
public static function createTetelek($requests){
|
||||
$s = "";
|
||||
foreach ($requests as $request){
|
||||
$s .= self::createTetel($request);
|
||||
}
|
||||
return $s;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param common\models\TicketInstallmentRequest $request
|
||||
* */
|
||||
public static function createTetel($request) {
|
||||
$tetel = new GiroBeszedTetel ();
|
||||
$customer = $request->customer;
|
||||
$tetel->tetelSorszam = $request->id_ticket_installment_request;
|
||||
$tetel->terhelesiDatum = date('Ymd' ,strtotime("+5 day"));;
|
||||
$tetel->osszeg = $request->money;
|
||||
// $tetel->kotelezettBankszamla->bankszerv = "58600252";
|
||||
$tetel->kotelezettBankszamla->szamlaszam = $customer->bank_account;
|
||||
$tetel->ugyfelazonositoAKezdemenyezonel = $customer->id_customer;
|
||||
// $tetel->ugyfelNeve = "Schneider Roland";
|
||||
// $tetel->ugyfelCime = "Mosonmagyarovar, Gardonyi 31";
|
||||
$tetel->szamlaTulajdonosNeve = $customer->name;
|
||||
$tetel->kozlemeny = "Berlet :" . $request->id_ticket;
|
||||
|
||||
return $tetel->toString();
|
||||
}
|
||||
|
||||
public static function createLab($requests) {
|
||||
$lab = new GiroBeszedLab ();
|
||||
|
||||
$osszeg = 0;
|
||||
foreach ($requests as $request ){
|
||||
$osszeg += $request->money;
|
||||
}
|
||||
|
||||
$lab->tetelekOsszerteke = $osszeg;
|
||||
$lab->tetelekSzama = count($requests);
|
||||
|
||||
return $lab->toString ();
|
||||
}
|
||||
}
|
||||
45
common/components/giro/GiroBeszedFej.php
Normal file
45
common/components/giro/GiroBeszedFej.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
namespace common\components\giro;
|
||||
/**
|
||||
* @property common\components\giro\GiroUzenetsorszam $uzenetSorszam
|
||||
* @property common\components\giro\GiroBankszamla $kezdemenyezoBankszamla
|
||||
* */
|
||||
class GiroBeszedFej extends GiroBase{
|
||||
|
||||
public $recordTipus = "01";
|
||||
public $uzenetTipus = "BESZED";
|
||||
public $duplumKod = "";
|
||||
public $kezdemenyezoAzonosito = "";
|
||||
|
||||
public $uzenetSorszam;
|
||||
public $kezdemenyezoBankszamla;
|
||||
|
||||
public $ertesitesiHatarido;
|
||||
public $jogcim = "BEE";
|
||||
public $kezdemenyezoCegNeve;
|
||||
public $kozlemeny;
|
||||
|
||||
|
||||
public function __construct(){
|
||||
$this->uzenetSorszam = new GiroUzenetsorszam();
|
||||
$this->kezdemenyezoBankszamla = new GiroBankszamla();
|
||||
}
|
||||
|
||||
|
||||
public function toString( ) {
|
||||
return $this->recordTipus
|
||||
.$this->uzenetTipus
|
||||
. $this->duplumKod
|
||||
. $this->szamKitolt( $this->kezdemenyezoAzonosito , 13)
|
||||
. $this->uzenetSorszam->toString()
|
||||
. $this->kezdemenyezoBankszamla->toString()
|
||||
. $this->szamKitolt($this->ertesitesiHatarido,8)
|
||||
. $this->jogcim
|
||||
. $this->szovegKitolt($this->kezdemenyezoCegNeve, 35)
|
||||
. $this->szovegKitolt($this->kozlemeny, 70)
|
||||
. $this->rekordVege()
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
30
common/components/giro/GiroBeszedLab.php
Normal file
30
common/components/giro/GiroBeszedLab.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
namespace common\components\giro;
|
||||
|
||||
use common\components\giro\GiroBase;
|
||||
/**
|
||||
* @property common\components\giro\GiroUzenetsorszam $uzenetSorszam
|
||||
* @property common\components\giro\GiroBankszamla $kezdemenyezoBankszamla
|
||||
* */
|
||||
class GiroBeszedLab extends GiroBase{
|
||||
|
||||
public $rekordTipus = "03";
|
||||
public $tetelekSzama = 0;
|
||||
public $tetelekOsszerteke = 0;
|
||||
|
||||
|
||||
public function GiroBeszedLab(){
|
||||
|
||||
}
|
||||
|
||||
public function toString(){
|
||||
return $this->rekordTipus
|
||||
. $this->szamKitolt($this->tetelekSzama,6)
|
||||
. $this->szamKitolt($this->tetelekOsszerteke,16)
|
||||
. $this->rekordVege()
|
||||
;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
44
common/components/giro/GiroBeszedTetel.php
Normal file
44
common/components/giro/GiroBeszedTetel.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
namespace common\components\giro;
|
||||
|
||||
use common\components\giro\GiroBase;
|
||||
/**
|
||||
* @property common\components\giro\GiroUzenetsorszam $uzenetSorszam
|
||||
* @property common\components\giro\GiroBankszamla $kotelezettBankszamla
|
||||
* */
|
||||
class GiroBeszedTetel extends GiroBase{
|
||||
|
||||
public $rekordTipus = "02";
|
||||
public $tetelSorszam = 0;
|
||||
public $terhelesiDatum = "";
|
||||
public $osszeg;
|
||||
public $kotelezettBankszamla;
|
||||
public $ugyfelazonositoAKezdemenyezonel;
|
||||
public $ugyfelNeve;
|
||||
public $ugyfelCime;
|
||||
public $szamlaTulajdonosNeve;
|
||||
public $kozlemeny;
|
||||
|
||||
|
||||
public function __construct(){
|
||||
$this->kotelezettBankszamla = new GiroBankszamla();
|
||||
}
|
||||
|
||||
public function toString(){
|
||||
return $this->rekordTipus
|
||||
. $this->szamKitolt($this->tetelSorszam,6)
|
||||
. $this->terhelesiDatum
|
||||
. $this->szamKitolt($this->osszeg, 10)
|
||||
. $this->kotelezettBankszamla->toString()
|
||||
. $this->szovegKitolt($this->ugyfelazonositoAKezdemenyezonel ,24)
|
||||
. $this->szovegKitolt( $this->ugyfelNeve ,35 )
|
||||
. $this->szovegKitolt($this->ugyfelCime , 35 )
|
||||
. $this->szovegKitolt($this->szamlaTulajdonosNeve , 35 )
|
||||
. $this->szovegKitolt($this->kozlemeny , 70 )
|
||||
. $this->rekordVege()
|
||||
;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
38
common/components/giro/GiroDETSTA.php
Normal file
38
common/components/giro/GiroDETSTA.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace common\components\giro;
|
||||
|
||||
use common\components\giro\GiroBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @property common\components\giro\GiroUzenetsorszam $uzenetSorszam
|
||||
* @property common\components\giro\GiroBankszamla $kezdemenyezoBankszamla
|
||||
*
|
||||
*/
|
||||
class GiroDETSTA extends GiroBase {
|
||||
|
||||
public $fej;
|
||||
public $lab;
|
||||
public $tetelek = [];
|
||||
|
||||
public function __construct() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static function parse($content){
|
||||
$detsta = new GiroDETSTA();
|
||||
$array = preg_split("/\r\n|\n|\r/", $content);
|
||||
$detsta->fej = GiroDETSTAFej::parse($array[0]);
|
||||
$detsta->lab = GiroDETSTALab::parse($array[count($array) -1]);
|
||||
|
||||
for ( $i = 1 ; $i < count($array) -1; $i++ ){
|
||||
$row = $array[$i];
|
||||
$tetel = GiroDETSTATetel::parse($row);
|
||||
$detsta->tetelek[] = $tetel;
|
||||
}
|
||||
return $detsta;
|
||||
}
|
||||
|
||||
}
|
||||
55
common/components/giro/GiroDETSTAFej.php
Normal file
55
common/components/giro/GiroDETSTAFej.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
namespace common\components\giro;
|
||||
|
||||
|
||||
/**
|
||||
* @property common\components\giro\GiroUzenetsorszam $csoportosUzenetSorszam
|
||||
* @property common\components\giro\GiroBankszamla $kezdemenyezoBankszamla
|
||||
* */
|
||||
class GiroDETSTAFej extends GiroBase{
|
||||
|
||||
public $recordTipus = "01";
|
||||
public $uzenetTipus = "DETSTA";
|
||||
public $jelentesJelzo = "9";
|
||||
public $kezdemenyezoAzonosito = "";
|
||||
|
||||
public $csoportosUzenetSorszam;
|
||||
public $detstaUzenetSorszam;
|
||||
public $ido;
|
||||
|
||||
|
||||
public function __construct(){
|
||||
$this->csoportosUzenetSorszam = new GiroUzenetsorszam();
|
||||
$this->detstaUzenetSorszam = new GiroUzenetsorszam();
|
||||
}
|
||||
|
||||
public function toString( ) {
|
||||
return $this->recordTipus
|
||||
.$this->uzenetTipus
|
||||
. $this->jelentesJelzo
|
||||
. $this->szamKitolt( $this->kezdemenyezoAzonosito , 13)
|
||||
. $this->csoportosUzenetSorszam->toString()
|
||||
. $this->detstaUzenetSorszam->toString()
|
||||
. $this->ido
|
||||
. $this->rekordVege()
|
||||
;
|
||||
}
|
||||
|
||||
public static function parse($row){
|
||||
$fej = new GiroDETSTAFej();
|
||||
|
||||
$fej->recordTipus = substr($row,0,2 );
|
||||
$fej->uzenetTipus = substr($row, 2,6 );
|
||||
$fej->jelentesJelzo = substr($row, 8,1);
|
||||
$fej->kezdemenyezoAzonosito = substr($row, 9,13);
|
||||
$fej->csoportosUzenetSorszam ->osszeallitasDatuma = substr($row, 22, 8);
|
||||
$fej->csoportosUzenetSorszam->sorszam = substr($row, 30, 4);
|
||||
$fej->detstaUzenetSorszam ->osszeallitasDatuma = substr($row, 34,8);
|
||||
$fej->detstaUzenetSorszam->sorszam = substr($row, 42,4);
|
||||
$fej->ido = substr($row, 46,6);
|
||||
|
||||
return $fej;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
44
common/components/giro/GiroDETSTALab.php
Normal file
44
common/components/giro/GiroDETSTALab.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace common\components\giro;
|
||||
|
||||
/**
|
||||
*
|
||||
* @property common\components\giro\GiroUzenetsorszam $csoportosUzenetSorszam
|
||||
* @property common\components\giro\GiroBankszamla $kezdemenyezoBankszamla
|
||||
*
|
||||
*/
|
||||
class GiroDETSTALab extends GiroBase {
|
||||
|
||||
public $recordTipus = "03";
|
||||
public $teljesitettTetelekSzama = "0";
|
||||
public $teljesitettTetelekOsszerteke = "0";
|
||||
public $visszautasitottTetelekSzama = "0";
|
||||
public $visszautasitottTetelekOsszerteke = "0";
|
||||
public $megNemValaszoltTetelekSzama = "0";
|
||||
public $megNemValaszoltTetelekOsszerteke = "0";
|
||||
public function __construct() {
|
||||
}
|
||||
public function toString() {
|
||||
return $this->recordTipus
|
||||
. $this->szamKitolt ( $this->teljesitettTetelekSzama, 6 )
|
||||
. $this->szamKitolt ( $this->teljesitettTetelekOsszerteke, 16 )
|
||||
. $this->szamKitolt ( $this->visszautasitottTetelekSzama, 6 )
|
||||
. $this->szamKitolt ( $this->visszautasitottTetelekOsszerteke, 16 )
|
||||
. $this->szamKitolt ( $this->megNemValaszoltTetelekSzama, 6 )
|
||||
. $this->szamKitolt ( $this->megNemValaszoltTetelekOsszerteke, 16 )
|
||||
. $this->rekordVege();
|
||||
;
|
||||
}
|
||||
public static function parse($row) {
|
||||
$lab = new GiroDETSTALab ();
|
||||
$lab->recordTipus = substr($row,0,2 );
|
||||
$lab->teljesitettTetelekSzama = substr($row,2,6 );
|
||||
$lab->teljesitettTetelekOsszerteke = substr($row,8,16 );
|
||||
$lab->visszautasitottTetelekSzama = substr($row,24,6 );
|
||||
$lab->visszautasitottTetelekOsszerteke = substr($row,30,16 );
|
||||
$lab->megNemValaszoltTetelekSzama = substr($row,46,6 );
|
||||
$lab->megNemValaszoltTetelekOsszerteke = substr($row,52, 16 );
|
||||
return $lab;
|
||||
}
|
||||
}
|
||||
61
common/components/giro/GiroDETSTATetel.php
Normal file
61
common/components/giro/GiroDETSTATetel.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace common\components\giro;
|
||||
|
||||
/**
|
||||
*
|
||||
* @property common\components\giro\GiroUzenetsorszam $csoportosUzenetSorszam
|
||||
* @property common\components\giro\GiroBankszamla $kezdemenyezoBankszamla
|
||||
*
|
||||
*/
|
||||
class GiroDETSTATetel extends GiroBase {
|
||||
public static $INFORMACIO_TELJESITETT = "00";
|
||||
public static $INFORMACIO_VISSZAUTASIOTT_VALASZ_NELKUL = "NO";
|
||||
public static $INFORMACIOK = [
|
||||
'02' => "nem létező 'címzett' számlaszám",
|
||||
'03' => "megszűnt 'címzett' számlaszám",
|
||||
'06' => "a 'címzett' számlaszáma nem értelmezhető (az ügyfél számlaszáma helyett a bank ügyfélforgalmi számlaszáma szerepel)",
|
||||
'10' => "a számlatulajdonos neve és a megadott számlaszám nem tartozik össze szemantikai, 'teljesíthetetlen' ok miatti visszaküldés (RETURN)",
|
||||
'50' => "fedezethiány miatti visszaküldés",
|
||||
'51' => "felhatalmazás hiánya miatti visszaküldés",
|
||||
'54' => "általános visszaküldés (az ügyfél megbízása alapján)",
|
||||
'65' => "összeghatár feletti beszedési megbízás",
|
||||
'99' => "egyéb hiba"
|
||||
];
|
||||
|
||||
public $recordTipus = "01";
|
||||
public $tetelSorszam = "0";
|
||||
public $osszeg = "0";
|
||||
public $eredetiTetelElszamolasiDatuma = "";
|
||||
public $visszajelzesInformacio;
|
||||
public $feldolgozasDatum;
|
||||
public $terhelesiDatum;
|
||||
public $valaszHivatkozasiKod;
|
||||
public $eredetiHivatkozasiKod;
|
||||
public $ugyfelAzonosito;
|
||||
|
||||
public function __construct() {
|
||||
$this->csoportosUzenetSorszam = new GiroUzenetsorszam ();
|
||||
$this->detstaUzenetSorszam = new GiroUzenetsorszam ();
|
||||
}
|
||||
public function toString() {
|
||||
return $this->recordTipus . $this->szamKitolt ( $this->tetelSorszam, 6 ) . $this->szamKitolt ( $this->osszeg, 10 ) . $this->eredetiTetelElszamolasiDatuma . $this->visszajelzesInformacio . $this->feldolgozasDatum . $this->terhelesiDatum . $this->szovegKitolt ( $this->valaszHivatkozasiKod, 29 ) . $this->szovegKitolt ( $this->eredetiHivatkozasiKod, 29 ) . $this->szovegKitolt ( $this->ugyfelAzonosito, 29 );
|
||||
}
|
||||
|
||||
public static function parse($row) {
|
||||
|
||||
$tetel = new GiroDETSTATetel ();
|
||||
$tetel->recordTipus = substr ( $row, 0, 2 );
|
||||
$tetel->tetelSorszam = substr ( $row, 2, 6 );
|
||||
$tetel->osszeg = substr ( $row, 8, 10 );
|
||||
$tetel->eredetiTetelElszamolasiDatuma = substr ( $row, 18, 8 );
|
||||
$tetel->visszajelzesInformacio = substr ( $row, 26, 2 );
|
||||
$tetel->feldolgozasDatum = substr ( $row, 28, 8 );
|
||||
$tetel->terhelesiDatum = substr ( $row, 36, 8 );
|
||||
$tetel->valaszHivatkozasiKod = substr ( $row, 44, 29 );
|
||||
$tetel->eredetiHivatkozasiKod = substr ( $row, 73, 29 );
|
||||
$tetel->ugyfelAzonosito = substr ( $row, 102, 24 );
|
||||
|
||||
return $tetel;
|
||||
}
|
||||
}
|
||||
16
common/components/giro/GiroUzenetSorszam.php
Normal file
16
common/components/giro/GiroUzenetSorszam.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
namespace common\components\giro;
|
||||
|
||||
use common\components\giro\GiroBase;
|
||||
|
||||
class GiroUzenetsorszam extends GiroBase{
|
||||
|
||||
public $osszeallitasDatuma;
|
||||
public $sorszam;
|
||||
|
||||
public function toString( ) {
|
||||
return $this->osszeallitasDatuma . $this->szamKitolt( $this->sorszam,4);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
@@ -13,5 +13,8 @@ return [
|
||||
'login_reception_email' => true, //if reception login should send email
|
||||
'login_admin_email' => true, //if admin login should send email
|
||||
'account_state_close_preload_money' => 'true',//preload money wnen show account state close page
|
||||
|
||||
'ugiro_duplom_kod' => 1,
|
||||
'ugiro_kezdemenyezo_szamlaszam' => '5860025215371128',
|
||||
'ugiro_kezdemenyezo_azonosito' => 'A25366936T244',
|
||||
|
||||
];
|
||||
|
||||
62
common/models/CardKeyAssignment.php
Normal file
62
common/models/CardKeyAssignment.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace common\models;
|
||||
|
||||
use Yii;
|
||||
use yii\helpers\ArrayHelper;
|
||||
use yii\behaviors\TimestampBehavior;
|
||||
|
||||
/**
|
||||
* This is the model class for table "card_key_assignment".
|
||||
*
|
||||
* @property integer $id_card
|
||||
* @property integer $id_key
|
||||
* @property integer $id_user
|
||||
* @property string $created_at
|
||||
* @property string $updated_at
|
||||
*/
|
||||
class CardKeyAssignment extends \yii\db\ActiveRecord
|
||||
{
|
||||
|
||||
public function behaviors()
|
||||
{
|
||||
return ArrayHelper::merge( [
|
||||
[
|
||||
'class' => TimestampBehavior::className(),
|
||||
'value' => function(){ return date('Y-m-d H:i:s' ); }
|
||||
],
|
||||
], parent::behaviors());
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public static function tableName()
|
||||
{
|
||||
return 'card_key_assignment';
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['id_card', 'id_key', 'id_user'], 'integer'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function attributeLabels()
|
||||
{
|
||||
return [
|
||||
'id_card' => Yii::t('common/image', 'Id Card'),
|
||||
'id_key' => Yii::t('common/image', 'Id Key'),
|
||||
'id_user' => Yii::t('common/image', 'Id User'),
|
||||
'created_at' => Yii::t('common/image', 'Created At'),
|
||||
'updated_at' => Yii::t('common/image', 'Updated At'),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -57,7 +57,7 @@ class CardSearch extends Card
|
||||
{
|
||||
|
||||
$query = new Query();
|
||||
$query->select(['card.number as card_number' , 'customer.name as customer_name', 'customer.email as customer_email','customer.phone as customer_phone']);
|
||||
$query->select(['card.id_card as card_id_card', 'card.number as card_number' , 'customer.name as customer_name', 'customer.email as customer_email','customer.phone as customer_phone']);
|
||||
$query->from('card');
|
||||
$query->innerJoin('customer','card.id_card = customer.id_customer_card');
|
||||
$query->orderBy(['customer.name' => SORT_ASC]);
|
||||
|
||||
@@ -46,7 +46,7 @@ class Ticket extends \common\models\BaseFitnessActiveRecord
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['id_user', 'id_ticket_type', 'id_account', 'id_discount', 'max_usage_count', 'usage_count', 'status', 'price_brutto'], 'integer'],
|
||||
[[ 'id_user', 'id_ticket_type', 'id_account', 'id_discount', 'max_usage_count', 'usage_count', 'status', 'price_brutto'], 'integer'],
|
||||
[['start', 'end', 'created_at', 'updated_at'], 'safe'],
|
||||
[['comment'], 'required'],
|
||||
[['comment'], 'string', 'max' => 255]
|
||||
@@ -59,7 +59,7 @@ class Ticket extends \common\models\BaseFitnessActiveRecord
|
||||
public function attributeLabels()
|
||||
{
|
||||
return [
|
||||
'id_ticket' => Yii::t('common/ticket', 'Id Ticket'),
|
||||
'id_ticket' => Yii::t('common/ticket', 'Bérlet azonosító'),
|
||||
'id_user' => Yii::t('common/ticket', 'Id User'),
|
||||
'id_ticket_type' => Yii::t('common/ticket', 'Id Ticket Type'),
|
||||
'id_account' => Yii::t('common/ticket', 'Id Account'),
|
||||
@@ -233,4 +233,20 @@ class Ticket extends \common\models\BaseFitnessActiveRecord
|
||||
return $query;
|
||||
}
|
||||
|
||||
public static function statuses( ) {
|
||||
return [
|
||||
Ticket::STATUS_ACTIVE => 'Aktív',
|
||||
Ticket::STATUS_DELETED => 'Törölve',
|
||||
];
|
||||
}
|
||||
|
||||
public static function toStatusName($id_status){
|
||||
$result = "Ismeretlen";
|
||||
$statuses = Ticket::statuses();
|
||||
if ( array_key_exists($id_status, $statuses)){
|
||||
$result = $statuses[$id_status];
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
156
common/models/TicketInstallmentRequest.php
Normal file
156
common/models/TicketInstallmentRequest.php
Normal file
@@ -0,0 +1,156 @@
|
||||
<?php
|
||||
|
||||
namespace common\models;
|
||||
|
||||
use Yii;
|
||||
use yii\helpers\ArrayHelper;
|
||||
use yii\behaviors\TimestampBehavior;
|
||||
|
||||
/**
|
||||
* This is the model class for table "ticket_installment_request".
|
||||
*
|
||||
* @property integer $id_ticket_installment_request
|
||||
* @property integer $id_ticket
|
||||
* @property integer $id_customer
|
||||
* @property integer $id_transfer
|
||||
* @property integer $status
|
||||
* @property integer $money
|
||||
* @property string $customer_name
|
||||
* @property string $bank_name
|
||||
* @property string $bank_address
|
||||
* @property string $bank_account
|
||||
* @property integer $priority
|
||||
* @property string $request_sent_at
|
||||
* @property string $request_processed_at
|
||||
* @property string $request_target_time_at
|
||||
* @property string $created_at
|
||||
* @property string $updated_at
|
||||
*/
|
||||
class TicketInstallmentRequest extends \yii\db\ActiveRecord
|
||||
{
|
||||
///status //pending | marked_to_send | sent | canceled | rejected | accepted |
|
||||
|
||||
public static $STATUS_PENDING = 0;
|
||||
public static $STATUS_MARKED_TO_SEND = 10;
|
||||
public static $STATUS_SENT = 20;
|
||||
public static $STATUS_CANCELED = 30;
|
||||
public static $STATUS_REJECTED = 40;
|
||||
public static $STATUS_ACCEPTED = 50;
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public static function tableName()
|
||||
{
|
||||
return 'ticket_installment_request';
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['id_ticket', 'id_customer', 'id_transfer', 'status', 'money', 'priority'], 'integer'],
|
||||
[['request_sent_at', 'request_processed_at', 'request_target_time_at', 'created_at', 'updated_at'], 'required'],
|
||||
[['request_sent_at', 'request_processed_at', 'request_target_time_at', 'created_at', 'updated_at'], 'safe'],
|
||||
[['customer_name', 'bank_name', 'bank_address', 'bank_account'], 'string', 'max' => 255]
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function attributeLabels()
|
||||
{
|
||||
return [
|
||||
'id_ticket_installment_request' => Yii::t('common/ticket_installment_request', 'Id Ticket Installment Request'),
|
||||
'id_ticket' => Yii::t('common/ticket_installment_request', 'Id Ticket'),
|
||||
'id_customer' => Yii::t('common/ticket_installment_request', 'Id Customer'),
|
||||
'id_transfer' => Yii::t('common/ticket_installment_request', 'Id Transfer'),
|
||||
'status' => Yii::t('common/ticket_installment_request', 'Status'),
|
||||
'money' => Yii::t('common/ticket_installment_request', 'Money'),
|
||||
'customer_name' => Yii::t('common/ticket_installment_request', 'Customer Name'),
|
||||
'bank_name' => Yii::t('common/ticket_installment_request', 'Bank Name'),
|
||||
'bank_address' => Yii::t('common/ticket_installment_request', 'Bank Address'),
|
||||
'bank_account' => Yii::t('common/ticket_installment_request', 'Bank Account'),
|
||||
'priority' => Yii::t('common/ticket_installment_request', 'Priority'),
|
||||
'request_sent_at' => Yii::t('common/ticket_installment_request', 'Request Sent At'),
|
||||
'request_processed_at' => Yii::t('common/ticket_installment_request', 'Request Processed At'),
|
||||
'request_target_time_at' => Yii::t('common/ticket_installment_request', 'Request Target Time At'),
|
||||
'created_at' => Yii::t('common/ticket_installment_request', 'Created At'),
|
||||
'updated_at' => Yii::t('common/ticket_installment_request', 'Updated At'),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function behaviors()
|
||||
{
|
||||
return ArrayHelper::merge( [
|
||||
[
|
||||
'class' => TimestampBehavior::className(),
|
||||
'value' => function(){ return date('Y-m-d H:i:s' ); }
|
||||
],
|
||||
], parent::behaviors());
|
||||
}
|
||||
|
||||
public function getCustomer(){
|
||||
return $this->hasOne( Customer::className(), ["id_customer" =>"id_customer" ] );
|
||||
}
|
||||
|
||||
/**
|
||||
* @param common\models\Ticket $ticket
|
||||
* @param common\models\TicketType $type
|
||||
* @return common\models\TicketInstallmentRequest[]
|
||||
* */
|
||||
public static function createInstallments($ticket,$type,$customer){
|
||||
$result = [];
|
||||
if ( $type->isInstallment() ){
|
||||
$count = $type->installment_count;
|
||||
$ticketCreatedAt = time();
|
||||
$money = $type->price_brutto;
|
||||
for ( $i = 1; $i <= $count; $i++){
|
||||
$request = TicketInstallmentRequest::createInstallment($ticket, $type, $customer, $money, $ticketCreatedAt, $i);
|
||||
$result[] = $request;
|
||||
}
|
||||
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
public static function createInstallment($ticket,$type,$customer,$money,$ticketCreated,$index){
|
||||
$request = new TicketInstallmentRequest();
|
||||
$request->id_ticket = $ticket->id_ticket;
|
||||
$request->id_customer = $customer->id_customer;
|
||||
$request->status = TicketInstallmentRequest::$STATUS_PENDING;
|
||||
$request->priority = $index;
|
||||
$request->request_target_time_at = date('Y-m-d H:i:s', strtotime("+".$index." month" ));
|
||||
$request->request_processed_at = null;
|
||||
$request->request_sent_at = null;
|
||||
$request->money = $money;
|
||||
|
||||
return $request;
|
||||
}
|
||||
|
||||
public static function statuses(){
|
||||
return [
|
||||
TicketInstallmentRequest::$STATUS_PENDING => 'Indításra vár',
|
||||
TicketInstallmentRequest::$STATUS_MARKED_TO_SEND=> 'Beküldésre jelölve',
|
||||
TicketInstallmentRequest::$STATUS_SENT=> 'Beküldve',
|
||||
TicketInstallmentRequest::$STATUS_CANCELED=> 'Törölve',
|
||||
TicketInstallmentRequest::$STATUS_REJECTED=> 'Visszautasítva',
|
||||
TicketInstallmentRequest::$STATUS_ACCEPTED=> 'Sikeresen végrehajtva',
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
public static function toStatusName($id_status){
|
||||
$result = "Ismeretlen";
|
||||
$statuses = TicketInstallmentRequest::statuses();
|
||||
if ( array_key_exists($id_status, $statuses)){
|
||||
$result = $statuses[$id_status];
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,6 +18,9 @@ use yii\helpers\ArrayHelper;
|
||||
* @property integer $id_account
|
||||
* @property integer $flag_student
|
||||
* @property integer $status
|
||||
* @property integer installment_enabled
|
||||
* @property integer installment_count
|
||||
* @property integer installment_money
|
||||
* @property string $created_at
|
||||
* @property string $updated_at
|
||||
*/
|
||||
@@ -33,6 +36,9 @@ class TicketType extends \common\models\BaseFitnessActiveRecord {
|
||||
const FLAG_STUDENT_OFF = 0;
|
||||
const FLAG_STUDENT_ON = 1;
|
||||
|
||||
const INSTALLMENT_OFF = 0;
|
||||
const INSTALLMENT_ON = 1;
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
@@ -89,6 +95,15 @@ class TicketType extends \common\models\BaseFitnessActiveRecord {
|
||||
////////////////
|
||||
[['id_account',], 'integer'],
|
||||
[['id_account',], 'validateIdAccount'],
|
||||
|
||||
/////////////////////
|
||||
//INSTALLMENT ENABLED
|
||||
/////////////////////
|
||||
[['installment_enabled',], 'integer'],
|
||||
[['installment_enabled',], 'in', 'range' => [ self::INSTALLMENT_ON, self::INSTALLMENT_OFF ]],
|
||||
|
||||
[['installment_money',], 'integer'],
|
||||
[['installment_count',], 'integer'],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -110,6 +125,9 @@ class TicketType extends \common\models\BaseFitnessActiveRecord {
|
||||
'status' => Yii::t('common/ticket_type', 'Status'),
|
||||
'created_at' => Yii::t('common/ticket_type', 'Created At'),
|
||||
'updated_at' => Yii::t('common/ticket_type', 'Updated At'),
|
||||
'installment_enabled' => Yii::t('common/ticket_type', 'Részlet fizetés a brutto áron felül'),
|
||||
'installment_count' => Yii::t('common/ticket_type', 'Havi részletek száma'),
|
||||
'installment_money' => Yii::t('common/ticket_type', 'Havi részlet összege'),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -170,6 +188,9 @@ class TicketType extends \common\models\BaseFitnessActiveRecord {
|
||||
public function isStudent(){
|
||||
return $this->flag_student == ( self::FLAG_STUDENT_ON);
|
||||
}
|
||||
public function isInstallment(){
|
||||
return $this->installment_enabled == ( self::INSTALLMENT_ON);
|
||||
}
|
||||
|
||||
|
||||
public function validateIdAccount($attribute,$params){
|
||||
|
||||
@@ -51,7 +51,10 @@ class Transfer extends \common\models\BaseFitnessActiveRecord
|
||||
const DIRECTION_IN = 20;//MONEY GOES IN TO THE ACCOUNT ( COMPANY EARN MONEY )
|
||||
|
||||
const PAYMENT_METHOD_CASH = 10;
|
||||
const PAYMENT_METHOD_TRANSFER = 20;
|
||||
const PAYMENT_METHOD_BANCCARD = 20; //BANKKÁRTYA
|
||||
const PAYMENT_METHOD_TRANSFER= 30; // ÁTUTALÁS
|
||||
const PAYMENT_METHOD_CAFETERY = 40;//SZÉCHENYI KÁRTYA
|
||||
// const PAYMENT_METHOD_DEBIT_MANDATE = 50;//CSOPORTOS BESZEDÉSI MEGBÍZÁS
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
@@ -464,7 +467,10 @@ class Transfer extends \common\models\BaseFitnessActiveRecord
|
||||
public static function paymentMethods( ) {
|
||||
return [
|
||||
self::PAYMENT_METHOD_CASH=> Yii::t('common/transfer','Készpénz'),
|
||||
self::PAYMENT_METHOD_TRANSFER => Yii::t('common/transfer','Bankkártyás fizetés'),
|
||||
self::PAYMENT_METHOD_BANCCARD => Yii::t('common/transfer','Bankkártyás fizetés'),
|
||||
self::PAYMENT_METHOD_TRANSFER => Yii::t('common/transfer','Átutalás'),
|
||||
self::PAYMENT_METHOD_CAFETERY => Yii::t('common/transfer','Széchenyi kártya'),
|
||||
// self::PAYMENT_METHOD_DEBIT_MANDATE => Yii::t('common/transfer','Csoportos beszedési megbízás'),
|
||||
];
|
||||
}
|
||||
public static function statuses( ) {
|
||||
|
||||
86
common/models/Ugiro.php
Normal file
86
common/models/Ugiro.php
Normal file
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
namespace common\models;
|
||||
|
||||
use Yii;
|
||||
use yii\behaviors\TimestampBehavior;
|
||||
use yii\helpers\ArrayHelper;
|
||||
|
||||
/**
|
||||
* This is the model class for table "ugiro".
|
||||
*
|
||||
* @property integer $id_ugiro
|
||||
* @property integer $id_user
|
||||
* @property string $created_at
|
||||
* @property string $updated_at
|
||||
*/
|
||||
class Ugiro extends \yii\db\ActiveRecord
|
||||
{
|
||||
|
||||
public static $PATH_MEGBIZAS = "giro/megbizas";
|
||||
public static $STATUS_SENT = 0;
|
||||
public static $STATUS_FINISHED = 1;
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public static function tableName()
|
||||
{
|
||||
return 'ugiro';
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function behaviors()
|
||||
{
|
||||
return ArrayHelper::merge( [
|
||||
[
|
||||
'class' => TimestampBehavior::className(),
|
||||
'value' => function(){ return date('Y-m-d H:i:s' ); }
|
||||
],
|
||||
], parent::behaviors());
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function attributeLabels()
|
||||
{
|
||||
return [
|
||||
'id_ugiro' => Yii::t('common/ticket_installment_request', 'Id Ugiro'),
|
||||
'id_user' => Yii::t('common/ticket_installment_request', 'Id User'),
|
||||
'created_at' => Yii::t('common/ticket_installment_request', 'Created At'),
|
||||
'updated_at' => Yii::t('common/ticket_installment_request', 'Updated At'),
|
||||
];
|
||||
}
|
||||
|
||||
public function getUser(){
|
||||
return $this->hasOne( User::className(), ["id" =>"id_user" ] );
|
||||
}
|
||||
|
||||
public static function statuses() {
|
||||
return [
|
||||
static::$STATUS_SENT =>"Folyamatban",
|
||||
static::$STATUS_FINISHED =>"Befejezve",
|
||||
]
|
||||
;
|
||||
}
|
||||
|
||||
public function getStatusName( ) {
|
||||
$statuses = static::statuses() ;
|
||||
$result = "Ismeretlen";
|
||||
if ( array_key_exists($this->status, $statuses)){
|
||||
$result = $statuses[$this->status];
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
51
common/models/UgiroRequestAssignment.php
Normal file
51
common/models/UgiroRequestAssignment.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace common\models;
|
||||
|
||||
use Yii;
|
||||
|
||||
/**
|
||||
* This is the model class for table "ugiro_request_assignment".
|
||||
*
|
||||
* @property integer $id_ugiro_request_assignment
|
||||
* @property integer $id_ugiro
|
||||
* @property integer $id_request
|
||||
* @property string $created_at
|
||||
* @property string $updated_at
|
||||
*/
|
||||
class UgiroRequestAssignment extends \yii\db\ActiveRecord
|
||||
{
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public static function tableName()
|
||||
{
|
||||
return 'ugiro_request_assignment';
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
[['id_ugiro', 'id_request'], 'integer'],
|
||||
[['created_at', 'updated_at'], 'required'],
|
||||
[['created_at', 'updated_at'], 'safe']
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public function attributeLabels()
|
||||
{
|
||||
return [
|
||||
'id_ugiro_request_assignment' => Yii::t('common/ugiro_request_assignment', 'Id Ugiro Request Assignment'),
|
||||
'id_ugiro' => Yii::t('common/ugiro_request_assignment', 'Id Ugiro'),
|
||||
'id_request' => Yii::t('common/ugiro_request_assignment', 'Id Request'),
|
||||
'created_at' => Yii::t('common/ugiro_request_assignment', 'Created At'),
|
||||
'updated_at' => Yii::t('common/ugiro_request_assignment', 'Updated At'),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user