add kulcsok, add tartós beszedés, add ticket type with intallments

This commit is contained in:
2016-01-20 14:48:34 +01:00
parent d1638a19de
commit d7cc84e78f
111 changed files with 4077 additions and 12 deletions

View File

@@ -0,0 +1,28 @@
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace backend\assets;
use yii\web\AssetBundle;
/**
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
class PendingRequestAsset extends AssetBundle
{
public $basePath = '@webroot';
public $baseUrl = '@web';
public $css = [
];
public $js = [
'js/index.pending.js',
];
public $depends = [
'backend\assets\AppAsset',
];
}

View File

@@ -103,6 +103,20 @@ class AdminMenuStructure{
$this->menuItems[] = ['label' => 'Pénzügy', 'url' => $this->emptyUrl,
'items' => $items
];
/////////////////////////////
// Tartós megbízások
/////////////////////////////
$items = [];
$items[] = ['label' => 'Megbízások', 'url' => ['/ticket-installment-request/index' , 'TicketInstallmentRequestSearch[start]' =>$today,'TicketInstallmentRequestSearch[end]' => $tomorrow ] ];
$items[] = ['label' => 'Giro kötegbe jelölés', 'url' => ['/ticket-installment-request/pending' , 'TicketInstallmentRequestSearchPending[end]' => $tomorrow ] ];
$items[] = ['label' => 'GIRO köteg létrehozás', 'url' => ['/ticket-installment-request/download-giro' ] ];
$items[] = ['label' => 'GIRO kötegek', 'url' => ['/ugiro/index' ] ];
// $items[] = ['label' => 'Bevétel', 'url' => ['/transfer/summary' , 'TransferSummarySearch[start]' =>$today,'TransferSummarySearch[end]' => $tomorrow ] ];
// $items[] = ['label' => 'Napi bevételek', 'url' => ['/transfer/list', 'TransferListSearch[start]' =>$todayDatetime,'TransferListSearch[end]' => $tomorrowDatetime ] ];
// $items[] = ['label' => 'Kassza müveletek', 'url' => ['/account-state/index'] ];
$this->menuItems[] = ['label' => 'Tartós megbízások', 'url' => $this->emptyUrl,
'items' => $items
];
}

View File

@@ -0,0 +1,175 @@
<?php
namespace backend\controllers;
use Yii;
use common\models\TicketInstallmentRequest;
use backend\models\TicketInstallmentRequestSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use backend\models\TicketInstallmentRequestSearchPending;
use backend\models\TicketInstallmentMarkForSendForm;
use backend\models\TicketInstallmentRequestSearchDownloadGiro;
use backend\models\GiroKotegForm;
/**
* TicketInstallmentRequestController implements the CRUD actions for TicketInstallmentRequest model.
*/
class TicketInstallmentRequestController extends Controller
{
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['post'],
],
],
];
}
/**
* Lists all TicketInstallmentRequest models.
* @return mixed
*/
public function actionIndex()
{
$searchModel = new TicketInstallmentRequestSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
/**
* Lists pending TicketInstallmentRequest models.
* @return mixed
*/
public function actionPending()
{
$model = new TicketInstallmentMarkForSendForm();
if ($model->load(Yii::$app->request->post()) ) {
$model->markForSend();
}
$searchModel = new TicketInstallmentRequestSearchPending();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index_pending', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
/**
* Lists pending TicketInstallmentRequest models.
* @return mixed
*/
public function actionDownloadGiro()
{
$model = new GiroKotegForm();
if ($model->load(Yii::$app->request->post()) ) {
$model->createKoteg();
return $this->redirect(['ugiro/view', 'id' => $model->koteg->id_ugiro]);
}
$searchModel = new TicketInstallmentRequestSearchDownloadGiro();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
$model->action = "create";
return $this->render('index_download_giro', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
'model' => $model,
]);
}
/**
* Displays a single TicketInstallmentRequest model.
* @param integer $id
* @return mixed
*/
public function actionView($id)
{
return $this->render('view', [
'model' => $this->findModel($id),
]);
}
/**
* Creates a new TicketInstallmentRequest model.
* If creation is successful, the browser will be redirected to the 'view' page.
* @return mixed
*/
public function actionCreate()
{
$model = new TicketInstallmentRequest();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id_ticket_installment_request]);
} else {
return $this->render('create', [
'model' => $model,
]);
}
}
/**
* Updates an existing TicketInstallmentRequest model.
* If update is successful, the browser will be redirected to the 'view' page.
* @param integer $id
* @return mixed
*/
public function actionUpdate($id)
{
$model = $this->findModel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id_ticket_installment_request]);
} else {
return $this->render('update', [
'model' => $model,
]);
}
}
/**
* Deletes an existing TicketInstallmentRequest model.
* If deletion is successful, the browser will be redirected to the 'index' page.
* @param integer $id
* @return mixed
*/
public function actionDelete($id)
{
$this->findModel($id)->delete();
return $this->redirect(['index']);
}
public function actionTest( )
{
return $this->render('test');
}
/**
* Finds the TicketInstallmentRequest model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
* @param integer $id
* @return TicketInstallmentRequest the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
protected function findModel($id)
{
if (($model = TicketInstallmentRequest::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
}
}

View File

@@ -0,0 +1,121 @@
<?php
namespace backend\controllers;
use Yii;
use common\models\Ugiro;
use backend\models\UgiroSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
/**
* UgiroController implements the CRUD actions for Ugiro model.
*/
class UgiroController extends Controller
{
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['post'],
],
],
];
}
/**
* Lists all Ugiro models.
* @return mixed
*/
public function actionIndex()
{
$searchModel = new UgiroSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
/**
* Displays a single Ugiro model.
* @param integer $id
* @return mixed
*/
public function actionView($id)
{
return $this->render('view', [
'model' => $this->findModel($id),
]);
}
/**
* Creates a new Ugiro model.
* If creation is successful, the browser will be redirected to the 'view' page.
* @return mixed
*/
public function actionCreate()
{
$model = new Ugiro();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id_ugiro]);
} else {
return $this->render('create', [
'model' => $model,
]);
}
}
/**
* Updates an existing Ugiro model.
* If update is successful, the browser will be redirected to the 'view' page.
* @param integer $id
* @return mixed
*/
public function actionUpdate($id)
{
$model = $this->findModel($id);
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id_ugiro]);
} else {
return $this->render('update', [
'model' => $model,
]);
}
}
/**
* Deletes an existing Ugiro model.
* If deletion is successful, the browser will be redirected to the 'index' page.
* @param integer $id
* @return mixed
*/
public function actionDelete($id)
{
$this->findModel($id)->delete();
return $this->redirect(['index']);
}
/**
* Finds the Ugiro model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
* @param integer $id
* @return Ugiro the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
protected function findModel($id)
{
if (($model = Ugiro::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
}
}

2
backend/giro2710txt Normal file
View File

@@ -0,0 +1,2 @@
01BESZED1A25366936T2442016012000015860025215371128 00000000BEEmovar
030000000000000000000000

2
backend/giro5459txt Normal file
View File

@@ -0,0 +1,2 @@
01BESZED1A25366936T2442016012000015860025215371128 00000000BEEmovar
030000000000000000000000

2
backend/giro9077txt Normal file
View File

@@ -0,0 +1,2 @@
01BESZED1A25366936T2442016012000015860025215371128 00000000BEEmovar
030000000000000000000000

2
backend/giro9550txt Normal file
View File

@@ -0,0 +1,2 @@
01BESZED1A25366936T2442016012000015860025215371128 00000000BEEmovar
030000000000000000000000

View File

@@ -89,6 +89,9 @@ class CustomerCreate extends \common\models\Customer
[['phone', 'tax_number', 'country'], 'string', 'max' => 20],
[['bank_account'], 'string', 'max' => 24],
[['bank_name'], 'string', 'max' => 100],
[['phone'], 'required', 'when' => function($model) {
return !isset( $model->email ) || empty( $model->email ) ;
} ,

View File

@@ -88,6 +88,8 @@ class CustomerUpdate extends \common\models\Customer
[[ 'description', 'address'], 'string', 'max' => 255],
[['phone', 'tax_number', 'country'], 'string', 'max' => 20],
[['bank_account'], 'string', 'max' => 24],
[['bank_name'], 'string', 'max' => 100],
[['phone'], 'required', 'when' => function($model) {
return !isset( $model->email ) || empty( $model->email ) ;

View File

@@ -0,0 +1,137 @@
<?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\models\TicketInstallmentRequest;
use common\models\Ugiro;
use common\components\giro\GiroBeszed;
use yii\helpers\FileHelper;
use yii\helpers\Inflector;
use yii\helpers\BaseInflector;
use common\models\UgiroRequestAssignment;
/**
* ContactForm is the model behind the contact form.
* @property \Yii\web\UploadedFile $file
*/
class GiroKotegForm extends Model{
public $action;
public $requests;
public $content;
public $koteg;
public $success;
public function rules(){
return [
[['action'], 'safe']
];
}
public function createKoteg(){
$this->readRequests();
$this->success = true;
if ( count( $this->requests ) > 0 ){
$connection = \Yii::$app->db;
$transaction = $connection->beginTransaction();
try {
$this->createUGiroKoteg();
$this->assignRequestsToUgiro();
$this->changeRequestsStatusToSent();
$this->generateFileContent();
$this->saveFile();
if ($this->success) {
$transaction->commit();
\Yii::$app->session->setFlash('success',"Fájl létrehozva");
return true;
} else {
$transaction->rollback();
throw new NotFoundHttpException( "Hiba történt!");
}
} catch (\Exception $e) {
$transaction->rollback();
throw $e;
}
}else{
\Yii::$app->session->setFlash('danger', "Megbízások száma 0!");
return false;
}
}
public function changeRequestsStatusToSent(){
foreach ($this->requests as $request){
$request->status = TicketInstallmentRequest::$STATUS_SENT;
$this->success &= $request->save(false);
}
}
public function assignRequestsToUgiro(){
foreach ($this->requests as $request){
$assignment = new UgiroRequestAssignment();
$assignment->id_request = $request->id_ticket_installment_request;
$assignment->id_ugiro = $this->koteg->id_ugiro;
$this->success &= $assignment->save(false);
}
}
public function createUGiroKoteg(){
$this->koteg = new Ugiro();
$this->koteg->status = Ugiro::$STATUS_SENT;
$this->koteg->id_user = \Yii::$app->user->id;
$this->success &= $this->koteg->save(false);
}
public function readRequests(){
$this->requests = TicketInstallmentRequest::find()->andWhere(['status' => TicketInstallmentRequest::$STATUS_MARKED_TO_SEND])->all();
}
public function generateFileContent(){
$this->content = GiroBeszed::createFileContent($this->koteg->id_ugiro, $this->requests);
}
public function saveFile( ) {
// $data = static::transliterate($this->content);
$data = $this->content;
$data = iconv("utf-8","ASCII",$data);
$path = Ugiro::$PATH_MEGBIZAS . DIRECTORY_SEPARATOR ."giro" . $this->koteg->id_ugiro."_". date('Ymd' ) .".txt";
$filename = Yii::getAlias('@backend/web').DIRECTORY_SEPARATOR .$path;
$dir = Yii::getAlias('@backend/web').DIRECTORY_SEPARATOR .Ugiro::$PATH_MEGBIZAS;
$this->koteg->path = $path;
$this->koteg->save(false);
if(!FileHelper::createDirectory($dir)){
throw new HttpException(500, 'Cannot create "'.$dir.'". Please check write permissions.');
}
$myfile = fopen($filename,'a');
fwrite($myfile, $data);
fclose($myfile);
}
public static function transliterate($string)
{
// if (static::hasIntl()) {
// return transliterator_transliterate(BaseInflector::$transliterator, $string);
// } else {
return str_replace(array_keys(BaseInflector::$transliteration), BaseInflector::$transliteration, $string);
// }
}
/**
* @return boolean if intl extension is loaded
*/
protected static function hasIntl()
{
return extension_loaded('intl');
}
}

