Payment Entry Exchange Gain/Loss JE recording Bug

Hi,

So, long story short, here’s the example and my setup

Setup:

  • Company base currency: LYD
  • Creditor account (as supplier): USD
  • Company Account: USD

Process:

  • First Entry (Journal Entry):
    100$ Credit
    from Creditor to Company Account with an exchange rate of (7)

  • Second Entry (Payment Entry - Pay):

    • Party Type: Supplier with his own account as the setup above.
    • 100$ Paid from Company Account (USD) to the Creditor at an exchange rate of 9.
    • The Journal Entry is referenced using the (Get Outstanding Invoices) button.
    • When I save and submit the document, it creates an Exchange Gain/Loss Journal Entry with a value of 900 LYD when it should have been only 200 LYD

I mean, is this a bug or something? I tried to trace back the code that sets the exchange_gain_loss field value for the reference row in the references table for that outstanding invoice, but I couldn’t find anything.

Any help would be appreciated. :cry:

I tried to do it on my side… The only problem i faced on my side is that it did not take the figures automatically into the payment deductionor or loss section … i had to manually put which account (exchange gain/loss) i wanted the difference to go … maybe they have done that to allow more flexibility

Also check Payment Entry : Exchange Gain/ loss · Issue #36873 · frappe/erpnext · GitHub