2016-01-06 20:52:09 +01:00
|
|
|
<?php namespace App\Ninja\Presenters;
|
|
|
|
|
|
|
|
use Utils;
|
|
|
|
use Laracasts\Presenter\Presenter;
|
|
|
|
|
|
|
|
class ExpensePresenter extends Presenter {
|
|
|
|
|
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
|
|
|
|
|
|
|
public function converted_amount()
|
|
|
|
{
|
|
|
|
return round($this->entity->amount * $this->entity->exchange_rate, 2);
|
|
|
|
}
|
2016-01-06 20:52:09 +01:00
|
|
|
}
|