Wrong matched invoice GL posting (currency balancing) in alternate schema for vendor credit memo if > 1 credit memo line

Description

The incorrect GL posting can be simulated as follows:
2 accounting schemes: primary schema=local currency, secondary schema=USD
Currency rate local currency/USD = 31.526248754713

1. Create PO with 2 PO lines,
1.1 1st line Product=A, qty=2400, unit price=1.00 in local currency
1.2 2nd line Product=B, qty=2400, unit price=2.00 in local currency
2. Create vendor invoice using Invoice (Vendor) against above PO for both lines, total quantity
3. Create vendor credit memo using invoice (vendor) against above PO for both lines, credit memo qty=100 in each line
4.1 Matched invoice GL posting in USD schema of first credit memo line is correct:
CR Inventory Clearing USD 3.17
DR Inventory Clearing USD 3.17
4.2 Matched invoice GL posting in USD schema of second credit memo line is INCORRECT:
CR Inventory Clearing USD 6.34 => CORRECT
DR Inventory Clearing USD 6.34 => CORRECT
CR Inventory Clearing USD 3.17 =>INCORRECT
DR Currency Balancing USD 3.17 => INCORRECT
It appears as if the incorrect currency balancing posting amount comprises the sum of all other credit
memo lines (3.17) and matched invoice GL postings.

Other JIRA tickets related to this ticket are:
https://idempiere.atlassian.net/browse/IDEMPIERE-4006
https://idempiere.atlassian.net/browse/IDEMPIERE-4127

Environment

None

Activity

Show:
Heng Sin Low
October 5, 2020, 3:25 AM

Hi Elaine,

Please follow up to the new issues discovered above.

Also, we have added a second accounting schema (in Euro) to the GardenWorld tenant, please see whether you can use that new addition to add unit testing for this ticket.

Regards,
Low

Elaine Tan
8 days ago
Edited

Patch: 0004-IDEMPIERE-4263-Wrong-matched-invoice-GL-posting-curr.patch

 

Michael Powacht
6 days ago

Testing in progress

Michael Powacht
5 days ago

We found quite a few issues resulting in error message: Posting Error: Source Not Balanced. It happens for example under the following condition:

PO in EUR in period 10, qty=10, MR in period 10, qty=10, Invoice in period 11 qty=10.

The exchange rate from EUR to THB and EUR to USD is different in period 10 and period 11.

Please look into it.

Elaine Tan
4 days ago

Caused by fix. We have fixed it, please verify.

Assignee

Elaine Tan

Reporter

Michael Powacht

Labels

None

Tested By

None

Components

Fix versions

Affects versions

Priority

Major
Configure