add indexes, add messagedetsta

This commit is contained in:
2016-01-29 17:13:33 +01:00
parent ad59cbb940
commit a00331ce7c
65 changed files with 3195 additions and 92 deletions

View File

@@ -0,0 +1,27 @@
<?php
namespace backend\components;
use yii\base\Widget;
class AdminCustomerTabWidget extends Widget{
public $customer;
public $card;
public $title;
public $viewFile = '//common/_customer_tab';
public function init(){
parent::init();
$this->card = $this->customer->card;
}
public function run(){
echo $this->render($this->viewFile,[ 'card' => $this->card, 'customer' => $this->customer ,'title' => $this->title ]);
}
}

View File

@@ -89,6 +89,7 @@ class AdminMenuStructure{
$items[] = ['label' => 'Termékek', 'url' => ['/product/index'] ];
$items[] = ['label' => 'Beszerzések', 'url' => ['/procurement/index'] ];
$items[] = ['label' => 'Részletes eladások', 'url' => ['/transfer/sale' ,'TransferSaleSearch[start]' =>$todayDatetime,'TransferSaleSearch[end]' => $tomorrowDatetime ] ];
$items[] = ['label' => 'Termék összesítő', 'url' => ['/product/statistics' ,'ProductStatisticsSearch[start]' =>$todayDatetime,'ProductStatisticsSearch[end]' => $tomorrowDatetime ] ];
$this->menuItems[] = ['label' => 'Termékek', 'url' => $this->emptyUrl,
'items' => $items
];
@@ -108,6 +109,7 @@ class AdminMenuStructure{
// Tartós megbízások
/////////////////////////////
$items = [];
$items[] = ['label' => 'Szerződések', 'url' => ['/contract/index' ] ];
$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' ] ];

View File

@@ -228,7 +228,7 @@ class CardController extends \backend\controllers\BackendController {
$card = Card::find()->andWhere(['number' => $item['number']])->one();
if ( $card != null ){
$card->rfid_key = $item['key'];
$sql = "update card set rfid_key = '" .$item['key'] ."' where id_card = " .$card->id_card .";";
$sql = "update card set rfid_key = '" . strtolower( $item['key'] )."' where id_card = " .$card->id_card .";";
$sqls[] = $sql;
$i++;
}else{

View File

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

View File

@@ -8,6 +8,8 @@ use backend\models\KeySearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use common\models\Customer;
use backend\models\KeyCustomerSearch;
/**
* KeyController implements the CRUD actions for Key model.
@@ -41,6 +43,28 @@ class KeyController extends Controller
'dataProvider' => $dataProvider, //csomagoló osztály a queryhez
]);
}
/**
* Lists all Key models.
* @return mixed
*/
public function actionIndexCustomer($id)
{
$model = Customer::findOne($id);
if ( !isset($model)){
throw new NotFoundHttpException('The requested page does not exist.');
}
$searchModel = new KeyCustomerSearch(['customer' => $model]);
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
// backend/views/kex/index.php
return $this->render('index-customer', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider, //csomagoló osztály a queryhez
]);
}
/**
* Displays a single Key model.

View File

@@ -0,0 +1,137 @@
<?php
namespace backend\controllers;
use Yii;
use common\models\MessageDetsta;
use backend\models\MessageDetstaSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use common\components\giro\GiroDETSTA;
use common\components\DetStaDBSave;
/**
* MessageDetstaController implements the CRUD actions for MessageDetsta model.
*/
class MessageDetstaController extends Controller
{
public function behaviors()
{
return [
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'delete' => ['post'],
],
],
];
}
/**
* Lists all MessageDetsta models.
* @return mixed
*/
public function actionIndex()
{
$filename = \Yii::getAlias("@backend") ."/web/giro/valasz/detsta.txt";
$ugiro = GiroDETSTA::parse(file_get_contents($filename));
file_put_contents("c:\\tmp\\detsta.txt", $ugiro->toString());
$saver = new DetStaDBSave(
[
'giroDETSTA' => $ugiro,
'koteg' => null,
'idUser' =>\Yii::$app->user->id
]);
$saver->run();
$searchModel = new MessageDetstaSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
/**
* Displays a single MessageDetsta model.
* @param integer $id
* @return mixed
*/
public function actionView($id)
{
return $this->render('view', [
'model' => $this->findModel($id),
]);
}
/**
* Creates a new MessageDetsta model.
* If creation is successful, the browser will be redirected to the 'view' page.
* @return mixed
*/
public function actionCreate()
{
$model = new MessageDetsta();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id_message]);
} else {
return $this->render('create', [
'model' => $model,
]);
}
}
/**
* Updates an existing MessageDetsta 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_message]);
} else {
return $this->render('update', [
'model' => $model,
]);
}
}
/**
* Deletes an existing MessageDetsta 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 MessageDetsta model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.
* @param integer $id
* @return MessageDetsta the loaded model
* @throws NotFoundHttpException if the model cannot be found
*/
protected function findModel($id)
{
if (($model = MessageDetsta::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
}
}

View File

@@ -12,6 +12,7 @@ use common\models\Warehouse;
use common\models\Product;
use common\models\User;
use common\components\Helper;
use common\models\Account;
/**
* ProcurementController implements the CRUD actions for Procurement model.
@@ -92,6 +93,8 @@ class ProcurementController extends \backend\controllers\BackendController
$model = new Procurement();
$model->scenario = 'create_general';
$accounts = Account::find()->andWhere(['status' => Account::STATUS_ACTIVE])->andWhere(['type' => Account::TYPE_ALL])->all();
$model->id_user = Yii::$app->user->id;
$warehouses = Warehouse::read(null);
@@ -137,7 +140,8 @@ class ProcurementController extends \backend\controllers\BackendController
} else {
return $this->render('create', [
'model' => $model,
'warehouses' =>$warehouses
'warehouses' =>$warehouses,
'accounts' => $accounts
]);
}
}

View File

@@ -10,6 +10,8 @@ use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use common\models\Account;
use common\models\ProductCategory;
use backend\models\ProductStatisticsSearch;
use PHPExcel;
/**
* ProductController implements the CRUD actions for Product model.
@@ -17,6 +19,24 @@ use common\models\ProductCategory;
class ProductController extends \backend\controllers\BackendController
{
public function behaviors()
{
return [
'access' => [
'class' => \yii\filters\AccessControl::className(),
'rules' => [
// allow authenticated users
[
'actions' => ['create','index','view','update','statistics'],
'allow' => true,
'roles' => ['admin','employee','reception'],
],
// everything else is denied
],
],
];
}
/**
* Lists all Product models.
@@ -106,6 +126,60 @@ class ProductController extends \backend\controllers\BackendController
return $this->redirect(['index']);
}
public function actionStatistics(){
$searchModel = new ProductStatisticsSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
if ( $searchModel->output == 'xls' ){
$models = $dataProvider->getModels();
$objPHPExcel = new \PHPExcel();
$sheet = $objPHPExcel->setActiveSheetIndex(0);
$row = 1;
$sheet->setCellValue('A'.$row, "Termék név")
->setCellValue('B'.$row, "Eladási ár")
->setCellValue('C'.$row, "Kassza")
->setCellValue('D'.$row, "Eladott mennyiség")
->setCellValue('E'.$row, "Eladás összege");
foreach ($models as $model ){
$row++;
$sheet->setCellValue('A'.$row, $model['product_name'])
->setCellValue('B'.$row, $model['product_sale_price'])
->setCellValue('C'.$row, $model['father_account_name'])
->setCellValue('D'.$row, $model['transfer_count'])
->setCellValue('E'.$row, $model['transfer_money']);
}
// Redirect output to a clients web browser (Excel5)
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="termek_statisztika.xls"');
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;
}
return $this->render('statistics', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
/**
* Finds the Product model based on its primary key value.

View File

@@ -15,6 +15,7 @@ use common\models\User;
use common\models\Customer;
use common\models\Card;
use backend\models\TicketSearchStatisitcs;
use backend\models\TicketSearchCustomer;
/**
* TicketController implements the CRUD actions for Ticket model.
@@ -128,7 +129,7 @@ class TicketController extends \backend\controllers\BackendController {
throw new NotFoundHttpException ( 'The requested page does not exist.' );
}
$searchModel = new TicketSearch ();
$searchModel = new TicketSearchCustomer(['customer' => $customer]);
$searchModel->id_card = $customer->id_customer_card;
$dataProvider = $searchModel->search ( Yii::$app->request->queryParams );
$searchModel->searchTotals ();

View File

@@ -7,6 +7,8 @@ use yii\base\Model;
use yii\data\ActiveDataProvider;
use common\models\Card;
use common\models\Customer;
use yii\db\Query;
use common\models\Key;
/**
* CardSearch represents the model behind the search form about `common\models\Card`.
@@ -15,6 +17,9 @@ class CardSearch extends Card
{
public $searchCustomerName;
public $searchKeyNumber;
public $usage;
public $key_assigned;
/**
* @inheritdoc
@@ -22,8 +27,8 @@ class CardSearch extends Card
public function rules()
{
return [
[['id_card', 'status', 'type'], 'integer'],
[[ 'searchCustomerName', 'number','rfid_key', 'created_at', 'updated_at'], 'safe'],
[['id_card', 'status', 'type','usage'], 'integer'],
[[ 'searchCustomerName', 'number','rfid_key', 'created_at', 'updated_at','searchKeyNumber','key_assigned'], 'safe'],
];
}
@@ -47,14 +52,64 @@ class CardSearch extends Card
{
$query = Card::find();
$query = new Query();
$query->select([
'card.id_card as card_id_card',
'card.number as card_number',
'card.rfid_key as card_rfid_key',
'card.status as card_status',
'card.type as card_type',
'customer.name as customer_name' ,
'customer.id_customer as customer_id_customer',
'key.number as key_number',
]);
$query->from(Card::tableName());
$query->leftJoin(Customer::tableName(), 'customer.id_customer_card = card.id_card');
$query->leftJoin("card_key_assignment", 'card.id_card = card_key_assignment.id_card');
$query->leftJoin(Key::tableName(), 'key.id_key = card_key_assignment.id_key');
$dataProvider = new ActiveDataProvider([
'query' => $query,
'sort' =>[
'defaultOrder' => [
'card_number' => SORT_ASC
],
'attributes' => [
'card_number' => [
'asc' => ['card.number' => SORT_ASC ],
'desc' => ['card.number' => SORT_DESC],
],
'card_rfid_key' => [
'asc' => ['card.rfid_key' => SORT_ASC ],
'desc' => ['card.rfid_key' => SORT_DESC],
],
'card_status' => [
'asc' => ['card.status' => SORT_ASC ],
'desc' => ['card.status' => SORT_DESC],
],
'card_type' => [
'asc' => ['card.type' => SORT_ASC ],
'desc' => ['card.type' => SORT_DESC],
],
'customer_name' => [
'asc' => ['customer.name' => SORT_ASC ],
'desc' => ['customer.name' => SORT_DESC],
],
'customer_id_customer' => [
'asc' => ['customer.id_customer' => SORT_ASC ],
'desc' => ['customer.id_customer' => SORT_DESC],
],
'key_number' => [
'asc' => ['key.number' => SORT_ASC ],
'desc' => ['key.number' => SORT_DESC],
],
]
]
]);
$dataProvider->sort ->attributes['customerName'] =[
'asc' => ['customer.name' => SORT_ASC ],
'desc' => ['customer.name' => SORT_DESC ],
];
$this->load($params);
@@ -64,7 +119,6 @@ class CardSearch extends Card
return $dataProvider;
}
$query->leftJoin(Customer::tableName(), 'customer.id_customer_card = card.id_card');
$query->andFilterWhere([
'card.status' => $this->status,
@@ -74,6 +128,19 @@ class CardSearch extends Card
$query->andFilterWhere(['like', 'card.number', $this->number]);
$query->andFilterWhere(['like', 'card.rfid_key', $this->rfid_key]);
$query->andFilterWhere(['like', 'customer.name', $this->searchCustomerName]);
if ( $this->usage == '1') {
$query->andWhere('customer.id_customer is not null');
}else if ( $this->usage == '2') {
$query->andWhere('customer.id_customer is null');
}
if ( $this->key_assigned == '1') {
$query->andWhere('key.id_key is not null');
}else if ( $this->key_assigned == '2') {
$query->andWhere('key.id_key is null');
}
Key::addKeyConditionOptional($query, $this->searchKeyNumber);
return $dataProvider;
}

View File

@@ -0,0 +1,79 @@
<?php
namespace backend\models;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use common\models\Contract;
/**
* ContractSearch represents the model behind the search form about `common\models\Contract`.
*/
class ContractCustomerSearch extends Contract
{
public $customer;
/**
* @inheritdoc
*/
public function rules()
{
return [
[['id_contract', 'id_user', 'id_customer', 'status', 'flag', 'part_paid', 'part_count', 'part_required', 'id_ticket_type'], 'integer'],
[['expired_at', '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 = Contract::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_contract' => $this->id_contract,
'id_user' => $this->id_user,
'id_customer' => $this->id_customer,
'status' => $this->status,
'flag' => $this->flag,
'part_paid' => $this->part_paid,
'part_count' => $this->part_count,
'part_required' => $this->part_required,
'expired_at' => $this->expired_at,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
'id_ticket_type' => $this->id_ticket_type,
]);
$query->andWhere(['contract.id_customer' => $this->customer->id_customer]);
return $dataProvider;
}
}

View File

@@ -0,0 +1,151 @@
<?php
namespace backend\models;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use common\models\Contract;
use yii\db\Query;
/**
* ContractSearch represents the model behind the search form about `common\models\Contract`.
*/
class ContractSearch extends Contract
{
public $customer_name;
/**
* @inheritdoc
*/
public function rules()
{
return [
[['id_contract', 'id_customer', 'status', 'flag', 'part_paid', 'part_count', 'part_required', 'id_ticket_type'], 'integer'],
[['customer_name' ], '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 = new Query();
$query->select([
'contract.id_contract as contract_id_contract',
'user.username as user_name',
'customer.id_customer as customer_id_customer',
'customer.name as customer_name',
'contract.status as contract_status',
'contract.flag as contract_flag',
'contract.part_required as contract_part_required',
'contract.part_paid as contract_part_paid',
'contract.part_count as contract_part_count',
'contract.created_at as contract_created_at',
'contract.expired_at as contract_expired_at',
]);
$query->from('contract');
$query->innerJoin('user' ,'user.id = contract.id_user');
$query->innerJoin('customer' ,'customer.id_customer = contract.id_customer');
$dataProvider = new ActiveDataProvider([
'query' => $query,
'sort' =>[
'defaultOrder' =>[
'contract_id_contract' => SORT_ASC
],
'attributes' =>[
'contract_id_contract' => [
'asc' => ['contract.id_contract' => SORT_ASC ],
'desc' => ['contract.id_contract' => SORT_DESC],
],
'user_name' => [
'asc' => ['user.username' => SORT_ASC ],
'desc' => ['user.username' => SORT_DESC],
],
'customer_id_customer' => [
'asc' => ['customer.id_customer' => SORT_ASC ],
'desc' => ['customer.id_customer' => SORT_DESC],
],
'customer_name' => [
'asc' => ['customer.name' => SORT_ASC ],
'desc' => ['customer.name' => SORT_DESC],
],
'contract_status' => [
'asc' => ['contract.status' => SORT_ASC ],
'desc' => ['contract.status' => SORT_DESC],
],
'contract_flag' => [
'asc' => ['contract.flag' => SORT_ASC ],
'desc' => ['contract.flag' => SORT_DESC],
],
'contract_part_required' => [
'asc' => ['contract.part_required' => SORT_ASC ],
'desc' => ['contract.part_required' => SORT_DESC],
],
'contract_part_paid' => [
'asc' => ['contract.part_paid' => SORT_ASC ],
'desc' => ['contract.part_paid' => SORT_DESC],
],
'contract_part_count' => [
'asc' => ['contract.part_count' => SORT_ASC ],
'desc' => ['contract.part_count' => SORT_DESC],
],
'contract_created_at' => [
'asc' => ['contract.created_at' => SORT_ASC ],
'desc' => ['contract.created_at' => SORT_DESC],
],
'contract_expired_at' => [
'asc' => ['contract.expired_at' => SORT_ASC ],
'desc' => ['contract.expired_at' => SORT_DESC],
],
]
],
]);
$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([
'contract.id_contract' => $this->id_contract,
'contract.id_user' => $this->id_user,
'contract.id_customer' => $this->id_customer,
'contract.status' => $this->status,
'contract.flag' => $this->flag,
'contract.part_paid' => $this->part_paid,
'contract.part_count' => $this->part_count,
'contract.part_required' => $this->part_required,
'contract.expired_at' => $this->expired_at,
'contract.created_at' => $this->created_at,
'contract.updated_at' => $this->updated_at,
'contract.id_ticket_type' => $this->id_ticket_type,
]);
$query->andFilterWhere(['like', 'customer.name', $this->customer_name]);
return $dataProvider;
}
}

View File

@@ -0,0 +1,75 @@
<?php
namespace backend\models;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use common\models\Key;
use yii\db\Query;
/**
* KeySearch represents the model behind the search form about `common\models\Key`.
*/
class KeyCustomerSearch extends Key
{
public $customer;
/**
* @inheritdoc
*/
public function rules()
{
return [
/*[['id_key', 'status', 'type'], 'integer'],
[['number', 'created_at', 'updated_at'], 'safe'],*/
[['number'], 'safe'],
[['rfid_key'], '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 = new Query();
$query->select(['key.number','key.rfid_key','key.created_at','key.status','key.type','card_key_assignment.created_at as assigned_at']);
$query->from('key');
$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([
]);
$query->innerJoin('card_key_assignment', 'card_key_assignment.id_key = key.id_key');
$query->innerJoin('customer', 'card_key_assignment.id_card = customer.id_customer_card');
$query->andWhere(['customer.id_customer' => $this->customer->id_customer]);
return $dataProvider;
}
}

View File

@@ -0,0 +1,69 @@
<?php
namespace backend\models;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use common\models\MessageDetsta;
/**
* MessageDetstaSearch represents the model behind the search form about `common\models\MessageDetsta`.
*/
class MessageDetstaSearch extends MessageDetsta
{
/**
* @inheritdoc
*/
public function rules()
{
return [
[['id_message', 'id_user'], 'integer'],
[['path', '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 = MessageDetsta::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_message' => $this->id_message,
'id_user' => $this->id_user,
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
]);
$query->andFilterWhere(['like', 'path', $this->path]);
return $dataProvider;
}
}

View File

@@ -0,0 +1,184 @@
<?php
namespace backend\models;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use common\models\ProductCategory;
use yii\db\Query;
use common\models\Transfer;
use common\models\Product;
use common\models\Account;
use common\components\Helper;
use common\components\RoleDefinition;
/**
* ProductCategorySearch represents the model behind the search form about `common\models\ProductCategory`.
*/
class ProductStatisticsSearch extends Product
{
public $start;
public $end;
public $timestampStart;
public $timestampEnd;
/**
* if output is 'xls', dataprovider pagination will be false
* */
public $output = '';
/**
* @inheritdoc
*/
public function rules()
{
return [
[['id_product_category', 'status','id_account'], 'integer'],
[['name','barcode','product_number','output' ], 'safe'],
[[ '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' ],
];
}
/**
* @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();
$query->select([
'product.id_product as product_id_product',
'product.name as product_name',
'product.sale_price as product_sale_price',
'product.product_number as product_number',
'product.barcode as product_barcode',
"father_account.name as father_account_name",
// "coalesce(account.name,'-') as account_name",
'coalesce(sum(transfer.count),0) as transfer_count',
'coalesce(sum(transfer.money),0) as transfer_money',
]);
$query->from("product");
$query->innerJoin('account as father_account','father_account.id_account = product.id_account');
$query->innerJoin('product_category','product_category.id_product_category = product.id_product_category');
$query->leftJoin("sale" ,'sale.id_product = product.id_product ' );
$query->leftJoin("transfer" ,'transfer.id_object = sale.id_sale and transfer.type =' .Transfer::TYPE_PRODUCT );
$query->leftJoin('account','account.id_account = transfer.id_account');
if ( !RoleDefinition::isAdmin() ){
$query->innerJoin ( "user_account_assignment", 'father_account.id_account = user_account_assignment.id_account' );
$query->andWhere ( [
'user_account_assignment.id_user' => Yii::$app->user->id
] );
$query->andWhere(['account.type' => Account::TYPE_ALL]);
}
$query->andWhere(['in' , 'transfer.status',[Transfer::STATUS_PAID,Transfer::STATUS_NOT_PAID]]);
$query->groupBy([
'product.id_product',
'product.name',
'product.sale_price',
'father_account.name',
'product.barcode',
'product.product_number',
]);
$dataProvider = new ActiveDataProvider([
'query' => $query,
'sort' =>[
'defaultOrder' =>[
'product_name' => SORT_ASC
],
'attributes' =>[
'product_name' => [
'asc' => ['product.name' => SORT_ASC ],
'desc' => ['product.name' => SORT_DESC],
],
'product_number' => [
'asc' => ['product.product_number' => SORT_ASC ],
'desc' => ['product.product_number' => SORT_DESC],
],
'product_barcode' => [
'asc' => ['product.barcode' => SORT_ASC ],
'desc' => ['product.barcode' => SORT_DESC],
],
'father_account_name' => [
'asc' => ['father_account.name' => SORT_ASC ],
'desc' => ['father_account.name' => SORT_DESC],
],
'product_sale_price' => [
'asc' => ['product.sale_price' => SORT_ASC ],
'desc' => ['product.sale_price' => SORT_DESC],
],
'transfer_count' => [
'asc' => ['coalesce(sum(transfer.count),0)' => SORT_ASC ],
'desc' => ['coalesce(sum(transfer.count),0)' => SORT_DESC],
],
'transfer_money' => [
'asc' => ['coalesce(sum(transfer.money),0)' => SORT_ASC ],
'desc' => ['coalesce(sum(transfer.money),0)' => SORT_DESC],
],
// 'account_name' => [
// 'asc' => ['account.name' => SORT_ASC ],
// 'desc' => ['account.name' => SORT_DESC],
// ],
]
],
]);
$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;
}
if ( $this->output == 'xls'){
$dataProvider->pagination = false;
}
$query->andFilterWhere([
'product_category.id_product_category' => $this->id_product_category,
'product.barcode' => Helper::fixAsciiChars($this->barcode),
'product.product_number' => Helper::fixAsciiChars($this->product_number),
'product.name' => ($this->name),
'product.id_account' => ($this->id_account),
// 'id_product_category' => $this->id_product_category,
]);
$created_condition = ['and',[ '>=', 'transfer.created_at', $this->timestampStart ] ,[ '<', 'transfer.created_at', $this->timestampEnd ] ];
$paid_condition = ['and',[ '>=', 'transfer.paid_at', $this->timestampStart ] ,[ '<', 'transfer.paid_at', $this->timestampEnd ] ];
$query->andFilterWhere(['or' , $created_condition , $paid_condition]);
// $query->andFilterWhere(['like', 'product.name', $this->name]);
return $dataProvider;
}
}

View File

@@ -30,6 +30,8 @@ class TicketSearch extends Ticket
public $statistics;
public $statisticsTotal;
public $customer;
/**
* @inheritdoc

View File

@@ -0,0 +1,296 @@
<?php
namespace backend\models;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;
use common\models\Ticket;
use common\components\Helper;
use yii\db\ActiveRecord;
use yii\helpers\ArrayHelper;
use yii\db\Query;
use common\models\Transfer;
/**
* TicketSearch represents the model behind the search form about `common\models\Ticket`.
*/
class TicketSearchCustomer extends Ticket
{
public $timestampStart;
public $timestampEnd;
public $users;
public $accounts;
public $ticketTypes;
public $valid_in_interval;
public $created_in_interval;
public $expire_in_interval;
public $statistics;
public $statisticsTotal;
public $customer;
/**
* @inheritdoc
*/
public function rules()
{
return [
[[ 'id_ticket', 'id_user', 'id_ticket_type', 'id_account','status'], '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'] ,
];
}
/**
* @inheritdoc
*/
public function scenarios()
{
// bypass scenarios() implementation in the parent class
return Model::scenarios();
}
public function attributeLabels(){
return ArrayHelper::merge(parent::attributeLabels(), [
'start' => Yii::t('backend/ticket','Start of interval'),
'end' => Yii::t('backend/ticket','End of interval'),
'valid_in_interval' => Yii::t('backend/ticket','Valid in interval'),
'created_in_interval' => Yii::t('backend/ticket','Created in interval'),
'expire_in_interval' => Yii::t('backend/ticket','Expire in interval'),
]);
}
public function afterValidate(){
if ( !isset($this->timestampStart)) {
$this->timestampStart ='1900-01-01';
}
if ( !isset($this->timestampEnd)) {
$this->timestampEnd ='3000-01-01';
}
}
/**
* Creates data provider instance with search query applied
*
* @param array $params
*
* @return ActiveDataProvider
*/
public function search($params)
{
$query = new Query();
$query->select([
'ticket.id_ticket as ticket_id_ticket',
'account.name as account_name',
'card.number as card_number',
'ticket_type.name as ticket_type_name',
'ticket.start as ticket_start',
'ticket.end as ticket_end',
'ticket.max_usage_count as ticket_max_usage_count',
'ticket.usage_count as ticket_usage_count',
'user.username as user_username',
'paid_by.username as paid_by_username',
'ticket.status as ticket_status',
'ticket.price_brutto as ticket_price_brutto',
]);
$query->from('ticket');
$query->innerJoin('ticket_type', 'ticket_type.id_ticket_type = ticket.id_ticket_type');
$query->innerJoin('transfer', 'transfer.id_object = ticket.id_ticket and transfer.type = ' . Transfer::TYPE_TICKET);
$query->innerJoin('account', 'account.id_account = ticket.id_account');
$query->innerJoin('user', 'user.id = transfer.id_user');
$query->leftJoin('user as paid_by', 'paid_by.id = transfer.paid_by');
$query->leftJoin('card', 'ticket.id_card = card.id_card');
$query->leftJoin('customer', 'customer.id_customer_card = card.id_card');
Helper::queryAccountConstraint($query, 'ticket.id_account');
$dataProvider = new ActiveDataProvider([
'query' => $query,
'sort' =>[
// 'defaultOrder' => ['end' => SORT_DESC],
'attributes' => [
// 'end',
'ticket_id_ticket' => [
'asc' => ['ticket.id_ticket' => SORT_ASC ],
'desc' => ['ticket.id_ticket' => SORT_DESC],
],
'ticket_start' => [
'asc' => ['ticket.start' => SORT_ASC ],
'desc' => ['ticket.start' => SORT_DESC],
],
'ticket_end' => [
'asc' => ['ticket.end' => SORT_ASC ],
'desc' => ['ticket.end' => SORT_DESC],
],
'user_username' => [
'asc' => ['user.username' => SORT_ASC ],
'desc' => ['user.username' => SORT_DESC],
],
'paid_by_username' => [
'asc' => ['paid_by.username' => SORT_ASC ],
'desc' => ['paid_by.username' => SORT_DESC],
],
'ticket_type_name' => [
'asc' => ['ticket_type.name' => SORT_ASC ],
'desc' => ['ticket_type.name' => SORT_DESC],
],
'account_name' => [
'asc' => ['account.name' => SORT_ASC ],
'desc' => ['account.name' => SORT_DESC],
],
'ticket_status' => [
'asc' => ['ticket.status' => SORT_ASC ],
'desc' => ['ticket.status' => SORT_DESC],
],
'ticket_price_brutto' => [
'asc' => ['ticket.price_brutto' => SORT_ASC ],
'desc' => ['ticket.price_brutto' => SORT_DESC],
],
// 'id_card' => [
// 'asc' => ['card.number' => SORT_ASC ],
// 'desc' => ['card.number' => SORT_DESC],
// ],
]
]
]);
$this->load($params);
if (!$this->validate()) {
$query->where('0=1');
return $query;
}
$query->andFilterWhere([
'ticket.id_user' => $this->id_user,
'ticket.id_ticket_type' => $this->id_ticket_type,
'ticket.id_account' => $this->id_account,
'ticket.id_card' => $this->id_card,
'ticket.id_ticket' => $this->id_ticket,
'ticket.status' => $this->status
]);
$query->andWhere(['customer.id_customer' => $this->customer->id_customer]);
$all = (!($this->valid_in_interval) && !($this->expire_in_interval) && !($this->created_in_interval) )
||
($this->valid_in_interval == true && $this->expire_in_interval == true && $this->created_in_interval);
$dateConditions = [];
$start = $this->timestampStart;
$end = $this->timestampEnd;
if( $all || $this->created_in_interval ){
$dateConditions[] = Helper::queryInIntervalRule('ticket.created_at', $start, $end);
}
if ( $all || $this->valid_in_interval ){
$dateConditions[] = Helper::queryValidRule('ticket.start', 'ticket.end', $start, $end);
}
if ( $all || $this->expire_in_interval ){
$dateConditions[] = Helper::queryExpireRule('ticket.start', 'ticket.end', $start, $end);
}
if ( count($dateConditions) == 1 ){
$query->andWhere($dateConditions[0]);
}else if ( count($dateConditions) > 1 ){
$cond = ['or'];
foreach ($dateConditions as $c){
$cond[] = $c;
}
$query->andWhere($cond);
}
return $dataProvider;
}
public function searchTotals(){
$query = Ticket::mkStatisticQuery($this->timestampStart, $this->timestampEnd,$this->id_card);
$this->statistics = $query->all();
$this->statisticsTotal =[
'valid' => 0,
'created' => 0,
'created_at_money' => 0,
'expired' => 0,
];
$this->statisticsTotal['valid'] = array_sum(array_column($this->statistics, 'valid'));
$this->statisticsTotal['created'] = array_sum(array_column($this->statistics, 'created'));
$this->statisticsTotal['created_money'] = array_sum(array_column($this->statistics, 'created_money'));
$this->statisticsTotal['expired'] = array_sum(array_column($this->statistics, 'expired'));
}
public static function mkSearchCondition( $timestampStart, $timestampEnd, $id_user,$id_ticket_tpye,$id_account,$valid_in_interval ,$expire_in_interval,$created_in_interval ){
$query = Ticket::find();
Helper::queryAccountConstraint($query, 'ticket.id_account');
$query->with('ticketType' );
$query->with('user');
$query->with('customer');
$query->andFilterWhere([
'id_user' => $id_user,
'id_ticket_type' => $id_ticket_type,
'id_account' => $id_account,
]);
$all = (!($valid_in_interval) && !($expire_in_interval) && !($created_in_interval) )
||
($valid_in_interval == true && $expire_in_interval == true && $created_in_interval);
$dateConditions = [];
$start = $timestampStart;
$end = $timestampEnd;
if( $all || $created_in_interval ){
$dateConditions[] = Helper::queryInIntervalRule('ticket.created_at', $start, $end);
}
if ( $all || $valid_in_interval ){
$dateConditions[] = Helper::queryValidRule('ticket.start', 'ticket.end', $start, $end);
}
if ( $all || $expire_in_interval ){
$dateConditions[] = Helper::queryExpireRule('ticket.start', 'ticket.end', $start, $end);
}
if ( count($dateConditions) == 1 ){
$query->andWhere($dateConditions[0]);
}else if ( count($dateConditions) > 1 ){
$cond = ['or'];
foreach ($dateConditions as $c){
$cond[] = $c;
}
$query->andWhere($cond);
}
}
}

View File

@@ -45,7 +45,7 @@ $userOptions = ['' => 'Mind'] + HtmlHelper::mkOptions($users,'id','username')
'autoclose'=>true,
'format' => 'yyyy.mm.dd'
]
]) ?>
])->label('Időszak kezdete') ?>
</div>
<div class="col-md-4">
<?= $form->field($model, 'end') ->widget(DatePicker::classname(), [
@@ -53,7 +53,7 @@ $userOptions = ['' => 'Mind'] + HtmlHelper::mkOptions($users,'id','username')
'autoclose'=>true,
'format' => 'yyyy.mm.dd'
]
]) ?>
]) ->label('Időszak vége') ?>
</div>
</div>

View File

@@ -49,6 +49,15 @@ $statusOptions = mkOptions(Card::statuses());
<div class='col-md-3'>
<?= $form->field($model, 'rfid_key')->textInput() ?>
</div>
<div class='col-md-3'>
<?= $form->field($model, 'searchKeyNumber')->textInput()->label("Kulcs") ?>
</div>
<div class='col-md-3'>
<?= $form->field($model, 'usage')->dropDownList(['' => 'Mind' , '1' => 'Használt', '2' => 'Üres' ])->label("Használat") ?>
</div>
<div class='col-md-3'>
<?= $form->field($model, 'key_assigned')->dropDownList(['' => 'Mind' , '1' => 'Kulcs hozzárendelve', '2' => 'Kulcs nélkül' ])->label("Kulcs hozzárendelés") ?>
</div>
</div>

View File

@@ -2,6 +2,8 @@
use yii\helpers\Html;
use yii\grid\GridView;
use common\models\Card;
use yii\helpers\Url;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\CardSearch */
@@ -10,6 +12,13 @@ use yii\grid\GridView;
$this->title = Yii::t('common/card', 'Cards');
$this->params['breadcrumbs'][] = $this->title;
?>
<style>
.grid-view a{
margin-right: 6px;
}
</style>
<div class="card-index">
<h1><?= Html::encode($this->title) ?></h1>
@@ -23,33 +32,63 @@ $this->params['breadcrumbs'][] = $this->title;
'dataProvider' => $dataProvider,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
[
'attribute' => 'number',
'value' => 'number'
'attribute' => 'card_number',
'label' => 'Kártyaszám'
],
[
'attribute' => 'rfid_key',
'value' => 'rfid_key'
'attribute' => 'card_rfid_key',
'label' => 'RFID szám'
],
[
'attribute' => 'status',
'value' => 'statusHuman'
'attribute' => 'card_status',
'label' => 'Státusz',
'value' => function ($model, $key, $index, $column){
return Card::toStatusName($model['card_status'],'-');
}
],
[
'attribute' => 'type',
'value' => 'typeHuman'
],
[
'attribute' => 'customerName',
'value' => 'customerName'
],
'updated_at:datetime',
[
'attribute' => 'card_type',
'label' => 'Típus',
'value' => function ($model, $key, $index, $column){
return Card::toTypeName($model['card_type'],'-');
}
],
[
'attribute' => 'customer_id_customer',
'label' => 'Vendég azonosító'
],
[
'attribute' => 'customer_name',
'label' => 'Vendég név'
],
[
'attribute' => 'key_number',
'label' => 'Kulcs száma'
],
[
'class' => 'yii\grid\ActionColumn',
'template' => '{view}{update}'
],
'template' => '{view}{update}',
'urlCreator' => function ($action, $model, $key, $index){
$result = "";
if ( 'view' == $action ){
$result = Url::toRoute(['card/view' , 'id' => $model['card_id_card'] ]);
}else if ( 'update' == $action ){
$result = Url::toRoute(['card/update' , 'id' => $model['card_id_card'] ]);
}
return $result;
},
'buttons' =>[
'view' => function ($url, $model, $key) {
return Html::a("Nézet" ,$url,['class' =>'btn btn-primary btn-xs']);
},
'update' => function ($url, $model, $key) {
return Html::a("Módosít" ,$url,['class' =>'btn btn-primary btn-xs']);
},
]
],
],
]); ?>

