Doc_MatchInv doesn't work correctly with negatives

Description

Test case:

Purchase Order: -1 Azalea

  • No Posting
    Material Receipt: -1 Azalea

  • 14120 DB -15

  • 21190 CR -15
    Invoice Vendor: -1 Azalea

  • 51400 DB -15

  • 21100 CR -15

Now, the MatchInv is intended to close the transit accounts, but:
MatchInv: -1 Azalea

  • 21190 DB +15 *

    (this must be negative!)

    *

  • 51400 CR +15 *

    (this must be negative!)

    *

Environment

None

Activity

Show:
Carlos Ruiz
January 18, 2019, 3:24 PM

In most cases it is a bad practice to use BigDecimal.abs() for quantities or money amounts - unless the case clearly requires it.

Noticed the class Doc_MatchInv has 4 calls to BigDecimal.abs() and one sign manually negated.

I tested the attached patch

for some cases and it seems to work, but didn't conduct full tests yet.

Regards,

Carlos Ruiz

Fixed

Assignee

Carlos Ruiz

Reporter

Carlos Ruiz

Labels

Tested By

None

Priority

Major