From 8b6b506d17fba92a64d76c6bb929f11a4e1dad6c Mon Sep 17 00:00:00 2001 From: Roland Schneider Date: Sat, 1 Oct 2016 18:41:21 +0200 Subject: [PATCH] Add transfer and account_state today view to reception --- common/components/DateUtil.php | 36 +++ common/components/Helper.php | 11 + common/config/params.php | 3 + frontend/components/FrontendMenuStructure.php | 230 +++++++++--------- .../controllers/AccountStateController.php | 74 ++++-- frontend/controllers/TransferController.php | 28 +++ frontend/models/AccountstateSearchToday.php | 85 +++++++ frontend/models/TransferSearchToday.php | 117 +++++++++ .../views/account-state/_search_today.php | 64 +++++ frontend/views/account-state/today.php | 37 +++ frontend/views/account-state/view.php | 6 +- frontend/views/transfer/_search_today.php | 36 +++ frontend/views/transfer/today.php | 32 +++ 13 files changed, 632 insertions(+), 127 deletions(-) create mode 100644 frontend/models/AccountstateSearchToday.php create mode 100644 frontend/models/TransferSearchToday.php create mode 100644 frontend/views/account-state/_search_today.php create mode 100644 frontend/views/account-state/today.php create mode 100644 frontend/views/transfer/_search_today.php create mode 100644 frontend/views/transfer/today.php diff --git a/common/components/DateUtil.php b/common/components/DateUtil.php index 7cc9e58..4e05d84 100644 --- a/common/components/DateUtil.php +++ b/common/components/DateUtil.php @@ -12,6 +12,34 @@ use yii\i18n\Formatter; class DateUtil { + /** + * Get UTC today @00:00:00 . + * Helper method to generate date for mysql + * + * @return \DateTime + */ + public static function todayStart( ){ + $d2 = new \DateTime(); + $d2->setTimezone( new \DateTimeZone( "UTC" ) ); + $d2->setTime(0, 0, 0); + return $d2; + } + + /** + * Get UTC t @00:00:00 . + * Helper method to generate date for mysql + * + * @return \DateTime + */ + public static function tomorrowStart( ){ + $d2 = new \DateTime(); + $d2->add(new \DateInterval('P1D')); + $d2->setTimezone( new \DateTimeZone( "UTC" ) ); + $d2->setTime(0, 0, 0); + return $d2; + } + + public static function addMonth($timestamp, $monthCount = 1) { @@ -65,4 +93,12 @@ class DateUtil return $formatter->asDatetime($dateTimeObject); } + public static function formatDateUtc($dateTimeObject) + { + $formatter = new Formatter; + $formatter->datetimeFormat = 'php:Y-m-d'; + $formatter->timeZone = 'UTC'; + return $formatter->asDatetime($dateTimeObject); + } + } \ No newline at end of file diff --git a/common/components/Helper.php b/common/components/Helper.php index aee7908..8d4d8bf 100644 --- a/common/components/Helper.php +++ b/common/components/Helper.php @@ -320,6 +320,17 @@ class Helper { public static function isTicketCreatePriceEditable() { return \Yii::$app->params ['ticket_create_price_editable'] == true ; } + + public static function isReceptionTransferListToday(){ + return \Yii::$app->params['reception_transfer_list_only_today']; + } + public static function isReceptionAccountStateIndexToday(){ + return \Yii::$app->params['reception_account_state_index_only_today']; + } + + public static function isReceptionTransferIndexEnabled(){ + return !Helper::isReceptionTransferListToday(); + } public static function getRealUserIp() { $client = @$_SERVER ['HTTP_CLIENT_IP']; diff --git a/common/config/params.php b/common/config/params.php index 59ae6a1..3645c02 100644 --- a/common/config/params.php +++ b/common/config/params.php @@ -30,6 +30,9 @@ return [ * Hány napig láthatják visszamenőleg a recepciósok az adatokat * */ 'reception_visibility_days' => 3, + 'reception_account_state_index_only_today' => false, + 'reception_transfer_list_only_today' => false, + 'backend_skin' => 'skin-red', //skin-green /**User cart module on/off*/ 'user_cart_on' => true, diff --git a/frontend/components/FrontendMenuStructure.php b/frontend/components/FrontendMenuStructure.php index 9bdfd3c..c8c116f 100644 --- a/frontend/components/FrontendMenuStructure.php +++ b/frontend/components/FrontendMenuStructure.php @@ -11,117 +11,127 @@ use backend\models\AccountSearch; use common\models\Account; use common\components\Helper; -class FrontendMenuStructure{ - - public $menuItems; - public $start;//start date and time - public $tomorrow;//tomorrow date and time - - public $startDate;//start date - public $tomorrowDate;//tomorrow date - public $yesterDay;//yesterday date - - public function __construct(){ - $this->menuItems = []; - - $this->yesterDay = \Yii::$app->formatter->asDatetime( strtotime('yesterday UTC') ); - $this->start = \Yii::$app->formatter->asDatetime( strtotime('today UTC') ); - $this->tomorrow = Yii::$app->formatter->asDatetime( strtotime('tomorrow UTC') ); - $this->startDate = Yii::$app->formatter->asDate( strtotime('today UTC') ); - $this->tomorrowDate = Yii::$app->formatter->asDate( strtotime('tomorrow UTC') ); - - Yii::info("Start date is : ". $this->start); - - - - if ( $this->isLogged() ){ - $lastAccountState = AccountState::find()->andWhere(['id_user' => Yii::$app->user->id])->andWhere(['type' => AccountState::TYPE_OPEN ])->orderBy(['account_state.created_at' => SORT_DESC])->limit(1)->one(); - if ( isset($lastAccountState) ){ - $this->start = Yii::$app->formatter->asDatetime(strtotime( $lastAccountState->created_at . ' UTC' )); - } - } +class FrontendMenuStructure +{ - } - - - - protected function can($authItem){ - $result = false; - if (\Yii::$app->user->can($authItem)) { - $result = true; - } - return $result; - } - - - protected function isLogged(){ - return !Yii::$app->user->isGuest; - } - - - protected function addRecepcio(){ - if ( $this->isLogged() ){ - - $isadmin =Yii::$app->user->can('admin') ||Yii::$app->user->can('employee'); - - $this->menuItems[] = ['label' => Yii::t('frontend/customer','Reception'), 'url' => ['/customer/reception'] ]; - - $items = [ - ['label' => Yii::t('frontend/account-state','Default account'), 'url' => ['/account/select'] ], - ['label' => Yii::t('frontend/account-state', 'Account states'), 'url' => ['/account-state/index' ,'AccountstateSearch[id_account]' => Account::readDefault(), 'AccountstateSearch[start]' => $this->yesterDay] ], - ['label' => Yii::t('frontend/account-state','Open account state'), 'url' => ['/account-state/open'] ], - ['label' => Yii::t('frontend/account-state','Close account state'), 'url' => ['/account-state/close'] ], - - ['label' => Yii::t('frontend/money-movement','Money movements'), 'url' => [ '/money-movement/index', 'MoneyMovementSearch[start]' => $this->start, 'MoneyMovementSearch[end]' => $this->tomorrow ] ], - - ]; - - if ( Helper::isCompanyMovar() ){ - $items[] = ['label' => Yii::t('frontend/transfer','Daily transfers'), 'url' => [ '/transfer/list', 'TransferListSearch[id_account]' => Account::readDefault(), 'TransferListSearch[start]' => $this->start, 'TransferListSearch[end]' => $this->tomorrow ] ]; - $items[] = ['label' => Yii::t('frontend/transfer','Sales detailed'), 'url' => [ '/transfer/sale', 'TransferSaleSearch[id_user]' =>\Yii::$app->user->id, 'TransferSaleSearch[id_account]' => Account::readDefault(), 'TransferSaleSearch[start]' => $this->start, 'TransferSaleSearch[end]' => $this->tomorrow ] ]; - $items[] = ['label' => Yii::t('frontend/transfer','Ticket sale detailed'), 'url' => [ '/transfer/tickets','TransferTicketSearch[id_user]' =>\Yii::$app->user->id, 'TransferTicketSearch[id_account]' => Account::readDefault(), 'TransferTicketSearch[start]' => $this->start, 'TransferTicketSearch[end]' => $this->tomorrow ] ]; - } - -// if ( $isadmin || Yii::$app->user->can('reception.transfers') ){ - $items[] = ['label' => Yii::t('frontend/transfer','Transfers'), 'url' => ['/transfer/index', 'TransferSearch[id_user]' =>\Yii::$app->user->id, 'TransferSearch[id_account]' => Account::readDefault(), 'TransferSearch[start]' => $this->start, 'TransferSearch[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' ] ]; + public $menuItems; + public $start;//start date and time + public $tomorrow;//tomorrow date and time + + public $startDate;//start date + public $tomorrowDate;//tomorrow date + public $yesterDay;//yesterday date + + public function __construct() + { + $this->menuItems = []; + + $this->yesterDay = \Yii::$app->formatter->asDatetime(strtotime('yesterday UTC')); + $this->start = \Yii::$app->formatter->asDatetime(strtotime('today UTC')); + $this->tomorrow = Yii::$app->formatter->asDatetime(strtotime('tomorrow UTC')); + $this->startDate = Yii::$app->formatter->asDate(strtotime('today UTC')); + $this->tomorrowDate = Yii::$app->formatter->asDate(strtotime('tomorrow UTC')); + + Yii::info("Start date is : " . $this->start); + + + if ($this->isLogged()) { + $lastAccountState = AccountState::find()->andWhere(['id_user' => Yii::$app->user->id])->andWhere(['type' => AccountState::TYPE_OPEN])->orderBy(['account_state.created_at' => SORT_DESC])->limit(1)->one(); + if (isset($lastAccountState)) { + $this->start = Yii::$app->formatter->asDatetime(strtotime($lastAccountState->created_at . ' UTC')); + } + } + + } + + + protected function can($authItem) + { + $result = false; + if (\Yii::$app->user->can($authItem)) { + $result = true; + } + return $result; + } + + + protected function isLogged() + { + return !Yii::$app->user->isGuest; + } + + + protected function addRecepcio() + { + if ($this->isLogged()) { + + $isadmin = Yii::$app->user->can('admin') || Yii::$app->user->can('employee'); + + $this->menuItems[] = ['label' => Yii::t('frontend/customer', 'Reception'), 'url' => ['/customer/reception']]; + + $items = []; + + $items[] = ['label' => Yii::t('frontend/account-state', 'Default account'), 'url' => ['/account/select']]; + + + if ( Helper::isReceptionAccountStateIndexToday() ){ + $items[] = ['label' => Yii::t('frontend/account-state', 'Account states'), 'url' => ['/account-state/today' ]]; + }else{ + $items[] = ['label' => Yii::t('frontend/account-state', 'Account states'), 'url' => ['/account-state/index', 'AccountstateSearch[id_account]' => Account::readDefault(), 'AccountstateSearch[start]' => $this->yesterDay]]; + } + + $items[] = ['label' => Yii::t('frontend/account-state', 'Open account state'), 'url' => ['/account-state/open']]; + $items[] = ['label' => Yii::t('frontend/account-state', 'Close account state'), 'url' => ['/account-state/close']]; + $items[] = ['label' => Yii::t('frontend/money-movement', 'Money movements'), 'url' => ['/money-movement/index', 'MoneyMovementSearch[start]' => $this->start, 'MoneyMovementSearch[end]' => $this->tomorrow]]; + + + if (Helper::isCompanyMovar()) { + $items[] = ['label' => Yii::t('frontend/transfer', 'Daily transfers'), 'url' => ['/transfer/list', 'TransferListSearch[id_account]' => Account::readDefault(), 'TransferListSearch[start]' => $this->start, 'TransferListSearch[end]' => $this->tomorrow]]; + $items[] = ['label' => Yii::t('frontend/transfer', 'Sales detailed'), 'url' => ['/transfer/sale', 'TransferSaleSearch[id_user]' => \Yii::$app->user->id, 'TransferSaleSearch[id_account]' => Account::readDefault(), 'TransferSaleSearch[start]' => $this->start, 'TransferSaleSearch[end]' => $this->tomorrow]]; + $items[] = ['label' => Yii::t('frontend/transfer', 'Ticket sale detailed'), 'url' => ['/transfer/tickets', 'TransferTicketSearch[id_user]' => \Yii::$app->user->id, 'TransferTicketSearch[id_account]' => Account::readDefault(), 'TransferTicketSearch[start]' => $this->start, 'TransferTicketSearch[end]' => $this->tomorrow]]; + } + + if ( Helper::isReceptionTransferListToday()){ + $items[] = ['label' => Yii::t('frontend/transfer', 'Transfers'), 'url' => ['/transfer/today', ]]; + }else{ + $items[] = ['label' => Yii::t('frontend/transfer', 'Transfers'), 'url' => ['/transfer/index', 'TransferSearch[id_user]' => \Yii::$app->user->id, 'TransferSearch[id_account]' => Account::readDefault(), 'TransferSearch[start]' => $this->start, 'TransferSearch[end]' => $this->tomorrow]]; + } + + $items[] = ['label' => Yii::t('frontend/card', 'Vendégek'), 'url' => ['/card/index']]; // $items[] = ['label' => Yii::t('frontend/card','Leltár'), 'url' => [ '/product/inventory' ] ]; // $items[] = ['label' => Yii::t('frontend/card','Leltár'), 'url' => [ '/inventory/index' ] ]; - - - $this->menuItems[] = ['label' => Yii::t('frontend/account', 'Account'), - 'items' => $items - - - - - ]; - } - } - - - protected function addLoginMainMenu(){ - if (Yii::$app->user->isGuest) { - $mainMenuItem= ['label' => Yii::t('frontend/site','Login'), 'url' => ['/site/login']]; - } else { - $mainMenuItem= [ - 'label' => Yii::t('frontend/transfer','Logout'). '(' . Yii::$app->user->identity->username . ')', - 'url' => ['/site/logout'], - 'linkOptions' => ['data-method' => 'post'] - ]; - } - $this->menuItems[] = $mainMenuItem; - } - - - public function run(){ - $this->addRecepcio(); - $this->addLoginMainMenu(); - return $this->menuItems; - } - - + + + $this->menuItems[] = ['label' => Yii::t('frontend/account', 'Account'), + 'items' => $items + + + ]; + } + } + + + protected function addLoginMainMenu() + { + if (Yii::$app->user->isGuest) { + $mainMenuItem = ['label' => Yii::t('frontend/site', 'Login'), 'url' => ['/site/login']]; + } else { + $mainMenuItem = [ + 'label' => Yii::t('frontend/transfer', 'Logout') . '(' . Yii::$app->user->identity->username . ')', + 'url' => ['/site/logout'], + 'linkOptions' => ['data-method' => 'post'] + ]; + } + $this->menuItems[] = $mainMenuItem; + } + + + public function run() + { + $this->addRecepcio(); + $this->addLoginMainMenu(); + return $this->menuItems; + } + + } \ No newline at end of file diff --git a/frontend/controllers/AccountStateController.php b/frontend/controllers/AccountStateController.php index 403fdd7..e2038a1 100644 --- a/frontend/controllers/AccountStateController.php +++ b/frontend/controllers/AccountStateController.php @@ -2,12 +2,13 @@ namespace frontend\controllers; +use common\components\DateUtil; +use frontend\models\AccountstateSearchToday; use Yii; use common\models\AccountState; use frontend\models\AccountstateSearch; use yii\web\Controller; use yii\web\NotFoundHttpException; -use yii\filters\VerbFilter; use common\models\Account; use common\components\DailyListing; use common\models\User; @@ -45,13 +46,18 @@ class AccountStateController extends Controller { ]; } - - /** - * Lists all AccountState models. - * - * @return mixed - */ + + /** + * Lists all AccountState models. + * @return mixed + * @throws NotFoundHttpException + */ public function actionIndex() { + + if ( Helper::isReceptionAccountStateIndexToday()){ + throw new NotFoundHttpException(); + } + $searchModel = new AccountstateSearch (); $searchModel->accounts = Account::read (); @@ -64,7 +70,24 @@ class AccountStateController extends Controller { 'dataProvider' => $dataProvider ] ); } - + + /** + * Lists all AccountState models. + * @return mixed + * @throws NotFoundHttpException + */ + public function actionToday() { + + $searchModel = new AccountstateSearchToday(); + + $dataProvider = $searchModel->search ( Yii::$app->request->queryParams ); + + return $this->render ( 'today', [ + 'searchModel' => $searchModel, + 'dataProvider' => $dataProvider + ] ); + } + /** * Creates a new AccountState model. * If creation is successful, the browser will be redirected to the 'view' page. @@ -92,9 +115,14 @@ class AccountStateController extends Controller { $mail->sednMail(); } - + $redirectTo = 'index'; + + if ( Helper::isReceptionAccountStateIndexToday() ){ + $redirectTo = 'today'; + } + return $this->redirect ( [ - 'index' + $redirectTo ] ); } else { @@ -139,9 +167,16 @@ class AccountStateController extends Controller { $mail = new AccountStateMail(['model' => $model,'controller' => $this]); $mail->sednMail(); } - - return $this->redirect ( [ - 'index' + + $redirectTo = 'index'; + + if ( Helper::isReceptionAccountStateIndexToday() ){ + $redirectTo = 'today'; + } + + + return $this->redirect ( [ + $redirectTo ] ); // return $this->redirect(['view', 'id' => $model->id_account_state]); } else { @@ -179,7 +214,14 @@ class AccountStateController extends Controller { * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { - if (($model = AccountState::findOne ( $id )) !== null) { + $query = AccountState::find(); + $query->andWhere(['id_account_state'=> $id]); + if ( Helper::isReceptionAccountStateIndexToday()){ + $query->andWhere(['id_user'=>\Yii::$app->user->id]); + $query->andWhere(['>=','account_state.created_at', DateUtil::formatDateUtc(DateUtil::todayStart()) ]); + } + $model = $query->one(); + if ( $model !== null ) { return $model; } else { throw new NotFoundHttpException ( 'The requested page does not exist.' ); @@ -256,7 +298,7 @@ class AccountStateController extends Controller { $details = null; if ($accountState->isTypeClose ()) { - $prev; + $prev = null; if ($accountState->type == AccountState::TYPE_CLOSE) { if (isset ( $accountState->prev_state )) { $prev = AccountState::findOne ( $accountState->prev_state ); @@ -311,7 +353,7 @@ class AccountStateController extends Controller { if ($accountState->isTypeClose ()) { - $prev; + $prev = null; if ($accountState->type == AccountState::TYPE_CLOSE) { if (isset ( $accountState->prev_state )) { $prev = AccountState::findOne ( $accountState->prev_state ); diff --git a/frontend/controllers/TransferController.php b/frontend/controllers/TransferController.php index ce8ebbd..ffa954d 100644 --- a/frontend/controllers/TransferController.php +++ b/frontend/controllers/TransferController.php @@ -2,6 +2,7 @@ namespace frontend\controllers; +use frontend\models\TransferSearchToday; use Yii; use common\models\Transfer; use frontend\models\TransferSearch; @@ -71,12 +72,18 @@ class TransferController extends Controller 'dataProvider' => $dataProvider, ]); } + /** * Lists all Transfer models. * @return mixed + * @throws NotFoundHttpException */ public function actionIndex() { + if ( !Helper::isReceptionTransferIndexEnabled()){ + throw new NotFoundHttpException(); + } + $searchModel = new TransferSearch(); $searchModel->accounts = Account::read(); $searchModel->load(Yii::$app->request->queryParams); @@ -90,6 +97,27 @@ class TransferController extends Controller 'dataProvider' => $dataProvider, ]); + } + + /** + * Lists all Transfer models. + * @return mixed + */ + public function actionToday() + { + $searchModel = new TransferSearchToday(); + $searchModel->id_account = Account::readDefault(); + $searchModel->load(Yii::$app->request->queryParams); + + $dataProvider = $searchModel->search(Yii::$app->request->queryParams); + + //$searchModel->totalsTransfers(Yii::$app->request->queryParams); + + return $this->render('today', [ + 'searchModel' => $searchModel, + 'dataProvider' => $dataProvider, + ]); + } /** diff --git a/frontend/models/AccountstateSearchToday.php b/frontend/models/AccountstateSearchToday.php new file mode 100644 index 0000000..f2d9377 --- /dev/null +++ b/frontend/models/AccountstateSearchToday.php @@ -0,0 +1,85 @@ + $query, + 'sort' => false + ]); + + $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->innerJoinWith('account'); + $query->innerJoinWith('account.userAccountAssignments'); + $query->andWhere(['user_account_assignment.id_user' => Yii::$app->user->id]); + $query->andWhere([ + 'account_state.id_user' => \Yii::$app->user->id, + 'account_state.id_account' => Account::readDefault() + ]); + + $query->andWhere( [ '>=','account_state.created_at', DateUtil::formatDateUtc( DateUtil::todayStart() ) ] ); + + $query->orderBy( 'account_state.created_at desc' ); + + $query->limit = 20; + + return $dataProvider; + } +} diff --git a/frontend/models/TransferSearchToday.php b/frontend/models/TransferSearchToday.php new file mode 100644 index 0000000..8c9c0f9 --- /dev/null +++ b/frontend/models/TransferSearchToday.php @@ -0,0 +1,117 @@ + ['integer']], + ]; + } + + + /** + * Creates data provider instance with search query applied + * + * @param array $params + * @return ActiveDataProvider + * @throws NotFoundHttpException + */ + public function search($params) + { + + if ( !isset( $this->id_account ) ){ + throw new NotFoundHttpException("Kassza nem található"); + } + + + $this->timestampStart = DateUtil::formatDateUtc( DateUtil::todayStart() ) ; + $this->timestampEnd = DateUtil::formatDateUtc( DateUtil::tomorrowStart() ); + $query = Transfer::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'); + } + $query->andWhere( ['or',['id_user' => Yii::$app->user->id ] , ['paid_by' => Yii::$app->user->id],] ); + $query->andWhere(['transfer.id_account' => $this->id_account]); + + $query->andFilterWhere([ + 'type' => $this->type, + ]); + + $query->andFilterWhere(['in' ,'type', $this->types]); + + $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]); + + + return $dataProvider; + } + + public function totalsTransfers($params){ + $accountTotals = []; + $fullTotal = [ + 'label' => Yii::t('common/transfer', 'Total'), + 'money' => 0 + ]; + + + $accounts = Account::find()->orderBy("name asc")->all(); + $accountMap = ArrayHelper::map( $accounts ,'id_account','name' ); + $idUser = Yii::$app->user->id; + + + $this->totals = Transfer::mkTotals($this->timestampStart, $this->timestampEnd, $idUser, $this->types, $this->id_account, $accounts, $accountMap); + + + } + +} diff --git a/frontend/views/account-state/_search_today.php b/frontend/views/account-state/_search_today.php new file mode 100644 index 0000000..d071eb1 --- /dev/null +++ b/frontend/views/account-state/_search_today.php @@ -0,0 +1,64 @@ + +'Mind']+ HtmlHelper::mkAccountOptions( $model->accounts ); +$userOptions = ['' => 'Mind'] + HtmlHelper::mkOptions($model->users,'id','username'); +$typeOptions = ['' => 'Mind'] + AccountState::types(); +?> + diff --git a/frontend/views/account-state/today.php b/frontend/views/account-state/today.php new file mode 100644 index 0000000..b9cc4df --- /dev/null +++ b/frontend/views/account-state/today.php @@ -0,0 +1,37 @@ +title = Yii::t('frontend/account-state', 'Account States'); +$this->params['breadcrumbs'][] = $this->title; +?> + + +
+ +

title) ?>

+ render('_search_today', ['model' => $searchModel]); ?> + +

+ 'btn btn-success']) ?> + 'btn btn-success']) ?> +