View File

@@ -0,0 +1,40 @@
<?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\models\TicketInstallmentRequest;
/**
* ContactForm is the model behind the contact form.
* @property \Yii\web\UploadedFile $file
*/
class TicketInstallmentMarkForSendForm extends Model{
public $items;
public function rules(){
return [
['items', 'each', 'rule' => ['integer']],
];
}
public function markForSend(){
if ( $this->validate() && isset($this->items ) && is_array($this->items ) ){
$updated = 0;
$updated = TicketInstallmentRequest::updateAll(['status' => TicketInstallmentRequest::$STATUS_MARKED_TO_SEND ],['in', 'id_ticket_installment_request' , $this->items]);
\Yii::$app->session->setFlash('success', $updated . " megbízás küldésre jelölve " );
}else{
\Yii::$app->session->setFlash('success', " Nem történt küldésre jelölés! " );
}
}
}

View File

@@ -0,0 +1,130 @@
<?php
namespace backend\models;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use common\models\TicketInstallmentRequest;
use yii\db\Query;
use yii\data\ArrayDataProvider;
/**
* TicketInstallmentRequestSearch represents the model behind the search form about `common\models\TicketInstallmentRequest`.
*/
class TicketInstallmentRequestSearch extends TicketInstallmentRequest
{
public $start;
public $end;
public $timestampStart;
public $timestampEnd;
public $processedStart;
public $processedEnd;
public $timestampProcessedStart;
public $timestampProcessedEnd;
public $sentStart;
public $sentEnd;
public $timestampSentStart;
public $timestampSentEnd;
public $customer_name;
public $id_ticket_type;
/**
* @inheritdoc
*/
public function rules()
{
return [
[['id_ticket_installment_request', 'id_ticket', 'id_customer', 'status' ,'id_ticket_type'], 'integer'],
[['customer_name' ], 'safe'],
[[ 'start', ], 'date' , 'timestampAttribute' => 'timestampStart' ,'timestampAttributeFormat' => 'yyyy-MM-dd' ],
[[ 'end' , ], 'date' , 'timestampAttribute' => 'timestampEnd' ,'timestampAttributeFormat' => 'yyyy-MM-dd' ],
[[ 'processedStart', ], 'date' , 'timestampAttribute' => 'timestampProcessedStart' ,'timestampAttributeFormat' => 'yyyy-MM-dd' ],
[[ 'processedEnd' , ], 'date' , 'timestampAttribute' => 'timestampProcessedEnd' ,'timestampAttributeFormat' => 'yyyy-MM-dd' ],
[[ 'sentStart', ], 'date' , 'timestampAttribute' => 'timestampSentStart' ,'timestampAttributeFormat' => 'yyyy-MM-dd' ],
[[ 'sentEnd' , ], 'date' , 'timestampAttribute' => 'timestampSentEnd' ,'timestampAttributeFormat' => 'yyyy-MM-dd' ],
];
}
/**
* @inheritdoc
*/
public function scenarios()
{
// bypass scenarios() implementation in the parent class
return Model::scenarios();
}
/**
* Creates data provider instance with search query applied
*
* @param array $params
*
* @return ActiveDataProvider
*/
public function search($params)
{
$query = new Query();
$this->load($params);
if (!$this->validate()) {
// uncomment the following line if you do not want to return any records when validation fails
// $query->where('0=1');
}
$query->select([
'ticket_installment_request.id_ticket_installment_request as request_id_ticket_installment_request', //id
'ticket_installment_request.request_target_time_at as request_request_target_time_at',//target time
'ticket_installment_request.money as request_money',//money
'ticket_installment_request.status as request_status',//status
'ticket_installment_request.request_sent_at as request_sent_at',//sent_at
'ticket_installment_request.priority as request_priority',//sent_at
'ticket_installment_request.request_processed_at as request_processed_at',//request_processed_at
'customer.id_customer as customer_id_customer',//id_customer
'customer.name as customer_name',//customer_name
'ticket_type.name as ticket_type_name',//ticket_type_name
'ticket.status as ticket_status',//ticket_status
'ticket.start as ticket_start',//ticket_start
'ticket.end as ticket_end',//ticket_send
'ticket.id_ticket as ticket_id_ticket',//id_ticket
]);
$query->from("ticket_installment_request");
$query->innerJoin("customer","customer.id_customer = ticket_installment_request.id_customer");
$query->innerJoin("ticket","ticket.id_ticket = ticket_installment_request.id_ticket");
$query->innerJoin("ticket_type","ticket.id_ticket_type = ticket_type.id_ticket_type");
$query->orderBy(["ticket_installment_request.request_target_time_at" => SORT_ASC]);
$query->andFilterWhere([
'ticket_installment_request.id_ticket_installment_request' => $this->id_ticket_installment_request,
'ticket.id_ticket' => $this->id_ticket,
'customer.id_customer' => $this->id_customer,
'ticket_installment_request.status' => $this->status,
'ticket_type.id_ticket_type' => $this->id_ticket_type,
]);
$query->andFilterWhere(['like', 'customer.name', $this->customer_name]);
//target time
$query->andFilterWhere(['>=', 'ticket_installment_request.request_target_time_at', $this->timestampStart]);
$query->andFilterWhere(['<', 'ticket_installment_request.request_target_time_at', $this->timestampEnd]);
//sent time
$query->andFilterWhere(['>=', 'ticket_installment_request.request_sent_at', $this->timestampSentStart]);
$query->andFilterWhere(['<', 'ticket_installment_request.request_sent_at', $this->timestampSentEnd]);
//processed time
$query->andFilterWhere(['>=', 'ticket_installment_request.request_processed_at', $this->timestampProcessedStart]);
$query->andFilterWhere(['<', 'ticket_installment_request.request_processed_at', $this->timestampProcessedEnd]);
$dataProvider = new ArrayDataProvider([
'allModels' => $query->all(),
// 'sort' => [
// 'attributes' => ['id', 'username', 'email'],
// ],
// 'pagination' => [
// 'pageSize' => 10,
// ],
]);
return $dataProvider;
}
}

