mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 12:12:48 +01:00
Working on white label renewal
This commit is contained in:
parent
e9f05c7006
commit
4bcdc155c0
@ -74,6 +74,20 @@ class Company extends Eloquent
|
||||
return $price - ($price * $this->discount);
|
||||
}
|
||||
|
||||
public function daysUntilPlanExpires()
|
||||
{
|
||||
if ( ! $this->hasActivePlan()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return Carbon::parse($this->plan_expires)->diffInDays(Carbon::today());
|
||||
}
|
||||
|
||||
public function hasActivePlan()
|
||||
{
|
||||
return Carbon::parse($this->plan_expires) >= Carbon::today();
|
||||
}
|
||||
|
||||
public function hasEarnedPromo()
|
||||
{
|
||||
if ( ! Utils::isNinjaProd() || Utils::isPro()) {
|
||||
|
@ -2284,6 +2284,7 @@ $LANG = array(
|
||||
'debug' => 'Debug',
|
||||
'https' => 'HTTPS',
|
||||
'require' => 'Require',
|
||||
'license_expiring' => 'Note: Your license will expire in :count days, :link to renew it.'
|
||||
|
||||
);
|
||||
|
||||
|
@ -589,7 +589,7 @@
|
||||
]) !!}
|
||||
@endif
|
||||
@else
|
||||
@include('partials.white_label')
|
||||
@include('partials.white_label', ['company' => Auth::user()->account->company])
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,9 +1,14 @@
|
||||
{{ trans('texts.powered_by') }}
|
||||
|
||||
{{-- Per our license, please do not remove or modify this section. --}}
|
||||
{!! link_to('https://www.invoiceninja.com/?utm_source=powered_by', 'InvoiceNinja.com', ['target' => '_blank', 'title' => trans('texts.created_by', ['name' => 'Hillel Coren'])]) !!} -
|
||||
{!! link_to(RELEASES_URL, 'v' . NINJA_VERSION, ['target' => '_blank', 'title' => trans('texts.trello_roadmap')]) !!} |
|
||||
|
||||
@if (Auth::user()->account->hasFeature(FEATURE_WHITE_LABEL))
|
||||
{{ trans('texts.white_labeled') }}
|
||||
@if ($company->hasActivePlan() && $company->daysUntilPlanExpires() <= 10)
|
||||
- <b>{{ trans('texts.license_expiring', ['count' => $company->daysUntilPlanExpires(), 'link' => 'link']) }}</b>
|
||||
@endif
|
||||
@else
|
||||
<a href="#" onclick="showWhiteLabelModal()">{{ trans('texts.white_label_link') }}</a>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user