When updating orders with quantity > 1 (states, odi, etc.) - new orders added

Part of what we use to convert from pre-order to real ticket is exhibiting some unwanted bahaviour.

If an order has quantity > 1, a new order is added and the old order’s quantity is reduced by one. Also, the original order has its state successfully changed, but ODI isn’t set to true as well.

This behaviour can be reproduced going back to version 5.3.

2023-08-04_12;55_1691175302_VirtualBoxVM

The rule converting to real ticket isn’t doing anything complex.

Actions:

2023-08-04_12;59_1691175569_VirtualBoxVM

Rule that converts to pre-order: PO Process Ticket for Later
Rule that converts from pre-order: PO Process Ticket for Current Shift

db:
SambaDEV_202308041257SQM.zip (583.9 KB)

Will all orders on the ticket be tagged as “Pre-Order”?
If so, remove the Select Orders action. I was able to prevent the Qty >1 from from being reduced by 1 and and the same order added.

I did not test the Update Orders actions to see if it was updating the Increase/Decrease Inventory.

Normally I would say that yes, all orders will have status==pre-order - but who knows.

In any event, there may be voided or comped orders so I still would need to select each to properly set ODI and/or calculate price.

The bigger issue, to me, is that selecting and updating orders is modifying the actual order count - it’s decrementing one and adding a completely new order. Not behaviour I expect.