1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-09 20:52:56 +01:00
invoiceninja/app/Ninja/Datatables/TaxRateDatatable.php
2019-01-30 22:25:37 +11:00

51 lines
1.2 KiB
PHP

<?php
namespace App\Ninja\Datatables;
use URL;
class TaxRateDatatable extends EntityDatatable
{
public $entityType = ENTITY_TAX_RATE;
public function columns()
{
return [
[
'name',
function ($model) {
return link_to("tax_rates/{$model->public_id}/edit", $model->name)->toHtml();
},
],
[
'rate',
function ($model) {
return ($model->rate + 0) . '%';
},
],
[
'type',
function ($model) {
if (auth()->user()->account->inclusive_taxes) {
return trans('texts.inclusive');
} else {
return $model->is_inclusive ? trans('texts.inclusive') : trans('texts.exclusive');
}
},
],
];
}
public function actions()
{
return [
[
uctrans('texts.edit_tax_rate'),
function ($model) {
return URL::to("tax_rates/{$model->public_id}/edit");
},
],
];
}
}