Fixed currency conversion created function issue.. ( 3792619848 )
This commit is contained in:
parent
6586826a76
commit
7f12a54bcd
@ -8,17 +8,31 @@
|
|||||||
suffix: (!this.currencySymbol.symbol_first) ? this.currencySymbol.symbol : '',
|
suffix: (!this.currencySymbol.symbol_first) ? this.currencySymbol.symbol : '',
|
||||||
precision: parseInt(this.currencySymbol.precision),
|
precision: parseInt(this.currencySymbol.precision),
|
||||||
masked: true
|
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>
|
:value="price"
|
||||||
<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" />
|
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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {Money} from 'v-money';
|
import {Money} from 'v-money';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'akaunting-currency-conversion',
|
name: 'akaunting-currency-conversion',
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
Money
|
Money
|
||||||
},
|
},
|
||||||
@ -28,17 +42,21 @@ export default {
|
|||||||
type: String,
|
type: String,
|
||||||
default: 'Currency conversion'
|
default: 'Currency conversion'
|
||||||
},
|
},
|
||||||
|
|
||||||
price: {
|
price: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'sale'
|
default: 'sale'
|
||||||
},
|
},
|
||||||
|
|
||||||
currecyCode: {
|
currecyCode: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'USD'
|
default: 'USD'
|
||||||
},
|
},
|
||||||
|
|
||||||
currencyRate: {
|
currencyRate: {
|
||||||
default: 1.000,
|
default: 1.000,
|
||||||
},
|
},
|
||||||
|
|
||||||
currencySymbol: {
|
currencySymbol: {
|
||||||
default: {}
|
default: {}
|
||||||
}
|
}
|
||||||
@ -53,15 +71,21 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
let conver = this.currencyConversionText.split(':price');
|
let conversion = this.currencyConversionText.split(':price');
|
||||||
|
|
||||||
this.texts.push(conver[0]);
|
if (conversion[0]) {
|
||||||
this.texts.push(conver[1].replace(':currency_code', company_currency_code).replace(':currency_rate', ''));
|
this.texts.push(conversion[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (conversion[1]) {
|
||||||
|
this.texts.push(conversion[1].replace(':currency_code', company_currency_code).replace(':currency_rate', ''));
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onChange() {
|
onChange() {
|
||||||
this.$emit('change', this.rate);
|
this.$emit('change', this.rate);
|
||||||
|
|
||||||
this.currencySymbol.rate = this.rate;
|
this.currencySymbol.rate = this.rate;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -81,11 +105,13 @@ export default {
|
|||||||
|
|
||||||
currencyRate: function (currencyRate) {
|
currencyRate: function (currencyRate) {
|
||||||
this.rate = currencyRate;
|
this.rate = currencyRate;
|
||||||
|
|
||||||
this.conversion = this.currencyConversionText.replace(':price', this.price).replace(':currency_code', this.currecyCode).replace();
|
this.conversion = this.currencyConversionText.replace(':price', this.price).replace(':currency_code', this.currecyCode).replace();
|
||||||
},
|
},
|
||||||
|
|
||||||
currencySymbol: function (currencySymbol) {
|
currencySymbol: function (currencySymbol) {
|
||||||
this.conversion = this.currencyConversionText.replace(':price', this.price).replace(':currency_code', this.currecyCode).replace();
|
this.conversion = this.currencyConversionText.replace(':price', this.price).replace(':currency_code', this.currecyCode).replace();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user