Fixed currency conversion created function issue.. ( 3792619848 )

This commit is contained in:
Cüneyt Şentürk 2023-02-23 17:37:40 +03:00
parent 6586826a76
commit 7f12a54bcd

View File

@ -8,9 +8,22 @@
suffix: (!this.currencySymbol.symbol_first) ? this.currencySymbol.symbol : '',
precision: parseInt(this.currencySymbol.precision),
masked: true
}" :value="price" disabled size="5" masked class="disabled-money text-right mr-1 js-conversion-input text-xs px-1"></money>
<span class="mr-2">{{ texts[1] }}</span>
<input name="currency_rate" v-model="rate" @input="onChange" class="text-sm px-3 py-2.5 mt-1 rounded-lg border border-light-gray text-black placeholder-light-gray bg-white disabled:bg-gray-200 focus:outline-none focus:ring-transparent focus:border-purple w-16 h-10 text-right js-conversion-input" />
}"
:value="price"
disabled size="5"
masked
class="disabled-money text-right mr-1 js-conversion-input text-xs px-1"
></money>
<span class="mr-2">
{{ texts[1] }}
</span>
<input name="currency_rate"
v-model="rate"
@input="onChange"
class="text-sm px-3 py-2.5 mt-1 rounded-lg border border-light-gray text-black placeholder-light-gray bg-white disabled:bg-gray-200 focus:outline-none focus:ring-transparent focus:border-purple w-16 h-10 text-right js-conversion-input"
/>
</div>
</template>
@ -19,6 +32,7 @@ import {Money} from 'v-money';
export default {
name: 'akaunting-currency-conversion',
components: {
Money
},
@ -28,17 +42,21 @@ export default {
type: String,
default: 'Currency conversion'
},
price: {
type: String,
default: 'sale'
},
currecyCode: {
type: String,
default: 'USD'
},
currencyRate: {
default: 1.000,
},
currencySymbol: {
default: {}
}
@ -53,15 +71,21 @@ export default {
},
created() {
let conver = this.currencyConversionText.split(':price');
let conversion = this.currencyConversionText.split(':price');
this.texts.push(conver[0]);
this.texts.push(conver[1].replace(':currency_code', company_currency_code).replace(':currency_rate', ''));
if (conversion[0]) {
this.texts.push(conversion[0]);
}
if (conversion[1]) {
this.texts.push(conversion[1].replace(':currency_code', company_currency_code).replace(':currency_rate', ''));
}
},
methods: {
onChange() {
this.$emit('change', this.rate);
this.currencySymbol.rate = this.rate;
}
},
@ -81,8 +105,10 @@ export default {
currencyRate: function (currencyRate) {
this.rate = currencyRate;
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();
},