OK, I feel a little stupid asking this, but I can’t quite make sense of the various posts I have read about this…
I have an order state called BookingDate
which stores a string in yyyymmdd format to hold the date that someone wants to dive. Each dive is a different order and sometimes people book dives out-of order, so I was hoping I could have the ticket template sort and group everything correctly.
However, although orders do get grouped, they do NOT seem to be sorted in order…
For example, if I create the following ticket (note the dates displayed as order states)
I have the following setup in the ticket template (the JS call does a lot of heavy lifting to make things look nice)
[ORDERS GROUP|ORDER STATE:BookingDate]
<tr><td colspan=3>{CALL:tkt.dateHeader('{GROUP KEY}')}</td></tr>
[ORDERS]
<tr class="orderHeader">
<td><span style="font-weight:bold">{PRODUCT NAME}............
.................
I then end up with the following ticket output…
Interestingly, you can see that the 3rd item on the list was correctly grouped under 3-APR, but overall the order is wrong (the 2nd item for 1-APR should have appeared first)
I am not sure what I should be selecting at the top of template editor
[BLANK - No selection]
seems to make no difference
None
seems to make no difference
Order State:X
seems to make no difference
Order State:BookingDate
seems to make no difference, but sometimes throws an error complaining about not implementing “IComparable”
What should I be doing to have my orders displayed in the correct order?