add kulcsok, add tartós beszedés, add ticket type with intallments

This commit is contained in:
2016-01-20 14:48:34 +01:00
parent d1638a19de
commit d7cc84e78f
111 changed files with 4077 additions and 12 deletions

View File

@@ -10,6 +10,8 @@ use common\models\Ticket;
use common\models\Account;
use common\models\CardSearch;
use common\models\AccountState;
use common\models\Key;
use common\models\CardKeyAssignment;
/**
* ContactForm is the model behind the contact form.
@@ -23,7 +25,7 @@ class ReceptionForm extends Model
public $defaultAccount;
public $cardSearchModel;
public $lastCassaState;
public $keys;
/**
* @inheritdoc
*/
@@ -53,6 +55,7 @@ class ReceptionForm extends Model
if ( $this->card != null ){
$this->customer = $this->card->customer;
$this->readValidTickets();
$this->readAssignedKeys();
}
$defaultAccount = Account::readDefault();
@@ -65,6 +68,14 @@ class ReceptionForm extends Model
}
public function readAssignedKeys(){
$query = Key::find();
$query->join( 'INNER JOIN', CardKeyAssignment::tableName() , Key::tableName().".id_key = " . CardKeyAssignment::tableName() . ".id_key");
$query->andWhere([ "card_key_assignment.id_card" => $this->card->id_card ]);
$this->keys = $query->all();
}
public function readLastCassaState(){
$a = Account::readDefault();
if ( isset($a)){
@@ -136,4 +147,23 @@ class ReceptionForm extends Model
}
public function getCardNumber(){
if ( isset($this->card)){
return $this->card->number;
}
return null;
}
public function getKeysText(){
$keyNumbers = [];
$result = "-";
if ( isset($this->keys)){
foreach ($this->keys as $k ){
$keyNumbers[] = $k->number;
}
$result = implode(", ",$keyNumbers);
}
return $result;
}
}