Multi Currency Purchase Invoice - Discrepancy/ Error

There is some errors in the formula used inside the Purchase Invoice module with multi currency for sure. I have not tested with default currency.
We order machinery from our vendor in Europe and had to make a 5% down payment in 2021 at a higher exchange rate than prevailing (1.44140). We made a forward contract for the remaining 95% amount at at even higher rate (1.50300) to pay the supplier in March 2022. The current exchange rate used for this transaction is 1.450481000.

The total invoice value is € 95,750.00 which at the exchange rate considered works out to be CAD $ 138,883.56.

But we made a payment of € 91, 320.00.

To make this payment we used the original deposit of € 4787.50 at 1.44140
and remaining € 86,532.50 at the forward contract rate of 1.5030.
Total composite CAD $136,958.33 for € 91, 320.00

The Advance payment account in EUR was

So one would have expect that the draw on the Advance payment account would be as shown below:
Expected Result:

In order to get the above desired result, the GL entries should have looked as follows:

Below you will see the Advance payment applied to the Purchase Invoice:

But if you see below it does not pick up the exchange rate from the journal entry and shows a huge exchange loss. It assumes a value of 0.0 for the exchange rate and hence the huge exchange loss.

It picks up the exchange rate from the payment entry though:

Below you can see the total purchase invoice value in EUR and CAD $

But we are only paying € 91, 320.00 out of the € 95,750.00 for this invoice at this point.

Once I submit the purchase Invoice, the advance payment account gets messed up. Please see below:

This is because of wrong entries in the General Ledger. For some reason, it takes the entire purchase invoice value of € 95,750.00 at the exchange rate used for the invoice which is CAD $ 138,883.56. Instead of using € 91, 320.00 and calculated CAD $ value of $136,958.33 which is € 4787.50 * 1.44140 + € 86,532.50 * 1.5030

It then tries to compensate the exchange loss through the advance payment account. Instead, it should have done the following:


The $43.48 credit is the exchange gain for the € 4787.50 *(1.450481 - 1,4414)
and the debit of $4544 is the correct value calculated from the payment entry. which makes everything right as below:

the Purchase Invoice Advance entry looks like this:


The exchange rate is 0.00

Journal entry has the Is Advance selected as yes

So I see 4 issues with the purchase invoice advance payment entries:

  1. Exchange rate not coming through for journal entries
  2. General ledger entry uses wrong (total invoice value) instead of using total from Advance Payment table
  3. It also uses the Purchase invoice exchange rate instead of the exchange rate from the advance payment entries.
  4. The Exchange loss/Gain should not be applied to the advance payment account.

I hope i have been able to explain the issue. I thing this may be a bug and I do not know where or how solve this issue.

I can make it work by entering the correct exchange rate and exchange loss/gain through the database to get the correct loss/gain and then changing the CAD $ values as shown and deleting the second entry for the advance payment account.

I hope this can be resolved through an update and should be a quick one I hope

2 Likes

We have not specifically validated that case, but have seen multiple similar cases. Multi-currency basically does NOT work in ERPnext.

What you describe also happens with payment entries, journal entries and matching invoices to payments.

As an example, currency revaluation which is required for fiscal period close does not use the balances of accounts on the date of the revalution in transaction. We had it do an exchange gain/loss for an account did NOT exist the day specified for the revaluation.

We are on version 12 have no knowledge if version 13 is better (or worse as sometimes happens)

1 Like

Thank you @tonto. I believe the only way to work around this at this time is to eliminate the exchange gain/loss by matching the present invoice exchange rate to the weighted exchange rate of the payment made.

The solution is pretty simple actually to show the exchange gain/loss against the invoice instead of the advance payments and leaving the advance company currency value as it was actually paid. But then, there is the issue of it using the complete invoice value instead of paid value in the GL as well.

Hi @venky

I just encountered this as well. Have you created a Github Issue yet?

Kind regards,

Do you mind explaining this workaround in a bit more detail ?

Kind regards