View File

@@ -0,0 +1,53 @@
<?php
use yii\helpers\Url;
?>
<?php
$route = \Yii::$app->controller->id .'/'. \Yii::$app->controller->action->id;
$items = [
// [ 'Recepció', ['customer/reception', 'number' => $card->number ]],
// [ 'Termék eladás', ['product/sale', 'number' => $card->number ]],
[ 'Információ', ['customer/view', 'id' => $customer->id_customer ]],
[ 'Adatlap', ['customer/update', 'id' => $customer->id_customer ]],
[ 'Befizetések', ['ticket/index-customer', 'id' => $customer->id_customer ]],
[ 'Kulcsok', ['key/index-customer','id' => $customer->id_customer ]],
[ 'Szerződések', ['contract/index-customer', 'id' => $customer->id_customer ]],
// [ 'Kosár', ['transfer/customer-cart', 'id_card' => $card->id_card ]],
];
?>
<ul class="nav nav-tabs">
<?php foreach ($items as $item){?>
<?php
if ( empty($title)){
if ( $item[1][0] == $route) {
$title = $item[0];
}
}
?>
<li role="presentation" class="<?php echo $item[1][0] == $route ? 'active' : '' ?>"><a href="<?php echo Url::toRoute($item[1])?>"><?php echo $item[0] ?></a></li>
<?php }?>
</ul>
<?php if ( !empty($title)) {?>
<h1><?php echo $title?></h1>
<p>Vendég: <?php echo $card->customer->name ?></p>
<p>Kártyaszám: <?php echo $card->number ?></p>
<?php }?>

