Skip to content

Ticket Printing

Ticket printing allows the associate to print tickets for items in the store.

Architecture

Requests to print tickets require a remote call to the Item Micro Service to get the item details. The Ticket Printing API then processes the item data into a ticket document for the configured type of ticket for the item and sends it to the JMC Client. The JMC Client then sends the a print command to the configured Ticket Printer.

flowchart LR
    integration("`Integration`")
    jmcClient("`JMC Client`")
    tickingPrintingAPI("`Ticket Printing API`")
    itemMicroService("`Item Micro Service`")
    ticketPrinter("`Ticket Printer`")
    integration -- Ticket Batches --> tickingPrintingAPI
    jmcClient -- Print Ticket --> tickingPrintingAPI
    tickingPrintingAPI -- Get Item Details --> itemMicroService
    tickingPrintingAPI -- Print Message --> jmcClient
    jmcClient -- Print Command --> ticketPrinter

Configuration

Documents

A template md and yml must be provided for each ticket type you wish to print.

note: ticket type needs to match between the document, tkt_printer, and tkt_ticket_type_item

Document yml

The document yml file tell the document engine which template to use, which template engine to use, and the style sheet.

template: square_ticket.md
templateEngine: freemarker
styleSheet: ticket.css

Template md

The template md file is the data that will be sent to the printer. JMC builds a ticket model that can be used to parameterize the data.

For example the template may contain ZPL for sending instructions to a Zebra Printer

A8,8,0,1,1,1,N,"${model.description}"

A8,28,0,1,1,1,N,"${model.productId}"

A172,29,0,3,1,1,N,"${model.formatMoney(model.ticket.sellingPrice)}"

B9,57,0,1,2,6,65,N,"${model.posItemId}"

A10,127,0,1,1,1,N,"${model.posItemId}"

A17,174,0,1,1,1,N,"${model.getProductAttribute('SIZE')}"

A18,156,0,1,1,1,N,"${model.getProductAttribute('COLOR')}"

P${model.quantity}

Properties available on the model are:

Property
itemId
batchId
quantity
description
posItemId
productId
sellingPrice
imageUrl
ticketType
getProductAttribute()
formatMoney()

Data

Table Purpose
tkt_printer mapping of printer and their label types to their ip location
tkt_ticket_type_item mapping of items to the type of ticket to print