How to modify a the ticket template

The templates that are used for defining the tickets produced by Mandalay CS are all standard text files that can easily be modified by using a standard text file editor E.G. NotePad.

The following article explains how to adjust these templates to match your requirements.

Ticket Template Folder

Ticket Template Folder

The template files used in Mandalay CS can be found in the installation folder in a sub folder called Ticket Templates. The installation folder can vary depending on the type of operating system but is generally found at C:\Program Files\Mandalay Technologies\MandalayCS for 3.6 and below or C:\ProgramData\Mandalay\MandalayCS\TicketTemplates for 3.7 and above.

Sample Ticket Templates

Any time Mandalay CS is installed or upgraded the latest versions of the default template are added to the Sample Ticket Templates.

Note: Upgrading Mandalay CS will not alter any existing templates in the Ticket Templates folder. If new features are required then they must be manually copied from the sample templates.

Back Up Templates

Before beginning to make changes to a template file the ticket templates should be backup by copying them to another location or adding them to a zip file.

Deciding what needs changing

Deciding what needs changing

The ticket templates are made up of a combination of 4 types of items.

  1. Labels - Any text that is not bounded by a * is considered a label.
  2. Fields - Fields are areas of the ticket that are populated with data from the system. The list of available fields can be found in a file called Fields.txt located in the Ticket Template folder.
  3. Sub Templates - Some items in a ticket are a repeated list of items. In all these cases field actually relates to another template file found in the Ticket Templates folder.
  4. Conditional Fields - Some fields can be used define if a section of the template should be defined or not. These fields start with *if [fieldname]* and all text after this and up to the matching *endif[fieldname]* will be displayed if the field name value equates to true. Refer to the fields.txt file for information on the fields that work with the IF condition.

You should compare the template file against a completed ticket to identify the changes that are necessary.

If the item to be changed is within a list of item, E.G. each item list of payment methods, then it may be necessary to modify the sub template for that section.

Which template?

The Mandalay CS system uses 5 standard transaction templates and 3 public weigh templates. These templates are available in the Ticket Templates folder.

Standard Transaction

  • tktEach.txt - This is the standard template for a ticket that does not have any weighed items.
  • tktFWGTN.txt - This is the template that can be produced on the first weight of a 2 weigh transactions. By default this is not produced and can be turned on in Configuration Manager.
  • tktGTN.txt - This is the template used for standard 2 weight transactions.If also has a section for non weighed items if they are included.
  • tktHotKey.txt - Any hotkey transactions will produce tickets with this template.
  • tktRefund.txt - Template used when refunding a transaction.

Public Weigh

  • tktPublicGMO.txt - template for Gross only public weigh transactions.
  • tktPublicTMO.txt - template for Tare only public weigh transactions.
  • tktPublicGTN.txt - template for Gross , Tare, Net public weigh tickets.

Sub Templates

Sub Templates

Sub templates are used to define the format of items in a list.

The above example shows the list that appears when showing all the non weighed products used in a transaction. The main template in the case will reference the sub template called tktGTN_TicketItem.txt when populating this list. If the item that needs changing appears in one of the sub templates then you will need to identify this template from the list below.

  • tktContractProductSummary.txt - Shows a summary report of product deliveries in a load or quantity based contract.
  • tktEach_TicketItem.txt - The list of products used in a non weighed transactions (each items) transaction.
  • tktGTN_TicketItem.txt - The list of non weighed products used in a 2 weight transaction.
  • tktPaymentMethods.txt - Lists all the payment methods used in a transaction.
  • tktVoucherSumary.txt - Lists the voucher codes used for the payment of transactions. Will also list any usage information related to it. Note: Only available for Advanced Vouchers.
  • tktWeight.txt - Depricated template for listing weights used in a transaction.

Modifying a template

Modifying a template

Once the appropriate template has been identified, open it up in a text editor, like NotePad, then locate the area where changes are needed.

Making label alterations

Making label alterations

If the adjustment is for a label in the template then adjust the text directly in the file.

Note: Make sure that all field line up as they were. You may need to start a new line or abbreviate the label if it forces the field to move to far. The standard page width is 80 characters.

Available Fields

Fields are sections of the ticket that are populated with data captured in the Mandalay system. The default templates provided only a small set of fields and a full list of available fields are in the document Fields.txt located in the Templates folder of the Mandalay installation. (The file is also attached to this article)

Making field alterations

Making field alterations

All fields are bound by a * character and in some cases may also start with the text RA, which is a formatting option.

When the field has been located in the file adjust it to the new field code. Making sure to keep the line within the 80 character limit for the paper. If the original code had RA at the beginning then this must remain.

To ensure the field first remove white space before the field code if necessary.

Field Alignment

Field Alignment

Each field code can be prefixed with a 2 character code to define the alignment.

  1. CE = Center alignment
  2. RA = Right alignment
  3. [Nothing] = Left alignment (Default)

Bold Text

Bold Text

It is possible to define a section of the template that should be shown in bold. This is done by adding a *bold* before and after the section of text to be marked bold.

Testing the changes

To test changes made to a template requires the Ticketing system to be running. Once the system has started use the following steps to check the ticket is working correctly.

  1. Save the changes to the file.
  2. Go to the Ticket History.
  3. Locate a ticket in the history that best matches the type of transaction used for the template you have changed.
  4. Reprint the ticket. The new template will be used.

TIP: You can leave ticketing running while adjusting the templates and use the reprint button each time the file has been changed.

Deploying the changes

Once the changes have been made to the local computers template the changes must then be copied to all computers that are required to produce a ticket, there is no automatic deployment option.

If you required changes to be made to your naus platform Ticketing then please send the updated templates to the support team and they will arrange for it to be deployed to our servers.