View File

@@ -0,0 +1,45 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model common\models\Contract */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="contract-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'id_contract')->textInput() ?>
<?= $form->field($model, 'id_user')->textInput() ?>
<?= $form->field($model, 'id_customer')->textInput() ?>
<?= $form->field($model, 'status')->textInput() ?>
<?= $form->field($model, 'flag')->textInput() ?>
<?= $form->field($model, 'part_paid')->textInput() ?>
<?= $form->field($model, 'part_count')->textInput() ?>
<?= $form->field($model, 'part_required')->textInput() ?>
<?= $form->field($model, 'expired_at')->textInput() ?>
<?= $form->field($model, 'created_at')->textInput() ?>
<?= $form->field($model, 'updated_at')->textInput() ?>
<?= $form->field($model, 'id_ticket_type')->textInput() ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? Yii::t('common/door_log', 'Create') : Yii::t('common/door_log', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@@ -0,0 +1,49 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model backend\models\ContractSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="contract-search">
<?php $form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
]); ?>
<?= $form->field($model, 'id_contract') ?>
<?= $form->field($model, 'id_user') ?>
<?= $form->field($model, 'id_customer') ?>
<?= $form->field($model, 'status') ?>
<?= $form->field($model, 'flag') ?>
<?php // echo $form->field($model, 'part_paid') ?>
<?php // echo $form->field($model, 'part_count') ?>
<?php // echo $form->field($model, 'part_required') ?>
<?php // echo $form->field($model, 'expired_at') ?>
<?php // echo $form->field($model, 'created_at') ?>
<?php // echo $form->field($model, 'updated_at') ?>
<?php // echo $form->field($model, 'id_ticket_type') ?>
<div class="form-group">
<?= Html::submitButton(Yii::t('common/door_log', 'Search'), ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton(Yii::t('common/door_log', 'Reset'), ['class' => 'btn btn-default']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@@ -0,0 +1,40 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model backend\models\ContractSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="contract-search">
<?php $form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
]); ?>
<div class="row">
<div class="col-md-3">
<?= $form->field($model, 'id_contract')->label('Szerződés azonosító') ?>
</div>
<div class="col-md-3">
<?= $form->field($model, 'id_customer')->label('Vendég azonosító') ?>
</div>
<div class="col-md-3">
<?= $form->field($model, 'customer_name')->label('Vendég neve') ?>
</div>
<div class="col-md-3">
</div>
</div>
<div class="form-group">
<?= Html::submitButton("Keresés", ['class' => 'btn btn-primary']) ?>
</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\Contract */
$this->title = Yii::t('common/door_log', 'Create Contract');
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/door_log', 'Contracts'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="contract-create">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>

