Hello. When there are selected orders on ticket order related actions works for only selected orders. You can prefer using Before Ticket Closing
event to update orders because at that time selection gets cleared. I mean you can Change Ticket Type and Close ticket when button clicked and update orders on Before Ticket Closing
event. You can also include Mark ticket as Closed
action to ensure ticket gets closed. Of course we should check ticket type is Abort
before doing it.
You also don’t need to zero prices or quantities. It might be a good idea to keep them for records. Setting Calculate Price
to false (same as zeroing price) and Decrease Inventory
to false (same as zeroing quantity) will be enough. They’ll just get ignored. That will work like voiding all orders.
Also creating a separate ticket type might not be needed. Just changing ticket state to Aborted
might be enough too…
Of course these are all recommendations and I’m just trying to let you know alternatives Your best solution will be the one that fits to your business. For example you should think how to inform kitchen when submitted orders gets aborted. If you need to send such update to kitchen using void mechanism might be a better idea.