add contract
This commit is contained in:
30
backend/controllers/TestController.php
Normal file
30
backend/controllers/TestController.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace backend\controllers;
|
||||
|
||||
use common\models\City;
|
||||
use yii\web\Controller;
|
||||
use backend\models\GiroBeszedForm;
|
||||
|
||||
/**
|
||||
* CityController implements the CRUD actions for City model.
|
||||
*/
|
||||
class TestController extends Controller
|
||||
{
|
||||
|
||||
|
||||
|
||||
public function actionCreateBeszed(){
|
||||
|
||||
$model = new GiroBeszedForm();
|
||||
|
||||
if ($model->load(\Yii::$app->request->post()) ) {
|
||||
$model->run();
|
||||
}
|
||||
|
||||
return $this->render("_create_beszed",['model' => $model]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -184,6 +184,13 @@ class UgiroController extends Controller
|
||||
}
|
||||
|
||||
|
||||
public function actionGenerateDetsta(){
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Finds the Ugiro model based on its primary key value.
|
||||
* If the model is not found, a 404 HTTP exception will be thrown.
|
||||
|
||||
85
backend/models/GenerateDetstaForm.php
Normal file
85
backend/models/GenerateDetstaForm.php
Normal file
@@ -0,0 +1,85 @@
|
||||
<?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\GiroDETSTA;
|
||||
use common\models\Ugiro;
|
||||
use common\components\giro\GiroDETSTAFej;
|
||||
use common\components\giro\GiroDETSTALab;
|
||||
use common\components\giro\GiroDETSTATetel;
|
||||
|
||||
/**
|
||||
* ContactForm is the model behind the contact form.
|
||||
* @property \Yii\web\UploadedFile $file
|
||||
*/
|
||||
class CardImportRfidForm extends Model{
|
||||
|
||||
|
||||
public $id_giro;
|
||||
public $uzenet;
|
||||
public $detstatUzenet;
|
||||
|
||||
public function rules(){
|
||||
return [
|
||||
[['id_giro'], 'safe']
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function run(){
|
||||
|
||||
$ugiro = Ugiro::findOne($this->id_giro);
|
||||
$requests = $ugiro->requests;
|
||||
|
||||
$this->detstatUzenet = new GiroDETSTA();
|
||||
|
||||
$fej = new GiroDETSTAFej();
|
||||
$fej->csoportosUzenetSorszam->osszeallitasDatuma = $ugiro->datum;
|
||||
$fej->csoportosUzenetSorszam->sorszam = $ugiro->number;
|
||||
$fej->detstaUzenetSorszam->osszeallitasDatuma = $ugiro->datum;
|
||||
$fej->detstaUzenetSorszam->sorszam = $ugiro->number;
|
||||
$fej->ido = "141414";
|
||||
$fej->jelentesJelzo = "8";
|
||||
$fej->kezdemenyezoAzonosito = \Yii::$app->params['ugiro_kezdemenyezo_azonosito'];
|
||||
$fej->kezdemenyezoBankszamla = \Yii::$app->params['ugiro_kezdemenyezo_szamlaszam'];
|
||||
|
||||
$this->detstatUzenet->fej = $fej;
|
||||
|
||||
foreach ($requests as $request){
|
||||
$tetel = new GiroDETSTATetel();
|
||||
$tetel->tetelSorszam = $request->number;
|
||||
$tetel->osszeg = $request->money;
|
||||
$tetel->eredetiTetelElszamolasiDatuma = date('Ymd');
|
||||
$tetel->visszajelzesInformacio = "00";
|
||||
$tetel->feldolgozasDatum = date('Ymd');
|
||||
$tetel->terhelesiDatum = date('Ymd');
|
||||
$tetel->eredetiHivatkozasiKod = "abc123";
|
||||
$tetel->ugyfelAzonosito = $request->id_customer;
|
||||
|
||||
$this->detstatUzenet->tetelek[] = $tetel;
|
||||
}
|
||||
|
||||
$lab = new GiroDETSTALab();
|
||||
$lab->teljesitettTetelekSzama = 0;
|
||||
$lab->teljesitettTetelekOsszerteke = 0;
|
||||
$lab->megNemValaszoltTetelekOsszerteke = 0;
|
||||
$lab->megNemValaszoltTetelekSzama = 0;
|
||||
$lab->visszautasitottTetelekOsszerteke = 0;
|
||||
$lab->visszautasitottTetelekSzama = 0;
|
||||
|
||||
$this->detstatUzenet->lab = $lab;
|
||||
|
||||
|
||||
$this->uzenet = $this->detstatUzenet->toString();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
183
backend/models/GiroBeszedForm.php
Normal file
183
backend/models/GiroBeszedForm.php
Normal file
@@ -0,0 +1,183 @@
|
||||
<?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();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -80,7 +80,11 @@ class GiroKotegForm extends Model{
|
||||
}
|
||||
|
||||
public function assignRequestsToUgiro(){
|
||||
$i = 0;
|
||||
foreach ($this->requests as $request){
|
||||
$i++;
|
||||
$request->number = $i;
|
||||
$request->save(false);
|
||||
$assignment = new UgiroRequestAssignment();
|
||||
$assignment->id_request = $request->id_ticket_installment_request;
|
||||
$assignment->id_ugiro = $this->koteg->id_ugiro;
|
||||
|
||||
4
backend/views/test/_create_beszed.php
Normal file
4
backend/views/test/_create_beszed.php
Normal file
@@ -0,0 +1,4 @@
|
||||
create beszed
|
||||
|
||||
|
||||
<?php echo $this->render('beszed_form', ['model' => $model]); ?>
|
||||
52
backend/views/test/beszed_form.php
Normal file
52
backend/views/test/beszed_form.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\ActiveForm;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model backend\models\GiroBeszedForm */
|
||||
/* @var $form ActiveForm */
|
||||
?>
|
||||
<div class="test-beszed_form">
|
||||
|
||||
<textarea rows="10" cols="200"><?php echo $model->uzenet_szoveg?></textarea>
|
||||
|
||||
<?php $form = ActiveForm::begin(); ?>
|
||||
<h2>fej</h2>
|
||||
<?= $form->field($model, 'fej_recordTipus') ?>
|
||||
<?= $form->field($model, 'uzenetTipus') ?>
|
||||
<?= $form->field($model, 'duplumKod') ?>
|
||||
<?= $form->field($model, 'kezdemenyezoAzonosito') ?>
|
||||
|
||||
<?php // $form->field($model, 'uzenetSorszam') ?>
|
||||
<?= $form->field($model, 'fej_osszeallitasDatuma') ?>
|
||||
<?= $form->field($model, 'fej_sorszam') ?>
|
||||
|
||||
|
||||
<?= $form->field($model, 'kezdemenyezoBankszamla') ?>
|
||||
<?= $form->field($model, 'ertesitesiHatarido') ?>
|
||||
<?= $form->field($model, 'jogcim') ?>
|
||||
<?= $form->field($model, 'kezdemenyezoCegNeve') ?>
|
||||
<?= $form->field($model, 'fej_kozlemeny') ?>
|
||||
<?php /**lab*/?>
|
||||
<h2>Lab</h2>
|
||||
<?= $form->field($model, 'lab_rekordTipus') ?>
|
||||
<?= $form->field($model, 'tetelekSzama') ?>
|
||||
<?= $form->field($model, 'tetelekOsszerteke') ?>
|
||||
<h2>Tetel</h2>
|
||||
<?php /*** tetel*/?>
|
||||
<?= $form->field($model, 'tetelSorszam') ?>
|
||||
<?= $form->field($model, 'terhelesiDatum') ?>
|
||||
<?= $form->field($model, 'osszeg') ?>
|
||||
<?= $form->field($model, 'kotelezettBankszamla') ?>
|
||||
<?= $form->field($model, 'ugyfelazonositoAKezdemenyezonel') ?>
|
||||
<?= $form->field($model, 'ugyfelNeve') ?>
|
||||
<?= $form->field($model, 'ugyfelCime') ?>
|
||||
<?= $form->field($model, 'szamlaTulajdonosNeve') ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton('Submit', ['class' => 'btn btn-primary']) ?>
|
||||
</div>
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
</div><!-- test-beszed_form -->
|
||||
Reference in New Issue
Block a user