add non cash money display to account state

This commit is contained in:
2016-10-05 07:56:50 +02:00
parent 7975d6ffc9
commit 8585286150
8 changed files with 454 additions and 279 deletions

View File

@@ -29,6 +29,7 @@ use common\components\Helper;
* @property string $comment
* @property string $created_at
* @property string $updated_at
* @property int id_contract
*/
class Ticket extends \common\models\BaseFitnessActiveRecord
{
@@ -133,7 +134,8 @@ class Ticket extends \common\models\BaseFitnessActiveRecord
public function getCardNumber(){
$result = "";
$card = $this->card;
/** @noinspection PhpUndefinedFieldInspection */
$card = $this->card;
if ( isset($card)){
$result = $card->number;
}
@@ -146,7 +148,8 @@ class Ticket extends \common\models\BaseFitnessActiveRecord
public function getCustomerName(){
$result = "";
$customer = $this->customer;
/** @noinspection PhpUndefinedFieldInspection */
$customer = $this->customer;
if ( isset($customer)){
$result = $customer->name;
}
@@ -171,23 +174,28 @@ class Ticket extends \common\models\BaseFitnessActiveRecord
}
public function getAccountName() {
$result = "";
$account = $this->account;
/** @noinspection PhpUndefinedFieldInspection */
/** @var \common\models\Account $account */
$account = $this->account;
if ( isset($account) ){
$result = $this->account->name;
$result = $account->name;
}
return $result;
}
public function getDiscountName() {
$result = "";
$discount = $this->discount;
/** @noinspection PhpUndefinedFieldInspection */
/** @var \common\models\Discount $discount */
$discount = $this->discount;
if ( isset($discount) ){
$result = $this->discount->name;
$result = $discount->name;
}
return $result;
}
public function getTicketTypeName() {
$result = "";
$ticketType = $this->ticketType;
/** @noinspection PhpUndefinedFieldInspection */
$ticketType = $this->ticketType;
if ( isset($ticketType) ){
$result = $ticketType->name;
}
@@ -195,17 +203,20 @@ class Ticket extends \common\models\BaseFitnessActiveRecord
}
public function getUserName() {
$result = "";
$user = $this->user;
/** @noinspection PhpUndefinedFieldInspection */
$user = $this->user;
if ( isset($user) ){
$result = $user->username;
}
return $result;
}
/**
* @param common\models\Card $card the card to which we are looking for
* */
/**
* @param \common\models\Card $card the card to which we are looking for
*
* @return array|\yii\db\ActiveRecord[]
*/
public static function readActive($card){
if ( $card == null )
@@ -224,9 +235,12 @@ class Ticket extends \common\models\BaseFitnessActiveRecord
return $result;
}
/**
* @param common\models\Card $card the card to which we are looking for
* */
/**
* @param \common\models\Card $card the card to which we are looking for
*
* @return array|\yii\db\ActiveRecord[]
*/
public static function readUnpaid($card){
if ( $card == null )
@@ -326,7 +340,7 @@ class Ticket extends \common\models\BaseFitnessActiveRecord
/**
* Apply request
*
* @var common\models\TicketInstallmentRequest $request megbízás
* @var \common\models\TicketInstallmentRequest $request megbízás
* */
public function applyTicketInstallmentRequest( $request ) {
//ha csoportos beszedéses