improve detsta

This commit is contained in:
2016-02-01 18:21:03 +01:00
parent 3b7f42014b
commit 6efbfa7d9b
11 changed files with 374 additions and 111 deletions

View File

@@ -16,6 +16,10 @@ use common\models\Customer;
use common\models\Card;
use backend\models\TicketSearchStatisitcs;
use backend\models\TicketSearchCustomer;
use common\components\TicketSale;
use common\models\Contract;
use common\components\giro\GiroDETSTATetel;
use common\components\DetStatTetelProcessor;
/**
* TicketController implements the CRUD actions for Ticket model.
@@ -34,7 +38,8 @@ class TicketController extends \backend\controllers\BackendController {
'view',
'update',
'index-customer',
'statistics'
'statistics' ,
'test'
],
'allow' => true,
'roles' => [
@@ -223,6 +228,58 @@ class TicketController extends \backend\controllers\BackendController {
] );
}
public function actionTest(){
// $this->doTestTicketSale();
$this->doTestDetstaProcess();
return $this->render('test');
}
protected function doTestDetstaProcess(){
$contract = Contract::findOne(19);
$megbizas = $contract->requests[0];
$tetel = new GiroDETSTATetel();
$tetel->visszajelzesInformacio = "02";
$tp = new DetStatTetelProcessor([
'megbizas' => $megbizas,
'tetel' => $tetel
]);
$tp->run();
}
protected function doTestTicketSale(){
$ticketType = TicketType::findOne(1);
$customer = Customer::findOne(1);
$account = Account::findOne(1);
$card = $customer->card;
$discount = null;
$contract = Contract::findOne(19);
$megbizas = $contract->requests[0];
$ticketSale = new TicketSale(
[
'ticketType'=> $ticketType,
'customer'=> $customer,
'account'=> $account,
'card'=> $card,
'discount'=> $discount,
'contract'=> $contract,
'ticketInstallmentRequest' => $megbizas
]
);
$ticketSale->doSale();
}
/**
* Finds the Ticket model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.

View File

@@ -0,0 +1 @@
test