DislikedDear Steve:
In the sentence
if (!OrderSelect(TicketNo, SELECT_BY_TICKET) || OrderCloseTime() > 0) return;
I thinks the first part of the sentence (in red) is always true because there is no number of ticket to make the selection by ticket: the sentence, will always be true, and ever will produce return.
It will be better to let only the second part as:
if ( OrderCloseTime() > 0) return;
Thanks
José LuisIgnored