add new contract design
This commit is contained in:
@@ -131,9 +131,15 @@ class ContractForm extends Model {
|
||||
$this->ticketType = TicketType::findOne ( $this->ticket_type );
|
||||
if (! isset ( $this->ticketType )) {
|
||||
$this->addError ( $attribute, "Bérlet típus nem található" );
|
||||
}else{
|
||||
$contracts = Contract::find()->andWhere(['>' ,'contract.expired_at', date('Y-m-d')])->andWhere(['not in' ,'contract.flag',[Contract::$FLAG_DELETED]])->all();
|
||||
if ( count($contracts) > 0 ){
|
||||
$this->addError( $attribute , "Már van érvényes vagy lemondott szerződés az adott időszakban");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user