Reversed MatchPO messes up matching


The matching process as programmed in MMatchPO doesn't deal well with reversed MatchPO:s.

Reversing Match PO:s is possible now but I strongly recommend deleting Match PO:s that doesn't match.

If you have reversed Match PO:s it creates faulty summarys when trying to match again.

Supplying patch that fixes that.

One would think that the reversed matching would even out since they are plus and minus, but the algorithm as it is now only works as expected with positive quantities.




Daniel Tamm
January 26, 2016, 4:26 PM
Carlos Ruiz
January 27, 2016, 4:46 PM

Hi , I tried to reproduce the issue, reversed match po and then recreated and everything went fine.

Can you please provide steps to reproduce the issue? I see the reverse MatchPO is happening automatically in some cases, like reversing the receipt or the invoice.

Daniel Tamm
January 27, 2016, 7:40 PM

The problem happens when an invoice / shipment is matched multiple times. (I.e. the order is shipped and invoiced in increments).


  • Create a purchase order with qty = 5.

  • Ship and invoice 2 of the items.

  • Make sure the shipment/invoice and PO is matched.

  • Reverse the MatchPO

  • Ship and invoice 3 of the items (total qty delivered and invoiced = 5)

  • Try to match the shipments / invoices.

Deepak Pansheriya
January 11, 2017, 2:11 PM

We able to reproduce issue by below steps.

1) Create a Purchase Order

2) Create an Invoice with Same BPartner - Create invoiceLines using "Create Lines From Button" from Purchase Order - Complete Invoice - Matched PO is created with POLine and InvoiceLine.

3) Reverse Invoice. - MatchedPO is reversed.

4) Create a new Invoice as per 2) - A new MatchPO will be created with poLine and new InvoiceLine

5) Create a Material receipt for same BPartner, Create MRLines using "Create Line From" from Order, Complete Material Receipt - Look At matching, material receipt line is matched on Reversed MatchPO.

We testing Daniel's patch and it worked. we created patch with release-4.1


Daniel Tamm


Daniel Tamm



Tested By

Deepak Pansheriya


Affects versions