AP2-573 Payment allocation posting wrongly for multi-currency if allocation date <> payment date

Description

Failing Test case:

Accounting Schema: currency USD

Created three conversion rates from EUR to USD:
aug-1 -> 1.1
aug-2 -> 1.2
aug-3 -> 1.3

Invoice Vendor aug-1
100 EUR
posted
DB Charge 110
CR AP 110

AP Payment without invoice aug-2
100 EUR
posted
DB Payment Selection 120
CR Bank 120

Allocation aug-3
Amount: -130
Currency: USD
Posted wrongly
DB AP 130
CR Payment Selection 130
DB Realized loss 20
CR AP 20

Here the AP is cleared correctly, but the payment selection is left with a wrong balance of -10, and the realized loss is wrongly calculated as 20 based on the allocation date instead of the payment date.

Environment

None

Status

Assignee

Carlos Ruiz

Reporter

Carlos Ruiz

Labels

None

Tested By

None

Priority

Major
Configure