diff --git a/app/Models/Account.php b/app/Models/Account.php index 02a94eee3dd7..445996ae092a 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -1118,6 +1118,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 a6213ff2bf9e..cd02126ac249 100644 --- a/app/Models/Company.php +++ b/app/Models/Company.php @@ -194,6 +194,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 321d71f304e1..2501448e9a51 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -134,6 +134,14 @@ class User extends Authenticatable return $this->account->isPro(); } + /** + * @return mixed + */ + public function hasActivePromo() + { + return $this->account->hasActivePromo(); + } + /** * @param $feature * diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index d35722054c8d..50f16160bee5 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -2597,6 +2597,7 @@ $LANG = array( 'send_client_reminders' => 'Send email reminders', 'can_view_tasks' => 'Tasks are visible in the portal', 'is_not_sent_reminders' => 'Reminders are not sent', + 'promotion_footer' => 'Your promotion will expire soon, :link to upgrade now.', ); diff --git a/resources/views/header.blade.php b/resources/views/header.blade.php index f0da5196670c..2c78cc887913 100644 --- a/resources/views/header.blade.php +++ b/resources/views/header.blade.php @@ -472,7 +472,11 @@