diff --git a/resources/assets/js/components/AkauntingCurrencyConversion.vue b/resources/assets/js/components/AkauntingCurrencyConversion.vue index 3ee000822..49055ae12 100644 --- a/resources/assets/js/components/AkauntingCurrencyConversion.vue +++ b/resources/assets/js/components/AkauntingCurrencyConversion.vue @@ -9,7 +9,7 @@ precision: parseInt(this.currencySymbol.precision), masked: true }" :value="price" disabled size="5" masked class="disabled-money text-right mr-2 js-conversion-input"> - {{ currecyCode }} {{ texts[2] }} + {{ texts[1] }} @@ -48,16 +48,16 @@ export default { return { conversion: '', rate: this.currencyRate, - texts: [] + texts: [], + texts_split: [] }; }, created() { let conver = this.currencyConversionText.split(':price'); - + this.texts.push(conver[0]); - this.texts.push(conver[1].replace(':currency_code', this.currecyCode).replace(':currency_rate', this.currencyRate)); - this.texts.push(this.texts[1].split(" ")[2]) + this.texts.push(conver[1].replace(':currency_code', this.currecyCode).replace(':currency_rate', '')); }, methods: { @@ -72,19 +72,19 @@ export default { }, price: function (price) { - this.conversion = this.currencyConversionText.replace(':price', price).replace(':currency_code', this.currecyCode).replace(':currency_rate', ''); + this.conversion = this.currencyConversionText.replace(':price', price).replace(':currency_code', this.currecyCode).replace(); }, currecyCode: function (currecyCode) { - this.conversion = this.currencyConversionText.replace(':price', this.price).replace(':currency_code', this.currecyCode).replace(':currency_rate', ''); + this.conversion = this.currencyConversionText.replace(':price', this.price).replace(':currency_code', this.currecyCode).replace(); }, currencyRate: function (currencyRate) { this.rate = currencyRate; - this.conversion = this.currencyConversionText.replace(':price', this.price).replace(':currency_code', this.currecyCode).replace(':currency_rate', ''); + this.conversion = this.currencyConversionText.replace(':price', this.price).replace(':currency_code', this.currecyCode).replace(); }, currencySymbol: function (currencySymbol) { - this.conversion = this.currencyConversionText.replace(':price', this.price).replace(':currency_code', this.currecyCode).replace(':currency_rate', ''); + this.conversion = this.currencyConversionText.replace(':price', this.price).replace(':currency_code', this.currecyCode).replace(); }, }, }; diff --git a/resources/assets/js/views/common/documents.js b/resources/assets/js/views/common/documents.js index 0cebfa3ff..45bb63c48 100644 --- a/resources/assets/js/views/common/documents.js +++ b/resources/assets/js/views/common/documents.js @@ -553,10 +553,13 @@ this.form.currency_code = currency.code; this.form.currency_rate = currency.rate; - this.currency_symbol = currency; - + this.currencyConversion(); } + + if (document_default_currency == currency.code) { + this.currency_symbol = currency; + } }, this); },