View File

@@ -0,0 +1,114 @@
<?php
namespace backend\models;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use common\models\TicketInstallmentRequest;
use yii\db\Query;
use yii\data\ArrayDataProvider;
/**
* TicketInstallmentRequestSearch represents the model behind the search form about `common\models\TicketInstallmentRequest`.
*/
class TicketInstallmentRequestSearchDownloadGiro extends TicketInstallmentRequest
{
public $start;
public $end;
public $timestampStart;
public $timestampEnd;
public $customer_name;
public $id_ticket_type;
/**
* @inheritdoc
*/
public function rules()
{
return [
[['id_ticket_installment_request', 'id_ticket', 'id_customer', 'status' ,'id_ticket_type'], 'integer'],
[['customer_name' ], 'safe'],
[[ 'start', ], 'date' , 'timestampAttribute' => 'timestampStart' ,'timestampAttributeFormat' => 'yyyy-MM-dd' ],
[[ 'end' , ], 'date' , 'timestampAttribute' => 'timestampEnd' ,'timestampAttributeFormat' => 'yyyy-MM-dd' ],
];
}
/**
* @inheritdoc
*/
public function scenarios()
{
// bypass scenarios() implementation in the parent class
return Model::scenarios();
}
/**
* Creates data provider instance with search query applied
*
* @param array $params
*
* @return ActiveDataProvider
*/
public function search($params)
{
$query = new Query();
$this->load($params);
if (!$this->validate()) {
// uncomment the following line if you do not want to return any records when validation fails
// $query->where('0=1');
}
$query->select([
'ticket_installment_request.id_ticket_installment_request as request_id_ticket_installment_request', //id
'ticket_installment_request.request_target_time_at as request_request_target_time_at',//target time
'ticket_installment_request.money as request_money',//money
'ticket_installment_request.status as request_status',//status
'ticket_installment_request.request_sent_at as request_sent_at',//sent_at
'ticket_installment_request.priority as request_priority',//sent_at
'ticket_installment_request.request_processed_at as request_processed_at',//request_processed_at
'customer.id_customer as customer_id_customer',//id_customer
'customer.name as customer_name',//customer_name
'ticket_type.name as ticket_type_name',//ticket_type_name
'ticket.status as ticket_status',//ticket_status
'ticket.start as ticket_start',//ticket_start
'ticket.end as ticket_end',//ticket_send
'ticket.id_ticket as ticket_id_ticket',//id_ticket
]);
$query->from("ticket_installment_request");
$query->innerJoin("customer","customer.id_customer = ticket_installment_request.id_customer");
$query->innerJoin("ticket","ticket.id_ticket = ticket_installment_request.id_ticket");
$query->innerJoin("ticket_type","ticket.id_ticket_type = ticket_type.id_ticket_type");
$query->andWhere(['ticket_installment_request.status' => TicketInstallmentRequest::$STATUS_MARKED_TO_SEND]);
$query->orderBy(["ticket_installment_request.request_target_time_at" => SORT_ASC]);
// $query->andFilterWhere([
// 'ticket_installment_request.id_ticket_installment_request' => $this->id_ticket_installment_request,
// 'ticket.id_ticket' => $this->id_ticket,
// 'customer.id_customer' => $this->id_customer,
// 'ticket_installment_request.status' => $this->status,
// 'ticket_type.id_ticket_type' => $this->id_ticket_type,
// ]);
// $query->andFilterWhere(['like', 'customer.name', $this->customer_name]);
//target time
// $query->andFilterWhere(['>=', 'ticket_installment_request.request_target_time_at', $this->timestampStart]);
// $query->andFilterWhere(['<', 'ticket_installment_request.request_target_time_at', $this->timestampEnd]);
$dataProvider = new ArrayDataProvider([
'allModels' => $query->all(),
// 'sort' => [
// 'attributes' => ['id', 'username', 'email'],
// ],
// 'pagination' => [
// 'pageSize' => 10,
// ],
]);
return $dataProvider;
}
}

View File

