add inventory group

This commit is contained in:
2016-02-29 20:51:54 +01:00
parent 3926498f3e
commit b196b86746
19 changed files with 589 additions and 4 deletions

View File

@@ -132,7 +132,10 @@ class ContractForm extends Model {
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();
$contracts = Contract::find()
->andWhere( ['>' ,'contract.expired_at', date('Y-m-d')])
->andWhere(['not in' ,'contract.flag',[Contract::$FLAG_DELETED]])
->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");
}