VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: panjarek on May 22, 2020, 10:26:47 AM

Title: Incorrect amounts in order emails for foreign currencies
Post by: panjarek on May 22, 2020, 10:26:47 AM
Hi,
I noticed that there is something wrong with amounts in an order email confirmations, when an order is done in a different currency than the shop main currency.
For example for standard payment method I have set email confirmations currency as user selected currency. When user makes an order he or she receives first confirmation with status Confirmed by shopper and there amounts are ok. But when I change status in next days and send another email with new status, amounts are incorrect. I think the currency rate from current date is taken, not form date of the order and that is why different amounts are sent. I think when user made an order, amounts should be constant in all email confirmations.

I tested it without email template overrides.
I attached screens from two emails.
Main shop currency is PLN orders are in EUR.

VirtueMart 3.8.2 10325 (I tested it also for 3.6.10 10211 and 3.2.15)
Joomla! 3.9.18

Regards
Jarek
Title: Re: Incorrect amounts in order emails for foreign currencies
Post by: Jörgen on May 22, 2020, 10:31:58 AM
You have changed the exchange rate, please use a fixed exchange rate to avoid this.

Jörgen @ Kreativ Fotografi
Title: Re: Incorrect amounts in order emails for foreign currencies
Post by: GJC Web Design on May 22, 2020, 10:54:11 AM
But perhaps panjarek is correct ... or not..  ;)

I guess if u confirm and pay an order in zloty on a certain date ( this will be stored in VM ) where are we legally when later the euro exchange rate has shifted and notification is required in euro?

I'm sure someone knows this..  is it always ( e.g. when declaring your turn over etc ) the rate on the day it was paid ( I would have thought so)?
If that is so is the exchange rate stored in the orders table not used?

@ panjarek .. can u check in the #__virtuemart_orders table what is stored there?
Title: Re: Incorrect amounts in order emails for foreign currencies
Post by: panjarek on May 22, 2020, 14:19:43 PM
I think exchange rate is stored correctly in orders table, please check attachment, prices calculated with this exchange rate are correct.

@Jörgen, thanks for advise, with fixed exchange rate it works correctly, but then I have calculate values in PLN (main currency) manually.
Title: Re: Incorrect amounts in order emails for foreign currencies
Post by: GJC Web Design on May 22, 2020, 14:22:03 PM
To me then this looks like a bug - reported
Title: Re: Incorrect amounts in order emails for foreign currencies
Post by: Jörgen on May 22, 2020, 17:45:55 PM
GJC I agree, should use the exchange rare att Time of purchase.
Jörgen @ Kreativ Fotografi
Title: Re: Incorrect amounts in order emails for foreign currencies
Post by: GJC Web Design on May 23, 2020, 09:58:02 AM
QuoteFor example for standard payment method I have set email confirmations currency as user selected currency.

where are u setting this?
Title: Re: Incorrect amounts in order emails for foreign currencies
Post by: panjarek on May 25, 2020, 10:27:34 AM
Maybe I wrote it wrongly, I standard payment method I set this: Accepted Currency: Selected currency in Currency Module
I thought that it also influence email currency.
Title: Re: Incorrect amounts in order emails for foreign currencies
Post by: panjarek on August 31, 2022, 21:39:56 PM
Hi,

do you know if this bug was corrected? I am testing VirtueMart 4.0.6 10690 and still have this issue :/
Title: Re: Incorrect amounts in order emails for foreign currencies
Post by: Milbo on September 12, 2022, 09:10:23 AM
Quote from: Jörgen on May 22, 2020, 10:31:58 AM
You have changed the exchange rate, please use a fixed exchange rate to avoid this.

Jörgen @ Kreativ Fotografi

Nono, the exchange rate is stored with the order imho, so this exchange rate should be taken, not the current one. Panjarek is right about that.
Title: Re: Incorrect amounts in order emails for foreign currencies
Post by: Milbo on September 12, 2022, 20:00:22 PM
fixed with https://dev.virtuemart.net/attachments/1329/com_virtuemart.4.0.7.10701.zip