@@ -0,0 +1,114 @@
<?php
namespace backend\models;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use common\models\TicketInstallmentRequest;
use yii\db\Query;
use yii\data\ArrayDataProvider;
/**
* TicketInstallmentRequestSearch represents the model behind the search form about `common\models\TicketInstallmentRequest`.
*/
class TicketInstallmentRequestSearchPending extends TicketInstallmentRequest
{
public $start;
public $end;
public $timestampStart;
public $timestampEnd;
public $customer_name;
public $id_ticket_type;
/**
* @inheritdoc
*/
public function rules()
{
return [
[['id_ticket_installment_request', 'id_ticket', 'id_customer', 'status' ,'id_ticket_type'], 'integer'],
[['customer_name' ], 'safe'],
[[ 'start', ], 'date' , 'timestampAttribute' => 'timestampStart' ,'timestampAttributeFormat' => 'yyyy-MM-dd' ],
[[ 'end' , ], 'date' , 'timestampAttribute' => 'timestampEnd' ,'timestampAttributeFormat' => 'yyyy-MM-dd' ],
];
}
/**
* @inheritdoc
*/
public function scenarios()
{
// bypass scenarios() implementation in the parent class
return Model::scenarios();
}
/**
* Creates data provider instance with search query applied
*
* @param array $params
*
* @return ActiveDataProvider
*/
public function search($params)
{
$query = new Query();
$this->load($params);
if (!$this->validate()) {
// uncomment the following line if you do not want to return any records when validation fails
// $query->where('0=1');
}
$query->select([
'ticket_installment_request.id_ticket_installment_request as request_id_ticket_installment_request', //id
'ticket_installment_request.request_target_time_at as request_request_target_time_at',//target time
'ticket_installment_request.money as request_money',//money
'ticket_installment_request.status as request_status',//status
'ticket_installment_request.request_sent_at as request_sent_at',//sent_at
'ticket_installment_request.priority as request_priority',//sent_at
'ticket_installment_request.request_processed_at as request_processed_at',//request_processed_at
'customer.id_customer as customer_id_customer',//id_customer
'customer.name as customer_name',//customer_name
'ticket_type.name as ticket_type_name',//ticket_type_name
'ticket.status as ticket_status',//ticket_status
'ticket.start as ticket_start',//ticket_start
'ticket.end as ticket_end',//ticket_send
'ticket.id_ticket as ticket_id_ticket',//id_ticket
]);
$query->from("ticket_installment_request");
$query->innerJoin("customer","customer.id_customer = ticket_installment_request.id_customer");
$query->innerJoin("ticket","ticket.id_ticket = ticket_installment_request.id_ticket");
$query->innerJoin("ticket_type","ticket.id_ticket_type = ticket_type.id_ticket_type");
$query->andWhere(['ticket_installment_request.status' => TicketInstallmentRequest::$STATUS_PENDING]);
$query->orderBy(["ticket_installment_request.request_target_time_at" => SORT_ASC]);
$query->andFilterWhere([
'ticket_installment_request.id_ticket_installment_request' => $this->id_ticket_installment_request,
'ticket.id_ticket' => $this->id_ticket,
'customer.id_customer' => $this->id_customer,
'ticket_installment_request.status' => $this->status,
'ticket_type.id_ticket_type' => $this->id_ticket_type,
]);
$query->andFilterWhere(['like', 'customer.name', $this->customer_name]);
//target time
$query->andFilterWhere(['>=', 'ticket_installment_request.request_target_time_at', $this->timestampStart]);
$query->andFilterWhere(['<', 'ticket_installment_request.request_target_time_at', $this->timestampEnd]);
$dataProvider = new ArrayDataProvider([
'allModels' => $query->all(),
// 'sort' => [
// 'attributes' => ['id', 'username', 'email'],
// ],
// 'pagination' => [
// 'pageSize' => 10,
// ],
]);
return $dataProvider;
}
}

View File

@@ -37,7 +37,7 @@ class TicketSearch extends Ticket
public function rules()
{
return [
[[ 'id_user', 'id_ticket_type', 'id_account'], 'integer'],
[[ 'id_ticket', 'id_user', 'id_ticket_type', 'id_account'], 'integer'],
[[ 'start', ], 'date' , 'timestampAttribute' => 'timestampStart' ,'timestampAttributeFormat' => 'yyyy-MM-dd' ],
[[ 'end' , ], 'date' , 'timestampAttribute' => 'timestampEnd' ,'timestampAttributeFormat' => 'yyyy-MM-dd' ],
[['valid_in_interval','created_in_interval','expire_in_interval'],'boolean'] ,
@@ -117,6 +117,7 @@ class TicketSearch extends Ticket
'id_ticket_type' => $this->id_ticket_type,
'id_account' => $this->id_account,
'id_card' => $this->id_card,
'id_ticket' => $this->id_ticket
]);

View File

@@ -0,0 +1,67 @@
<?php
namespace backend\models;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use common\models\Ugiro;
/**
* UgiroSearch represents the model behind the search form about `common\models\Ugiro`.
*/
class UgiroSearch extends Ugiro
{
/**
* @inheritdoc
*/
public function rules()
{
return [
[['id_ugiro', 'id_user'], 'integer'],
[['created_at', 'updated_at'], 'safe'],
];
}
/**
* @inheritdoc
*/
public function scenarios()
{
// bypass scenarios() implementation in the parent class
return Model::scenarios();
}
/**
* Creates data provider instance with search query applied
*
* @param array $params
*
* @return ActiveDataProvider
*/
public function search($params)
{
$query = Ugiro::find();
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
$this->load($params);
if (!$this->validate()) {
// uncomment the following line if you do not want to return any records when validation fails
// $query->where('0=1');
return $dataProvider;
}
$query->andFilterWhere([
'id_ugiro' => $this->id_ugiro,
'id_user' => $this->id_user,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
]);
return $dataProvider;
}
}

View File

@@ -75,6 +75,16 @@ use kartik\widgets\DatePicker;
<?= $form->field($model, 'tax_number')->textInput(['maxlength' => true]) ?>
</div>
</div>
<div class='row'>
<div class='col-md-6'>
<?= $form->field($model, 'bank_name')->textInput(['maxlength' => true])->label("Bank neve") ?>
</div>
</div>
<div class='row'>
<div class='col-md-6'>
<?= $form->field($model, 'bank_account')->textInput(['maxlength' => true])->label("Bankszámlaszám") ?>
</div>
</div>
<div class='row'>
<div class='col-md-6'>
<?= $form->field($model, 'country')->textInput(['maxlength' => true]) ?>

View File

@@ -79,6 +79,16 @@ use kartik\widgets\DatePicker;
<?= $form->field($model, 'tax_number')->textInput(['maxlength' => true]) ?>
</div>
</div>
<div class='row'>
<div class='col-md-6'>
<?= $form->field($model, 'bank_name')->textInput(['maxlength' => true])->label("Bank neve") ?>
</div>
</div>
<div class='row'>
<div class='col-md-6'>
<?= $form->field($model, 'bank_account')->textInput(['maxlength' => true])->label("Bankszámlaszám") ?>
</div>
</div>
<div class='row'>
<div class='col-md-6'>
<?= $form->field($model, 'country')->textInput(['maxlength' => true]) ?>

View File

@@ -44,6 +44,8 @@ $this->params['breadcrumbs'][] = $this->title;
'image',
'description',
'tax_number',
'bank_name',
'bank_account',
'country',
'zip',
'city',

View File

@@ -0,0 +1,124 @@
<?php
use common\models\TicketInstallmentRequest;
use common\models\Ticket;
?>
<table class="table table-striped">
<tr>
<th>
Megbízás azonosító
</th>
<td>
<?php echo "".$model['request_id_ticket_installment_request'];?>
</td>
<th>
Megbízás státusza
</th>
<td>
<?php echo TicketInstallmentRequest::toStatusName( $model['request_status'] );?>
</td>
<th>
Megbízás összege
</th>
<td>
<?php echo $model['request_money'] ." Ft";?>
</td>
<tr>
<tr>
<th>
Megbízás inditására irányzott dátum
</th>
<td>
<?php echo \Yii::$app->formatter->asDatetime( $model['request_request_target_time_at'] );?>
</td>
<th>
Megbízás elindításának ideje
</th>
<td>
<?php echo \Yii::$app->formatter->asDatetime( $model['request_sent_at'] );?>
</td>
<th>
Megbízás feldoglozásának ideje
</th>
<td>
<?php echo \Yii::$app->formatter->asDatetime( $model['request_processed_at'] );?>
</td>
<tr>
<tr>
<th>
Megbízás prioritása
</th>
<td>
<?php echo $model['request_priority'] ;?>
</td>
<th>
</th>
<td>
</td>
<th>
</th>
<td>
</td>
<tr>
<tr>
<th>
Vendég azonosító
</th>
<td>
<?php echo "". $model['customer_id_customer'];?>
</td>
<th>
Vendég neve
</th>
<td>
<?php echo $model['customer_name'];?>
</td>
<th>
</th>
<td>
</td>
<tr>
<tr>
<th>
Bérlet azonosító
</th>
<td>
<?php echo "". $model['ticket_id_ticket'];?>
</td>
<th>
Bérlet típus
</th>
<td>
<?php echo $model['ticket_type_name'];?>
</td>
<th>
Bérlet státusza
</th>
<td>
<?php echo Ticket::toStatusName( $model['ticket_status'] );?>
</td>
<tr>
<tr>
<th>
Bérlet érvényességének kezdete
</th>
<td>
<?php echo \Yii::$app->formatter->asDate( $model['ticket_start'] ) ;?>
</td>
<th>
Bérlet érvényességének vége
</th>
<td>
<?php echo \Yii::$app->formatter->asDate( $model['ticket_end'] ) ;?>
</td>
<th>
</th>
<td>
</td>
<tr>
</table>

