Add unpaid tickets display
Add unpaid tickets display to reception
This commit is contained in:
@@ -5,7 +5,7 @@ return [
|
||||
'supportEmail' => 'rocho02@gmail.com',
|
||||
'infoEmail' => 'info@rocho-net.hu',
|
||||
'user.passwordResetTokenExpire' => 3600,
|
||||
'version' => 'v0.0.74',
|
||||
'version' => 'v0.0.75',
|
||||
'company' => 'movar',//gyor
|
||||
'company_name' => "Freimann Kft.",
|
||||
'product_visiblity' => 'account',// on reception which products to display. account or global
|
||||
|
||||
@@ -124,6 +124,11 @@ class Ticket extends \common\models\BaseFitnessActiveRecord
|
||||
public function getCard(){
|
||||
return $this->hasOne( Card::className(), ["id_card" =>"id_card" ] );
|
||||
}
|
||||
|
||||
public function getContract(){
|
||||
return $this->hasOne( Contract::className(), ["id_contract" =>"id_contract" ] );
|
||||
}
|
||||
|
||||
public function getCardNumber(){
|
||||
$result = "";
|
||||
$card = $this->card;
|
||||
@@ -217,6 +222,31 @@ class Ticket extends \common\models\BaseFitnessActiveRecord
|
||||
return $result;
|
||||
|
||||
}
|
||||
/**
|
||||
* @param common\models\Card $card the card to which we are looking for
|
||||
* */
|
||||
public static function readUnpaid($card){
|
||||
|
||||
if ( $card == null )
|
||||
return [];
|
||||
|
||||
$query = Ticket::find();
|
||||
$query->innerJoin("transfer", "transfer.id_object = ticket.id_ticket ");
|
||||
$today = date('Y-m-d');
|
||||
|
||||
$query->andWhere(['ticket.id_card' => $card->id_card]);
|
||||
$query->andWhere( 'ticket.start <= :today' ,[ 'today' => $today] );
|
||||
$query->andWhere( 'ticket.end >= :today' ,[ 'today' => $today] );
|
||||
$query->andWhere( ['in' ,'ticket.status' ,[ Ticket::STATUS_INACTIVE, Ticket::STATUS_ACTIVE] ]);
|
||||
$query->andWhere( ["transfer.type" => Transfer::TYPE_TICKET] );
|
||||
$query->andWhere( [ "transfer.status" => Transfer::STATUS_NOT_PAID ]);
|
||||
$query->orderBy([ "ticket.created_at" =>SORT_DESC] );
|
||||
|
||||
$result = $query->all();
|
||||
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static function mkStatisticQuery($start,$end,$id_card = null){
|
||||
|
||||
Reference in New Issue
Block a user