Skip to content

Commit

Permalink
fixed tax select2
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed May 7, 2018
1 parent 6bb5aab commit 1e960ee
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 51 deletions.
143 changes: 100 additions & 43 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions resources/views/expenses/bills/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function addItem() {
html += ' <input class="form-control text-right" required="required" name="item[' + item_row + '][price]" type="text" id="item-price-' + item_row + '">';
html += ' </td>';
html += ' <td>';
html += ' <select class="form-control select2" name="item[' + item_row + '][tax_id]" id="item-tax-' + item_row + '">';
html += ' <select class="form-control tax-select2" name="item[' + item_row + '][tax_id]" id="item-tax-' + item_row + '">';
html += ' <option selected="selected" value="">{{ trans('general.form.select.field', ['field' => trans_choice('general.taxes', 1)]) }}</option>';
@foreach($taxes as $tax_key => $tax_value)
html += ' <option value="{{ $tax_key }}">{{ $tax_value }}</option>';
Expand All @@ -176,7 +176,7 @@ function addItem() {
$('[data-toggle="tooltip"]').tooltip('hide');
$('#item-row-' + item_row + ' .select2').select2({
$('#item-row-' + item_row + ' .tax-select2').select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.taxes', 1)]) }}"
});
Expand Down
4 changes: 2 additions & 2 deletions resources/views/expenses/bills/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function addItem() {
html += ' <input class="form-control text-right" required="required" name="item[' + item_row + '][price]" type="text" id="item-price-' + item_row + '">';
html += ' </td>';
html += ' <td>';
html += ' <select class="form-control select2" name="item[' + item_row + '][tax_id]" id="item-tax-' + item_row + '">';
html += ' <select class="form-control tax-select2" name="item[' + item_row + '][tax_id]" id="item-tax-' + item_row + '">';
html += ' <option selected="selected" value="">{{ trans('general.form.select.filed', ['field' => trans_choice('general.taxes', 1)]) }}</option>';
@foreach($taxes as $tax_key => $tax_value)
html += ' <option value="{{ $tax_key }}">{{ $tax_value }}</option>';
Expand All @@ -182,7 +182,7 @@ function addItem() {
$('[data-toggle="tooltip"]').tooltip('hide');
$('#item-row-' + item_row + ' .select2').select2({
$('#item-row-' + item_row + ' .tax-select2').select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.taxes', 1)]) }}"
});
Expand Down
4 changes: 2 additions & 2 deletions resources/views/incomes/invoices/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function addItem() {
html += ' <input class="form-control text-right" required="required" name="item[' + item_row + '][price]" type="text" id="item-price-' + item_row + '">';
html += ' </td>';
html += ' <td>';
html += ' <select class="form-control select2" name="item[' + item_row + '][tax_id]" id="item-tax-' + item_row + '">';
html += ' <select class="form-control tax-select2" name="item[' + item_row + '][tax_id]" id="item-tax-' + item_row + '">';
html += ' <option selected="selected" value="">{{ trans('general.form.select.field', ['field' => trans_choice('general.taxes', 1)]) }}</option>';
@foreach($taxes as $tax_key => $tax_value)
html += ' <option value="{{ $tax_key }}">{{ $tax_value }}</option>';
Expand All @@ -177,7 +177,7 @@ function addItem() {
$('[data-toggle="tooltip"]').tooltip('hide');
$('#item-row-' + item_row + ' .select2').select2({
$('#item-row-' + item_row + ' .tax-select2').select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.taxes', 1)]) }}"
});
Expand Down
4 changes: 2 additions & 2 deletions resources/views/incomes/invoices/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ function addItem() {
html += ' <input class="form-control text-right" required="required" name="item[' + item_row + '][price]" type="text" id="item-price-' + item_row + '">';
html += ' </td>';
html += ' <td>';
html += ' <select class="form-control select2" name="item[' + item_row + '][tax_id]" id="item-tax-' + item_row + '">';
html += ' <select class="form-control tax-select2" name="item[' + item_row + '][tax_id]" id="item-tax-' + item_row + '">';
html += ' <option selected="selected" value="">{{ trans('general.form.select.field', ['field' => trans_choice('general.taxes', 1)]) }}</option>';
@foreach($taxes as $tax_key => $tax_value)
html += ' <option value="{{ $tax_key }}">{{ $tax_value }}</option>';
Expand All @@ -181,7 +181,7 @@ function addItem() {
$('[data-toggle="tooltip"]').tooltip('hide');
$('#item-row-' + item_row + ' .select2').select2({
$('#item-row-' + item_row + ' .tax-select2').select2({
placeholder: "{{ trans('general.form.select.field', ['field' => trans_choice('general.taxes', 1)]) }}"
});
Expand Down

0 comments on commit 1e960ee

Please sign in to comment.