From 6a027f2e38cef806c94a9c0e6ba2a8f31bc694d8 Mon Sep 17 00:00:00 2001 From: Burak Civan Date: Thu, 1 Jul 2021 10:23:15 +0300 Subject: [PATCH] Currency total edited --- .../AkauntingCurrencyConversion.vue | 4 +-- resources/assets/js/views/common/documents.js | 31 +++++++++++++++---- .../documents/form/totals.blade.php | 2 +- .../views/partials/admin/scripts.blade.php | 4 +++ 4 files changed, 32 insertions(+), 9 deletions(-) diff --git a/resources/assets/js/components/AkauntingCurrencyConversion.vue b/resources/assets/js/components/AkauntingCurrencyConversion.vue index 49055ae12..dce08bb9c 100644 --- a/resources/assets/js/components/AkauntingCurrencyConversion.vue +++ b/resources/assets/js/components/AkauntingCurrencyConversion.vue @@ -49,7 +49,6 @@ export default { conversion: '', rate: this.currencyRate, texts: [], - texts_split: [] }; }, @@ -57,12 +56,13 @@ export default { 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.texts.push(conver[1].replace(':currency_code', company_currency_code).replace(':currency_rate', '')); }, methods: { onChange() { this.$emit('change', this.rate); + this.currencySymbol.rate = this.rate; } }, diff --git a/resources/assets/js/views/common/documents.js b/resources/assets/js/views/common/documents.js index 45bb63c48..d208d1e63 100644 --- a/resources/assets/js/views/common/documents.js +++ b/resources/assets/js/views/common/documents.js @@ -64,7 +64,8 @@ "symbol_first":1, "decimal_mark":".", "thousands_separator":"," - } + }, + dropdown_visible: true } }, @@ -72,6 +73,24 @@ if ((document.getElementById('items') != null) && (document.getElementById('items').rows)) { this.colspan = document.getElementById("items").rows[0].cells.length - 1; } + + if (!this.edit.status) { + this.dropdown_visible = false; + } + + this.currency_symbol.rate = this.form.currency_rate; + + if(company_currency_code) { + let default_currency_symbol = null; + + for(let symbol of this.currencies) { + if(symbol.code == company_currency_code) { + default_currency_symbol = symbol.symbol; + } + } + this.currency_symbol.symbol = default_currency_symbol; + } + }, methods: { @@ -529,11 +548,11 @@ // Change currency get money onChangeCurrency(currency_code) { - if (this.edit.status && this.edit.currency <= 3) { + if (this.edit.status && this.edit.currency <= 2) { this.edit.currency++; return; } - + if (!this.currencies.length) { let currency_promise = Promise.resolve(window.axios.get((url + '/settings/currencies'))); @@ -552,12 +571,12 @@ this.currency = currency; this.form.currency_code = currency.code; - this.form.currency_rate = currency.rate; + this.form.currency_rate = currency.rate; this.currencyConversion(); } - - if (document_default_currency == currency.code) { + + if (company_currency_code == currency.code) { this.currency_symbol = currency; } }, this); diff --git a/resources/views/components/documents/form/totals.blade.php b/resources/views/components/documents/form/totals.blade.php index 2508a11ad..45b2b2e20 100644 --- a/resources/views/components/documents/form/totals.blade.php +++ b/resources/views/components/documents/form/totals.blade.php @@ -131,7 +131,7 @@ @stack('grand_total_td_end') @stack('currency_conversion_td_start') - + + + @stack('scripts_start') @stack('charts')