View File

@@ -0,0 +1,57 @@
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use backend\components\AdminCustomerTabWidget;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\ContractSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = "Vendég szerződések";
$this->params['breadcrumbs'][] = "Vendég";
$this->params['breadcrumbs'][] = "Szerződések";
?>
<?php echo AdminCustomerTabWidget::widget(['customer' => $searchModel->customer]) ?>
<div class="contract-index">
<?php // echo $this->render('_search-customer', ['model' => $searchModel]); ?>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
[
'label' => 'Szerződés azonosító',
'value' => 'id_contract',
'attribute' =>'id_contract',
],
[
'label' => 'Felhasználó',
'value' => 'userName',
'attribute' =>'id_user',
],
[
'label' => 'Státusz',
'value' => 'statusName',
'attribute' =>'status',
],
[
'label' => 'Állapot',
'value' => 'flagName',
'attribute' =>'flag',
],
[
'label' => 'Lejárat',
'value' => 'expired_at',
'attribute' =>'expired_at',
'format' => 'date'
],
'created_at:datetime',
// ['class' => 'yii\grid\ActionColumn'],
],
]); ?>
</div>

View File

@@ -0,0 +1,85 @@
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use common\models\Contract;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\ContractSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = "Szerződések";
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="contract-index">
<h1><?php echo "Szerződések" ?></h1>
<?php echo $this->render('_search', ['model' => $searchModel]); ?>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
/*
* 'contract.id_contract as contract_id_contract',
'user.username as user_name',
'customer.id_customer as customer_id_customer',
'customer.name as customer_name',
'customer.status as customer_status',
'customer.flags as customer_flags',*/
[
'attribute' => 'contract_id_contract' ,
'label' =>'Szerződés azonosító'
],
[
'attribute' => 'user_name' ,
'label' =>'Felhasználó'
],
[
'attribute' => 'customer_id_customer' ,
'label' =>'Vendég azonosító'
],
[
'attribute' => 'customer_name' ,
'label' =>'Vendég név'
],
[
'attribute' => 'contract_status' ,
'label' =>'Státusz',
'value' => function ($model, $key, $index, $column){
return Contract::toStatusName($model['contract_status']);
}
],
[
'attribute' => 'contract_flag' ,
'label' =>'Állapot',
'value' => function ($model, $key, $index, $column){
return Contract::toFlangName($model['contract_flag']);
}
],
[
'attribute' => 'contract_part_count' ,
'label' =>'Összes részlet'
],
[
'attribute' => 'contract_part_required' ,
'label' =>'Esedékes részletek'
],
[
'attribute' => 'contract_part_paid' ,
'label' =>'Részletek fizetve'
],
[
'attribute' => 'contract_created_at' ,
'label' =>'Létrehozva',
'format' => 'date'
],
[
'attribute' => 'contract_expired_at' ,
'label' =>'Lejárat',
'format' => 'date'
],
],
]); ?>
</div>

