1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 16:31:33 +02:00
invoiceninja/app/Ninja/Presenters/ClientPresenter.php
2017-02-01 13:09:26 +02:00

39 lines
859 B
PHP

<?php
namespace App\Ninja\Presenters;
class ClientPresenter extends EntityPresenter
{
public function country()
{
return $this->entity->country ? $this->entity->country->name : '';
}
public function balance()
{
$client = $this->entity;
$account = $client->account;
return $account->formatMoney($client->balance, $client);
}
public function paid_to_date()
{
$client = $this->entity;
$account = $client->account;
return $account->formatMoney($client->paid_to_date, $client);
}
public function paymentTerms()
{
$client = $this->entity;
if (! $client->payment_terms) {
return '';
}
return sprintf('%s: %s %s', trans('texts.payment_terms'), trans('texts.payment_terms_net'), $client->defaultDaysDue());
}
}