Creating a partial invoice for a negative order produces incorrect matching qty

Description

Creating a partial invoice for a negative order produces incorrect matching qty.

To reproduce:
1. Create/complete a PO for negative 4 Plum Trees.
2. Create/complete a Material receipt from this PO.
3. Create a standard Invoice from the material receipt but change the quantity from -4 to -3. (This can happen if the Vendor has only agreed to give a credit for 3 at present.)
4. Try to complete and the Invoice status will be Invalid, with the following error:

10000012: Grand Total=-90.0 (#1) - Total matched qty > invoiced qty.
MatchedQty=-4, InvoicedQty=-3, Line=MInvoiceLine[1000006,10,QtyInvoiced=-3,LineNetAmt=-90]

The matched qty is -4, but should only be -3 to match the invoice qty.

Environment

iDempiere Version: 9.0.0.qualifier
Operating System: UBuntu 18.04
Database: Postgresql 10.18
Java version: openjdk-11

Attachments

1
  • 08 Nov 2021, 05:40 AM

Activity

Show:

Tony Snook November 16, 2021 at 5:44 AM

The above patch fixes the problem with the incorrect MatchInv quantities, but still need to fix a similar issue with MatchPO.

Details

Assignee

Reporter

Components

Affects versions

Priority

Created November 8, 2021 at 4:52 AM
Updated July 14, 2022 at 5:24 AM