Matched PO posting status "Deferred" never transitions to "Posted" if no matching MR is assigned

Description

This is related to JIRA https://idempiere.atlassian.net/browse/IDEMPIERE-3910

1. PO Product Qty=10
2. MR Product Qty=10
2.1 Matched PO document created
2.2 Matched PO document posted by accounting engine and costing record updated=>ok
3. Invoice-1 (vendor) Product Qty=4
3.1 Matched PO document created
3.2 Matched PO document updated with posting status "Deferred" by accounting engine
4. Invoice-2 (vendor) Product Qty=6
4.1 Matched PO document created
4.2 Matched PO document updated with posting status "Deferred" by accounting engine

Since there are no further MR quantities coming in and matched against the matched PO documents from the invoice, status "Deferred" never transitions to status "Posted"

Here is a possible solution:
If invoice quantities are less than MR quantities, the partial invoice quantities should be matched against MR quantities exactly the way it works for MR quantities less than invoice quantities:

So instead of Matched PO structure:

MPO document1: MR-1___________________10 Status=Posted
MPO document2: ___________Invoice-1_ 4 Status=Deferred
MPO document3: ___________Invoice-2_ 6 Status=Deferred

it should first match partial Invoice Qty with 1st MR:

1. MR-1:
MPO document1: MR-1__________________10 Status=Posted
2. Invoice-1:
MPO document1: MR-1___________________ 6 Status=Posted
MPO document2: MR-1_______Invoice-1_ 4 Status=Posted
3. Invoice-2:
MPO document1: MR-1_______Invoice-2_ 6 Status=Posted
MPO document2: MR-1_______Invoice-1_ 4 Status=Posted

Environment

None

Activity

Show:
Heng Sin Low
June 18, 2019, 7:24 AM

, I will address it here.

Heng Sin Low
June 18, 2019, 1:12 PM

Hi , this is ready for testing again.

Michael Powacht
June 19, 2019, 2:26 AM

Thank you Heng Sin, works mostly as expected. I encountered a scenario where the matched invoice quantity does not add up, such as in following example:

PO Qty=10
MR-1 Qty=4
Invoice-1 Qty=3, matched invoice qty=3=>OK
MR-2 Qty=3
MR-3 Qty=3
Invoice-2 Qty=7, matched invoice qty=6=>Not OK, should be MI qty 7.

Please let me know if you agree.
Michael

Heng Sin Low
June 19, 2019, 10:24 AM

, please test the new fix, thanks.

Michael Powacht
June 20, 2019, 2:34 AM

Thank you Heng Sin. From my latest tests, all scenarios work as expected.
As discussed, we'll of course sponsor these changes. Thanks again!

Assignee

Heng Sin Low

Reporter

Michael Powacht

Labels

None

Tested By

None

Components

Fix versions

Affects versions

Priority

Major
Configure