Fix rate calculation

This commit is contained in:
2024-03-25 18:36:15 +01:00
parent fcf0ef36ab
commit 21865a35d9

View File

@@ -110,7 +110,9 @@ const tproducts = computed(() => {
prod.salesPrice = Math.round(prod.salesPrice * 100) / 100;
prod.calcPrice =
Math.round(prod.calcPrice * settingsStore.currencyCoef * 100) / 100;
prod.rate = currencyHash.value[prod.currency];
console.log('CHA=',currencyHash.value[prod.currency]);
prod.rate =
Math.round((currencyHash.value[prod.currency] == undefined? 1.0 : currencyHash.value[prod.currency] ) / (settingsStore.currency != "EUR" ? currencyHash.value[settingsStore.currency] : 1.0)*100)/100;
if (prod.tag != null && prod.tag.length > 1) prod.tag = prod.tag.replace(/_/g, " ");
return prod;
});