diff --git a/app/Models/Account.php b/app/Models/Account.php index 61643b68df36..aff6a20ff0b1 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -1110,6 +1110,14 @@ class Account extends Eloquent return ! empty($plan_details); } + /** + * @return mixed + */ + public function hasActivePromo() + { + return $this->company->hasActivePromo(); + } + /** * @param null $plan_details * diff --git a/app/Models/Company.php b/app/Models/Company.php index 180b9ec61533..de509d30e71c 100644 --- a/app/Models/Company.php +++ b/app/Models/Company.php @@ -199,6 +199,10 @@ class Company extends Eloquent public function applyFreeYear() { + if ($this->plan_started && $this->plan_started != '0000-00-00') { + return; + } + $this->plan = PLAN_PRO; $this->plan_term = PLAN_TERM_YEARLY; $this->plan_price = PLAN_PRICE_PRO_MONTHLY; diff --git a/app/Models/User.php b/app/Models/User.php index bdc21dcdcff0..830e498ec54f 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -132,6 +132,14 @@ class User extends Authenticatable return $this->account->isPro(); } + /** + * @return mixed + */ + public function hasActivePromo() + { + return $this->account->hasActivePromo(); + } + /** * @param $feature * diff --git a/resources/views/header.blade.php b/resources/views/header.blade.php index eea95a1d62ea..e3ae6dd3602b 100644 --- a/resources/views/header.blade.php +++ b/resources/views/header.blade.php @@ -470,7 +470,9 @@