2015-10-21 13:11:08 +02:00
|
|
|
@extends('header')
|
|
|
|
|
2016-05-29 11:26:02 +02:00
|
|
|
@section('content')
|
2015-10-21 13:11:08 +02:00
|
|
|
@parent
|
|
|
|
|
|
|
|
@include('accounts.nav', ['selected' => ACCOUNT_TAX_RATES])
|
|
|
|
|
|
|
|
{!! Former::open()->addClass('warn-on-exit') !!}
|
|
|
|
{{ Former::populate($account) }}
|
|
|
|
{{ Former::populateField('invoice_taxes', intval($account->invoice_taxes)) }}
|
|
|
|
{{ Former::populateField('invoice_item_taxes', intval($account->invoice_item_taxes)) }}
|
2016-05-29 11:26:02 +02:00
|
|
|
{{ Former::populateField('enable_second_tax_rate', intval($account->enable_second_tax_rate)) }}
|
2016-08-15 17:08:06 +02:00
|
|
|
{{ Former::populateField('include_item_taxes_inline', intval($account->include_item_taxes_inline)) }}
|
2017-12-03 12:56:10 +01:00
|
|
|
{{ Former::populateField('inclusive_taxes', intval($account->inclusive_taxes)) }}
|
2015-10-21 13:11:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
|
|
|
<h3 class="panel-title">{!! trans('texts.tax_settings') !!}</h3>
|
2016-05-29 11:26:02 +02:00
|
|
|
</div>
|
2015-10-21 13:11:08 +02:00
|
|
|
<div class="panel-body">
|
|
|
|
|
2016-08-15 17:08:06 +02:00
|
|
|
{!! Former::checkbox('invoice_taxes')
|
|
|
|
->text(trans('texts.enable_invoice_tax'))
|
2017-01-09 16:01:51 +01:00
|
|
|
->label(' ')
|
|
|
|
->value(1) !!}
|
2015-10-21 13:11:08 +02:00
|
|
|
|
2016-08-15 17:08:06 +02:00
|
|
|
{!! Former::checkbox('invoice_item_taxes')
|
|
|
|
->text(trans('texts.enable_line_item_tax'))
|
2017-01-09 16:01:51 +01:00
|
|
|
->label(' ')
|
|
|
|
->value(1) !!}
|
2015-10-21 13:11:08 +02:00
|
|
|
|
2017-12-03 12:56:10 +01:00
|
|
|
{!! Former::checkbox('enable_second_tax_rate')
|
|
|
|
->text(trans('texts.enable_second_tax_rate'))
|
2017-01-09 16:01:51 +01:00
|
|
|
->label(' ')
|
|
|
|
->value(1) !!}
|
2016-08-15 17:08:06 +02:00
|
|
|
|
2018-01-01 10:26:28 +01:00
|
|
|
{!! Former::checkbox('include_item_taxes_inline')
|
|
|
|
->text(trans('texts.include_item_taxes_inline'))
|
|
|
|
->label(' ')
|
|
|
|
->value(1) !!}
|
|
|
|
|
|
|
|
@if (! $hasInclusiveTaxRates && $countInvoices == 0)
|
2017-12-03 14:16:09 +01:00
|
|
|
{!! Former::checkbox('inclusive_taxes')
|
|
|
|
->text(trans('texts.inclusive_taxes_help'))
|
|
|
|
->label(' ')
|
2018-01-01 10:26:28 +01:00
|
|
|
->help('inclusive_taxes_notice')
|
2017-12-03 14:16:09 +01:00
|
|
|
->value(1) !!}
|
2018-02-16 10:54:46 +01:00
|
|
|
@elseif ($countInvoices <= 10)
|
|
|
|
{!! Former::plaintext(' ')->help(
|
|
|
|
trans($account->inclusive_taxes ? 'texts.taxes_are_included_help' : 'texts.taxes_are_not_included_help') . '<br/>' .
|
|
|
|
trans('texts.change_requires_purge', ['link' => link_to(url('/settings/account_management'), trans('texts.purging'))])) !!}
|
2017-12-03 14:16:09 +01:00
|
|
|
@endif
|
2017-12-03 12:56:10 +01:00
|
|
|
|
2015-10-21 13:11:08 +02:00
|
|
|
|
|
|
|
|
2017-12-04 22:32:10 +01:00
|
|
|
@if ($taxRates->count())
|
|
|
|
@include('partials.tax_rates', ['taxRateLabel' => trans('texts.default_tax_rate_id')])
|
|
|
|
|
|
|
|
@endif
|
2015-10-21 13:11:08 +02:00
|
|
|
|
|
|
|
{!! Former::actions( Button::success(trans('texts.save'))->submit()->appendIcon(Icon::create('floppy-disk')) ) !!}
|
|
|
|
{!! Former::close() !!}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{!! Button::primary(trans('texts.create_tax_rate'))
|
|
|
|
->asLinkTo(URL::to('/tax_rates/create'))
|
|
|
|
->withAttributes(['class' => 'pull-right'])
|
|
|
|
->appendIcon(Icon::create('plus-sign')) !!}
|
|
|
|
|
2015-11-05 23:37:04 +01:00
|
|
|
@include('partials.bulk_form', ['entityType' => ENTITY_TAX_RATE])
|
|
|
|
|
2016-05-29 11:26:02 +02:00
|
|
|
{!! Datatable::table()
|
2015-10-21 13:11:08 +02:00
|
|
|
->addColumn(
|
|
|
|
trans('texts.name'),
|
|
|
|
trans('texts.rate'),
|
2017-01-02 12:38:58 +01:00
|
|
|
trans('texts.type'),
|
2015-10-21 13:11:08 +02:00
|
|
|
trans('texts.action'))
|
2016-05-29 11:26:02 +02:00
|
|
|
->setUrl(url('api/tax_rates/'))
|
2015-10-21 13:11:08 +02:00
|
|
|
->setOptions('sPaginationType', 'bootstrap')
|
2016-05-29 11:26:02 +02:00
|
|
|
->setOptions('bFilter', false)
|
|
|
|
->setOptions('bAutoWidth', false)
|
2017-01-02 12:38:58 +01:00
|
|
|
->setOptions('aoColumns', [[ "sWidth"=> "25%" ], [ "sWidth"=> "25%" ], ["sWidth"=> "25%"], ["sWidth"=> "25%"]])
|
2015-10-21 13:11:08 +02:00
|
|
|
->setOptions('aoColumnDefs', [['bSortable'=>false, 'aTargets'=>[2]]])
|
|
|
|
->render('datatable') !!}
|
|
|
|
|
|
|
|
<script>
|
2015-11-11 13:17:58 +01:00
|
|
|
window.onDatatableReady = actionListHandler;
|
2016-05-29 11:26:02 +02:00
|
|
|
</script>
|
2015-10-21 13:11:08 +02:00
|
|
|
|
|
|
|
|
2017-12-03 12:56:10 +01:00
|
|
|
<script type="text/javascript">
|
|
|
|
$(function() {
|
2017-12-03 14:16:09 +01:00
|
|
|
@if ($countInvoices > 0)
|
2017-12-03 12:56:10 +01:00
|
|
|
$('#inclusive_taxes').change(function() {
|
|
|
|
swal("{{ trans('texts.inclusive_taxes_warning') }}");
|
|
|
|
})
|
|
|
|
@endif
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
|
2016-05-29 11:26:02 +02:00
|
|
|
@stop
|