add conctract flag canceled2
This commit is contained in:
@@ -34,6 +34,7 @@ class Contract extends \yii\db\ActiveRecord
|
||||
public static $FLAG_CANCELED = 20;
|
||||
public static $FLAG_ACTIVE= 30;
|
||||
public static $FLAG_EXPIRED = 40;
|
||||
public static $FLAG_CANCELED_2 = 50;
|
||||
|
||||
|
||||
public function behaviors()
|
||||
@@ -129,14 +130,7 @@ class Contract extends \yii\db\ActiveRecord
|
||||
return $this->hasOne(Discount::className(), ['id_discount' => 'id_discount']);
|
||||
}
|
||||
|
||||
// public static $STATUS_PAID = 10;
|
||||
// public static $STATUS_NOT_PAID = 20;
|
||||
|
||||
// public static $FLAG_DELETED = 10;
|
||||
// public static $FLAG_CANCELED = 20;
|
||||
// public static $FLAG_ACTIVE= 30;
|
||||
// public static $FLAG_EXPIRED = 40;
|
||||
|
||||
|
||||
|
||||
public static function statuses(){
|
||||
return [
|
||||
@@ -150,6 +144,7 @@ class Contract extends \yii\db\ActiveRecord
|
||||
return [
|
||||
static::$FLAG_ACTIVE => "Aktív",
|
||||
static::$FLAG_CANCELED => "Felbontva",
|
||||
static::$FLAG_CANCELED_2 => "Felbontva, újrakötés lehetőségével",
|
||||
static::$FLAG_DELETED => "Törölve",
|
||||
static::$FLAG_EXPIRED => "Lejárt",
|
||||
];
|
||||
@@ -163,6 +158,13 @@ class Contract extends \yii\db\ActiveRecord
|
||||
return Helper::getArrayValue(self::flags(), $flag, "");
|
||||
}
|
||||
|
||||
public static function getFlagsDoesNotProhibitNewContract(){
|
||||
return [
|
||||
static::$FLAG_CANCELED_2,
|
||||
static::$FLAG_DELETED
|
||||
];
|
||||
}
|
||||
|
||||
public function getStatusName() {
|
||||
return self::toStatusName($this->status);
|
||||
}
|
||||
@@ -190,6 +192,8 @@ class Contract extends \yii\db\ActiveRecord
|
||||
return $this->flag == static::$FLAG_ACTIVE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getPriceMonthly(){
|
||||
return $this->ticket->price_brutto;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user