add ticket installment
This commit is contained in:
@@ -29,11 +29,11 @@ class GiroBase {
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function szovegOlvas($row,$start,$length, $padchar = " "){
|
||||
public static function szovegOlvas($row,$start,$length, $padchar = " "){
|
||||
return rtrim(substr($row, $start,$length),$padchar);
|
||||
}
|
||||
|
||||
public function szamOlvas($row,$start,$length, $padchar = "0"){
|
||||
public static function szamOlvas($row,$start,$length, $padchar = "0"){
|
||||
return ltrim(substr($row, $start,$length),$padchar);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,19 +15,24 @@ class GiroBeszed extends GiroBase {
|
||||
|
||||
public function __construct() {
|
||||
}
|
||||
public static function createFileContent($id, $requests) {
|
||||
$s = self::createFej($id);
|
||||
$s .= self::createTetelek($requests);
|
||||
|
||||
|
||||
public static function createFileContent($number,$datum /**összeállítás dátum*/, $requests, $terhelesiDatum = null) {
|
||||
if ( !isset($terhelesiDatum)){
|
||||
$terhelesiDatum = date('Ymd' ,strtotime("+5 day"));
|
||||
}
|
||||
$s = self::createFej($number, $datum);
|
||||
$s .= self::createTetelek($requests,$terhelesiDatum);
|
||||
$s .= self::createLab($requests);
|
||||
return $s;
|
||||
}
|
||||
|
||||
public static function createFej($id) {
|
||||
public static function createFej($number, $daturm) {
|
||||
$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->uzenetSorszam->osszeallitasDatuma = $daturm;
|
||||
$fej->uzenetSorszam->sorszam = $number;
|
||||
$fej->kezdemenyezoBankszamla->szamlaszam = \Yii::$app->params['ugiro_kezdemenyezo_szamlaszam']; // "5860025215371128";
|
||||
// $fej->kezdemenyezoBankszamla->bankszerv = "58600252"; // "TAKBHUHB";
|
||||
$fej->ertesitesiHatarido = "";
|
||||
@@ -36,10 +41,12 @@ class GiroBeszed extends GiroBase {
|
||||
return $fej->toString ();
|
||||
}
|
||||
|
||||
public static function createTetelek($requests){
|
||||
public static function createTetelek($requests,$terhelesiDatum){
|
||||
$s = "";
|
||||
$i = 0;
|
||||
foreach ($requests as $request){
|
||||
$s .= self::createTetel($request);
|
||||
$i++;
|
||||
$s .= self::createTetel($request,$i,$terhelesiDatum);
|
||||
}
|
||||
return $s;
|
||||
}
|
||||
@@ -47,19 +54,19 @@ class GiroBeszed extends GiroBase {
|
||||
/**
|
||||
* @param common\models\TicketInstallmentRequest $request
|
||||
* */
|
||||
public static function createTetel($request) {
|
||||
public static function createTetel($request,$sorszam,$terhelesiDatum) {
|
||||
$tetel = new GiroBeszedTetel ();
|
||||
$customer = $request->customer;
|
||||
$tetel->tetelSorszam = $request->id_ticket_installment_request;
|
||||
$tetel->terhelesiDatum = date('Ymd' ,strtotime("+5 day"));;
|
||||
$tetel->tetelSorszam = $sorszam;
|
||||
$tetel->terhelesiDatum = $terhelesiDatum;
|
||||
$tetel->osszeg = $request->money;
|
||||
// $tetel->kotelezettBankszamla->bankszerv = "58600252";
|
||||
$tetel->kotelezettBankszamla->szamlaszam = $customer->bank_account;
|
||||
$tetel->ugyfelazonositoAKezdemenyezonel = $customer->id_customer;
|
||||
$tetel->ugyfelazonositoAKezdemenyezonel = $request->id_ticket_installment_request;
|
||||
// $tetel->ugyfelNeve = "Schneider Roland";
|
||||
// $tetel->ugyfelCime = "Mosonmagyarovar, Gardonyi 31";
|
||||
$tetel->szamlaTulajdonosNeve = $customer->name;
|
||||
$tetel->kozlemeny = "Berlet :" . $request->id_ticket;
|
||||
$tetel->kozlemeny = "Berlet:" . $request->id_ticket .";MegbizasAzo:" . $request->id_ticket_installment_request;
|
||||
|
||||
return $tetel->toString();
|
||||
}
|
||||
|
||||
@@ -6,8 +6,9 @@ use common\components\giro\GiroBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @property common\components\giro\GiroUzenetsorszam $uzenetSorszam
|
||||
* @property common\components\giro\GiroBankszamla $kezdemenyezoBankszamla
|
||||
* @property common\components\giro\GiroDETSTAFej $fej
|
||||
* @property common\components\giro\GiroDETSTALab $lab
|
||||
* @property common\components\giro\GiroDETSTATetel $tetelek
|
||||
*
|
||||
*/
|
||||
class GiroDETSTA extends GiroBase {
|
||||
@@ -20,14 +21,25 @@ class GiroDETSTA extends GiroBase {
|
||||
}
|
||||
|
||||
|
||||
public function toString(){
|
||||
$s = "";
|
||||
$s .= $this->fej->toString();
|
||||
foreach ($this->tetelek as $tetel ){
|
||||
$s .= $tetel->toString();
|
||||
}
|
||||
$s .= $this->lab->toString();
|
||||
|
||||
return $s;
|
||||
}
|
||||
|
||||
|
||||
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]);
|
||||
$detsta->lab = GiroDETSTALab::parse($array[count($array) -2]);
|
||||
|
||||
for ( $i = 1 ; $i < count($array) -1; $i++ ){
|
||||
for ( $i = 1 ; $i < count($array) -2; $i++ ){
|
||||
$row = $array[$i];
|
||||
$tetel = GiroDETSTATetel::parse($row);
|
||||
$detsta->tetelek[] = $tetel;
|
||||
|
||||
@@ -43,7 +43,7 @@ class GiroDETSTAFej extends GiroBase{
|
||||
$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->csoportosUzenetSorszam->sorszam = static::szamOlvas($row, 30, 4);
|
||||
$fej->detstaUzenetSorszam ->osszeallitasDatuma = substr($row, 34,8);
|
||||
$fej->detstaUzenetSorszam->sorszam = substr($row, 42,4);
|
||||
$fej->ido = substr($row, 46,6);
|
||||
|
||||
@@ -17,8 +17,10 @@ class GiroDETSTALab extends GiroBase {
|
||||
public $visszautasitottTetelekOsszerteke = "0";
|
||||
public $megNemValaszoltTetelekSzama = "0";
|
||||
public $megNemValaszoltTetelekOsszerteke = "0";
|
||||
|
||||
public function __construct() {
|
||||
}
|
||||
|
||||
public function toString() {
|
||||
return $this->recordTipus
|
||||
. $this->szamKitolt ( $this->teljesitettTetelekSzama, 6 )
|
||||
|
||||
@@ -39,7 +39,17 @@ class GiroDETSTATetel extends GiroBase {
|
||||
$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 );
|
||||
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, 24 )
|
||||
. $this->rekordVege();
|
||||
}
|
||||
|
||||
public static function parse($row) {
|
||||
|
||||
Reference in New Issue
Block a user