Wrong code found in MOrder.reactivateIt


This code is found reviewing MOrder.reactivateIt():

According to the comment the intention seems to be to replace the document type from "Prepay Order" to "POS Order" in order to force the automatic reversal of shipment and invoice when they are already created.

But the line 2726 compares against the same DOCSUBTYPESO_PrepayOrder instead of DOCSUBTYPESO_POSOrder.

The result is now:

  • whan a prepay order is reactivated and completed again, it duplicates the shipment and invoice




Heng Sin Low
June 4, 2020, 8:45 AM

Hi , there’s still a small issue with the fix - after reactivation and completion of the prepay order, the document status of the order change back to Waiting Payment but at the same time, we still have a Completed payment that’s linked to the order.

Carlos Ruiz
June 9, 2020, 9:55 AM

Thanks , you're right - when trying to complete the order again is left in Waiting Payment, and the payment is there, but the allocation was reversed, so, the payment is unallocated, and there is no way to allocate a payment to an order - so, I guess the only option would be to revert the payment and register it again.

But that seems really a hassle, I just noticed that as it is now it doesn't revert any document (same as Standard Orders) and when completing the order again it creates a shipment and invoice with zero quantities (harmless).

So, maybe the fix here would be just to remove the code that is doing nothing (is harmless, just consuming some CPU cycles I guess) - changing priority of this ticket.



Carlos Ruiz


Carlos Ruiz



Tested By


Fix versions