#1: Log Card Read In Botond

This commit is contained in:
2018-02-07 08:23:26 +01:00
parent acb5b040c5
commit cf08823d3f
13 changed files with 149 additions and 54 deletions

View File

@@ -12,11 +12,12 @@ use yii\helpers\ArrayHelper;
* This is the model class for table "account".
*
* @property integer $id_account
* @property string $name
* @property string $name
* @property integer $status
* @property integer $type
* @property string $created_at
* @property string $updated_at
* @property string $created_at
* @property string $updated_at
* @property integer $log_card_read_in_reception
*/
class Account extends \yii\db\ActiveRecord
{
@@ -55,7 +56,7 @@ class Account extends \yii\db\ActiveRecord
return [
[['name', 'type'], 'required'],
[['name', ], 'unique'],
[['status', 'type'], 'integer'],
[['status', 'type','log_card_read_in_reception'], 'integer'],
[['name'], 'string', 'max' => 64]
];
}
@@ -72,6 +73,7 @@ class Account extends \yii\db\ActiveRecord
'type' => Yii::t('common/account', 'Type'),
'created_at' => Yii::t('common/account', 'Created At'),
'updated_at' => Yii::t('common/account', 'Updated At'),
'log_card_read_in_reception' => Yii::t('common/account', 'Log Card Read in Reception'),
];
}
@@ -115,6 +117,19 @@ class Account extends \yii\db\ActiveRecord
return $this->status == self::STATUS_DELETED;
}
/**
* When this account is the current default account,
* and this flag is turned on, then if a card will be
* read in the reception masks , than we will care a doorlog
* into the database.
* Use case is example "Botond", where there is no
* three arm gate, but we want to track the customers.
* @return bool
*/
public function isLogCardReadInReceptionOn(){
return $this->log_card_read_in_reception == 1;
}
/**
* $param int $forceIncludeAccount id account, that should be included in list, even if it is inactive
* @param null $forceIncludeAccount the next account should be included too, even if it is not
@@ -205,5 +220,7 @@ class Account extends \yii\db\ActiveRecord
public static function toAccaountMap($accounts){
return ArrayHelper::map( $accounts,'id_account','name' );
}
}