View File

@@ -0,0 +1,51 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model common\models\TicketInstallmentRequest */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="ticket-installment-request-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'id_ticket')->textInput() ?>
<?= $form->field($model, 'id_customer')->textInput() ?>
<?= $form->field($model, 'id_transfer')->textInput() ?>
<?= $form->field($model, 'status')->textInput() ?>
<?= $form->field($model, 'money')->textInput() ?>
<?= $form->field($model, 'customer_name')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'bank_name')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'bank_address')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'bank_account')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'priority')->textInput() ?>
<?= $form->field($model, 'request_sent_at')->textInput() ?>
<?= $form->field($model, 'request_processed_at')->textInput() ?>
<?= $form->field($model, 'request_target_time_at')->textInput() ?>
<?= $form->field($model, 'created_at')->textInput() ?>
<?= $form->field($model, 'updated_at')->textInput() ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? Yii::t('common/ticket_installment_request', 'Create') : Yii::t('common/ticket_installment_request', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@@ -0,0 +1,124 @@
<?php
use common\models\TicketInstallmentRequest;
use common\models\Ticket;
?>
<table class="table table-striped">
<tr>
<th>
Megbízás azonosító
</th>
<td>
<?php echo "".$model['request_id_ticket_installment_request'];?>
</td>
<th>
Megbízás státusza
</th>
<td>
<?php echo TicketInstallmentRequest::toStatusName( $model['request_status'] );?>
</td>
<th>
Megbízás összege
</th>
<td>
<?php echo $model['request_money'] ." Ft";?>
</td>
<tr>
<tr>
<th>
Megbízás inditására irányzott dátum
</th>
<td>
<?php echo \Yii::$app->formatter->asDatetime( $model['request_request_target_time_at'] );?>
</td>
<th>
Megbízás elindításának ideje
</th>
<td>
<?php echo \Yii::$app->formatter->asDatetime( $model['request_sent_at'] );?>
</td>
<th>
Megbízás feldoglozásának ideje
</th>
<td>
<?php echo \Yii::$app->formatter->asDatetime( $model['request_processed_at'] );?>
</td>
<tr>
<tr>
<th>
Megbízás prioritása
</th>
<td>
<?php echo $model['request_priority'] ;?>
</td>
<th>
</th>
<td>
</td>
<th>
</th>
<td>
</td>
<tr>
<tr>
<th>
Vendég azonosító
</th>
<td>
<?php echo "". $model['customer_id_customer'];?>
</td>
<th>
Vendég neve
</th>
<td>
<?php echo $model['customer_name'];?>
</td>
<th>
</th>
<td>
</td>
<tr>
<tr>
<th>
Bérlet azonosító
</th>
<td>
<?php echo "". $model['ticket_id_ticket'];?>
</td>
<th>
Bérlet típus
</th>
<td>
<?php echo $model['ticket_type_name'];?>
</td>
<th>
Bérlet státusza
</th>
<td>
<?php echo Ticket::toStatusName( $model['ticket_status'] );?>
</td>
<tr>
<tr>
<th>
Bérlet érvényességének kezdete
</th>
<td>
<?php echo \Yii::$app->formatter->asDate( $model['ticket_start'] ) ;?>
</td>
<th>
Bérlet érvényességének vége
</th>
<td>
<?php echo \Yii::$app->formatter->asDate( $model['ticket_end'] ) ;?>
</td>
<th>
</th>
<td>
</td>
<tr>
</table>

View File

@@ -0,0 +1,142 @@
<?php
use common\models\TicketInstallmentRequest;
use common\models\Ticket;
use yii\helpers\Html;
?>
<table class="table table-striped">
<tr>
<th>
Beküldésre jelöl
</th>
<td>
<?php echo Html::checkbox("TicketInstallmentMarkForSendForm[items][]",false, ['class' => 'pending-request', 'value' => $model['request_id_ticket_installment_request']])?>
</td>
<th>
</th>
<td>
</td>
<th>
</th>
<td>
</td>
<tr>
<tr>
<th>
Megbízás azonosító
</th>
<td>
<?php echo "".$model['request_id_ticket_installment_request'];?>
</td>
<th>
Megbízás státusza
</th>
<td>
<?php echo TicketInstallmentRequest::toStatusName( $model['request_status'] );?>
</td>
<th>
Megbízás összege
</th>
<td>
<?php echo $model['request_money'] ." Ft";?>
</td>
<tr>
<tr>
<th>
Megbízás inditására irányzott dátum
</th>
<td>
<?php echo \Yii::$app->formatter->asDatetime( $model['request_request_target_time_at'] );?>
</td>
<th>
Megbízás elindításának ideje
</th>
<td>
<?php echo \Yii::$app->formatter->asDatetime( $model['request_sent_at'] );?>
</td>
<th>
Megbízás feldoglozásának ideje
</th>
<td>
<?php echo \Yii::$app->formatter->asDatetime( $model['request_processed_at'] );?>
</td>
<tr>
<tr>
<th>
Megbízás prioritása
</th>
<td>
<?php echo $model['request_priority'] ;?>
</td>
<th>
</th>
<td>
</td>
<th>
</th>
<td>
</td>
<tr>
<tr>
<th>
Vendég azonosító
</th>
<td>
<?php echo "". $model['customer_id_customer'];?>
</td>
<th>
Vendég neve
</th>
<td>
<?php echo $model['customer_name'];?>
</td>
<th>
</th>
<td>
</td>
<tr>
<tr>
<th>
Bérlet azonosító
</th>
<td>
<?php echo "". $model['ticket_id_ticket'];?>
</td>
<th>
Bérlet típus
</th>
<td>
<?php echo $model['ticket_type_name'];?>
</td>
<th>
Bérlet státusza
</th>
<td>
<?php echo Ticket::toStatusName( $model['ticket_status'] );?>
</td>
<tr>
<tr>
<th>
Bérlet érvényességének kezdete
</th>
<td>
<?php echo \Yii::$app->formatter->asDate( $model['ticket_start'] ) ;?>
</td>
<th>
Bérlet érvényességének vége
</th>
<td>
<?php echo \Yii::$app->formatter->asDate( $model['ticket_end'] ) ;?>
</td>
<th>
</th>
<td>
</td>
<tr>
</table>

View File

@@ -0,0 +1,137 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use common\models\TicketInstallmentRequest;
use common\models\TicketType;
use yii\helpers\ArrayHelper;
use kartik\widgets\DatePicker;
/* @var $this yii\web\View */
/* @var $model backend\models\TicketInstallmentRequestSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<?php
$ticketTypeOptions = ['' => 'Mind'] + ArrayHelper::map(TicketType::read(), 'id_ticket_type', 'name');
?>
<div class="ticket-installment-request-search">
<?php $form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
]); ?>
<div class="row">
<div class="col-md-3">
<?= $form->field($model, 'id_ticket_installment_request')->label("Megbízás azonosító") ?>
</div>
<div class="col-md-3">
<?= $form->field($model, 'id_ticket')->label("Bérlet azonosító") ?>
</div>
<div class="col-md-3">
<?= $form->field($model, 'id_customer')->label("Vendég azonosító") ?>
</div>
</div>
<div class="row">
<div class="col-md-3">
<?= $form->field($model, 'customer_name')->label("Vendég neve") ?>
</div>
<div class="col-md-3">
<?= $form->field($model, 'status')->label("Megbízás státusza")->dropDownList( ['' => 'Mind' ] + TicketInstallmentRequest::statuses()) ?>
</div>
<div class="col-md-3">
<?= $form->field($model, 'id_ticket_type')->label("Bérlet típus")->dropDownList( $ticketTypeOptions) ?>
</div>
</div>
<div class="row">
<div class="col-md-3">
<?= $form->field($model, 'start')->widget(DatePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd'
]
])->label('Megbízás inditására irányzott kezdete ( inklúzív )') ?>
</div>
<div class="col-md-3">
<?= $form->field($model, 'end') ->widget(DatePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd'
]
])->label('Megbízás inditására irányzott dátum vége ( exklúzív )') ?>
</div>
</div>
<div class="row">
<div class="col-md-3">
<?= $form->field($model, 'sentStart')->widget(DatePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd'
]
])->label('Megbízás elindításának időszak kezdete ( inklúzív )') ?>
</div>
<div class="col-md-3">
<?= $form->field($model, 'sentEnd') ->widget(DatePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd'
]
])->label('Megbízás elindításának időszak vége ( exklúzív )') ?>
</div>
</div>
<div class="row">
<div class="col-md-3">
<?= $form->field($model, 'processedStart')->widget(DatePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd'
]
])->label('Megbízás feldolgozása időszak kezdete ( inklúzív )') ?>
</div>
<div class="col-md-3">
<?= $form->field($model, 'processedEnd') ->widget(DatePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd'
]
])->label('Megbízás feldolgozása időszak vége ( exklúzív )') ?>
</div>
</div>
<?php // echo $form->field($model, 'money') ?>
<?php // echo $form->field($model, 'customer_name') ?>
<?php // echo $form->field($model, 'bank_name') ?>
<?php // echo $form->field($model, 'bank_address') ?>
<?php // echo $form->field($model, 'bank_account') ?>
<?php // echo $form->field($model, 'priority') ?>
<?php // echo $form->field($model, 'request_sent_at') ?>
<?php // echo $form->field($model, 'request_processed_at') ?>
<?php // echo $form->field($model, 'request_target_time_at') ?>
<?php // echo $form->field($model, 'created_at') ?>
<?php // echo $form->field($model, 'updated_at') ?>
<div class="form-group">
<?= Html::submitButton(Yii::t('common/ticket_installment_request', 'Search'), ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton(Yii::t('common/ticket_installment_request', 'Reset'), ['class' => 'btn btn-default']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@@ -0,0 +1,76 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use common\models\TicketInstallmentRequest;
use common\models\TicketType;
use yii\helpers\ArrayHelper;
use kartik\widgets\DatePicker;
/* @var $this yii\web\View */
/* @var $model backend\models\TicketInstallmentRequestSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<?php
$ticketTypeOptions = ['' => 'Mind'] + ArrayHelper::map(TicketType::read(), 'id_ticket_type', 'name');
?>
<div class="ticket-installment-request-search">
<?php $form = ActiveForm::begin([
'action' => ['pending'],
'method' => 'get',
]); ?>
<div class="row">
<div class="col-md-3">
<?= $form->field($model, 'id_ticket_installment_request')->label("Megbízás azonosító") ?>
</div>
<div class="col-md-3">
<?= $form->field($model, 'id_ticket')->label("Bérlet azonosító") ?>
</div>
<div class="col-md-3">
<?= $form->field($model, 'id_customer')->label("Vendég azonosító") ?>
</div>
</div>
<div class="row">
<div class="col-md-3">
<?= $form->field($model, 'customer_name')->label("Vendég neve") ?>
</div>
<div class="col-md-3">
<?= $form->field($model, 'id_ticket_type')->label("Bérlet típus")->dropDownList( $ticketTypeOptions) ?>
</div>
<div class="col-md-3">
</div>
</div>
<div class="row">
<div class="col-md-3">
<?= $form->field($model, 'start')->widget(DatePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd'
]
])->label('Megbízás inditására irányzott kezdete ( inklúzív )') ?>
</div>
<div class="col-md-3">
<?= $form->field($model, 'end') ->widget(DatePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd'
]
])->label('Megbízás inditására irányzott dátum vége ( exklúzív )') ?>
</div>
</div>
<div class="form-group">
<?= Html::submitButton(Yii::t('common/ticket_installment_request', 'Search'), ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton(Yii::t('common/ticket_installment_request', 'Reset'), ['class' => 'btn btn-default']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@@ -0,0 +1,21 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\models\TicketInstallmentRequest */
$this->title = Yii::t('common/ticket_installment_request', 'Create Ticket Installment Request');
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/ticket_installment_request', 'Ticket Installment Requests'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="ticket-installment-request-create">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>

View File

@@ -0,0 +1,29 @@
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\ListView;
use yii\base\Widget;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\TicketInstallmentRequestSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('common/ticket_installment_request', 'Bérlet fizetési megbízások');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="ticket-installment-request-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php echo $this->render('_search', ['model' => $searchModel]); ?>
<?php
echo ListView::widget([
'dataProvider' => $dataProvider,
'itemView' => '_index_view'
]);
?>
</div>

View File

@@ -0,0 +1,44 @@
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\ListView;
use yii\base\Widget;
use kartik\widgets\ActiveForm;
use backend\assets\PendingRequestAsset;
use yii\helpers\Url;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\TicketInstallmentRequestSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('common/ticket_installment_request', 'Giro köteg létrehozása');
$this->params['breadcrumbs'][] = $this->title;
?>
<?php
PendingRequestAsset::register($this);
?>
<div class="ticket-installment-request-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php
echo ListView::widget([
'dataProvider' => $dataProvider,
'itemView' => '_download_giro_view'
]);
?>
<?php $form = ActiveForm::begin([
'action' => Url::current(),
'method' => 'post',
]); ?>
<?php echo $form->field($model, 'action')->hiddenInput()->label(false) ?>
<div class="form-group">
<?= Html::submitButton("Köteg létrehozása", ['class' => 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@@ -0,0 +1,50 @@
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\ListView;
use yii\base\Widget;
use kartik\widgets\ActiveForm;
use backend\assets\PendingRequestAsset;
use yii\helpers\Url;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\TicketInstallmentRequestSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('common/ticket_installment_request', 'Indításra váró bérlet fizetési megbízások');
$this->params['breadcrumbs'][] = $this->title;
?>
<?php
PendingRequestAsset::register($this);
?>
<div class="ticket-installment-request-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php echo $this->render('_search_pending', ['model' => $searchModel]); ?>
<div>
<label>
Mindent ki/be
<?php echo Html::checkbox("select-all",false, ['id' => 'select-all-pending' ]);?>
</label>
</div>
<?php $form = ActiveForm::begin([
'action' => Url::current(),
'method' => 'post',
]); ?>
<?php
echo ListView::widget([
'dataProvider' => $dataProvider,
'itemView' => '_pending_view'
]);
?>
<div class="form-group">
<?= Html::submitButton("Beküldendőnek jelöl", ['class' => 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@@ -0,0 +1,85 @@
<?php
use common\components\giro\GiroBeszedLab;
use common\components\giro\GiroBeszedFej;
use yii\helpers\Html;
use common\components\giro\GiroBeszedTetel;
use common\components\giro\GiroBeszed;
use common\components\giro\GiroDETSTAFej;
$data = iconv("utf-8","CP852","árvíztűrő tükörfúrógép");
echo $data;
echo mb_detect_encoding($data, "auto");
$fej = new GiroBeszedFej();
$fej->duplumKod = 1;
$fej->kezdemenyezoAzonosito = "A25366936T244" ;//"66658092128";
$fej->uzenetSorszam ->osszeallitasDatuma = "20160120";
$fej->uzenetSorszam->sorszam = 1;
$fej->kezdemenyezoBankszamla->szamlaszam = "5860025215371128";//"5860025215371128";
// $fej->kezdemenyezoBankszamla->bankszerv = "58600252"; //"TAKBHUHB";
$fej->ertesitesiHatarido = "";
$fej->kezdemenyezoCegNeve = "Cutler Four kft";
echo "fej<br>";
echo "'".str_replace(' ', '&nbsp;',Html::encode($fej->toString()) )."'";
echo "<br>";
$tetel = new GiroBeszedTetel();
$tetel->tetelSorszam = 1;
$tetel->terhelesiDatum = "20160122";
$tetel->osszeg = "1000";
// $tetel->kotelezettBankszamla->bankszerv = "58600252";
$tetel->kotelezettBankszamla->szamlaszam = "5860025215371128";
$tetel->ugyfelazonositoAKezdemenyezonel = 1;
$tetel->ugyfelNeve = "Schneider Roland";
$tetel->ugyfelCime = "Mosonmagyarovar, Gardonyi 31";
$tetel->szamlaTulajdonosNeve = "Schneider Roland";
$tetel->kozlemeny = "Berlet";
echo "tetel<br>";
echo "'".str_replace(' ', '&nbsp;',($tetel->toString())) ."'";
echo "<br>";
$lab = new GiroBeszedLab();
$lab->tetelekOsszerteke = 1000;
$lab->tetelekSzama=1;
echo "<br>lab<br>";
echo str_replace(' ', '&nbsp;', $lab->toString() );
$content = GiroBeszed::createFileContent(1, []);
echo "'".str_replace(' ', '&nbsp;', Html::encode(GiroBeszed::createFileContent(1, [])) ."'");
$data = iconv("windows-1252","ASCII",$content);
// $filename = \Yii::$app->basePath . "/" ."giro" . rand(0,10000)."txt";
// $myfile = fopen($filename,'a');
// fwrite($myfile, $data);
// fclose($myfile);
$dfej = new GiroDETSTAFej();
$dfej->kezdemenyezoAzonosito = "A25366936T244";
$dfej->csoportosUzenetSorszam ->osszeallitasDatuma = "20160120";
$dfej->csoportosUzenetSorszam->sorszam = 1;
$dfej->detstaUzenetSorszam ->osszeallitasDatuma = "20160120";
$dfej->detstaUzenetSorszam->sorszam = 1;
$dfej->ido = "100000";
echo "dfej<br>";
echo $dfej->toString();
echo "<br>";
$s = "01DETSTA0A25366936T244201601200001201601200001100000";
$def2 = GiroDETSTAFej::parse($s);
print_r($def2);
?>

View File

@@ -0,0 +1,23 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\models\TicketInstallmentRequest */
$this->title = Yii::t('common/ticket_installment_request', 'Update {modelClass}: ', [
'modelClass' => 'Ticket Installment Request',
]) . ' ' . $model->id_ticket_installment_request;
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/ticket_installment_request', 'Ticket Installment Requests'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->id_ticket_installment_request, 'url' => ['view', 'id' => $model->id_ticket_installment_request]];
$this->params['breadcrumbs'][] = Yii::t('common/ticket_installment_request', 'Update');
?>
<div class="ticket-installment-request-update">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>

View File

@@ -0,0 +1,50 @@
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model common\models\TicketInstallmentRequest */
$this->title = $model->id_ticket_installment_request;
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/ticket_installment_request', 'Ticket Installment Requests'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="ticket-installment-request-view">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a(Yii::t('common/ticket_installment_request', 'Update'), ['update', 'id' => $model->id_ticket_installment_request], ['class' => 'btn btn-primary']) ?>
<?= Html::a(Yii::t('common/ticket_installment_request', 'Delete'), ['delete', 'id' => $model->id_ticket_installment_request], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => Yii::t('common/ticket_installment_request', 'Are you sure you want to delete this item?'),
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id_ticket_installment_request',
'id_ticket',
'id_customer',
'id_transfer',
'status',
'money',
'customer_name',
'bank_name',
'bank_address',
'bank_account',
'priority',
'request_sent_at',
'request_processed_at',
'request_target_time_at',
'created_at',
'updated_at',
],
]) ?>
</div>

View File

@@ -56,8 +56,12 @@ use yii\helpers\ArrayHelper;
<?= $form->field($model, 'status')->checkbox( ['value' => 10, 'label' => Yii::t('common/ticket_type', "Active") ]) ?>
<?= $form->field($model, 'flag_student')->checkbox( ['value' => 1, 'label' => Yii::t('common/ticket_type', "Student") ]) ?>
<?= mkTitle("Csoportos beszedés")?>
<?= $form->field($model, 'installment_enabled')->checkbox( ['value' => 1, 'label' => Yii::t('common/ticket_type', "Csoportos beszedéses a bruttó áron felül") ]) ?>
<p>A részletek havonta kerülnek beszedésre</p>
<?= $form->field($model, 'installment_money')->textInput() ?>
<?= $form->field($model, 'installment_count')->textInput() ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? Yii::t('common/ticket_type', 'Create') : Yii::t('common/ticket_type', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>

View File

@@ -52,6 +52,12 @@ $this->params['breadcrumbs'][] = $this->title;
],
'created_at:datetime',
'updated_at:datetime',
[
'attribute' => 'installment_enabled',
'value' => ( $model->isInstallment() ? Yii::t('common', 'Yes' ) : Yii::t('common', 'No' ) ),
],
'installment_money',
'installment_count',
],
]) ?>

