2019-08-29 06:07:04 +02:00
|
|
|
<?php
|
|
|
|
/**
|
2020-09-06 11:38:10 +02:00
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
2019-08-29 06:07:04 +02:00
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2021-01-03 22:54:54 +01:00
|
|
|
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
2019-08-29 06:07:04 +02:00
|
|
|
*
|
|
|
|
* @license https://opensource.org/licenses/AAL
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Models\Presenters;
|
|
|
|
|
2019-09-05 07:04:52 +02:00
|
|
|
use App\Utils\Number;
|
|
|
|
use App\Utils\Traits\MakesDates;
|
|
|
|
|
2019-08-29 06:07:04 +02:00
|
|
|
/**
|
2020-09-06 11:38:10 +02:00
|
|
|
* Class InvoicePresenter.
|
2019-08-29 06:07:04 +02:00
|
|
|
*
|
2019-12-30 22:59:12 +01:00
|
|
|
* For convenience and to allow users to easiliy
|
2019-08-29 06:07:04 +02:00
|
|
|
* customise their invoices, we provide all possible
|
|
|
|
* invoice variables to be available from this presenter.
|
|
|
|
*
|
2019-12-30 22:59:12 +01:00
|
|
|
* Shortcuts to other presenters are here to facilitate
|
2019-08-29 06:07:04 +02:00
|
|
|
* a clean UI / UX
|
|
|
|
*/
|
|
|
|
class InvoicePresenter extends EntityPresenter
|
|
|
|
{
|
2019-12-30 22:59:12 +01:00
|
|
|
use MakesDates;
|
|
|
|
|
|
|
|
public function amount()
|
|
|
|
{
|
|
|
|
return Number::formatMoney($this->balance, $this->client);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function invoice_number()
|
|
|
|
{
|
|
|
|
if ($this->number != '') {
|
|
|
|
return $this->number;
|
|
|
|
} else {
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
}
|
2019-08-29 06:07:04 +02:00
|
|
|
}
|