fix currency recalc

This commit is contained in:
2024-03-19 20:18:54 +01:00
parent 08cadfcf33
commit 46496d7438
3 changed files with 16 additions and 11 deletions

View File

@@ -93,7 +93,7 @@ const tproducts = computed(() => {
if (prod.tag == "NONE") prod.tag = "";
prod.salesPrice = Math.round(prod.salesPrice * 100) / 100;
prod.calcPrice =
Math.round(prod.calcPrice * currencyCoef.value * 100) / 100;
Math.round(prod.calcPrice * settingsStore.currencyCoef * 100) / 100;
prod.rate = currencyHash.value[prod.currency];
if (prod.tag != null && prod.tag.length > 1) prod.tag = prod.tag.replace(/_/g, " ");
return prod;
@@ -183,7 +183,6 @@ const ccountry = ref([]);
const ccountry_list = ref(["TEST"]);
const currencyHash = ref({});
const currency = ref([]);
const currencyCoef = ref(1.0);
const items = ref([]);
@@ -387,14 +386,6 @@ const showRow = async (item) => {
response.isConfirmed && fetch();
}
};
const onSelectCurrency = () => {
console.log("CURR", settingsStore.currency);
console.log("COEF", currencyCoef.value);
if (settingsStore.currency != "EUR")
currencyCoef.value = currencyHash.value[settingsStore.currency];
else currencyCoef.value = 1.0;
};
const submit = () => {
console.log("ITEM=", form);