Author Topic: Invalid calculation of the costprice in multi-currency enviroment  (Read 1096 times)


  • Beginner
  • *
  • Posts: 1
Problem: costprice is calculated in default currency, ignoring the fact, that the cost price is set to different currency than the final price (in default currency).

I use Euro and Litas (LTL)
Litas is my default currency (rate = 1).
Euro rate ir 3.5
No taxes or rules are specified.

I enter cost price in euros and display them litas. Base price and final price is displayed in Litas as this default currency.
The conversion from Euro to litas is done correctly.
Example 100 Euro * 3.5 = 350 Lt (as expected)

But the reverse calculation (calculation of the costprice) is done incorrectly. What I noticed, that the calculation is done backwards (to calculate the cost price) and then, the calculated cost price is calculated forward again (to calculate the final price)
 (I enter 350 Lt as final price).
Expected calculation: 350Lt / 3.5 = 100 Lt.

Actual Result:
Sales price: 350 Eur
Base price: 1225 Lt (350 * 3.5)
Final price: 1225 Lt

Virtuemart 2.0.6