fix account_state ( collection_money ), display product/ticket on reception only for selected account, add daily transfers (reception/admin)

This commit is contained in:
2015-12-31 13:52:22 +01:00
parent 72fc139674
commit f59eadd8cc
26 changed files with 1153 additions and 404 deletions

View File

@@ -7,6 +7,7 @@ use yii\helpers\Html;
use common\models\MoneyMovement;
use yii\db\Query;
use common\models\AccountState;
use backend\models\AccountSearch;
class FrontendMenuStructure{
@@ -20,8 +21,8 @@ class FrontendMenuStructure{
public function __construct(){
$this->menuItems = [];
$this->start = Yii::$app->formatter->asDatetime( strtotime('today UTC') );
$this->tomorrow = Yii::$app->formatter->asDatetime( strtotime('tomorrow UTC') );
$this->start = \Yii::$app->formatter->asDatetime( strtotime('today') );
$this->tomorrow = Yii::$app->formatter->asDatetime( strtotime('tomorrow') );
$this->startDate = Yii::$app->formatter->asDate( strtotime('today UTC') );
$this->tomorrowDate = Yii::$app->formatter->asDate( strtotime('tomorrow UTC') );
@@ -30,7 +31,7 @@ class FrontendMenuStructure{
if ( $this->isLogged() ){
$lastAccountState = AccountState::find()->andWhere(['id_user' => Yii::$app->user->id])->orderBy(['account_state.created_at' => SORT_DESC])->limit(1)->one();
$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' ));
}