1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-16 16:13:20 +01:00
invoiceninja/resources/views/accounts/tax_rates.blade.php

110 lines
3.8 KiB
PHP
Raw Normal View History

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)) }}
{{ 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">
{!! Former::checkbox('invoice_taxes')
->text(trans('texts.enable_invoice_tax'))
->label('&nbsp;')
->value(1) !!}
2015-10-21 13:11:08 +02:00
{!! Former::checkbox('invoice_item_taxes')
->text(trans('texts.enable_line_item_tax'))
->label('&nbsp;')
->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'))
->label('&nbsp;')
->value(1) !!}
2018-01-01 10:26:28 +01:00
{!! Former::checkbox('include_item_taxes_inline')
->text(trans('texts.include_item_taxes_inline'))
->label('&nbsp;')
->value(1) !!}
@if (! $hasInclusiveTaxRates && $countInvoices == 0)
2019-01-30 12:00:26 +01:00
<br/>
2018-03-25 13:13:43 +02:00
<br/>
{!! Former::checkbox('inclusive_taxes')
->text(trans('texts.inclusive_taxes_help'))
->label('&nbsp;')
2019-01-30 12:00:26 +01:00
->help('<b>' . strtoupper(trans('texts.important')) . ': '
. trans('texts.inclusive_taxes_notice') . '</b>')
->value(1) !!}
2019-01-30 12:00:26 +01:00
@elseif ($countInvoices <= 25)
2018-02-16 10:54:46 +01:00
{!! 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'))])) !!}
2019-01-30 12:00:26 +01:00
@else
{!! Former::plaintext(' ')->help(
trans($account->inclusive_taxes ? 'texts.taxes_are_included_help' : 'texts.taxes_are_not_included_help')) !!}
@endif
2017-12-03 12:56:10 +01:00
2015-10-21 13:11:08 +02:00
&nbsp;
@if ($taxRates->count())
@include('partials.tax_rates', ['taxRateLabel' => trans('texts.default_tax_rate_id')])
&nbsp;
@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() {
@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