For Ticket Design, the data elements of Current Date and Current Time are available under the Order category for both Headers and Receipts. Does anyone have any tricks for being able to print the current date and time onto the Ticket itself? We'd like to know not just when the order was processed, but when the ticket was actually printed. Thanks.
I think you could use the user defined fields to somehow bring in the print time of the ticket. That's really the only way I can think of doing this.
Chris
I thought that would be the case. Does anyone know how to put that particular information into a User Defined Field?
Hi Meredith
It needs a little bit of SQL coding.....
Basically, what you'd need to do would be to add a User Defined Element (ude) into the stored procedure called LP_TICKET_ELEMENTS, (as opposed to the User-defined Fields on the order). You have only six ude's to play with (called ude 1 through ude 6, unexpectedly), but if you haven't done it before, they're probably all available.
ude's have to output as text, so you'd have to format the date how you want it printed first. They're limited to 30 characters, but presumably that's not a problem.
The code to pick up the current date-time as the ticket is printed would be fairly simple -
For example, if you were going to define ude 5 , you would insert some code like this below:,
/************ ude 5 - return current datetime, formatted in Weird American Date Fomat *******/
If @ude_no = 5
Set @ude_value= convert(varchar(20),getdate(),100)
/********* end of ude 5 code ***************/
which would return something like: "Oct 18 2014 1:42PM".
If you want a different format, you just use a different format code number instead of 100, and change the length of the varchar if you want to chop off bits at the end. This one: "convert(varchar(16),getdate(),120)" ffor instance, would output an ISO datetime, like " 2014-10-18 13:47"
Then you just add a User-Defined data element to your ticket design, and specify to get ude 5.
I don't think you need a UDE -- you should be able to do this using a mask on any ticket element. Try this:
String(Today(), 'm/d/yyyy h:mm:ss')
Modify as needed! Just use Today() if you want the raw datetime formatting.
The ticket element masks are actually InfoMaker expressions, and there's a function reference in the InfoMaker user guide. I've extracted the relevant sections to a PDF posted on my profile.
That mask trick worked great. My box office thanks you!