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

38 lines
735 B
PHP
Raw Normal View History

2016-01-06 20:52:09 +01:00
<?php namespace App\Ninja\Presenters;
use Utils;
/**
* Class ExpensePresenter
*/
class ExpensePresenter extends EntityPresenter
{
2016-01-06 20:52:09 +01:00
/**
* @return string
*/
2016-01-06 20:52:09 +01:00
public function vendor()
{
return $this->entity->vendor ? $this->entity->vendor->getDisplayName() : '';
}
/**
* @return \DateTime|string
*/
2016-01-06 20:52:09 +01:00
public function expense_date()
{
return Utils::fromSqlDate($this->entity->expense_date);
}
2016-01-21 21:36:49 +01:00
2016-12-05 19:35:01 +01:00
public function amount()
{
return Utils::formatMoney($this->entity->amount, $this->entity->expense_currency_id);
}
public function category()
{
return $this->entity->expense_category ? $this->entity->expense_category->name : '';
}
2016-05-23 11:26:08 +02:00
}