1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-09 20:52:56 +01:00

Don’t allow both types of inclusive tax rates

This commit is contained in:
Hillel Coren 2017-12-04 23:30:04 +02:00
parent 65369399bb
commit bc63c2c503
4 changed files with 3 additions and 3 deletions

View File

@ -495,6 +495,7 @@ class AccountController extends BaseController
'title' => trans('texts.tax_rates'),
'taxRates' => TaxRate::scope()->whereIsInclusive(false)->get(),
'countInvoices' => Invoice::scope()->withTrashed()->count(),
'hasInclusiveTaxRates' => TaxRate::scope()->whereIsInclusive(true)->count() ? true : false,
];
return View::make('accounts.tax_rates', $data);

View File

@ -27,7 +27,7 @@ class TaxRateDatatable extends EntityDatatable
'type',
function ($model) {
if (auth()->user()->account->inclusive_taxes) {
return trans('texts.standard');
return trans('texts.inclusive');
} else {
return $model->is_inclusive ? trans('texts.inclusive') : trans('texts.exclusive');
}

View File

@ -2606,7 +2606,6 @@ $LANG = array(
'edit_times' => 'Edit Times',
'inclusive_taxes_help' => 'Include <b>taxes in the cost</b>',
'inclusive_taxes_warning' => 'Warning: existing invoices will need to be resaved',
'standard' => 'Standard',
);

View File

@ -35,7 +35,7 @@
->label('&nbsp;')
->value(1) !!}
@if ($account->inclusive_taxes || $countInvoices <= 10)
@if (! $hasInclusiveTaxRates && ($account->inclusive_taxes || $countInvoices <= 10))
{!! Former::checkbox('inclusive_taxes')
->text(trans('texts.inclusive_taxes_help'))
->label('&nbsp;')