diff --git a/resources/assets/js/components/AkauntingModal.vue b/resources/assets/js/components/AkauntingModal.vue index 362392c61..86c93c480 100644 --- a/resources/assets/js/components/AkauntingModal.vue +++ b/resources/assets/js/components/AkauntingModal.vue @@ -49,6 +49,7 @@ import AkauntingRadioGroup from './forms/AkauntingRadioGroup'; import AkauntingSelect from './AkauntingSelect'; import AkauntingDate from './AkauntingDate'; import AkauntingRecurring from './AkauntingRecurring'; +import AkauntingMoney from './AkauntingMoney'; export default { name: 'akaunting-modal', @@ -58,7 +59,8 @@ export default { AkauntingRadioGroup, AkauntingSelect, AkauntingDate, - AkauntingRecurring + AkauntingRecurring, + AkauntingMoney, }, props: { diff --git a/resources/assets/js/components/AkauntingModalAddNew.vue b/resources/assets/js/components/AkauntingModalAddNew.vue index d60cc23ea..5655185d4 100644 --- a/resources/assets/js/components/AkauntingModalAddNew.vue +++ b/resources/assets/js/components/AkauntingModalAddNew.vue @@ -137,7 +137,7 @@ export default { }; }, - created: function () { + created: function () { let documentClasses = document.body.classList; documentClasses.add("modal-open"); @@ -238,6 +238,12 @@ export default { this.form.currency = response.data.currency_name; this.form.currency_code = response.data.currency_code; this.form.currency_rate = response.data.currency_rate; + + this.currency.decimal = response.data.decimal_mark; + this.currency.thousands = response.data.thousands_separator; + this.currency.prefix = (response.data.symbol_first) ? response.data.symbol : ''; + this.currency.suffix = (!response.data.symbol_first) ? response.data.symbol : ''; + this.currency.precision = parseInt(response.data.precision); }) .catch(error => { }); diff --git a/resources/assets/js/components/AkauntingMoney.vue b/resources/assets/js/components/AkauntingMoney.vue index ce7382cda..8eb91cddd 100644 --- a/resources/assets/js/components/AkauntingMoney.vue +++ b/resources/assets/js/components/AkauntingMoney.vue @@ -158,14 +158,18 @@ export default { //this.model = this.value; if (this.dynamicCurrency.code != this.currency.code) { - this.money = { - decimal: this.dynamicCurrency.decimal_mark, - thousands: this.dynamicCurrency.thousands_separator, - prefix: (this.dynamicCurrency.symbol_first) ? this.dynamicCurrency.symbol : '', - suffix: (!this.dynamicCurrency.symbol_first) ? this.dynamicCurrency.symbol : '', - precision: parseInt(this.dynamicCurrency.precision), - masked: this.masked - }; + if (!this.dynamicCurrency.decimal) { + this.money = { + decimal: this.dynamicCurrency.decimal_mark, + thousands: this.dynamicCurrency.thousands_separator, + prefix: (this.dynamicCurrency.symbol_first) ? this.dynamicCurrency.symbol : '', + suffix: (!this.dynamicCurrency.symbol_first) ? this.dynamicCurrency.symbol : '', + precision: parseInt(this.dynamicCurrency.precision), + masked: this.masked + }; + } else { + this.money = this.dynamicCurrency; + } } this.$emit('interface', this.model);