From 2069a9161c1665f59dd2a236b0d98e020f1c259b Mon Sep 17 00:00:00 2001 From: EnesSacid-Buker Date: Fri, 24 Feb 2023 15:16:41 +0300 Subject: [PATCH] Money vue component updated --- .../assets/js/components/AkauntingMoney.vue | 33 +++++++++++-------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/resources/assets/js/components/AkauntingMoney.vue b/resources/assets/js/components/AkauntingMoney.vue index 42c03c837..813e1d4a2 100644 --- a/resources/assets/js/components/AkauntingMoney.vue +++ b/resources/assets/js/components/AkauntingMoney.vue @@ -109,6 +109,11 @@ export default { default: false, description: "Selectbox disabled status" }, + isDynamic: { + type: Boolean, + default: true, + description: "Currency is dynamic" + }, dynamicCurrency: { type: Object, default: function () { @@ -168,18 +173,20 @@ export default { mounted() { //this.model = this.value; - if (this.dynamicCurrency.code != this.currency.code) { - 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; + if (this.isDynamic) { + if (this.dynamicCurrency.code != this.currency.code) { + 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; + } } } @@ -206,7 +213,7 @@ export default { watch: { dynamicCurrency: function (currency) { - if (!currency) { + if (! currency) { return; }