Add unpaid tickets display
Add unpaid tickets display to reception
This commit is contained in:
@@ -26,6 +26,7 @@ class ReceptionForm extends Model
|
||||
public $card;
|
||||
public $customer;
|
||||
public $tickets;
|
||||
public $unpaidTickets;
|
||||
public $defaultAccount;
|
||||
public $cardSearchModel;
|
||||
public $lastCassaState;
|
||||
@@ -77,6 +78,7 @@ class ReceptionForm extends Model
|
||||
if ( $this->card != null ){
|
||||
$this->customer = $this->card->customer;
|
||||
$this->readValidTickets();
|
||||
$this->readUnpaidTicket();
|
||||
$this->readAssignedKeys();
|
||||
$this->readContract();
|
||||
}
|
||||
@@ -183,6 +185,10 @@ class ReceptionForm extends Model
|
||||
$this->tickets = Ticket::readActive($this->card);
|
||||
}
|
||||
|
||||
public function readUnpaidTicket(){
|
||||
$this->unpaidTickets = Ticket::readUnpaid($this->card);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return true , if card found without customer
|
||||
* */
|
||||
|
||||
@@ -105,4 +105,35 @@ if ( isset($model->contract)){
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset( $model->unpaidTickets ) ) {
|
||||
if ( count($model->unpaidTickets) > 0){
|
||||
echo Html::beginTag("div",['class'=>"alert alert-warning", "role"=>"alert"]);
|
||||
echo Html::beginTag("strong",[ ]);
|
||||
echo "Fizetetlen bérletek";
|
||||
echo Html::endTag("strong");
|
||||
echo "<ul>";
|
||||
$formatter = \Yii::$app->formatter;
|
||||
foreach ($model->unpaidTickets as $t ){
|
||||
echo Html::beginTag("li",[ ]);
|
||||
$c = $t->contract;
|
||||
if (isset($c)){
|
||||
echo "<b>Szerződéses</b>";
|
||||
}
|
||||
echo $t->getTicketTypeName();
|
||||
|
||||
echo ": ";
|
||||
echo $formatter->asDate($t->start);
|
||||
echo " - " ;
|
||||
echo $formatter->asDate($t->end);
|
||||
echo " (";
|
||||
echo $t->price_brutto;
|
||||
echo " Ft)";
|
||||
echo Html::endTag("li");
|
||||
}
|
||||
echo "</ul>";
|
||||
echo Html::endTag("div");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user