frappe / erpnext

Free and Open Source Enterprise Resource Planning (ERP)
https://erpnext.com
GNU General Public License v3.0
21.73k stars 7.3k forks source link

Wrong valuation of foreign currency accounts after change in exchange rates #31888

Closed blewsky closed 3 months ago

blewsky commented 2 years ago

Information about bug

The Chart of Accounts shows wrong valuations in the company currency after changes in exchange rates. It seems the way how multi-currency transactions are treated internally needs to be rewritten. The current implementation makes it difficult to impossible to use multi-currency in ERPnext.

Example:

Company currency: MXN (e.g. used in cash account) Foreign currency: USD (e.g. used in forex bank account)

Start Cash: 50 MXN Dr Bank: 0 USD Cr

Deposit cash to USD account Payment type: “Internal Transfer” from “Cash” to “Bank USD” Paid Amount 100 MXN Received Amount 5 USD Exchange Rate 1 USD = 10 MXN

--> Entries in CoA Cash: 0 MXN Cr USD Bank : 5 USD/50 MXN Dr (<-- correct valuation)

Journal Entry at new exchange rate Accounting entries (selected “Multi Currency”): Bank USD 1 USD Cr (Click on “Edit” → set Exchange Rate: 20 MXN ) E.g. Administrative Expenses 20 MXN Dr --> Here ERPnext should probably detect that the exchange rate changed since last the transaction and suggest an Exchange G/L difference entry

--> Resulting entries in CoA Cash: 0 MXN Cr USD Bank : 4 USD/30 MXN (<-- wrong valuation in MXN, should be 80 MXN instead) Administrative Expenses 20 MXN Dr

The valuation in the company currency is calculated subtracting the company currency value from the Journal Entry transaction. This is wrong. Instead, the valuation in the CoA should be calculated using the exchange rate from the Journal Entry.

Module

accounts, buying, selling

Version

ERPNext: v13.36.3 (HEAD) Frappe Framework: v13.37.0 (HEAD)

Installation method

FrappeCloud

Relevant log output / Stack trace / Full Error Message.

No response

Nihantra-Patel commented 3 months ago

We no longer provide support for version 13 or older.

Kindly upgrade to version 15, then refresh and check again because lots of bugs fixed in the new version.

Version EOL Branch
Version 12 End of 2022 version-12
Version 13 End of 2023 version-13
Version 14 End of 2024 (planned) version-14
Version 15 End of 2026 (planned) version-15
Bleeding edge N/A develop

For more information, please refer to the guidelines.

Thank You!