add conctract flag canceled2

This commit is contained in:
2016-04-21 21:08:33 +02:00
parent b886e1cc74
commit 6a5cf48217
5 changed files with 38 additions and 14 deletions

View File

@@ -157,7 +157,7 @@ class ContractForm extends Model {
}else{
$contracts = Contract::find()
->andWhere( ['>' ,'contract.expired_at', date('Y-m-d')])
->andWhere(['not in' ,'contract.flag',[Contract::$FLAG_DELETED]])
->andWhere(['not in' ,'contract.flag', Contract::getFlagsDoesNotProhibitNewContract() ])
->andWhere(['contract.id_customer' => $this->customer->id_customer])->all();
if ( count($contracts) > 0 ){
$this->addError( $attribute , "Már van érvényes vagy lemondott szerződés az adott időszakban");