View File

@@ -0,0 +1,23 @@
<?php
use yii\helpers\Html;
/* @var $this yii\web\View */
/* @var $model common\models\Contract */
$this->title = Yii::t('common/door_log', 'Update {modelClass}: ', [
'modelClass' => 'Contract',
]) . ' ' . $model->id_contract;
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/door_log', 'Contracts'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->id_contract, 'url' => ['view', 'id' => $model->id_contract]];
$this->params['breadcrumbs'][] = Yii::t('common/door_log', 'Update');
?>
<div class="contract-update">
<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\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model common\models\Contract */
$this->title = $model->id_contract;
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/door_log', 'Contracts'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="contract-view">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a(Yii::t('common/door_log', 'Update'), ['update', 'id' => $model->id_contract], ['class' => 'btn btn-primary']) ?>
<?= Html::a(Yii::t('common/door_log', 'Delete'), ['delete', 'id' => $model->id_contract], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => Yii::t('common/door_log', 'Are you sure you want to delete this item?'),
'method' => 'post',
],
]) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id_contract',
'id_user',
'id_customer',
'status',
'flag',
'part_paid',
'part_count',
'part_required',
'expired_at',
'created_at',
'updated_at',
'id_ticket_type',
],
]) ?>
</div>

View File

@@ -1,18 +1,18 @@
<?php
use yii\helpers\Html;
use backend\components\AdminCustomerTabWidget;
/* @var $this yii\web\View */
/* @var $model common\models\Customer */
$this->title = Yii::t('common/customer', 'Módosítás: ' ) . ' ' . $model->name;
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/customer', 'Customers'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->id_customer]];
$this->title = "Vendég módosítása";
$this->params['breadcrumbs'][] = "Vendég";
$this->params['breadcrumbs'][] = Yii::t('common/customer', 'Update');
?>
<?php echo AdminCustomerTabWidget::widget(['customer' => $model]) ?>
<div class="customer-update">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form_update', [
'model' => $model,

