1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00
invoiceninja/app/Ninja/Presenters/CompanyPresenter.php

31 lines
750 B
PHP
Raw Normal View History

2017-01-30 20:40:43 +01:00
<?php
namespace App\Ninja\Presenters;
2016-12-14 15:19:16 +01:00
class CompanyPresenter extends EntityPresenter
{
public function promoMessage()
{
2017-01-30 17:05:31 +01:00
if (! $this->entity->hasActivePromo()) {
2016-12-14 15:19:16 +01:00
return '';
}
return trans('texts.promo_message', [
'expires' => $this->entity->promo_expires->format('M dS, Y'),
2017-01-30 20:40:43 +01:00
'amount' => (int) ($this->discount * 100) . '%',
2016-12-14 15:19:16 +01:00
]);
}
public function discountMessage()
{
2017-01-30 17:05:31 +01:00
if (! $this->entity->hasActiveDiscount()) {
2016-12-14 15:19:16 +01:00
return '';
}
return trans('texts.discount_message', [
'expires' => $this->entity->discount_expires->format('M dS, Y'),
2017-01-30 20:40:43 +01:00
'amount' => (int) ($this->discount * 100) . '%',
2016-12-14 15:19:16 +01:00
]);
}
}