Invoice and bill item tax issue solved.
This commit is contained in:
parent
ac29fe4bf1
commit
934d1d0b7e
@ -533,6 +533,7 @@ export default {
|
||||
add_new_html: '',
|
||||
form: {},
|
||||
new_options: false,
|
||||
hide_selected: false,
|
||||
}
|
||||
},
|
||||
|
||||
@ -548,23 +549,41 @@ export default {
|
||||
|
||||
methods: {
|
||||
change() {
|
||||
if (typeof(this.real_model) === 'object') {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.$emit('change', this.real_model);
|
||||
this.$emit('interface', this.real_model);
|
||||
},
|
||||
|
||||
onAddItem() {
|
||||
async onAddItem() {
|
||||
if (this.multiple) {
|
||||
this.hide_selected = this.real_model;
|
||||
}
|
||||
|
||||
// Get Select Input value
|
||||
var value = this.$children[0].$children[0].$children[0].$refs.input.value;
|
||||
if (this.title) {
|
||||
var value = this.$children[0].$children[0].$children[0].$refs.input.value;
|
||||
} else {
|
||||
var value = this.$children[0].$children[0].$refs.input.value;
|
||||
}
|
||||
|
||||
if (this.add_new.type == 'inline') {
|
||||
this.addInline(value);
|
||||
if (value === '') {
|
||||
return false;
|
||||
}
|
||||
|
||||
await this.addInline(value);
|
||||
} else {
|
||||
this.onModal(value);
|
||||
await this.onModal(value);
|
||||
}
|
||||
},
|
||||
|
||||
addInline(value) {
|
||||
|
||||
if (this.multiple) {
|
||||
this.hide_selected = false;
|
||||
}
|
||||
},
|
||||
|
||||
onModal(value) {
|
||||
@ -662,7 +681,12 @@ export default {
|
||||
if (response.data.success) {
|
||||
this.selectOptions[response.data.data[this.add_new.field.key]] = response.data.data[this.add_new.field.value];
|
||||
this.new_options[response.data.data[this.add_new.field.key]] = response.data.data[this.add_new.field.value];
|
||||
this.real_model = response.data.data[this.add_new.field.key].toString();
|
||||
|
||||
if (this.multiple) {
|
||||
this.real_model.push(response.data.data[this.add_new.field.key].toString());
|
||||
} else {
|
||||
this.real_model = response.data.data[this.add_new.field.key].toString();
|
||||
}
|
||||
|
||||
this.change();
|
||||
|
||||
@ -670,6 +694,10 @@ export default {
|
||||
|
||||
this.add_new.html = '';
|
||||
this.add_new_html = null;
|
||||
|
||||
if (this.multiple) {
|
||||
this.hide_selected = false;
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
@ -706,6 +734,12 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
real_model: function (value) {
|
||||
if (this.multiple && this.hide_selected) {
|
||||
this.real_model = this.hide_selected;
|
||||
}
|
||||
},
|
||||
|
||||
value: function (value) {
|
||||
if (this.multiple) {
|
||||
this.real_model = value;
|
||||
|
@ -104,7 +104,7 @@
|
||||
@stack('tax_id_input_start')
|
||||
<akaunting-select
|
||||
class="mb-0 select-tax"
|
||||
:form-classes="[{'has-error': form.errors.has('tax_id') }]"
|
||||
:form-classes="[{'has-error': form.errors.has('items.' + index + '.tax_id') }]"
|
||||
:icon="''"
|
||||
:title="''"
|
||||
:placeholder="'{{ trans('general.form.select.field', ['field' => trans_choice('general.taxes', 1)]) }}'"
|
||||
@ -117,7 +117,11 @@
|
||||
'text' => trans('general.add_new'),
|
||||
'path' => route('modals.taxes.create'),
|
||||
'type' => 'modal',
|
||||
'field' => 'name',
|
||||
'field' => [
|
||||
'key' => 'id',
|
||||
'value' => 'title'
|
||||
],
|
||||
'new_text' => trans('modules.new'),
|
||||
'buttons' => [
|
||||
'cancel' => [
|
||||
'text' => trans('general.cancel'),
|
||||
@ -132,7 +136,7 @@
|
||||
:collapse="false"
|
||||
@interface="row.tax_id = $event"
|
||||
@change="onCalculateTotal($event)"
|
||||
:form-error="form.errors.get('tax_id')"
|
||||
:form-error="form.errors.get('items.' + index + '.tax_id')"
|
||||
:no-data-text="'{{ trans('general.no_data') }}'"
|
||||
:no-matching-data-text="'{{ trans('general.no_matching_data') }}'"
|
||||
></akaunting-select>
|
||||
|
@ -104,7 +104,7 @@
|
||||
@stack('tax_id_input_start')
|
||||
<akaunting-select
|
||||
class="mb-0 select-tax"
|
||||
:form-classes="[{'has-error': form.errors.has('tax_id') }]"
|
||||
:form-classes="[{'has-error': form.errors.has('items.' + index + '.tax_id') }]"
|
||||
:icon="''"
|
||||
:title="''"
|
||||
:placeholder="'{{ trans('general.form.select.field', ['field' => trans_choice('general.taxes', 1)]) }}'"
|
||||
@ -117,7 +117,11 @@
|
||||
'text' => trans('general.add_new'),
|
||||
'path' => route('modals.taxes.create'),
|
||||
'type' => 'modal',
|
||||
'field' => 'name',
|
||||
'field' => [
|
||||
'key' => 'id',
|
||||
'value' => 'title'
|
||||
],
|
||||
'new_text' => trans('modules.new'),
|
||||
'buttons' => [
|
||||
'cancel' => [
|
||||
'text' => trans('general.cancel'),
|
||||
@ -132,7 +136,7 @@
|
||||
:collapse="false"
|
||||
@interface="row.tax_id = $event"
|
||||
@change="onCalculateTotal($event)"
|
||||
:form-error="form.errors.get('tax_id')"
|
||||
:form-error="form.errors.get('items.' + index + '.tax_id')"
|
||||
:no-data-text="'{{ trans('general.no_data') }}'"
|
||||
:no-matching-data-text="'{{ trans('general.no_matching_data') }}'"
|
||||
></akaunting-select>
|
||||
|
Loading…
x
Reference in New Issue
Block a user