View File

@@ -2,21 +2,21 @@
use yii\helpers\Html;
use yii\widgets\DetailView;
use yii\base\Widget;
use backend\components\AdminCustomerTabWidget;
/* @var $this yii\web\View */
/* @var $model common\models\Customer */
$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/customer', 'Customers'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
$this->title = "Vendég információk";
$this->params['breadcrumbs'][] = "Vendég";
$this->params['breadcrumbs'][] = "Információk";
?>
<?php echo AdminCustomerTabWidget::widget(['customer' => $model]) ?>
<div class="customer-view">
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a(Yii::t('common/customer', 'Update'), ['update', 'id' => $model->id_customer], ['class' => 'btn btn-primary']) ?>
</p>
<?= DetailView::widget([
'model' => $model,

View File

@@ -0,0 +1,53 @@
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use common\models\Key;
use backend\components\AdminCustomerTabWidget;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\KeySearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('backend/key', 'Keys');
$this->params['breadcrumbs'][] = "Vendég";
$this->params['breadcrumbs'][] = "Kulcsok";
?>
<?php echo AdminCustomerTabWidget::widget(['customer' => $searchModel->customer]) ?>
<div class="key-index">
<?= GridView::widget([
'dataProvider' => $dataProvider,
//'filterModel' => $searchModel, // ezt nem szeretjük
'columns' => [
// ['class' => 'yii\grid\SerialColumn'],
// 'id_key',
[
'attribute' => 'number',
'label' => "Kulcs szám",
],
[
'attribute' => 'rfid_key',
'label' => "RFID kód",
],
[
'attribute' => 'status',
'value' => function ($model, $key, $index, $column){
$statuszok = Key::statuses();
$result = $statuszok[$model['status']];
return $result;
}
],
[
'attribute' => 'assigned_at',
'label' => "Kiadva",
'format' =>'datetime'
],
],
]); ?>
</div>

View File

@@ -0,0 +1,31 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model common\models\MessageDetsta */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="message-detsta-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'id_message')->textInput() ?>
<?= $form->field($model, 'path')->textInput(['maxlength' => true]) ?>
<?= $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/message_detsta', 'Create') : Yii::t('common/message_detsta', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@@ -0,0 +1,35 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model backend\models\MessageDetstaSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<div class="message-detsta-search">
<?php $form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
]); ?>
<?= $form->field($model, 'id_message') ?>
<?= $form->field($model, 'path') ?>
<?= $form->field($model, 'id_user') ?>
<?= $form->field($model, 'created_at') ?>
<?= $form->field($model, 'updated_at') ?>
<div class="form-group">
<?= Html::submitButton(Yii::t('common/message_detsta', 'Search'), ['class' => 'btn btn-primary']) ?>
<?= Html::resetButton(Yii::t('common/message_detsta', '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\MessageDetsta */
$this->title = Yii::t('common/message_detsta', 'Create Message Detsta');
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/message_detsta', 'Message Detstas'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="message-detsta-create">
<h1><?= Html::encode($this->title) ?></h1>
<?= $this->render('_form', [
'model' => $model,
]) ?>
</div>

View File

@@ -0,0 +1,38 @@
<?php
use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\MessageDetstaSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('common/message_detsta', 'Message Detstas');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="message-detsta-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?= Html::a(Yii::t('common/message_detsta', 'Create Message Detsta'), ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'id_message',
'path',
'id_user',
'created_at',
'updated_at',
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
</div>

View File

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

View File

@@ -0,0 +1,171 @@
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model common\models\MessageDetsta */
$this->title = $model->id_message;
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/message_detsta', 'Message Detstas'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="message-detsta-view">
<?php
echo Html::a("Vissza a köteghez",['ugiro/view', 'id' => $model->id_ugiro] ,[ 'class' => 'btn btn-primary']);
?>
<div class="row">
<div class="col-md-4">
<h1>Fej</h1>
<?= DetailView::widget([
'model' => $model->fej,
'attributes' => [
[
'attribute' => 'record_tipus' ,
'label' => 'Rekord típus'
],
[
'attribute' => 'uzenet_tipus' ,
'label' => 'Üzenet típus'
],
[
'attribute' => 'jelentes_jelzo' ,
'label' => 'Jelentés jelző'
],
[
'attribute' => 'kezdemenyezo_azonosito' ,
'label' => 'Kezdeményező azonosító'
],
[
'attribute' => 'csoportos_uzenet_sorszam' ,
'label' => 'Csoportos üzenet sorszám'
],
[
'attribute' => 'csoportos_uzenet_datum' ,
'label' => 'Csoportos üzenet dátum',
'format' => 'date'
],
[
'attribute' => 'detsta_uzenet_sorszam' ,
'label' => 'Detsta üzenet sorszám'
],
[
'attribute' => 'detsta_uzenet_datum' ,
'label' => 'Detsta üzenet dátum',
'format' => 'date'
],
[
'attribute' => 'ido' ,
'label' => 'Idő'
],
],
]) ?>
</div>
<div class="col-md-4">
<h1>Láb</h1>
<?= DetailView::widget([
'model' => $model->lab,
'attributes' => [
[
'attribute' => 'record_tipus' ,
'label' => 'Rekord típus'
],
[
'attribute' => 'teljesitett_tetelek_szama' ,
'label' => 'Teljesített tételek száma'
],
[
'attribute' => 'teljesitett_tetelek_osszerteke' ,
'label' => 'Teljesített tételek összértéke'
],
[
'attribute' => 'visszautasitott_tetelek_szama' ,
'label' => 'Visszautasított tételek száma'
],
[
'attribute' => 'visszautasitott_tetelek_osszerteke' ,
'label' => 'Visszautasított tételek összértéke'
],
[
'attribute' => 'megnemvalaszolt_tetelek_szama' ,
'label' => 'Meg nem válaszolt tételek száma'
],
[
'attribute' => 'megnemvalaszolt_tetelek_osszerteke' ,
'label' => 'Meg nem válaszolt tételek összértéke'
],
],
]) ?>
</div>
</div>
<div class="row">
<div class="col-md-4">
<h1>Tételek</h1>
<?php
$tetelek = $model->tetelek;
foreach ($tetelek as $tetel){
echo "<h2>Tétel: ".$tetel->tetel_sorszam."</h2>";
echo DetailView::widget([
'model' => $tetel,
'attributes' => [
[
'attribute' => 'record_tipus' ,
'label' => 'Rekord típus'
],
[
'attribute' => 'tetel_sorszam' ,
'label' => 'Tétel sorszám'
],
[
'attribute' => 'osszeg' ,
'label' => 'Összeg'
],
[
'attribute' => 'eredeti_tetel_elszamolasi_datuma' ,
'label' => 'Eredeti tétel elszámolási dátum'
],
[
'attribute' => 'visszajelzes_informacio' ,
'label' => 'Visszajelzés Informacio'
],
[
'attribute' => 'terhelesi_datum' ,
'label' => 'Terhelési dátuma'
],
[
'attribute' => 'feldolgozas_datum' ,
'label' => 'Feldolgozás dátuma'
],
[
'attribute' => 'valasz_hivatkozasi_kod' ,
'label' => 'Válasz hivatkozási kód'
],
[
'attribute' => 'eredeti_hivatkozasi_kod' ,
'label' => 'Eredeti hivatkozási kód'
],
[
'attribute' => 'ugyfel_azonosito' ,
'label' => 'Ügyfél azonosító'
],
[
'value' => $tetel->request->customer->name ,
'label' => 'Vendég'
],
]
]);
}
?>
</div>
</div>
</div>

View File

@@ -12,15 +12,17 @@ use yii\helpers\ArrayHelper;
<?php
$warehouseOptions = ArrayHelper::map($warehouses, 'id_warehouse', 'name') ;
$accountsOptions = ArrayHelper::map($accounts, 'id_account', 'name') ;
?>
<div class="procurement-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'productIdentifier')->textInput()->hint(Yii::t('common/procurement', "Product name, product number or barcode")) ?>
<?= $form->field($model, 'productIdentifier')->textInput()->hint(Yii::t('common/procurement', "Product name, product number or barcode"))->label('Vonalkód vagy termékszám') ?>
<?= $form->field($model, 'id_warehouse')->dropDownList($warehouseOptions) ?>
<?= $form->field($model, 'id_account')->dropDownList($accountsOptions)->label('Kassza') ?>
<?= $form->field($model, 'count')->textInput() ?>

View File

@@ -17,7 +17,8 @@ $this->params['breadcrumbs'][] = $this->title;
<?= $this->render('_form', [
'model' => $model,
'warehouses' => $warehouses
'warehouses' => $warehouses,
'accounts' => $accounts
]) ?>
</div>

View File

@@ -0,0 +1,85 @@
<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use common\models\Product;
use common\models\ProductCategory;
use yii\helpers\ArrayHelper;
use common\models\Account;
use kartik\widgets\DateTimePicker;
/* @var $this yii\web\View */
/* @var $model backend\models\ProductSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<?php
function mkOptions($options){
$o = $options;
$o[''] = Yii::t('common/product','All' ) ;
return $o;
}
$statusOptions = ['' => "Mind"] + ( Product::statuses() );
$productCategories = ['' => "Mind"] + ArrayHelper::map( ProductCategory::read(null) ,'id_product_category','name') ;
$accounts = ['' => "Mind"] + ( ArrayHelper::map( Account::read(null) ,'id_account','name'));
?>
<div class="product-search">
<?php $form = ActiveForm::begin([
'action' => ['product/statistics'],
'method' => 'get',
]); ?>
<div class="row">
<div class="col-md-4">
<?= $form->field($model, 'id_product_category')->dropDownList($productCategories) ?>
</div>
<div class="col-md-4">
<?= $form->field($model, 'id_account')->dropDownList($accounts) ?>
</div>
<div class="col-md-4">
<?php // echo $form->field($model, 'status')->dropDownList($statusOptions) ?>
</div>
<div class="col-md-4">
<?= $form->field($model, 'name')->label("Terméknév") ?>
</div>
<div class="col-md-4">
<?= $form->field($model, 'barcode') ?>
</div>
<div class="col-md-4">
<?= $form->field($model, 'product_number') ?>
</div>
</div>
<div class="row">
<div class="col-md-4">
<?= $form->field($model, 'start')->widget(DateTimePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd hh:ii'
]
])->label("Időszak kezdete (inklúzív)") ?>
</div>
<div class="col-md-4">
<?= $form->field($model, 'end') ->widget(DateTimePicker::classname(), [
'pluginOptions' => [
'autoclose'=>true,
'format' => 'yyyy.mm.dd hh:ii'
]
])->label("Időszak vége (exklúzív)") ?>
</div>
</div>
<div class="form-group">
<?= Html::submitButton(Yii::t('common/product', 'Search'), ['class' => 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>

View File

@@ -0,0 +1,64 @@
<?php
use yii\helpers\Html;
use yii\grid\GridView;
use yii\helpers\Url;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\ProductSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('common/product', 'Products');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="product-index">
<h1><?php echo "Termék eladás statisztika" ?></h1>
<?php echo $this->render('_search_statistics', ['model' => $searchModel]); ?>
<?php
$params = [];
$params[ Html::getInputName($searchModel, 'output')] = "xls";
echo Html::a("XLS", Url::current($params), ['class' => 'btn btn-primary'] );
?>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
[
'attribute' => 'product_name',
'label' => 'Terméknév',
],
[
'attribute' => 'product_number',
'label' => 'Termékszám',
],
[
'attribute' => 'product_barcode',
'label' => 'Vonalkód',
],
[
'attribute' => 'father_account_name',
'label' => 'Termék kassza',
],
// [
// 'attribute' => 'account_name',
// 'label' => 'Fizetési kassza',
// ],
[
'attribute' => 'product_sale_price',
'label' => 'Eladási ár',
],
[
'attribute' => 'transfer_count',
'label' => 'Eladott mennyiség',
],
[
'attribute' => 'transfer_money',
'label' => 'Eladás összege',
],
],
]); ?>
</div>

View File

@@ -149,7 +149,7 @@ use yii\helpers\Html;
</tr>
<tr>
<th>
Sorszám a kötegben belül
Tétel sorszám
</th>
<td>
<?php echo ( $model['request_number'] ) ;?>

View File

@@ -20,7 +20,7 @@ $userOptions = ['' => 'Mind'] + ArrayHelper::map($model->users, 'id', 'userna
<div class="ticket-search">
<?php $form = ActiveForm::begin([
'action' => ['index'],
// 'action' => ['index-customer',''],
'method' => 'get',
]); ?>

View File

@@ -4,6 +4,8 @@ use yii\helpers\Html;
use yii\grid\GridView;
use yii\helpers\ArrayHelper;
use yii\data\ArrayDataProvider;
use backend\components\AdminCustomerTabWidget;
use common\models\Ticket;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\TicketSearch */
@@ -15,15 +17,15 @@ if ( isset($card)){
}
$this->title = Yii::t('common/ticket', '{customer} Tickets', ['customer'=>$customer]);
$this->params['breadcrumbs'][] = $this->title;
$this->params['breadcrumbs'][] = "Vendég";
$this->params['breadcrumbs'][] = "Befizetések";
?>
<?php echo AdminCustomerTabWidget::widget(['customer' => $searchModel->customer]) ?>
<div class="ticket-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php echo $this->render('_search_customer', ['model' => $searchModel]); ?>
@@ -83,27 +85,50 @@ $this->params['breadcrumbs'][] = $this->title;
'dataProvider' => $dataProvider,
'columns' => [
[
'attribute' => 'id_customer',
'value' => 'customerName'
'attribute' => 'ticket_id_ticket',
'label' => 'Bérlet azonosító'
],
// [
// 'attribute' => 'card_number',
// 'label' => 'Kártyaszám'
// ],
[
'attribute' => 'ticket_start',
'label' => 'Érvényesség kezdete',
'format' => 'datetime'
],
[
'attribute' => 'id_card',
'value' => 'cardNumber'
'attribute' => 'ticket_end',
'label' => 'Érvényesség vége',
'format' => 'datetime'
],
'start:date',
'end:date',
[
'attribute' => 'id_user',
'value' => 'userName'
'attribute' => 'user_username',
'label' => 'Kiadta',
],
[
'attribute' => 'paid_by_username',
'label' => 'Fizette'
],
[
'attribute' => 'id_ticket_type',
'value' => 'ticketTypeName'
'attribute' => 'ticket_type_name',
'label' => 'Típus'
],
[
'attribute' => 'id_account',
'value' => 'accountName'
'attribute' => 'account_name',
'label' => 'Kassza'
],
[
'attribute' => 'ticket_status',
'label' => 'Státusz',
'value' => function ($model, $key, $index, $column){
return Ticket::toStatusName($model['ticket_status']);
}
],
[
'attribute' => 'ticket_price_brutto',
'label' => 'Ár'
],
// 'max_usage_count',
// 'usage_count',

View File

@@ -87,6 +87,11 @@ $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']);
$detstaMessage = $model->messageDetsta;
if ( isset($detstaMessage)){
echo Html::a("Detsta üzenet",['message-detsta/view', 'id' => $detstaMessage->id_message] ,[ 'class' => 'btn btn-primary']);
}
?>
</div>