Finish contract_rejected_put_to_cart
This commit is contained in:
commit
167d614927
@ -108,7 +108,7 @@ class AdminMenuStructure{
|
||||
// $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'] ];
|
||||
$items[] = ['label' => 'Későbbi utalások', 'url' => ['/transfer/payment-later','TransferLaterSearch[start]' =>$todayDatetime,'TransferLaterSearch[end]' => $tomorrowDatetime ] ];
|
||||
$items[] = ['label' => 'Későbbi utalások', 'url' => ['/transfer/payment-later','TransferLaterSearch[start]' =>$todayDatetime,'TransferLaterSearch[end]' => $tomorrowDatetime ,'TransferLaterSearch[enterStart]' =>$todayDatetime,'TransferLaterSearch[enterEnd]' => $tomorrowDatetime ] ];
|
||||
//$items[] = ['label' => 'Zárások', 'url' => ['/collection/index' , 'CollectionSearch[start]' =>$todayDatetime,'CollectionSearch[end]' => $tomorrowDatetime ] ];
|
||||
$this->menuItems[] = ['label' => 'Pénzügy', 'url' => $this->emptyUrl,
|
||||
'items' => $items
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
<?php
|
||||
namespace backend\controllers;
|
||||
|
||||
use common\models\DoorLog;
|
||||
use Yii;
|
||||
use common\models\Transfer;
|
||||
use backend\models\TransferSearch;
|
||||
use yii\db\Expression;
|
||||
use yii\db\Query;
|
||||
use yii\web\Controller;
|
||||
use yii\web\NotFoundHttpException;
|
||||
use yii\filters\VerbFilter;
|
||||
@ -81,7 +84,9 @@ class TransferController extends \backend\controllers\BackendController
|
||||
|
||||
|
||||
if ( $searchModel->output =='pdf'){
|
||||
$this->downloadPaymentLater($dataProvider);
|
||||
$this->downloadPaymentLaterPDF($dataProvider);
|
||||
}else if ( $searchModel->output =='xls'){
|
||||
$this->downloadPaymentLaterXLS($searchModel, $dataProvider);
|
||||
}
|
||||
|
||||
$accounts = Account::read();
|
||||
@ -97,7 +102,151 @@ class TransferController extends \backend\controllers\BackendController
|
||||
]);
|
||||
}
|
||||
|
||||
protected function downloadPaymentLater($dataProvider) {
|
||||
|
||||
protected function getEnterCount($start,$end,$idCustomer){
|
||||
|
||||
|
||||
|
||||
$query = new Query();
|
||||
|
||||
$query->select([
|
||||
'card.number as card_number',
|
||||
'card.id_card as card_id_card',
|
||||
'count(*) as enter',
|
||||
new Expression('EXTRACT( YEAR_MONTH FROM door_log.created_at) as ym'),
|
||||
new Expression('EXTRACT( YEAR FROM door_log.created_at ) as year'),
|
||||
new Expression('EXTRACT( MONTH FROM door_log.created_at ) as month ')
|
||||
|
||||
]);
|
||||
|
||||
$query->from('door_log');
|
||||
$query->innerJoin('card','card.id_card = door_log.id_card');
|
||||
$query->andWhere(['in','door_log.direction',[3,7]]);
|
||||
$query->groupBy([
|
||||
'card.number',
|
||||
'card.id_card',
|
||||
'ym',
|
||||
'year',
|
||||
'month'
|
||||
]);
|
||||
|
||||
$query->andWhere(['door_log.id_customer' => $idCustomer]);
|
||||
|
||||
|
||||
$query->andWhere([ '>=','door_log.created_at',$start]);
|
||||
$query->andWhere([ '<','door_log.created_at',$end]);
|
||||
|
||||
$customerStatistic = $query->one();
|
||||
|
||||
$moveInCount = $customerStatistic['enter'];
|
||||
|
||||
return $moveInCount;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @param \backend\models\TransferLaterSearch $searchModel
|
||||
* @param \yii\data\ActiveDataProvider $dataProvider
|
||||
*/
|
||||
protected function downloadPaymentLaterXLS( $searchModel, $dataProvider) {
|
||||
|
||||
$fn = "kesobbi_utalasok.xls";
|
||||
|
||||
$objPHPExcel = new \PHPExcel ();
|
||||
$sheet = $objPHPExcel->setActiveSheetIndex ( 0 );
|
||||
$formatter = \Yii::$app->formatter;
|
||||
|
||||
|
||||
|
||||
$row = 1;
|
||||
$sheet->setCellValue('A'.$row, 'Csoportos beszedés');
|
||||
|
||||
$row++;
|
||||
$sheet->setCellValue('A'.$row, 'Időszak kezdete');
|
||||
$sheet->setCellValue('B'.$row, $searchModel->start);
|
||||
$sheet->setCellValue('C'.$row, 'Időszak vége');
|
||||
$sheet->setCellValue('D'.$row, $searchModel->end);
|
||||
$row++;
|
||||
$sheet->setCellValue('A'.$row, 'Belépési Időszak kezdete');
|
||||
$sheet->setCellValue('B'.$row, $searchModel->enterStart);
|
||||
$sheet->setCellValue('C'.$row, 'Belépési Időszak vége');
|
||||
$sheet->setCellValue('D'.$row, $searchModel->enterEnd);
|
||||
$row++;
|
||||
$sheet->setCellValue('A'.$row, 'Bérlettípus');
|
||||
$sheet->setCellValue('B'.$row, $searchModel->id_ticket_type);
|
||||
$sheet->setCellValue('C'.$row, 'Felhasználó');
|
||||
$sheet->setCellValue('D'.$row, $searchModel->id_user);
|
||||
|
||||
$row++;
|
||||
$sheet->setCellValue('A'.$row, 'Kártyaszám')
|
||||
->setCellValue('B'.$row, 'Vendég')
|
||||
->setCellValue('C'.$row, 'Kiadva')
|
||||
->setCellValue('D'.$row, 'Bérlet típus')
|
||||
->setCellValue('E'.$row, 'Összeg')
|
||||
->setCellValue('F'.$row, 'Megjegyzés')
|
||||
->setCellValue('G'.$row, 'Belépések az időszakban');
|
||||
;
|
||||
|
||||
foreach ( $dataProvider->getModels() as $model ) {
|
||||
$row ++;
|
||||
|
||||
$sheet
|
||||
->setCellValue('A'.$row, $model['card_number'])
|
||||
->setCellValue('B'.$row, $model['customer_name'])
|
||||
->setCellValue('C'.$row, $model['transfer_created_at'])
|
||||
->setCellValue('D'.$row, ($model['ticket_type_name']))
|
||||
->setCellValue('E'.$row, $model['transfer_money'])
|
||||
->setCellValue('F'.$row, $model['ticket_comment'])
|
||||
->setCellValue('G'.$row, $model['enter'])
|
||||
// ->setCellValue('F'.$row, $processedTime)
|
||||
// ->setCellValue('G'.$row, $status)
|
||||
;
|
||||
}
|
||||
|
||||
$styleArray = array (
|
||||
'font' => array (
|
||||
'bold' => true
|
||||
)
|
||||
);
|
||||
|
||||
$sheet->getStyle ( 'A1' )->applyFromArray ( $styleArray );
|
||||
|
||||
foreach ( range ( 'A', 'G' ) as $columnID ) {
|
||||
$sheet->getColumnDimension ( $columnID )->setAutoSize ( true );
|
||||
$sheet->getStyle ( $columnID . '5' )->applyFromArray ( $styleArray );
|
||||
}
|
||||
|
||||
foreach ( ['A','C'] as $columnID ) {
|
||||
$sheet->getColumnDimension ( $columnID )->setAutoSize ( true );
|
||||
$sheet->getStyle ( $columnID . '2' )->applyFromArray ( $styleArray );
|
||||
$sheet->getStyle ( $columnID . '3' )->applyFromArray ( $styleArray );
|
||||
$sheet->getStyle ( $columnID . '4' )->applyFromArray ( $styleArray );
|
||||
}
|
||||
|
||||
|
||||
$fileName = $fn;
|
||||
|
||||
// Redirect output to a client’s web browser (Excel5)
|
||||
header ( 'Content-Type: application/vnd.ms-excel' );
|
||||
header ( 'Content-Disposition: attachment;filename="' . $fileName . '"' );
|
||||
header ( 'Cache-Control: max-age=0' );
|
||||
// If you're serving to IE 9, then the following may be needed
|
||||
header ( 'Cache-Control: max-age=1' );
|
||||
// If you're serving to IE over SSL, then the following may be needed
|
||||
header ( 'Expires: Mon, 26 Jul 1997 05:00:00 GMT' ); // Date in the past
|
||||
header ( 'Last-Modified: ' . gmdate ( 'D, d M Y H:i:s' ) . ' GMT' ); // always modified
|
||||
header ( 'Cache-Control: cache, must-revalidate' ); // HTTP/1.1
|
||||
header ( 'Pragma: public' ); // HTTP/1.0
|
||||
$objWriter = \PHPExcel_IOFactory::createWriter ( $objPHPExcel, 'Excel5' );
|
||||
$objWriter->save ( 'php://output' );
|
||||
|
||||
|
||||
exit ();
|
||||
|
||||
}
|
||||
|
||||
protected function downloadPaymentLaterPDF($dataProvider) {
|
||||
|
||||
// $mpdf = new \mPDF ( 'utf-8', 'A4' );
|
||||
$mpdf = new \mPDF ( 'utf-8', 'A4-L' );
|
||||
@ -242,6 +391,7 @@ class TransferController extends \backend\controllers\BackendController
|
||||
->setCellValue('N'.$row, $model['transfer_paid_at'])
|
||||
->setCellValue('O'.$row, $model['ticket_start'])
|
||||
->setCellValue('P'.$row, $model['ticket_end'])
|
||||
->setCellValue('Q'.$row, $model['all_comment'])
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
namespace backend\controllers;
|
||||
|
||||
use common\models\TicketInstallmentRequest;
|
||||
use Yii;
|
||||
use common\models\Ugiro;
|
||||
use backend\models\UgiroSearch;
|
||||
@ -108,7 +109,9 @@ class UgiroController extends Controller {
|
||||
$output = $_GET ['output'];
|
||||
|
||||
if ($output == 'pdf') {
|
||||
$this->downloadUgiro ( $model );
|
||||
$this->downloadUgiroPdf ( $model );
|
||||
}else if ($output == 'xls') {
|
||||
$this->downloadUgiroXls ( $model );
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -128,9 +131,157 @@ class UgiroController extends Controller {
|
||||
'detstaDp' => $detstaDp
|
||||
] );
|
||||
}
|
||||
protected function downloadUgiro($model) {
|
||||
|
||||
// $mpdf = new \mPDF ( 'utf-8', 'A4' );
|
||||
/**
|
||||
* @param \common\models\Ugiro $model
|
||||
*/
|
||||
protected function downloadUgiroXls($model) {
|
||||
|
||||
$fn = "köteg.". $model->id_ugiro . ".xls";
|
||||
|
||||
$query = new Query();
|
||||
$query->select([
|
||||
'card.number as card_number',
|
||||
'customer.id_customer as customer_id_customer',
|
||||
'customer.name as customer_name',
|
||||
'customer.bank_account as customer_bank_account',
|
||||
'ticket_installment_request.money as request_money',
|
||||
'ticket_installment_request.status as request_status',
|
||||
'ticket_installment_request.request_target_time_at as request_request_target_time_at',
|
||||
'ticket_installment_request.request_processed_at as request_request_processed_at',
|
||||
]);
|
||||
$query->from('ticket_installment_request');
|
||||
$query->innerJoin('ugiro_request_assignment','ticket_installment_request.id_ticket_installment_request = ugiro_request_assignment.id_request');
|
||||
$query->innerJoin('customer','customer.id_customer = ticket_installment_request.id_customer');
|
||||
$query->innerJoin('card','customer.id_customer_card = card.id_card');
|
||||
$query->andWhere(['ugiro_request_assignment.id_ugiro' => $model->id_ugiro]);
|
||||
$query->orderBy(['customer.name' => SORT_ASC]);
|
||||
|
||||
$dataProvider = new ActiveDataProvider(
|
||||
[
|
||||
'query' => $query,
|
||||
'sort' => false,
|
||||
'pagination' => false
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
|
||||
$objPHPExcel = new \PHPExcel ();
|
||||
$sheet = $objPHPExcel->setActiveSheetIndex ( 0 );
|
||||
$formatter = \Yii::$app->formatter;
|
||||
|
||||
|
||||
$row = 1;
|
||||
|
||||
$sheet->setCellValue('A'.$row, 'Csoportos beszedés');
|
||||
|
||||
$row++;
|
||||
$sheet->setCellValue('A'.$row, 'Köteg azonosító');
|
||||
$sheet->setCellValue('B'.$row, $model->id_ugiro);
|
||||
$sheet->setCellValue('C'.$row, 'Üzenetsorszám');
|
||||
$sheet->setCellValue('D'.$row, $model->number);
|
||||
$row++;
|
||||
$sheet->setCellValue('A'.$row, 'Összeállítási dáutm');
|
||||
$sheet->setCellValue('B'.$row, $model->datum);
|
||||
$sheet->setCellValue('C'.$row, 'Terhelési dáutm');
|
||||
$sheet->setCellValue('D'.$row, $model->terhelesi_datum);
|
||||
|
||||
$row++;
|
||||
$sheet->setCellValue('A'.$row, 'Kártyaszám')
|
||||
->setCellValue('B'.$row, 'Vendég')
|
||||
->setCellValue('C'.$row, 'Bankszámlaszám')
|
||||
->setCellValue('D'.$row, 'Összeg')
|
||||
->setCellValue('E'.$row, 'Esedékességi dátum')
|
||||
->setCellValue('F'.$row, 'Feldolgozás dátum')
|
||||
->setCellValue('G'.$row, 'Státusz')
|
||||
;
|
||||
|
||||
|
||||
foreach ( $dataProvider->getModels() as $model ) {
|
||||
$row ++;
|
||||
$status = "";
|
||||
switch ($model['request_status']){
|
||||
case TicketInstallmentRequest::$STATUS_ACCEPTED:
|
||||
$status = "Fizetve";
|
||||
break;
|
||||
case TicketInstallmentRequest::$STATUS_REJECTED:
|
||||
$status = "Kosár";
|
||||
break;
|
||||
case TicketInstallmentRequest::$STATUS_ACCEPTED_MANUAL:
|
||||
$status = "Kosár";
|
||||
break;
|
||||
case TicketInstallmentRequest::$STATUS_CANCELED:
|
||||
$status = "Sztornó";
|
||||
break;
|
||||
case TicketInstallmentRequest::$STATUS_MARKED_TO_SEND:
|
||||
$status = "Küldésre jelölve";
|
||||
break;
|
||||
case TicketInstallmentRequest::$STATUS_PENDING:
|
||||
$status = "Feldolgozás alatt";
|
||||
break;
|
||||
case TicketInstallmentRequest::$STATUS_SENT:
|
||||
$status = "Elküldve";
|
||||
break;
|
||||
default:
|
||||
$status = "";
|
||||
}
|
||||
|
||||
$targetTime = isset( $model['request_request_target_time_at'] ) ? $formatter->asDate($model['request_request_target_time_at']) :"";
|
||||
$processedTime = isset( $model['request_request_processed_at'] ) ? $formatter->asDatetime($model['request_request_processed_at']) :"";
|
||||
$sheet
|
||||
->setCellValue('A'.$row, $model['card_number'])
|
||||
->setCellValue('B'.$row, $model['customer_name'])
|
||||
->setCellValue('C'.$row, $model['customer_bank_account'])
|
||||
->setCellValue('D'.$row, ($model['request_money']))
|
||||
->setCellValue('E'.$row, $targetTime)
|
||||
->setCellValue('F'.$row, $processedTime)
|
||||
->setCellValue('G'.$row, $status)
|
||||
;
|
||||
}
|
||||
|
||||
$styleArray = array (
|
||||
'font' => array (
|
||||
'bold' => true
|
||||
)
|
||||
);
|
||||
|
||||
$sheet->getStyle ( 'A1' )->applyFromArray ( $styleArray );
|
||||
|
||||
foreach ( range ( 'A', 'G' ) as $columnID ) {
|
||||
$sheet->getColumnDimension ( $columnID )->setAutoSize ( true );
|
||||
$sheet->getStyle ( $columnID . '4' )->applyFromArray ( $styleArray );
|
||||
}
|
||||
|
||||
foreach ( ['A','C'] as $columnID ) {
|
||||
$sheet->getColumnDimension ( $columnID )->setAutoSize ( true );
|
||||
$sheet->getStyle ( $columnID . '2' )->applyFromArray ( $styleArray );
|
||||
$sheet->getStyle ( $columnID . '3' )->applyFromArray ( $styleArray );
|
||||
}
|
||||
|
||||
|
||||
$fileName = $fn;
|
||||
|
||||
// Redirect output to a client’s web browser (Excel5)
|
||||
header ( 'Content-Type: application/vnd.ms-excel' );
|
||||
header ( 'Content-Disposition: attachment;filename="' . $fileName . '"' );
|
||||
header ( 'Cache-Control: max-age=0' );
|
||||
// If you're serving to IE 9, then the following may be needed
|
||||
header ( 'Cache-Control: max-age=1' );
|
||||
// If you're serving to IE over SSL, then the following may be needed
|
||||
header ( 'Expires: Mon, 26 Jul 1997 05:00:00 GMT' ); // Date in the past
|
||||
header ( 'Last-Modified: ' . gmdate ( 'D, d M Y H:i:s' ) . ' GMT' ); // always modified
|
||||
header ( 'Cache-Control: cache, must-revalidate' ); // HTTP/1.1
|
||||
header ( 'Pragma: public' ); // HTTP/1.0
|
||||
$objWriter = \PHPExcel_IOFactory::createWriter ( $objPHPExcel, 'Excel5' );
|
||||
$objWriter->save ( 'php://output' );
|
||||
|
||||
|
||||
exit ();
|
||||
|
||||
}
|
||||
protected function downloadUgiroPdf($model) {
|
||||
|
||||
$mpdf = new \mPDF ( 'utf-8', 'A4-L' );
|
||||
$fn = "köteg.". $model->id_ugiro . ".pdf";
|
||||
|
||||
|
||||
@ -94,9 +94,11 @@ class TicketInstallmentRequestSearch extends TicketInstallmentRequest
|
||||
'ticket.end as ticket_end',//ticket_send
|
||||
'ticket.id_ticket as ticket_id_ticket',//id_ticket
|
||||
'ugiro_request_assignment.id_ugiro as ugiro_id_ugiro' ,//köteg azonosító
|
||||
'card.number as card_number'
|
||||
]);
|
||||
$query->from("ticket_installment_request");
|
||||
$query->innerJoin("customer","customer.id_customer = ticket_installment_request.id_customer");
|
||||
$query->leftJoin("card","card.id_card = customer.id_customer_card");
|
||||
$query->leftJoin("ticket","ticket.id_ticket = ticket_installment_request.id_ticket");
|
||||
$query->leftJoin("ticket_type","ticket.id_ticket_type = ticket_type.id_ticket_type");
|
||||
$query->leftJoin("ugiro_request_assignment","ticket_installment_request.id_ticket_installment_request = ugiro_request_assignment.id_request");
|
||||
|
||||
@ -10,9 +10,7 @@ use yii\db\Expression;
|
||||
use yii\base\Object;
|
||||
use yii\db\Query;
|
||||
use yii\helpers\ArrayHelper;
|
||||
use common\models\Account;
|
||||
use common\components\Helper;
|
||||
use common\components\RoleDefinition;
|
||||
|
||||
/**
|
||||
* TransferSearch represents the model behind the search form about `common\models\Transfer`.
|
||||
@ -25,6 +23,12 @@ class TransferLaterSearch extends Transfer
|
||||
public $timestampStart;
|
||||
public $timestampEnd;
|
||||
|
||||
public $enterStart;
|
||||
public $enterEnd;
|
||||
|
||||
public $timestampEnterStart;
|
||||
public $timestampEnterEnd;
|
||||
|
||||
public $id_ticket_type;
|
||||
|
||||
|
||||
@ -45,6 +49,8 @@ class TransferLaterSearch extends Transfer
|
||||
[[ 'id_ticket_type','id_user'], 'integer'],
|
||||
[[ 'start', ], 'date', 'format' =>Yii::$app->formatter->datetimeFormat , 'timestampAttribute' => 'timestampStart' ,'timestampAttributeFormat' => 'yyyy-MM-dd HH:mm' ,'timeZone' => 'UTC' ],
|
||||
[[ 'end' , ], 'date' ,'format' =>Yii::$app->formatter->datetimeFormat , 'timestampAttribute' => 'timestampEnd' ,'timestampAttributeFormat' => 'yyyy-MM-dd HH:mm' ,'timeZone' => 'UTC' ],
|
||||
[[ 'enterStart', ], 'date', 'format' =>Yii::$app->formatter->datetimeFormat , 'timestampAttribute' => 'timestampEnterStart' ,'timestampAttributeFormat' => 'yyyy-MM-dd HH:mm' ,'timeZone' => 'UTC' ],
|
||||
[[ 'enterEnd' , ], 'date' ,'format' =>Yii::$app->formatter->datetimeFormat , 'timestampAttribute' => 'timestampEnterEnd' ,'timestampAttributeFormat' => 'yyyy-MM-dd HH:mm' ,'timeZone' => 'UTC' ],
|
||||
['selected', 'each', 'rule' => ['integer']],
|
||||
];
|
||||
}
|
||||
@ -58,7 +64,7 @@ class TransferLaterSearch extends Transfer
|
||||
return Model::scenarios();
|
||||
}
|
||||
|
||||
/**
|
||||
/**1
|
||||
* Creates data provider instance with search query applied
|
||||
*
|
||||
* @param array $params
|
||||
@ -68,6 +74,9 @@ class TransferLaterSearch extends Transfer
|
||||
public function search($params)
|
||||
{
|
||||
$query = new Query();
|
||||
$this->load($params);
|
||||
|
||||
$valid = $this->validate();
|
||||
|
||||
$query->select([
|
||||
'transfer.id_transfer as transfer_id_transfer',
|
||||
@ -83,26 +92,49 @@ class TransferLaterSearch extends Transfer
|
||||
'ticket.start as ticket_start',
|
||||
'ticket.end as ticket_end',
|
||||
'ticket.comment as ticket_comment',
|
||||
'card.number as card_number',
|
||||
new Expression('count(door_log.id_door_log) as enter'),
|
||||
]);
|
||||
$query->from("transfer");
|
||||
$query->innerJoin('user', " user.id = transfer.id_user");
|
||||
$query->leftJoin('customer', " transfer.id_customer = customer.id_customer");
|
||||
$query->leftJoin('card', " customer.id_customer_card = card.id_card");
|
||||
$query->leftJoin('ticket', " transfer.type = ".Transfer::TYPE_TICKET." and transfer.id_object = ticket.id_ticket");
|
||||
$query->leftJoin('ticket_type', " ticket.id_ticket_type = ticket_type.id_ticket_type");
|
||||
$query->leftJoin('sale', " transfer.type = ".Transfer::TYPE_PRODUCT." and transfer.id_object = sale.id_sale");
|
||||
$query->leftJoin('product', " product.id_product = sale.id_product");
|
||||
$query->leftJoin('door_log',
|
||||
"door_log.id_customer = transfer.id_customer and door_log.direction in (3,7)
|
||||
and door_log.created_at >= :start and door_log.created_at < :end ",
|
||||
[':start' => $this->timestampEnterStart,
|
||||
':end' => $this->timestampEnterEnd]);
|
||||
$query->groupBy(
|
||||
[
|
||||
'transfer.id_transfer',
|
||||
'transfer.created_at',
|
||||
'transfer.money',
|
||||
'transfer.status',
|
||||
'user.username',
|
||||
'customer.id_customer',
|
||||
'customer.name',
|
||||
'customer.description',
|
||||
'ticket_type.name',
|
||||
'product.name',
|
||||
'ticket.start',
|
||||
'ticket.end',
|
||||
'ticket.comment',
|
||||
'card.number'
|
||||
]
|
||||
);
|
||||
|
||||
$query->andWhere(["transfer.payment_method" => Transfer::PAYMENT_METHOD_TRANSFER_LATER ]);
|
||||
|
||||
$query->andWhere(['transfer.status' => Transfer::STATUS_NOT_PAID]);
|
||||
|
||||
$this->load($params);
|
||||
|
||||
$valid = $this->validate();
|
||||
|
||||
$dataProvider = new ActiveDataProvider([
|
||||
'query' => $query,
|
||||
'pagination' => $this->output == 'pdf' ? false : [],
|
||||
'pagination' => ( $this->output == 'pdf' || $this->output == 'xls' ) ? false : [],
|
||||
'sort' => [
|
||||
'defaultOrder' =>[
|
||||
'transfer_created_at' => SORT_DESC
|
||||
@ -119,6 +151,8 @@ class TransferLaterSearch extends Transfer
|
||||
['ticket_end'],
|
||||
['ticket_comment'],
|
||||
['customer_description'],
|
||||
['enter'],
|
||||
['card_number']
|
||||
])
|
||||
|
||||
]
|
||||
@ -151,6 +185,40 @@ class TransferLaterSearch extends Transfer
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* TODO: DASAP
|
||||
* @param $start
|
||||
* @param $end
|
||||
* @param $idCustomer
|
||||
*/
|
||||
protected function getEnterCount($start,$end,$idCustomer){
|
||||
$query = new Query();
|
||||
$query->select([
|
||||
'card.number as card_number',
|
||||
'card.id_card as card_id_card',
|
||||
'count(*) as enter',
|
||||
new Expression('EXTRACT( YEAR_MONTH FROM door_log.created_at) as ym'),
|
||||
new Expression('EXTRACT( YEAR FROM door_log.created_at ) as year'),
|
||||
new Expression('EXTRACT( MONTH FROM door_log.created_at ) as month ')
|
||||
|
||||
]);
|
||||
$query->from('door_log');
|
||||
$query->innerJoin('card','card.id_card = door_log.id_card');
|
||||
$query->andWhere(['in','door_log.direction',[3,7]]);
|
||||
$query->groupBy([
|
||||
'card.number',
|
||||
'card.id_card',
|
||||
'ym',
|
||||
'year',
|
||||
'month'
|
||||
]);
|
||||
$query->andWhere(['door_log.id_customer' => $idCustomer]);
|
||||
$query->andWhere([ '>=','door_log.created_at',$start]);
|
||||
$query->andWhere([ '<','door_log.created_at',$end]);
|
||||
$query->all();
|
||||
}
|
||||
|
||||
|
||||
public function totalsTransfers( ){
|
||||
|
||||
|
||||
|
||||
@ -128,7 +128,11 @@ class TransferSearch extends Transfer
|
||||
'transfer.created_at as transfer_created_at',
|
||||
'transfer.paid_at as transfer_paid_at',
|
||||
'ticket.start as ticket_start',
|
||||
'ticket.end as ticket_end'
|
||||
'ticket.end as ticket_end',
|
||||
new Expression('case
|
||||
when transfer.type = ' . Transfer::TYPE_TICKET . ' then ticket.comment
|
||||
when transfer.type = ' . Transfer::TYPE_PRODUCT . ' then sale.comment
|
||||
when transfer.type = ' . Transfer::TYPE_MONEY_MOVEMENT_OUT . ' then money_movement.comment end as all_comment'),
|
||||
]);
|
||||
}else if ( $mode == 'total'){
|
||||
$query->select([
|
||||
@ -236,6 +240,7 @@ class TransferSearch extends Transfer
|
||||
['transfer_paid_at'],
|
||||
['ticket_start'],
|
||||
['ticket_end'],
|
||||
['all_comment'],
|
||||
])
|
||||
]
|
||||
];
|
||||
|
||||
@ -159,6 +159,10 @@ echo Html::a("Vissza a köteghez",['ugiro/view', 'id' => $model->id_ugiro] ,[ '
|
||||
'value' => $tetel->request->customer->name ,
|
||||
'label' => 'Vendég'
|
||||
],
|
||||
[
|
||||
'value' => $tetel->request->customer->card->number ,
|
||||
'label' => 'Vendég'
|
||||
],
|
||||
]
|
||||
]);
|
||||
|
||||
|
||||
@ -89,7 +89,6 @@ use yii\helpers\Html;
|
||||
<td>
|
||||
<?php echo $model['request_id_contract'] ;?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th>
|
||||
@ -105,8 +104,10 @@ use yii\helpers\Html;
|
||||
<?php echo $model['customer_name'];?>
|
||||
</td>
|
||||
<th>
|
||||
Kártyaszám
|
||||
</th>
|
||||
<td>
|
||||
<?php echo $model['card_number'];?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
@ -46,6 +46,25 @@ use common\models\User;
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'enterStart')->widget(DateTimePicker::classname(), [
|
||||
'pluginOptions' => [
|
||||
'autoclose'=>true,
|
||||
'format' => 'yyyy.mm.dd hh:ii'
|
||||
]
|
||||
])->label("Belépések -tól") ?>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'enterEnd') ->widget(DateTimePicker::classname(), [
|
||||
'pluginOptions' => [
|
||||
'autoclose'=>true,
|
||||
'format' => 'yyyy.mm.dd hh:ii'
|
||||
]
|
||||
])->label("Belépések -ig") ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'id_ticket_type')->dropDownList($ticketTypeOptions)->label("Bérlet típus") ?>
|
||||
|
||||
@ -134,14 +134,26 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
'label' => "Érv. tól",
|
||||
'format' => 'date'
|
||||
],
|
||||
[
|
||||
[
|
||||
'attribute' => 'ticket_end',
|
||||
'label' => "Érv. ig",
|
||||
'format' => 'date'
|
||||
],[
|
||||
'attribute' => 'all_comment',
|
||||
'label' => "Komment",
|
||||
'format' => 'raw'
|
||||
],
|
||||
|
||||
['class' => 'yii\grid\ActionColumn',
|
||||
'template' => '{view}'
|
||||
'template' => '{view}',
|
||||
'urlCreator' => function ($action, $model, $key, $index)
|
||||
{
|
||||
if ( $action == 'view'){
|
||||
return \yii\helpers\Url::toRoute(['transfer/view','id' => $model['transfer_id_transfer']]);
|
||||
|
||||
}
|
||||
return "";
|
||||
}
|
||||
],
|
||||
],
|
||||
]); ?>
|
||||
@ -209,6 +221,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
'value' => 'paymentMethodName',
|
||||
'label' => "Fizetési mód"
|
||||
],
|
||||
|
||||
'created_at:datetime',
|
||||
'paid_at:datetime',
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
<div style="margin-bottom: 6px;">
|
||||
<?php
|
||||
echo Html::a("PDF",Url::current(['TransferLaterSearch[output]'=>'pdf']), ['class' => 'btn btn-primary' ]);
|
||||
echo Html::a("XLS",Url::current(['TransferLaterSearch[output]'=>'xls']), ['class' => 'btn btn-primary' ]);
|
||||
?>
|
||||
</div>
|
||||
|
||||
@ -85,6 +85,10 @@ echo Html::a("Egyiket sem",null, ['class' => 'btn btn-primary deselect-all',
|
||||
'attribute' => 'customer_name',
|
||||
'label' => 'Vendég'
|
||||
],
|
||||
[
|
||||
'attribute' => 'card_number',
|
||||
'label' => 'Kártyaszám'
|
||||
],
|
||||
[
|
||||
'attribute' => 'ticket_type_name',
|
||||
'label' => 'Bérlet típus'
|
||||
@ -126,6 +130,10 @@ echo Html::a("Egyiket sem",null, ['class' => 'btn btn-primary deselect-all',
|
||||
[
|
||||
'attribute' => 'ticket_comment',
|
||||
'label' => 'Megj'
|
||||
],
|
||||
[
|
||||
'attribute' => 'enter',
|
||||
'label' => 'Belépések'
|
||||
],
|
||||
],
|
||||
]); ?>
|
||||
|
||||
@ -125,7 +125,7 @@ $attributes = [
|
||||
//echo Html::a("DetSta Fájl Feldoglozás",['view', 'id' => $model->id_ugiro] ,['data-method' =>'post', 'class' => 'btn btn-danger']);
|
||||
}
|
||||
echo Html::a("Megbízások a kötegben",['ticket-installment-request/index', 'TicketInstallmentRequestSearch[id_ugiro]' => $model->id_ugiro] ,[ 'class' => 'btn btn-primary']);
|
||||
echo Html::a("PDF", Url::current(['output' => 'pdf']) ,[ 'class' => 'btn btn-primary']);
|
||||
echo Html::a("Xls", Url::current(['output' => 'xls']) ,[ 'class' => 'btn btn-primary']);
|
||||
|
||||
$detstaMessage = $model->messageDetsta;
|
||||
if ( isset($detstaMessage)){
|
||||
|
||||
@ -1,3 +1,8 @@
|
||||
-0.0.81
|
||||
- add comment to transaction/index
|
||||
-0.0.80
|
||||
- csoportos beszedés: kosár ha nem sikerült
|
||||
- későbbi utalások: xls, belépések száma
|
||||
-0.0.79
|
||||
- add frontend confirm on delete,
|
||||
- add transfer changes
|
||||
|
||||
@ -52,8 +52,6 @@ class DetStaDBSave extends Object
|
||||
|
||||
/**
|
||||
*
|
||||
* @param common\models\Ugiro;
|
||||
* @param common\models\giro\GiroDETSTA $giroDETSTA
|
||||
* */
|
||||
protected function saveMessageDetsta( ) {
|
||||
$this->message = new MessageDetsta();
|
||||
|
||||
@ -3,20 +3,15 @@ namespace common\components;
|
||||
|
||||
|
||||
use yii\base\Object;
|
||||
use common\models\TicketInstallmentRequest;
|
||||
use common\components\giro\GiroDETSTATetel;
|
||||
use common\models\Ugiro;
|
||||
use common\components\giro\GiroDETSTA;
|
||||
use common\components\giro\GiroDETSTAFej;
|
||||
use common\components\giro\GiroDETSTALab;
|
||||
use common\components\DetStaDBSave;
|
||||
|
||||
|
||||
/**
|
||||
* This is the model class for table "ticket".
|
||||
*
|
||||
* @property common\components\giro\GiroDETSTA $detstatUzenet
|
||||
* @property common\models\UGiro $koteg
|
||||
* @property \common\components\giro\GiroDETSTA $detstatUzenet
|
||||
* @property \common\models\UGiro $koteg
|
||||
*
|
||||
* */
|
||||
class DetStatProcessor extends Object{
|
||||
@ -122,12 +117,17 @@ class DetStatProcessor extends Object{
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function readKoteg(){
|
||||
$this->koteg = Ugiro::findOne($this->idKoteg );
|
||||
if ( !isset($this->koteg) ){
|
||||
$this->errors [] = "Kötege nem található! (".$this->detstatUzenet->fej." )";
|
||||
/** @var DetStatProcessor $this */
|
||||
$this->errors [] = "Köteg nem található! (".$this->detstatUzenet->fej ." )";
|
||||
}
|
||||
}
|
||||
|
||||
public function readKotegMegbizasok(){
|
||||
$this->megbizasok = $this->koteg->requests;
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
namespace common\components;
|
||||
|
||||
use common\models\Transfer;
|
||||
use yii\base\Object;
|
||||
use common\models\TicketInstallmentRequest;
|
||||
use common\components\giro\GiroDETSTATetel;
|
||||
@ -11,10 +12,10 @@ use common\models\Contract;
|
||||
/**
|
||||
* This is the model class for table "ticket".
|
||||
*
|
||||
* @property common\components\giro\GiroDETSTATetel $tetel
|
||||
* @property common\models\TicketInstallmentRequest $megbizas
|
||||
* @property common\models\Ticket $ticket
|
||||
* @property common\models\Contract $contract
|
||||
* @property \common\components\giro\GiroDETSTATetel $tetel
|
||||
* @property \common\models\TicketInstallmentRequest $megbizas
|
||||
* @property \common\models\Ticket $ticket
|
||||
* @property \common\models\Contract $contract
|
||||
*
|
||||
*
|
||||
*/
|
||||
@ -44,7 +45,7 @@ class DetStatTetelProcessor extends Object {
|
||||
* */
|
||||
protected $comment;
|
||||
/**
|
||||
* A bérlet objectkum, amit elmentettünk
|
||||
* A bérlet objektum, amit elmentettünk
|
||||
* */
|
||||
protected $ticket;
|
||||
/**
|
||||
@ -58,13 +59,13 @@ class DetStatTetelProcessor extends Object {
|
||||
|
||||
\Yii::info('Megbízás feldolgozása: megbízás azonosító=' .$this->megbizas->id_ticket_installment_request);
|
||||
|
||||
if ($this->isAlreadeyAccepted ()) {
|
||||
if ($this->isAlreadyAccepted ()) {
|
||||
\Yii::info('A megbízás feldolgozásának megszakítása. A megbízás már elfogadott: megbízás azonosító=' .$this->megbizas->id_ticket_installment_request);
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !isset($this->tetel)){
|
||||
\Yii::info('A megbízás feldolgozásának megszakítása. Nincs valaszsor a detsta üzenetben');
|
||||
\Yii::info('A megbízás feldolgozásának megszakítása. Nincs válasz sor a detsta üzenetben');
|
||||
return;
|
||||
}
|
||||
|
||||
@ -75,6 +76,8 @@ class DetStatTetelProcessor extends Object {
|
||||
|
||||
if ( $this->status == TicketInstallmentRequest::$STATUS_ACCEPTED ){
|
||||
$this->buyNewTicket();
|
||||
}else if ( $this->status == TicketInstallmentRequest::$STATUS_ACCEPTED_MANUAL ){
|
||||
$this->putTicketToCustomerCart();
|
||||
}else{
|
||||
$this->doRejectRequest();
|
||||
}
|
||||
@ -86,14 +89,17 @@ class DetStatTetelProcessor extends Object {
|
||||
$this->eredetiMegbizasStatus = $this->megbizas->status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
protected function isEredetiMegbizasStatusFinished(){
|
||||
return $this->eredetiMegbizasStatus == TicketInstallmentRequest::$STATUS_ACCEPTED ||
|
||||
$this->eredetiMegbizasStatus == TicketInstallmentRequest::$STATUS_ACCEPTED_MANUAL ||
|
||||
$this->eredetiMegbizasStatus == TicketInstallmentRequest::$STATUS_REJECTED;
|
||||
return TicketInstallmentRequest::$STATUS_ACCEPTED == $this->eredetiMegbizasStatus ||
|
||||
TicketInstallmentRequest::$STATUS_ACCEPTED_MANUAL == $this->eredetiMegbizasStatus ||
|
||||
TicketInstallmentRequest::$STATUS_REJECTED == $this->eredetiMegbizasStatus;
|
||||
}
|
||||
|
||||
protected function buyNewTicket(){
|
||||
\Yii::info('Új bérlet vásárlás folyamant indítása' );
|
||||
\Yii::info('Új bérlet vásárlás folyamat indítása' );
|
||||
|
||||
$megbizas = $this->megbizas;
|
||||
$customer = $this->contract->customer;
|
||||
@ -123,6 +129,39 @@ class DetStatTetelProcessor extends Object {
|
||||
$this->updateContractOnSuccess();
|
||||
$this->updateMegbizasOnSuccess();
|
||||
|
||||
}
|
||||
protected function putTicketToCustomerCart(){
|
||||
\Yii::info('Új bérlet vásárló kosarába helyezés folyamat indítása' );
|
||||
|
||||
$megbizas = $this->megbizas;
|
||||
$customer = $this->contract->customer;
|
||||
$card = $customer->card;
|
||||
$account = Account::findOne(1);
|
||||
$ticketType = $this->contract->ticketType;
|
||||
$discount = $this->contract->discount;
|
||||
|
||||
$ticketSale = new TicketSale(
|
||||
[
|
||||
'ticketType'=> $ticketType,
|
||||
'customer'=> $customer,
|
||||
'account'=> $account,
|
||||
'card'=> $card,
|
||||
'discount'=> $discount,
|
||||
'contract'=> $this->contract,
|
||||
'ticketInstallmentRequest' => $megbizas,
|
||||
'transferStatus' => Transfer::STATUS_NOT_PAID
|
||||
]
|
||||
);
|
||||
|
||||
$ticketSale->doSale();
|
||||
\Yii::info('Bérlet és tranzakció elmentve' );
|
||||
|
||||
$this->transfer = $ticketSale->transfer;
|
||||
$this->ticket = $ticketSale->ticket;
|
||||
|
||||
$this->updateContractOnSuccess();
|
||||
$this->updateMegbizasOnSuccess();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -139,7 +178,7 @@ class DetStatTetelProcessor extends Object {
|
||||
* */
|
||||
protected function updateMegbizasOnSuccess(){
|
||||
|
||||
\Yii::info('Megbízás frissítése - megbizás elfogadva ' );
|
||||
\Yii::info('Megbízás frissítése - megbízás elfogadva ' );
|
||||
|
||||
$this->megbizas->status = $this->status;
|
||||
$this->megbizas->id_transfer = $this->transfer->id_transfer;
|
||||
@ -161,7 +200,7 @@ class DetStatTetelProcessor extends Object {
|
||||
* */
|
||||
protected function updateMegbizasOnFail(){
|
||||
|
||||
\Yii::info('Megbázás frissítése - megbízás visszautasítva ' );
|
||||
\Yii::info('Megbízás frissítése - megbízás visszautasítva ' );
|
||||
|
||||
$this->megbizas->status = $this->status;
|
||||
$this->megbizas->detsta_answer = $this->kod;
|
||||
@ -269,12 +308,12 @@ class DetStatTetelProcessor extends Object {
|
||||
if ($this->kod == GiroDETSTATetel::$INFORMACIO_TELJESITETT) {
|
||||
$this->status = TicketInstallmentRequest::$STATUS_ACCEPTED;
|
||||
} else {
|
||||
$this->status = TicketInstallmentRequest::$STATUS_REJECTED;
|
||||
$this->status = TicketInstallmentRequest::$STATUS_ACCEPTED_MANUAL;
|
||||
}
|
||||
\Yii::info('Visszajelző kód kiolvasva: kod=' .$this->kod);
|
||||
\Yii::info('Visszajelző kód kiolvasva: statusz=' .$this->status. " (" . TicketInstallmentRequest::toStatusName($this->status) .")");
|
||||
}
|
||||
protected function isAlreadeyAccepted() {
|
||||
protected function isAlreadyAccepted() {
|
||||
return $this->megbizas->isStatusAccepted ();
|
||||
}
|
||||
public function hasError() {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -77,8 +77,9 @@ class TransferPayout extends \yii\base\Object{
|
||||
}
|
||||
|
||||
/**
|
||||
* @param common\models\Transfer $transfer the transfer to payout
|
||||
* */
|
||||
* @param \common\models\Transfer $transfer the transfer to payout
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function payoutTransfer($transfer){
|
||||
|
||||
$transfer->paid_by = $this->idUser;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace common\components\giro;
|
||||
|
||||
use common\components\giro\GiroBase;
|
||||
use \common\components\giro\GiroBase;
|
||||
|
||||
class GiroBankszamla extends GiroBase{
|
||||
|
||||
|
||||
@ -5,18 +5,43 @@ namespace common\components\giro;
|
||||
use backend\models\GiroKotegForm;
|
||||
class GiroBase {
|
||||
|
||||
/**
|
||||
* @param $input
|
||||
* @param $hossz
|
||||
* @param string $pad_string
|
||||
* @return string
|
||||
*/
|
||||
public function mezoKitolt($input, $hossz, $pad_string = "") {
|
||||
return str_pad($input, $hossz, $pad_string, STR_PAD_LEFT);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $input
|
||||
* @param $hossz
|
||||
* @param string $pad_string
|
||||
* @return string
|
||||
*/
|
||||
public function szamKitolt($input, $hossz, $pad_string = "0") {
|
||||
return str_pad($input, $hossz, $pad_string, STR_PAD_LEFT);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $input
|
||||
* @param $hossz
|
||||
* @param string $pad_string
|
||||
* @return string
|
||||
*/
|
||||
public function szamKitoltJobb($input, $hossz, $pad_string = "0") {
|
||||
return str_pad($input, $hossz, $pad_string, STR_PAD_RIGHT);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $input
|
||||
* @param $hossz
|
||||
* @param string $pad_string
|
||||
* @return mixed|string
|
||||
*/
|
||||
public function szovegKitolt($input, $hossz, $pad_string = " ") {
|
||||
$data = $input;
|
||||
$data = GiroKotegForm::transliterate($data);
|
||||
@ -29,14 +54,31 @@ class GiroBase {
|
||||
return $data;
|
||||
}
|
||||
|
||||
public static function szovegOlvas($row,$start,$length, $padchar = " "){
|
||||
/**
|
||||
* @param $row
|
||||
* @param $start
|
||||
* @param $length
|
||||
* @param string $padchar
|
||||
* @return string
|
||||
*/
|
||||
public static function szovegOlvas($row, $start, $length, $padchar = " "){
|
||||
return rtrim(substr($row, $start,$length),$padchar);
|
||||
}
|
||||
|
||||
public static function szamOlvas($row,$start,$length, $padchar = "0"){
|
||||
/**
|
||||
* @param $row
|
||||
* @param $start
|
||||
* @param $length
|
||||
* @param string $padchar
|
||||
* @return string
|
||||
*/
|
||||
public static function szamOlvas($row, $start, $length, $padchar = "0"){
|
||||
return ltrim(substr($row, $start,$length),$padchar);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function rekordVege(){
|
||||
return "\r\n";
|
||||
}
|
||||
|
||||
@ -2,12 +2,11 @@
|
||||
|
||||
namespace common\components\giro;
|
||||
|
||||
use common\components\giro\GiroBase;
|
||||
|
||||
/**
|
||||
*@property common\components\giro\GiroBeszedFej $fej
|
||||
*@property common\components\giro\GiroBeszedLab $lab
|
||||
*@property common\components\giro\GiroBeszedTetel[] $tetelek
|
||||
*@property \common\components\giro\GiroBeszedFej $fej
|
||||
*@property \common\components\giro\GiroBeszedLab $lab
|
||||
*@property \common\components\giro\GiroBeszedTetel[] $tetelek
|
||||
*
|
||||
*/
|
||||
class GiroBeszed extends GiroBase {
|
||||
@ -20,7 +19,14 @@ class GiroBeszed extends GiroBase {
|
||||
}
|
||||
|
||||
|
||||
public static function createFileContent($number,$datum /**összeállítás dátum*/, $requests, $terhelesiDatum = null) {
|
||||
/**
|
||||
* @param $number
|
||||
* @param $datum
|
||||
* @param $requests
|
||||
* @param null $terhelesiDatum
|
||||
* @return string
|
||||
*/
|
||||
public static function createFileContent($number, $datum /**összeállítás dátum*/, $requests, $terhelesiDatum = null) {
|
||||
if ( !isset($terhelesiDatum)){
|
||||
$terhelesiDatum = date('Ymd' ,strtotime("+5 day"));
|
||||
}
|
||||
@ -31,6 +37,11 @@ class GiroBeszed extends GiroBase {
|
||||
return $s;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $number
|
||||
* @param $daturm
|
||||
* @return string
|
||||
*/
|
||||
public static function createFej($number, $daturm) {
|
||||
$fej = new GiroBeszedFej ();
|
||||
$fej->duplumKod = \Yii::$app->params['ugiro_duplom_kod'];
|
||||
@ -45,7 +56,12 @@ class GiroBeszed extends GiroBase {
|
||||
return $fej->toString ();
|
||||
}
|
||||
|
||||
public static function createTetelek($requests,$terhelesiDatum){
|
||||
/**
|
||||
* @param $requests
|
||||
* @param $terhelesiDatum
|
||||
* @return string
|
||||
*/
|
||||
public static function createTetelek($requests, $terhelesiDatum){
|
||||
$s = "";
|
||||
$i = 0;
|
||||
foreach ($requests as $request){
|
||||
@ -56,8 +72,10 @@ class GiroBeszed extends GiroBase {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param common\models\TicketInstallmentRequest $request
|
||||
* */
|
||||
* @param \common\models\TicketInstallmentRequest $request
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function createTetel($request,$sorszam,$terhelesiDatum) {
|
||||
$tetel = new GiroBeszedTetel ();
|
||||
$customer = $request->customer;
|
||||
@ -75,6 +93,10 @@ class GiroBeszed extends GiroBase {
|
||||
return $tetel->toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $requests
|
||||
* @return string
|
||||
*/
|
||||
public static function createLab($requests) {
|
||||
$lab = new GiroBeszedLab ();
|
||||
|
||||
@ -90,6 +112,9 @@ class GiroBeszed extends GiroBase {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function toString( ) {
|
||||
$s = "";
|
||||
$s .= $this->fej->toString();
|
||||
|
||||
@ -2,13 +2,12 @@
|
||||
|
||||
namespace common\components\giro;
|
||||
|
||||
use common\components\giro\GiroBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @property common\components\giro\GiroDETSTAFej $fej
|
||||
* @property common\components\giro\GiroDETSTALab $lab
|
||||
* @property common\components\giro\GiroDETSTATetel $tetelek
|
||||
* @property \common\components\giro\GiroDETSTAFej $fej
|
||||
* @property \common\components\giro\GiroDETSTALab $lab
|
||||
* @property \common\components\giro\GiroDETSTATetel $tetelek
|
||||
*
|
||||
*/
|
||||
class GiroDETSTA extends GiroBase {
|
||||
@ -48,11 +47,11 @@ class GiroDETSTA extends GiroBase {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param common\components\giro\GiroBeszed $beszed
|
||||
* @param \common\components\giro\GiroBeszed $beszed
|
||||
* */
|
||||
public static function createBeszedAnswer($beszed){
|
||||
// /**@var common\components\giro\GiroBeszed $beszed*/
|
||||
$beszed = new GiroBeszed();
|
||||
//$beszed = new GiroBeszed();
|
||||
$detsta = new GiroDETSTA();
|
||||
$detsta->fej = new GiroDETSTAFej();
|
||||
|
||||
|
||||
@ -3,8 +3,8 @@ namespace common\components\giro;
|
||||
|
||||
|
||||
/**
|
||||
* @property common\components\giro\GiroUzenetsorszam $csoportosUzenetSorszam
|
||||
* @property common\components\giro\GiroBankszamla $kezdemenyezoBankszamla
|
||||
* @property \common\components\giro\GiroUzenetsorszam $csoportosUzenetSorszam
|
||||
* @property \common\components\giro\GiroBankszamla $kezdemenyezoBankszamla
|
||||
* */
|
||||
class GiroDETSTAFej extends GiroBase{
|
||||
|
||||
@ -35,6 +35,10 @@ class GiroDETSTAFej extends GiroBase{
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $row
|
||||
* @return GiroDETSTAFej
|
||||
*/
|
||||
public static function parse($row){
|
||||
$fej = new GiroDETSTAFej();
|
||||
|
||||
|
||||
@ -4,8 +4,8 @@ namespace common\components\giro;
|
||||
|
||||
/**
|
||||
*
|
||||
* @property common\components\giro\GiroUzenetsorszam $csoportosUzenetSorszam
|
||||
* @property common\components\giro\GiroBankszamla $kezdemenyezoBankszamla
|
||||
* @property \common\components\giro\GiroUzenetsorszam $csoportosUzenetSorszam
|
||||
* @property \common\components\giro\GiroBankszamla $kezdemenyezoBankszamla
|
||||
*
|
||||
*/
|
||||
class GiroDETSTATetel extends GiroBase {
|
||||
@ -23,7 +23,7 @@ class GiroDETSTATetel extends GiroBase {
|
||||
'99' => "egyéb hiba"
|
||||
];
|
||||
|
||||
public $recordTipus = "01";
|
||||
public $recordTipus = "02";
|
||||
public $tetelSorszam = "0";
|
||||
public $osszeg = "0";
|
||||
public $eredetiTetelElszamolasiDatuma = "";
|
||||
|
||||
@ -5,7 +5,7 @@ return [
|
||||
'supportEmail' => 'rocho02@gmail.com',
|
||||
'infoEmail' => 'info@rocho-net.hu',
|
||||
'user.passwordResetTokenExpire' => 3600,
|
||||
'version' => 'v0.0.79',
|
||||
'version' => 'v0.0.81',
|
||||
'company' => 'movar',//gyor
|
||||
'company_name' => "Freimann Kft.",
|
||||
'product_visiblity' => 'account',// on reception which products to display. account or global
|
||||
|
||||
@ -23,6 +23,9 @@ use common\components\Helper;
|
||||
* @property string $created_at
|
||||
* @property string $updated_at
|
||||
* @property string $started_at
|
||||
* @property \common\models\Discount discount
|
||||
* @property \common\models\Customer customer
|
||||
* @property \common\models\TicketType ticketType
|
||||
*/
|
||||
class Contract extends \yii\db\ActiveRecord
|
||||
{
|
||||
|
||||
@ -1,9 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace common\models;
|
||||
|
||||
use Yii;
|
||||
use common\models\BaseFitnessActiveRecord;
|
||||
|
||||
/**
|
||||
* This is the model class for table "customer".
|
||||
@ -29,6 +27,10 @@ use common\models\BaseFitnessActiveRecord;
|
||||
* @property string $address
|
||||
* @property string $created_at
|
||||
* @property string $updated_at
|
||||
* @property \common\models\Card card
|
||||
* @property integer status
|
||||
* @property \common\models\User user
|
||||
* @property mixed bank_account
|
||||
*/
|
||||
class Customer extends BaseFitnessActiveRecord
|
||||
{
|
||||
@ -116,7 +118,7 @@ class Customer extends BaseFitnessActiveRecord
|
||||
|
||||
public function getStatusHuman(){
|
||||
$result = null;
|
||||
$s = self::statuses($this->status);
|
||||
$s = self::statuses( );
|
||||
if ( array_key_exists($this->status, $s)){
|
||||
$result = $s[$this->status];
|
||||
}
|
||||
|
||||
@ -28,8 +28,10 @@ use common\components\Helper;
|
||||
* @property string $updated_at
|
||||
* @property string $detsta_answer
|
||||
* @property string $comment
|
||||
* @property string $updated_at
|
||||
* @property common\components\giro\GiroDETSTATetel $detstaTetel GiroDetstaTetel record a DetSta fájlból
|
||||
* @property \common\components\giro\GiroDETSTATetel $detstaTetel GiroDetstaTetel record a DetSta fájlból
|
||||
* @property \common\models\Contract contract
|
||||
* @property \common\models\Customer customer
|
||||
* @property string number
|
||||
*/
|
||||
class TicketInstallmentRequest extends \yii\db\ActiveRecord
|
||||
{
|
||||
@ -242,9 +244,9 @@ class TicketInstallmentRequest extends \yii\db\ActiveRecord
|
||||
|
||||
|
||||
/**
|
||||
* @param common\models\Ticket $ticket
|
||||
* @param common\models\TicketType $type
|
||||
* @return common\models\TicketInstallmentRequest[]
|
||||
* @param \common\models\Ticket $ticket
|
||||
* @param \common\models\TicketType $type
|
||||
* @return \common\models\TicketInstallmentRequest[]
|
||||
* */
|
||||
public static function createInstallments($ticket,$type,$customer,$contract){
|
||||
$result = [];
|
||||
|
||||
@ -18,6 +18,8 @@ use yii\helpers\ArrayHelper;
|
||||
* @property string $created_at
|
||||
* @property string $updated_at
|
||||
* @property string $terhelesi_datum
|
||||
* @property mixed requests
|
||||
* @property int status
|
||||
*/
|
||||
class Ugiro extends \yii\db\ActiveRecord
|
||||
{
|
||||
|
||||
@ -2,6 +2,11 @@
|
||||
namespace console\controllers;
|
||||
|
||||
|
||||
use common\components\giro\GiroDETSTA;
|
||||
use common\components\giro\GiroDETSTAFej;
|
||||
use common\components\giro\GiroDETSTALab;
|
||||
use common\components\giro\GiroDETSTATetel;
|
||||
use common\models\Ugiro;
|
||||
use yii\console\Controller;
|
||||
use frontend\models\ContractForm;
|
||||
use common\models\TicketType;
|
||||
@ -39,5 +44,59 @@ class DetstaConsoleController extends Controller{
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param integer $id_ugiro
|
||||
*/
|
||||
public function actionDetstaAnswer($id_ugiro,$accepted = 1){
|
||||
|
||||
/** @var \common\models\Ugiro $ugiro */
|
||||
$ugiro = Ugiro::findOne($id_ugiro);
|
||||
/** @var \common\components\giro\\GiroDETSTA $detsta */
|
||||
$detsta = new GiroDETSTA();
|
||||
/** @var \common\components\giro\GiroDETSTAFej $detsta */
|
||||
$detsta->fej = new GiroDETSTAFej();
|
||||
|
||||
|
||||
$detsta->fej->jelentesJelzo = 8;
|
||||
$detsta->fej->kezdemenyezoAzonosito =\Yii::$app->params['ugiro_kezdemenyezo_azonosito'];
|
||||
$detsta->fej->csoportosUzenetSorszam->osszeallitasDatuma = $ugiro->datum;
|
||||
$detsta->fej->csoportosUzenetSorszam->sorszam = $ugiro->number;
|
||||
$detsta->fej->detstaUzenetSorszam->osszeallitasDatuma = $ugiro->datum;
|
||||
$detsta->fej->detstaUzenetSorszam->sorszam = $ugiro->number;
|
||||
|
||||
|
||||
|
||||
$detsta->lab = new GiroDETSTALab();
|
||||
|
||||
$tetelek = $ugiro->requests;
|
||||
/** @var \common\models\TicketInstallmentRequest $tetel */
|
||||
foreach ($tetelek as $tetel ){
|
||||
$detstaTetel = new GiroDETSTATetel();
|
||||
|
||||
$detstaTetel->tetelSorszam = $tetel->number;
|
||||
$detstaTetel->osszeg = $tetel->money;
|
||||
$detstaTetel->eredetiTetelElszamolasiDatuma = $ugiro->datum;
|
||||
if ( $accepted == "1"){
|
||||
$detstaTetel->visszajelzesInformacio = GiroDETSTATetel::$INFORMACIO_TELJESITETT;
|
||||
}else{
|
||||
$detstaTetel->visszajelzesInformacio = '50';
|
||||
}
|
||||
$detstaTetel->feldolgozasDatum = $ugiro->datum;
|
||||
$detstaTetel->terhelesiDatum = $ugiro->datum;
|
||||
$detstaTetel->valaszHivatkozasiKod = '1234';
|
||||
$detstaTetel->eredetiHivatkozasiKod = '1234';
|
||||
$detstaTetel->ugyfelAzonosito = $tetel->customer->id_customer;
|
||||
|
||||
$detsta->tetelek[] = $detstaTetel;
|
||||
|
||||
|
||||
}
|
||||
|
||||
$content = $detsta->toString();
|
||||
|
||||
file_put_contents('c:\tmp\detsta.txt',$content);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Schema;
|
||||
use yii\db\Migration;
|
||||
|
||||
class m160729_060405_create_index_doorlog_customer__created_at_direction extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->execute("create index fitweb_door_log_enter on door_log (id_customer,created_at,direction )");
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
echo "m160729_060405_create_index_doorlog_customer__created_at_direction cannot be reverted.\n";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
// Use safeUp/safeDown to run migration code within a transaction
|
||||
public function safeUp()
|
||||
{
|
||||
}
|
||||
|
||||
public function safeDown()
|
||||
{
|
||||
}
|
||||
*/
|
||||
}
|
||||
@ -45,8 +45,9 @@ class ContractController extends Controller {
|
||||
|
||||
/**
|
||||
* Lists all Contract models.
|
||||
*
|
||||
* @param $id_card
|
||||
* @return mixed
|
||||
* @throws \Yii\web\NotFoundHttpException
|
||||
*/
|
||||
public function actionIndex($id_card) {
|
||||
$card = Card::findOne ( $id_card );
|
||||
|
||||
Loading…
Reference in New Issue
Block a user