View File

@@ -54,6 +54,9 @@ $userOptions = ['' => 'Mind'] + ArrayHelper::map($model->users, 'id', 'userna
]
]) ?>
</div>
<div class='col-md-4'>
<?= $form->field($model, 'id_ticket')->textInput() ?>
</div>
</div>
<div class='row'>
<div class='col-md-4'>

View File

@@ -77,6 +77,11 @@ $this->params['breadcrumbs'][] = $this->title;
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
[
'attribute' => 'id_ticket',
'value' => 'id_ticket',
'label' => 'B. Azonosító'
],
[
'attribute' => 'id_customer',
'value' => 'customerName'

View File

@@ -0,0 +1,27 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model common\models\Ugiro */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="ugiro-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'id_user')->textInput() ?>
<?= $form->field($model, 'created_at')->textInput() ?>
<?= $form->field($model, 'updated_at')->textInput() ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? Yii::t('common/ugiro', 'Create') : Yii::t('common/ugiro', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@@ -0,0 +1,33 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model backend\models\UgiroSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="ugiro-search">
<?php $form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
]); ?>
<?= $form->field($model, 'id_ugiro') ?>
<?= $form->field($model, 'id_user') ?>
<?= $form->field($model, 'created_at') ?>
<?= $form->field($model, 'updated_at') ?>
<div class="form-group">
<?= Html::submitButton(Yii::t('common/ugiro', 'Search'), ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton(Yii::t('common/ugiro', 'Reset'), ['class' => 'btn btn-default']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@@ -0,0 +1,21 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\models\Ugiro */
$this->title = Yii::t('common/ugiro', 'Create Ugiro');
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/ugiro', 'Ugiros'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="ugiro-create">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>

View File

@@ -0,0 +1,46 @@
<?php
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\UgiroSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('common/ugiro', 'Kötegek');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="ugiro-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
[
'attribute' => 'id_ugiro',
'label' => 'Köteg azonosító'
],
[
'attribute' => 'user.username',
'label' => 'Felhasnáló'
],
[
'attribute' => 'statusName',
'label' => 'Státusz'
],
[
'attribute' => 'created_at',
'label' => 'Létrehozva',
'format' =>'datetime'
],
['class' => 'yii\grid\ActionColumn',
'template' => '{view}'
],
],
]); ?>
</div>

