2017-01-30 20:40:43 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Ninja\Presenters;
|
2016-12-12 19:42:51 +01:00
|
|
|
|
2017-11-30 21:02:46 +01:00
|
|
|
use Str;
|
2016-12-12 19:42:51 +01:00
|
|
|
use stdClass;
|
|
|
|
|
|
|
|
class InvoiceItemPresenter extends EntityPresenter
|
|
|
|
{
|
|
|
|
public function rBits()
|
|
|
|
{
|
|
|
|
$data = new stdClass();
|
|
|
|
$data->description = $this->entity->notes;
|
|
|
|
$data->item_price = floatval($this->entity->cost);
|
|
|
|
$data->quantity = floatval($this->entity->qty);
|
|
|
|
$data->amount = round($data->item_price * $data->quantity, 2);
|
|
|
|
|
|
|
|
return $data;
|
|
|
|
}
|
2017-11-30 21:02:46 +01:00
|
|
|
|
2018-01-21 20:12:49 +01:00
|
|
|
public function tax1()
|
|
|
|
{
|
|
|
|
$item = $this->entity;
|
|
|
|
|
|
|
|
return $item->tax_name1 . ' ' . $item->tax_rate1 . '%';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function tax2()
|
|
|
|
{
|
|
|
|
$item = $this->entity;
|
|
|
|
|
|
|
|
return $item->tax_name2 . ' ' . $item->tax_rate2 . '%';
|
|
|
|
}
|
2016-12-12 19:42:51 +01:00
|
|
|
}
|