mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Added setting to hide second tax rate
This commit is contained in:
parent
e5afb28e4b
commit
0e75ddb5e6
@ -790,11 +790,7 @@ class AccountController extends BaseController
|
|||||||
private function saveTaxRates()
|
private function saveTaxRates()
|
||||||
{
|
{
|
||||||
$account = Auth::user()->account;
|
$account = Auth::user()->account;
|
||||||
|
$account->fill(Input::all());
|
||||||
$account->invoice_taxes = Input::get('invoice_taxes') ? true : false;
|
|
||||||
$account->invoice_item_taxes = Input::get('invoice_item_taxes') ? true : false;
|
|
||||||
$account->show_item_taxes = Input::get('show_item_taxes') ? true : false;
|
|
||||||
$account->default_tax_rate_id = Input::get('default_tax_rate_id');
|
|
||||||
$account->save();
|
$account->save();
|
||||||
|
|
||||||
Session::flash('message', trans('texts.updated_settings'));
|
Session::flash('message', trans('texts.updated_settings'));
|
||||||
|
@ -134,6 +134,7 @@ class InvoiceApiController extends BaseAPIController
|
|||||||
'city',
|
'city',
|
||||||
'state',
|
'state',
|
||||||
'postal_code',
|
'postal_code',
|
||||||
|
'country_id',
|
||||||
'private_notes',
|
'private_notes',
|
||||||
'currency_code',
|
'currency_code',
|
||||||
] as $field) {
|
] as $field) {
|
||||||
|
@ -56,6 +56,11 @@ class Account extends Eloquent
|
|||||||
'currency_id',
|
'currency_id',
|
||||||
'language_id',
|
'language_id',
|
||||||
'military_time',
|
'military_time',
|
||||||
|
'invoice_taxes',
|
||||||
|
'invoice_item_taxes',
|
||||||
|
'show_item_taxes',
|
||||||
|
'default_tax_rate_id',
|
||||||
|
'enable_second_tax_rate',
|
||||||
];
|
];
|
||||||
|
|
||||||
public static $basicSettings = [
|
public static $basicSettings = [
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
// Whether checkboxes should always be present in the POST data,
|
// Whether checkboxes should always be present in the POST data,
|
||||||
// no matter if you checked them or not
|
// no matter if you checked them or not
|
||||||
'push_checkboxes' => false,
|
'push_checkboxes' => true,
|
||||||
|
|
||||||
// The value a checkbox will have in the POST array if unchecked
|
// The value a checkbox will have in the POST array if unchecked
|
||||||
'unchecked_value' => 0,
|
'unchecked_value' => 0,
|
||||||
|
@ -1312,7 +1312,8 @@ $LANG = array(
|
|||||||
'security' => 'Security',
|
'security' => 'Security',
|
||||||
'see_whats_new' => 'See what\'s new in v:version',
|
'see_whats_new' => 'See what\'s new in v:version',
|
||||||
'wait_for_upload' => 'Please wait for the document upload to complete.',
|
'wait_for_upload' => 'Please wait for the document upload to complete.',
|
||||||
'upgrade_for_permissions' => 'Upgrade to our Enterprise plan to enable permissions.'
|
'upgrade_for_permissions' => 'Upgrade to our Enterprise plan to enable permissions.',
|
||||||
|
'enable_second_tax_rate' => 'Enable specifying a <b>second tax rate</b>',
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
{{ Former::populateField('invoice_taxes', intval($account->invoice_taxes)) }}
|
{{ Former::populateField('invoice_taxes', intval($account->invoice_taxes)) }}
|
||||||
{{ Former::populateField('invoice_item_taxes', intval($account->invoice_item_taxes)) }}
|
{{ Former::populateField('invoice_item_taxes', intval($account->invoice_item_taxes)) }}
|
||||||
{{ Former::populateField('show_item_taxes', intval($account->show_item_taxes)) }}
|
{{ Former::populateField('show_item_taxes', intval($account->show_item_taxes)) }}
|
||||||
|
{{ Former::populateField('enable_second_tax_rate', intval($account->enable_second_tax_rate)) }}
|
||||||
|
|
||||||
|
|
||||||
<div class="panel panel-default">
|
<div class="panel panel-default">
|
||||||
@ -30,6 +31,10 @@
|
|||||||
->text(trans('texts.show_line_item_tax'))
|
->text(trans('texts.show_line_item_tax'))
|
||||||
->label(' ') !!}
|
->label(' ') !!}
|
||||||
|
|
||||||
|
{!! Former::checkbox('enable_second_tax_rate')
|
||||||
|
->text(trans('texts.enable_second_tax_rate'))
|
||||||
|
->label(' ') !!}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{!! Former::select('default_tax_rate_id')
|
{!! Former::select('default_tax_rate_id')
|
||||||
|
@ -243,7 +243,7 @@
|
|||||||
@endif
|
@endif
|
||||||
<th style="min-width:120px" data-bind="text: costLabel">{{ $invoiceLabels['unit_cost'] }}</th>
|
<th style="min-width:120px" data-bind="text: costLabel">{{ $invoiceLabels['unit_cost'] }}</th>
|
||||||
<th style="{{ $account->hide_quantity ? 'display:none' : 'min-width:120px' }}" data-bind="text: qtyLabel">{{ $invoiceLabels['quantity'] }}</th>
|
<th style="{{ $account->hide_quantity ? 'display:none' : 'min-width:120px' }}" data-bind="text: qtyLabel">{{ $invoiceLabels['quantity'] }}</th>
|
||||||
<th style="min-width:180px;display:none;" data-bind="visible: $root.invoice_item_taxes.show">{{ trans('texts.tax') }}</th>
|
<th style="min-width:{{ $account->enable_second_tax_rate ? 180 : 120 }}px;display:none;" data-bind="visible: $root.invoice_item_taxes.show">{{ trans('texts.tax') }}</th>
|
||||||
<th style="min-width:120px;">{{ trans('texts.line_total') }}</th>
|
<th style="min-width:120px;">{{ trans('texts.line_total') }}</th>
|
||||||
<th style="min-width:32px;" class="hide-border"></th>
|
<th style="min-width:32px;" class="hide-border"></th>
|
||||||
</tr>
|
</tr>
|
||||||
@ -288,16 +288,18 @@
|
|||||||
->addOption('', '')
|
->addOption('', '')
|
||||||
->options($taxRateOptions)
|
->options($taxRateOptions)
|
||||||
->data_bind('value: tax1')
|
->data_bind('value: tax1')
|
||||||
->addClass('tax-select')
|
->addClass($account->enable_second_tax_rate ? 'tax-select' : '')
|
||||||
->raw() !!}
|
->raw() !!}
|
||||||
<input type="text" data-bind="value: tax_name1, attr: {name: 'invoice_items[' + $index() + '][tax_name1]'}" style="display:none">
|
<input type="text" data-bind="value: tax_name1, attr: {name: 'invoice_items[' + $index() + '][tax_name1]'}" style="display:none">
|
||||||
<input type="text" data-bind="value: tax_rate1, attr: {name: 'invoice_items[' + $index() + '][tax_rate1]'}" style="display:none">
|
<input type="text" data-bind="value: tax_rate1, attr: {name: 'invoice_items[' + $index() + '][tax_rate1]'}" style="display:none">
|
||||||
|
<div data-bind="visible: $root.invoice().account.enable_second_tax_rate == '1'">
|
||||||
{!! Former::select('')
|
{!! Former::select('')
|
||||||
->addOption('', '')
|
->addOption('', '')
|
||||||
->options($taxRateOptions)
|
->options($taxRateOptions)
|
||||||
->data_bind('value: tax2')
|
->data_bind('value: tax2')
|
||||||
->addClass('tax-select')
|
->addClass('tax-select')
|
||||||
->raw() !!}
|
->raw() !!}
|
||||||
|
</div>
|
||||||
<input type="text" data-bind="value: tax_name2, attr: {name: 'invoice_items[' + $index() + '][tax_name2]'}" style="display:none">
|
<input type="text" data-bind="value: tax_name2, attr: {name: 'invoice_items[' + $index() + '][tax_name2]'}" style="display:none">
|
||||||
<input type="text" data-bind="value: tax_rate2, attr: {name: 'invoice_items[' + $index() + '][tax_rate2]'}" style="display:none">
|
<input type="text" data-bind="value: tax_rate2, attr: {name: 'invoice_items[' + $index() + '][tax_rate2]'}" style="display:none">
|
||||||
</td>
|
</td>
|
||||||
@ -438,17 +440,19 @@
|
|||||||
->id('taxRateSelect1')
|
->id('taxRateSelect1')
|
||||||
->addOption('', '')
|
->addOption('', '')
|
||||||
->options($taxRateOptions)
|
->options($taxRateOptions)
|
||||||
->addClass('tax-select')
|
->addClass($account->enable_second_tax_rate ? 'tax-select' : '')
|
||||||
->data_bind('value: tax1')
|
->data_bind('value: tax1')
|
||||||
->raw() !!}
|
->raw() !!}
|
||||||
<input type="text" name="tax_name1" data-bind="value: tax_name1" style="display:none">
|
<input type="text" name="tax_name1" data-bind="value: tax_name1" style="display:none">
|
||||||
<input type="text" name="tax_rate1" data-bind="value: tax_rate1" style="display:none">
|
<input type="text" name="tax_rate1" data-bind="value: tax_rate1" style="display:none">
|
||||||
|
<div data-bind="visible: $root.invoice().account.enable_second_tax_rate == '1'">
|
||||||
{!! Former::select('')
|
{!! Former::select('')
|
||||||
->addOption('', '')
|
->addOption('', '')
|
||||||
->options($taxRateOptions)
|
->options($taxRateOptions)
|
||||||
->addClass('tax-select')
|
->addClass('tax-select')
|
||||||
->data_bind('value: tax2')
|
->data_bind('value: tax2')
|
||||||
->raw() !!}
|
->raw() !!}
|
||||||
|
</div>
|
||||||
<input type="text" name="tax_name2" data-bind="value: tax_name2" style="display:none">
|
<input type="text" name="tax_name2" data-bind="value: tax_name2" style="display:none">
|
||||||
<input type="text" name="tax_rate2" data-bind="value: tax_rate2" style="display:none">
|
<input type="text" name="tax_rate2" data-bind="value: tax_rate2" style="display:none">
|
||||||
</td>
|
</td>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user