View File

@@ -0,0 +1,23 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\models\Ugiro */
$this->title = Yii::t('common/ugiro', 'Update {modelClass}: ', [
'modelClass' => 'Ugiro',
]) . ' ' . $model->id_ugiro;
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/ugiro', 'Ugiros'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->id_ugiro, 'url' => ['view', 'id' => $model->id_ugiro]];
$this->params['breadcrumbs'][] = Yii::t('common/ugiro', 'Update');
?>
<div class="ugiro-update">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>

View File

@@ -0,0 +1,58 @@
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
use yii\helpers\Url;
use common\models\Ugiro;
/* @var $this yii\web\View */
/* @var $model common\models\Ugiro */
$this->title = "Köteg részletei";
$this->params['breadcrumbs'][] = ['label' => "Kötegek", 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="ugiro-view">
<h1><?= Html::encode($this->title) ?></h1>
<?php
$attributes = [
[
'attribute' => 'id_ugiro',
'label' => 'Köteg azonosító'
],
[
'attribute' => 'user.username',
'label' => 'Felhasználó'
],
[
'attribute' => 'statusName',
'label' => 'Státusz'
],
[
'attribute' => 'created_at',
'label' => 'Létrehozva',
'format' =>'datetime'
],
[
'attribute' => 'path',
'label' => 'Köteg Fájl',
'value' => Html::a( "Letöltés" , Url::base() ."/". $model->path , ['target' =>'_blank' ,'download' =>'CS-BESZED.' .$model->id_ugiro ] ),
'format' => 'raw'
],
];
if ( $model->status == Ugiro::$STATUS_FINISHED){
}
?>
<?= DetailView::widget([
'model' => $model,
'attributes' => $attributes,
]) ?>
</div>

View File

@@ -0,0 +1,3 @@
01BESZED1A25366936T2442016012000105860025215371128 00000000BEEmovar
02000001201601250000007800 1 roland Berlet :614
030000010000000000007800

View File

@@ -0,0 +1,3 @@
01BESZED1A25366936T2442016012000115860025215371128 00000000BEEmovar
020000012016012500000078005860025215371128 1 roland Berlet :614
030000010000000000007800

View File

@@ -0,0 +1,4 @@
01BESZED1A25366936T2442016012000125860025215371128 00000000BEEmovar
020000012016012500000078005860025215371128 1 roland Berlet :614
020000022016012500000078005860025215371128 1 roland Berlet :614
030000020000000000015600

View File

@@ -0,0 +1,4 @@
01BESZED1A25366936T2442016012000145860025215371128 00000000BEEmovar
020000012016012500000078005860025215371128 1 roland  rv¡ztûr t<>k”rfûr¢gBerlet :614
020000022016012500000078005860025215371128 1 roland  rv¡ztûr t<>k”rfûr¢gBerlet :614
030000020000000000015600

View File

@@ -0,0 +1,4 @@
01BESZED1A25366936T2442016012000155860025215371128 00000000BEEmovar
020000012016012500000078005860025215371128 1 roland  rv¡ztûr t<>k”rfûr¢ Berlet :614
020000022016012500000078005860025215371128 1 roland  rv¡ztûr t<>k”rfûr¢ Berlet :614
030000020000000000015600

View File

@@ -0,0 +1,4 @@
01BESZED1A25366936T2442016012000165860025215371128 00000000BEEmovar
020000012016012500000078005860025215371128 1 roland arvizturo tukorfurogBerlet :614
020000022016012500000078005860025215371128 1 roland arvizturo tukorfurogBerlet :614
030000020000000000015600

View File

@@ -0,0 +1,4 @@
01BESZED1A25366936T2442016012000175860025215371128 00000000BEEmovar
020000012016012500000078005860025215371128 1 roland arvizturo tukorfurogBerlet :614
020000022016012500000078005860025215371128 1 roland arvizturo tukorfurogBerlet :614
030000020000000000015600

View File

@@ -0,0 +1,4 @@
01BESZED1A25366936T2442016012000185860025215371128 00000000BEEmovar
020000012016012500000078005860025215371128 1 roland arvizturo tukor Berlet :614
020000022016012500000078005860025215371128 1 roland arvizturo tukor Berlet :614
030000020000000000015600

View File

@@ -0,0 +1,4 @@
01BESZED1A25366936T2442016012000195860025215371128 00000000BEEmovar
020000012016012500000078005860025215371128 1 roland arvizturo tukor Berlet :614
020000022016012500000078005860025215371128 1 roland arvizturo tukor Berlet :614
030000020000000000015600

View File

@@ -0,0 +1,4 @@
01BESZED1A25366936T2442016012000205860025215371128 00000000BEEmovar
020000012016012500000078005860025215371128 1 roland Berlet :614
020000022016012500000078005860025215371128 1 roland a Berlet :614
030000020000000000015600

View File

@@ -0,0 +1,4 @@
01BESZED1A25366936T2442016012000215860025215371128 00000000BEEmovar
020000012016012500000078005860025215371128 1 roland arvizturo tukorfurogBerlet :614
020000022016012500000078005860025215371128 1 roland arvizturo tukorfurogBerlet :614
030000020000000000015600

View File

@@ -0,0 +1,4 @@
01BESZED1A25366936T2442016012000225860025215371128 00000000BEEmovar
020000012016012500000078005860025215371128 1 roland arvizturo tukorfurogBerlet :614
020000022016012500000078005860025215371128 1 roland arvizturo tukorfurogBerlet :614
030000020000000000015600

View File

@@ -0,0 +1,4 @@
01BESZED1A25366936T2442016012000235860025215371128 00000000BEEmovar
020000012016012500000078005860025215371128 1 roland arvizturo tukorfurogBerlet :614
020000022016012500000078005860025215371128 1 roland arvizturo tukorfurogBerlet :614
030000020000000000015600

View File

@@ -0,0 +1,4 @@
01BESZED1A25366936T2442016012000265860025215371128 00000000BEEmovar
020000012016012500000078005860025215371128 1 roland arvizturo tukorfurogep Berlet :614
020000022016012500000078005860025215371128 1 roland arvizturo tukorfurogep Berlet :614
030000020000000000015600

View File

@@ -0,0 +1,4 @@
01BESZED1A25366936T2442016012000275860025215371128 00000000BEEmovar
020000012016012500000078005860025215371128 1 roland arvizturo tukorfurogep Berlet :614
020000022016012500000078005860025215371128 1 roland arvizturo tukorfurogep Berlet :614
030000020000000000015600

View File

@@ -0,0 +1,3 @@
01BESZED1A25366936T2442016012000285860025215371128 00000000BEEmovar
020000012016012500000078005860025215371128 1 roland arvizturo tukorfurogep Berlet :614
030000010000000000007800

View File

@@ -0,0 +1,3 @@
01BESZED1A25366936T2442016012000295860025215371128 00000000BEEmovar
020000012016012500000078005860025215371128 1 roland arvizturo tukorfurogep Berlet :614
030000010000000000007800

View File

@@ -0,0 +1,13 @@
01BESZED1A25366936T2442016012000305860025215371128 00000000BEEmovar
020000012016012500000078005860025215371128 1 roland arvizturo tukorfurogep Berlet :614
020000022016012500000078005860025215371128 1 roland arvizturo tukorfurogep Berlet :614
020000032016012500000078005860025215371128 1 roland arvizturo tukorfurogep Berlet :614
020000042016012500000078005860025215371128 1 roland arvizturo tukorfurogep Berlet :614
020000052016012500000078005860025215371128 1 roland arvizturo tukorfurogep Berlet :614
020000062016012500000078005860025215371128 1 roland arvizturo tukorfurogep Berlet :614
020000072016012500000078005860025215371128 1 roland arvizturo tukorfurogep Berlet :614
020000082016012500000078005860025215371128 1 roland arvizturo tukorfurogep Berlet :614
020000092016012500000078005860025215371128 1 roland arvizturo tukorfurogep Berlet :614
020000102016012500000078005860025215371128 1 roland arvizturo tukorfurogep Berlet :614
020000112016012500000078005860025215371128 1 roland arvizturo tukorfurogep Berlet :614
030000110000000000085800

View File

@@ -0,0 +1,3 @@
01BESZED1A25366936T2442016012000095860025215371128 00000000BEEmovar
02000001201601250000007800 1 roland Berlet :614
030000010000000000007800

View File

@@ -0,0 +1,8 @@
$(document).ready(function() {
$("#select-all-pending").click(function() {
var checkBoxes = $(".pending-request");
checkBoxes.prop("checked", $("#select-all-pending").prop("checked"));
});
});