Finish v.0.0.18
This commit is contained in:
commit
aeb4f7bbc3
@ -35,10 +35,10 @@ class AdminMenuStructure{
|
|||||||
|
|
||||||
//$today = \Yii::$app->formatter->asDate( time() );
|
//$today = \Yii::$app->formatter->asDate( time() );
|
||||||
$today = \Yii::$app->formatter->asDate( strtotime('today UTC') );
|
$today = \Yii::$app->formatter->asDate( strtotime('today UTC') );
|
||||||
$tomorrow = \Yii::$app->formatter->asDate( ( 60 *60 *24 + time()));
|
$tomorrow = \Yii::$app->formatter->asDate( strtotime('tomorrow UTC') );
|
||||||
|
|
||||||
$todayDatetime = \Yii::$app->formatter->asDatetime( strtotime('today') );
|
$todayDatetime = \Yii::$app->formatter->asDatetime( strtotime('today UTC') );
|
||||||
$tomorrowDatetime = \Yii::$app->formatter->asDatetime( strtotime('tomorrow') );
|
$tomorrowDatetime = \Yii::$app->formatter->asDatetime( strtotime('tomorrow UTC') );
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////
|
/////////////////////////////
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
-0.0.18
|
||||||
|
- reception customer search
|
||||||
|
- timezone changes
|
||||||
|
- reception card read redirect changes
|
||||||
|
- fix reception ticket visiblitity
|
||||||
-0.0.17
|
-0.0.17
|
||||||
- fix helper::fixascii function
|
- fix helper::fixascii function
|
||||||
- admin pdf download
|
- admin pdf download
|
||||||
|
|||||||
@ -24,8 +24,9 @@ return [
|
|||||||
'datetimeFormat' => 'yyyy.MM.dd HH:mm',
|
'datetimeFormat' => 'yyyy.MM.dd HH:mm',
|
||||||
'timeFormat' => 'HH:mm',
|
'timeFormat' => 'HH:mm',
|
||||||
'locale' => 'hu-Hu',
|
'locale' => 'hu-Hu',
|
||||||
'timeZone' => 'Europe/Budapest',
|
// 'timeZone' => 'Europe/Budapest',
|
||||||
'defaultTimeZone' => 'UTC',
|
'timeZone' => 'UTC',
|
||||||
|
// 'defaultTimeZone' => 'UTC',
|
||||||
'nullDisplay' => "-",
|
'nullDisplay' => "-",
|
||||||
],
|
],
|
||||||
'authManager' => [
|
'authManager' => [
|
||||||
|
|||||||
@ -3,7 +3,7 @@ return [
|
|||||||
'adminEmail' => 'rocho02@gmail.com',
|
'adminEmail' => 'rocho02@gmail.com',
|
||||||
'supportEmail' => 'rocho02@gmail.com',
|
'supportEmail' => 'rocho02@gmail.com',
|
||||||
'user.passwordResetTokenExpire' => 3600,
|
'user.passwordResetTokenExpire' => 3600,
|
||||||
'version' => 'v0.0.17',
|
'version' => 'v0.0.18',
|
||||||
'company' => 'movar',//gyor
|
'company' => 'movar',//gyor
|
||||||
'company_name' => "Freimann Kft.",
|
'company_name' => "Freimann Kft.",
|
||||||
'product_visiblity' => 'account',// on reception which products to display. account or global
|
'product_visiblity' => 'account',// on reception which products to display. account or global
|
||||||
|
|||||||
88
common/models/CardSearch.php
Normal file
88
common/models/CardSearch.php
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace common\models;
|
||||||
|
|
||||||
|
use Yii;
|
||||||
|
use yii\base\Model;
|
||||||
|
use yii\data\ActiveDataProvider;
|
||||||
|
use common\models\Card;
|
||||||
|
use yii\db\Query;
|
||||||
|
use yii\helpers\ArrayHelper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CardSearch represents the model behind the search form about `common\models\Card`.
|
||||||
|
*/
|
||||||
|
class CardSearch extends Card
|
||||||
|
{
|
||||||
|
|
||||||
|
public $customerName;
|
||||||
|
/**
|
||||||
|
* @inheritdoc
|
||||||
|
*/
|
||||||
|
public function rules()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
['customerName','string','max' =>200],
|
||||||
|
['number','string','max' =>200]
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritdoc
|
||||||
|
*/
|
||||||
|
public function scenarios()
|
||||||
|
{
|
||||||
|
// bypass scenarios() implementation in the parent class
|
||||||
|
return Model::scenarios();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function attributeLabels(){
|
||||||
|
return ArrayHelper::merge(parent::attributeLabels(),
|
||||||
|
[
|
||||||
|
'card_number' => 'Kártya szám',
|
||||||
|
'customerName' => 'Vendég'
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates data provider instance with search query applied
|
||||||
|
*
|
||||||
|
* @param array $params
|
||||||
|
*
|
||||||
|
* @return ActiveDataProvider
|
||||||
|
*/
|
||||||
|
public function search($params)
|
||||||
|
{
|
||||||
|
|
||||||
|
$query = new Query();
|
||||||
|
$query->select(['card.number as card_number' , 'customer.name as customer_name', 'customer.email as customer_email','customer.phone as customer_phone']);
|
||||||
|
$query->from('card');
|
||||||
|
$query->innerJoin('customer','card.id_card = customer.id_customer_card');
|
||||||
|
$query->orderBy(['customer.name' => SORT_ASC]);
|
||||||
|
|
||||||
|
|
||||||
|
$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([
|
||||||
|
// 'lower(customer.name)' => $this->customerName
|
||||||
|
]);
|
||||||
|
|
||||||
|
$query->andFilterWhere(['like', 'customer.name', $this->customerName]);
|
||||||
|
|
||||||
|
return $dataProvider;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -59,7 +59,7 @@ class Transfer extends \common\models\BaseFitnessActiveRecord
|
|||||||
return ArrayHelper::merge( [
|
return ArrayHelper::merge( [
|
||||||
[
|
[
|
||||||
'class' => TimestampBehavior::className(),
|
'class' => TimestampBehavior::className(),
|
||||||
'value' => function(){ return date('Y-m-d H:i:s' ); }
|
'value' => function(){ return date('Y-m-d H:i:s' ,\Yii::$app->formatter->asTimestamp(date('Y-d-m h:i:s')) ); }
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'class' => DiscountAwareBehavior::className(),
|
'class' => DiscountAwareBehavior::className(),
|
||||||
|
|||||||
@ -23,8 +23,8 @@ class FrontendMenuStructure{
|
|||||||
public function __construct(){
|
public function __construct(){
|
||||||
$this->menuItems = [];
|
$this->menuItems = [];
|
||||||
|
|
||||||
$this->start = \Yii::$app->formatter->asDatetime( strtotime('today') );
|
$this->start = \Yii::$app->formatter->asDatetime( strtotime('today UTC') );
|
||||||
$this->tomorrow = Yii::$app->formatter->asDatetime( strtotime('tomorrow') );
|
$this->tomorrow = Yii::$app->formatter->asDatetime( strtotime('tomorrow UTC') );
|
||||||
$this->startDate = Yii::$app->formatter->asDate( strtotime('today UTC') );
|
$this->startDate = Yii::$app->formatter->asDate( strtotime('today UTC') );
|
||||||
$this->tomorrowDate = Yii::$app->formatter->asDate( strtotime('tomorrow UTC') );
|
$this->tomorrowDate = Yii::$app->formatter->asDate( strtotime('tomorrow UTC') );
|
||||||
|
|
||||||
@ -85,6 +85,8 @@ class FrontendMenuStructure{
|
|||||||
$items[] = ['label' => Yii::t('frontend/collection','Collections'), 'url' => ['/collection/index' , 'CollectionSearch[start]' =>$this->start,'CollectionSearch[end]' => $this->tomorrow ] ];
|
$items[] = ['label' => Yii::t('frontend/collection','Collections'), 'url' => ['/collection/index' , 'CollectionSearch[start]' =>$this->start,'CollectionSearch[end]' => $this->tomorrow ] ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$items[] = ['label' => Yii::t('frontend/card','Vendégek'), 'url' => [ '/card/index' ] ];
|
||||||
|
|
||||||
|
|
||||||
$this->menuItems[] = ['label' => Yii::t('frontend/account', 'Account'),
|
$this->menuItems[] = ['label' => Yii::t('frontend/account', 'Account'),
|
||||||
'items' => $items
|
'items' => $items
|
||||||
|
|||||||
@ -81,6 +81,16 @@ class CardController extends Controller
|
|||||||
echo Json::encode ( $out );
|
echo Json::encode ( $out );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function actionIndex(){
|
||||||
|
$searchModel = new \common\models\CardSearch();
|
||||||
|
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
|
||||||
|
|
||||||
|
return $this->render('index', [
|
||||||
|
'searchModel' => $searchModel,
|
||||||
|
'dataProvider' => $dataProvider,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -59,7 +59,8 @@ class CustomerController extends Controller
|
|||||||
if ( $model->isFreeCard() ){
|
if ( $model->isFreeCard() ){
|
||||||
return $this->redirect([ 'create', 'number' => $model->card->number ]);
|
return $this->redirect([ 'create', 'number' => $model->card->number ]);
|
||||||
}else if ( $model->isCustomerWithTicket()){
|
}else if ( $model->isCustomerWithTicket()){
|
||||||
return $this->redirect([ 'product/sale', 'number' => $model->card->number ]);
|
// return $this->redirect([ 'product/sale', 'number' => $model->card->number ]);
|
||||||
|
// return $this->redirect([ 'customer/reception', 'number' => $model->card->number ]);
|
||||||
}else if ( $model->isCardWithCustomer() ){
|
}else if ( $model->isCardWithCustomer() ){
|
||||||
return $this->redirect([ 'ticket/create', 'number' => $model->card->number ]);
|
return $this->redirect([ 'ticket/create', 'number' => $model->card->number ]);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -97,7 +97,7 @@ class TicketController extends FrontendController
|
|||||||
|
|
||||||
$discounts = Discount::read();
|
$discounts = Discount::read();
|
||||||
|
|
||||||
$ticketTypes = TicketType::read(null, Account::readDefault());
|
$ticketTypes = TicketType::read(null, null);
|
||||||
|
|
||||||
$accounts = Account::readAccounts();
|
$accounts = Account::readAccounts();
|
||||||
|
|
||||||
|
|||||||
@ -8,6 +8,7 @@ use common\models\Card;
|
|||||||
use common\models\Customer;
|
use common\models\Customer;
|
||||||
use common\models\Ticket;
|
use common\models\Ticket;
|
||||||
use common\models\Account;
|
use common\models\Account;
|
||||||
|
use common\models\CardSearch;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ContactForm is the model behind the contact form.
|
* ContactForm is the model behind the contact form.
|
||||||
@ -19,6 +20,7 @@ class ReceptionForm extends Model
|
|||||||
public $customer;
|
public $customer;
|
||||||
public $tickets;
|
public $tickets;
|
||||||
public $defaultAccount;
|
public $defaultAccount;
|
||||||
|
public $cardSearchModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritdoc
|
* @inheritdoc
|
||||||
@ -56,6 +58,8 @@ class ReceptionForm extends Model
|
|||||||
$this->defaultAccount = Account::findOne($defaultAccount);
|
$this->defaultAccount = Account::findOne($defaultAccount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->cardSearchModel = new CardSearch();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDefaultAccountName(){
|
public function getDefaultAccountName(){
|
||||||
|
|||||||
38
frontend/views/card/_search.php
Normal file
38
frontend/views/card/_search.php
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use yii\helpers\Html;
|
||||||
|
use yii\widgets\ActiveForm;
|
||||||
|
|
||||||
|
/* @var $this yii\web\View */
|
||||||
|
/* @var $model frontend\models\CollectionSearch */
|
||||||
|
/* @var $form yii\widgets\ActiveForm */
|
||||||
|
?>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="collection-search">
|
||||||
|
|
||||||
|
<?php $form = ActiveForm::begin([
|
||||||
|
'action' => ['index'],
|
||||||
|
'method' => 'get',
|
||||||
|
]); ?>
|
||||||
|
|
||||||
|
|
||||||
|
<div class='row'>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<?php echo $form->field($model, 'customerName') ?>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<?php echo $form->field($model, 'number') ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<?= Html::submitButton(Yii::t('frontend/collection', 'Search'), ['class' => 'btn btn-primary']) ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php ActiveForm::end(); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
70
frontend/views/card/index.php
Normal file
70
frontend/views/card/index.php
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use yii\helpers\Html;
|
||||||
|
use yii\grid\GridView;
|
||||||
|
use common\components\AccountTotalWidget;
|
||||||
|
use yii\helpers\Url;
|
||||||
|
|
||||||
|
/* @var $this yii\web\View */
|
||||||
|
/* @var $searchModel frontend\models\CollectionSearch */
|
||||||
|
/* @var $dataProvider yii\data\ActiveDataProvider */
|
||||||
|
|
||||||
|
$this->title = Yii::t('frontend/collection', 'Vendégek');
|
||||||
|
$this->params['breadcrumbs'][] = $this->title;
|
||||||
|
?>
|
||||||
|
<div class="collection-index">
|
||||||
|
|
||||||
|
<h1><?= Html::encode($this->title) ?></h1>
|
||||||
|
<?php echo $this->render('_search', ['model' => $searchModel]); ?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<?= GridView::widget([
|
||||||
|
'dataProvider' => $dataProvider,
|
||||||
|
'columns' => [
|
||||||
|
[
|
||||||
|
'attribute' => 'card_number',
|
||||||
|
'label' => 'Kártyaszám',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'attribute' => 'customer_name',
|
||||||
|
'label' => 'Név',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'attribute' => 'customer_phone',
|
||||||
|
'label' => 'Tel',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'attribute' => 'customer_email',
|
||||||
|
'label' => 'E-mail',
|
||||||
|
],
|
||||||
|
// [
|
||||||
|
// 'attribute' => 'customer.name',
|
||||||
|
// 'value' => 'customer.name',
|
||||||
|
// ],
|
||||||
|
|
||||||
|
|
||||||
|
['class' => 'yii\grid\ActionColumn',
|
||||||
|
'template' => '{ticket} {ticket_history}',
|
||||||
|
'buttons' => [
|
||||||
|
'ticket' => function ($url, $model, $key) {
|
||||||
|
return Html::a('Új bérlet', $url, ['class'=> 'btn btn-xs btn-success' ]) ;
|
||||||
|
},
|
||||||
|
'ticket_history' => function ($url, $model, $key) {
|
||||||
|
return Html::a('Befizetések', $url, ['class'=> 'btn btn-xs btn-success' ]) ;
|
||||||
|
},
|
||||||
|
],
|
||||||
|
'urlCreator' => function ($action, $model, $key, $index){
|
||||||
|
$url = "";
|
||||||
|
if ( 'ticket' == $action ){
|
||||||
|
$url = Url::to(['ticket/create','number' => $model['card_number']]);
|
||||||
|
}else if ( 'ticket_history' == $action ){
|
||||||
|
$url = Url::to(['ticket/index','number' => $model['card_number']]);
|
||||||
|
}
|
||||||
|
return $url;
|
||||||
|
}
|
||||||
|
],
|
||||||
|
],
|
||||||
|
]); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
@ -6,6 +6,8 @@ use frontend\components\ReceptionCardNumberTicketsWidget;
|
|||||||
use yii\base\Widget;
|
use yii\base\Widget;
|
||||||
use frontend\components\ReceptionTicketWidget;
|
use frontend\components\ReceptionTicketWidget;
|
||||||
use frontend\components\ReceptionCustomerWidget;
|
use frontend\components\ReceptionCustomerWidget;
|
||||||
|
use yii\widgets\ActiveForm;
|
||||||
|
use yii\helpers\Html;
|
||||||
?>
|
?>
|
||||||
<div class='row'>
|
<div class='row'>
|
||||||
<div class='col-md-4'>
|
<div class='col-md-4'>
|
||||||
@ -13,6 +15,19 @@ use frontend\components\ReceptionCustomerWidget;
|
|||||||
Aktuális kassza: <?php echo $model->getDefaultAccountName();?>
|
Aktuális kassza: <?php echo $model->getDefaultAccountName();?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<?php $form = ActiveForm::begin([
|
||||||
|
'action' => ['card/index'],
|
||||||
|
'method' => 'get',
|
||||||
|
]); ?>
|
||||||
|
<div class='col-md-3'>
|
||||||
|
<?php echo Html::textInput('CardSearch[customerName]','',['class'=>"form-control", 'placeholder' =>'Vendég neve']) ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class='col-md-3'>
|
||||||
|
<?= Html::submitButton(Yii::t('frontend/collection', 'Search'), ['class' => 'btn btn-primary']) ?>
|
||||||
|
</div>
|
||||||
|
<?php ActiveForm::end(); ?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class='row'>
|
<div class='row'>
|
||||||
<div class='col-md-3'>
|
<div class='col-md-3'>
|
||||||
|
|||||||
@ -26,7 +26,6 @@ if ( isset($model->card)){
|
|||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="form-card-number">
|
<div class="form-card-number">
|
||||||
<?php $form = ActiveForm::begin([
|
<?php $form = ActiveForm::begin([
|
||||||
'enableAjaxValidation' => false,
|
'enableAjaxValidation' => false,
|
||||||
@ -35,7 +34,7 @@ if ( isset($model->card)){
|
|||||||
]); ?>
|
]); ?>
|
||||||
<div class="row" >
|
<div class="row" >
|
||||||
<div class='col-md-12'>
|
<div class='col-md-12'>
|
||||||
<?php echo Html::textInput("number", $number ,['class' => 'form-control'])?>
|
<?php echo Html::textInput("number", $number ,['class' => 'form-control', 'placeholder' => 'Kártyaszám'])?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row" >
|
<div class="row" >
|
||||||
@ -44,7 +43,7 @@ if ( isset($model->card)){
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php ActiveForm::end(); ?>
|
<?php ActiveForm::end(); ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -6,3 +6,9 @@ use frontend\components\ReceptionWidget;
|
|||||||
?>
|
?>
|
||||||
<h1>Recepció</h1>
|
<h1>Recepció</h1>
|
||||||
<?php echo ReceptionWidget::widget( ['form' => $model, 'route' => ['customer/reception'] ] )?>
|
<?php echo ReceptionWidget::widget( ['form' => $model, 'route' => ['customer/reception'] ] )?>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// echo "Timezone:" . date_default_timezone_get();
|
||||||
|
//echo date("Y-m-d H:i");
|
||||||
|
|
||||||
|
?>
|
||||||
|
|||||||
@ -68,7 +68,7 @@ use common\models\Account;
|
|||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class='col-md-4'>
|
<div class='col-md-4'>
|
||||||
<?php echo Html::a(Yii::t("frontend/ticket","Sell"),null,['class' => 'btn btn-danger btn-block', 'id' => 'btn_sell'] );?>
|
<?php echo Html::a(Yii::t("frontend/ticket","Fizetve"),null,['class' => 'btn btn-danger btn-block', 'id' => 'btn_sell'] );?>
|
||||||
</div>
|
</div>
|
||||||
<div class='col-md-4'>
|
<div class='col-md-4'>
|
||||||
<?php echo Html::a(Yii::t("frontend/ticket","To cart"),null,['class' => 'btn btn-success btn-block', 'id' => 'btn_add_to_user_cart'] );?>
|
<?php echo Html::a(Yii::t("frontend/ticket","To cart"),null,['class' => 'btn btn-success btn-block', 'id' => 'btn_add_to_user_cart'] );?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user