2016-01-06 20:52:09 +01:00
|
|
|
<?php namespace App\Ninja\Presenters;
|
|
|
|
|
|
|
|
use Utils;
|
|
|
|
|
2016-05-23 11:26:08 +02:00
|
|
|
class ExpensePresenter extends EntityPresenter {
|
2016-01-06 20:52:09 +01:00
|
|
|
|
2016-01-07 16:14:11 +01:00
|
|
|
// Expenses
|
2016-01-06 20:52:09 +01:00
|
|
|
public function vendor()
|
|
|
|
{
|
|
|
|
return $this->entity->vendor ? $this->entity->vendor->getDisplayName() : '';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function expense_date()
|
|
|
|
{
|
|
|
|
return Utils::fromSqlDate($this->entity->expense_date);
|
|
|
|
}
|
2016-01-21 21:36:49 +01:00
|
|
|
|
2016-02-24 22:54:43 +01:00
|
|
|
public function invoiced_amount()
|
|
|
|
{
|
2016-03-24 23:15:52 +01:00
|
|
|
return $this->entity->invoice_id ? $this->entity->convertedAmount() : 0;
|
2016-02-24 22:54:43 +01:00
|
|
|
}
|
2016-05-23 11:26:08 +02:00
|
|
|
|
|
|
|
}
|