+ + $dataProvider, + 'itemView' => '_item_view' + ])?> + +
diff --git a/frontend/views/account-state/view.php b/frontend/views/account-state/view.php index 93ed468..4be174d 100644 --- a/frontend/views/account-state/view.php +++ b/frontend/views/account-state/view.php @@ -24,7 +24,11 @@ if ( $model ->type == AccountState::TYPE_OPEN ){ }else{ $this->title = "Kassza zárás"; } -$this->params['breadcrumbs'][] = ['label' => Yii::t('frontend/account-state', 'Account States'), 'url' => ['index']]; +if ( \common\components\Helper::isReceptionAccountStateIndexToday()){ + $this->params['breadcrumbs'][] = ['label' => Yii::t('frontend/account-state', 'Account States'), 'url' => ['today']]; +}else{ + $this->params['breadcrumbs'][] = ['label' => Yii::t('frontend/account-state', 'Account States'), 'url' => ['index']]; +} $this->params['breadcrumbs'][] = $this->title; ?> diff --git a/frontend/views/transfer/_search_today.php b/frontend/views/transfer/_search_today.php new file mode 100644 index 0000000..ac5c27a --- /dev/null +++ b/frontend/views/transfer/_search_today.php @@ -0,0 +1,36 @@ + + + + diff --git a/frontend/views/transfer/today.php b/frontend/views/transfer/today.php new file mode 100644 index 0000000..50ac776 --- /dev/null +++ b/frontend/views/transfer/today.php @@ -0,0 +1,32 @@ +title = Yii::t('frontend/transfer', 'Transfers'); +$this->params['breadcrumbs'][] = $this->title; +?> + +
+

title) ?>

+ render('_search_today', ['model' => $searchModel]); ?> + $dataProvider, + 'itemView' => '_view' , + 'itemOptions' => ['class' => 'item-transfer'] + ] ) + ?> +