add reception account state view and pdf export
This commit is contained in:
@@ -15,7 +15,8 @@ use common\components\RoleDefinition;
|
||||
class DailyListing
|
||||
{
|
||||
|
||||
public $mode = "reception";//reception or admin
|
||||
public $mode = "reception";//reception or admin or accountstate
|
||||
|
||||
/**
|
||||
* string start date , inclusive
|
||||
* */
|
||||
@@ -108,6 +109,25 @@ class DailyListing
|
||||
public $type;
|
||||
|
||||
|
||||
public function readTotalEasy(){
|
||||
$this->readTicketMoney();
|
||||
$this->readProductsMoney();
|
||||
$this->readMoneyMovementMoney();
|
||||
$this->calcTotal();
|
||||
}
|
||||
|
||||
public function readTotalDetailed(){
|
||||
$this->readTickets();
|
||||
$this->readProducts();
|
||||
$this->readMoneyMovements();
|
||||
}
|
||||
public function readTotalMedium(){
|
||||
$this->readProductsByCategory();
|
||||
$this->readProductsByCategoryDetailed();
|
||||
$this->readTicketStas();
|
||||
$this->readMoneyMovementsStats();
|
||||
}
|
||||
|
||||
public function loadFilters($transfer){
|
||||
$this->start = $transfer->start;
|
||||
$this->end = $transfer->end;
|
||||
@@ -119,9 +139,22 @@ class DailyListing
|
||||
$this->timestampEnd = $transfer->timestampEnd;
|
||||
}
|
||||
|
||||
public function loadAccountState($accountState){
|
||||
$this->mode = 'accountstate';
|
||||
$this->start = $accountState->start_date;
|
||||
$this->end = $accountState->created_at;
|
||||
$this->timestampStart = $accountState->start_date;
|
||||
$this->timestampEnd =$accountState->created_at;
|
||||
$this->id_account = $accountState->id_account;
|
||||
$this->id_user = $accountState->id_user;
|
||||
}
|
||||
|
||||
public function isModeAdmin(){
|
||||
return $this->mode == 'admin';
|
||||
}
|
||||
public function isModeAccountState(){
|
||||
return $this->mode == 'accountstate';
|
||||
}
|
||||
|
||||
|
||||
public function calcTotal(){
|
||||
@@ -139,11 +172,15 @@ class DailyListing
|
||||
|
||||
|
||||
public function addAccountConstraint($query){
|
||||
if (!$this->isModeAdmin() || !RoleDefinition::isAdmin() ){
|
||||
|
||||
if ( $this->isModeAccountState() ){
|
||||
$query->andWhere(['account.type' => Account::TYPE_ALL ]);
|
||||
|
||||
}else if (!$this->isModeAdmin() || !RoleDefinition::isAdmin() ){
|
||||
$query->innerJoin("user_account_assignment",'transfer.id_account = user_account_assignment.id_account' );
|
||||
$query->andWhere(['user_account_assignment.id_user' => Yii::$app->user->id ]);
|
||||
|
||||
if ( RoleDefinition::isReception() || !$this->isModeAdmin()){
|
||||
if ( RoleDefinition::isReception() || !$this->isModeAdmin()){
|
||||
$query->andWhere(['transfer.id_user' => Yii::$app->user->id ]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user