[go: up one dir, main page]

0% found this document useful (0 votes)
24 views11 pages

POS Pizza Custom Receipt Script Codes

The document outlines the scripted printing capabilities of POS Pizza, detailing how to create custom receipt layouts in both graphics and text modes using a scripting language. It explains the different components of the script, including formatting commands, conditional printing, and various %xx codes for dynamic data insertion. Additionally, it highlights the differences in printing modes and font usage between text and graphics modes, along with examples of receipt scripts.

Uploaded by

aaroncopus88
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views11 pages

POS Pizza Custom Receipt Script Codes

The document outlines the scripted printing capabilities of POS Pizza, detailing how to create custom receipt layouts in both graphics and text modes using a scripting language. It explains the different components of the script, including formatting commands, conditional printing, and various %xx codes for dynamic data insertion. Additionally, it highlights the differences in printing modes and font usage between text and graphics modes, along with examples of receipt scripts.

Uploaded by

aaroncopus88
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

POS Pizza scripted printing

POS Pizza v9.x ©2000-2024 Summit Computer Networks, Inc.

This document explains the scripted printing in POS Pizza for both graphics mode, and text mode. Using
the scripting language, you can build completely custom receipt layouts for kitchen, and customer
receipts using simple commands.

The print scripts are intended for use with POS receipt printers that print on a continuous roll of paper.
POS Pizza ships with some default scripts to help get you up and running very quickly. Additionally, POS
Pizza can print a standard “canned” format that is not script based.

Script printing now supports text-based printing as well as the graphical mode that has always been
supported. Text mode prints characters to the printer making up a receipt rather than pixels which
make up an image of a receipt. Character based printing is much faster in many cases, especially on
impact type printers such as the Epson TM-U220. To print HELLO WORLD, the letters that make that
phrase are sent to the printer. So “H” “E” “L” “L” “O” “ “ “W” “O” “R” “L” “D” 11 characters (letters and
spaces) is sent to the printer. In graphics mode those letters would be created pixel-by-pixel and then
those pixels would be sent to the printer which is much more than the 11 bytes / characters sent in text
mode. Thermal printers generally print graphics mode receipts just as quickly as they do text based
receipts.

POS Pizza [CS] and [SA] support all printing modes, while POS Pizza [LT] only supports the text based
script modes, and the “canned” receipt layouts.

The scripting can be broken into 5 simple parts.

1. Literal text, that is text contained within the script printed as is.
2. Formatting commands, left/right/center justify.
3. Lines and boxes.
4. Conditional printing commands.
5. Order and other variables, %xx commands which are directly replaced with text.
Script Language
The script language is comprised of regular text and phrases along with special sequences of %xx codes
that get replaced with actual data whenever the receipt is printed. These %xx codes can also do things
like right or left justify, or center text on the receipt as well as switch fonts and many other functions.
This document will go over each of the %xx codes and explain how they work in both text and graphics
modes.

A simple receipt script might look like the one below.


; **** TOP SECTION ****
%el ; add an empty line for
; our slanted font 3
%f3 ; Use Font 3 (slanted)
%cl%li ; Center Legal Name
%f1 ; Use Font 1 for remainder
%h4 ; very tight spacing
%el ; empty line
%cl%dD %dM %dd %dy %d2 ; print date & time
Register: %sn ; print register name
Cashier: %cn ; print cashier name
%po%tbTable: %tb ; print table (if there)
%po%caSold To: %ca ; customer name
%f2 ; bold font for ext data
%po%ed%ef: %ed ; extra data
%f1 ; normal font
%po%fp%po%cpPH: %cp ; customer phone #
%po%fa%cf ; full customer address
%po%fp%el ; empty line if phone or delivery
%ljTicket #: %on ; order number on LEFT
%nn%rjType: %tp ; type RIGHT same line as order #
; **** ITEMS SECTION ****
%ln%el ; Line and an empty line
:For Each Item ; Begin Per Item Layout
%fi ; full item description
:End Item ; end of per item layout
; **** FOOTER SECTION ****
%ln ; print a LINE
%el ; empty line
%rj ; right justify totals
%po%df%dc: %df ; deliv Fee (if present)
Subtotal: %st ; subtotal
Taxes: %tt ; R Justified, Taxes: $0.45
%po%ds%dn: -%ds ; discount (if present)
%rj%po%taGratuity: %ta ; gratuity (if present)
%rj%po%ccCrd Surcharge: %cc
%rj%po%cdCash Discount: %cd
Total: %to ; R Justified, Total: $15.85
%cl%po%emEmail: %em ; Centered Email
The script above would generate a graphical receipt output that looks like the one pictured below.

In the script semicolon ; characters are comments. This allows you to comment your scripts, so that you
will better understand them after revisiting them after a period of time. Comments aren’t required but
they are highly encouraged.

Next, we will discuss each of the %xx codes that are available and what they do. Some codes are
supported only in graphics mode, and will be ignored in text mode. Text mode printing may look
somewhat different on the printed page than in the viewer, since text mode uses the printer’s onboard
fonts, which vary from manufacturer to manufacturer. Generally, there are 2 onboard font sizes, large
and normal. Large is double height, and double width. These can be controlled individually on some
printers so you could theoretically use 4 different fonts, but POS Pizza only allows 2 sizes to be used per
receipt in text mode.

Print Fonts
As noted above, the print fonts in text mode are dependent on the printer model used, since only
characters are sent to the printer, then they are printed using the printer’s built-in fonts. Fonts in
graphics mode are dependent upon the fonts that are installed in your copy of Windows. These fonts
will be used to produce a graphical receipt and then that receipt is sent to the printer as a graphic,
rather than characters of text.
There are 4 fonts available in both graphics and text mode. In graphics mode they are controlled by the
4 font buttons and corresponding angle field in the script editor.

Click any of the buttons (while in graphical mode) to choose a new font for each specific font command.

The font commands are %f1, %f2, %f3, and %f4. Each button in graphics mode will set what each font
is.

In text mode these are generated from the 2 sizes, and 2 colors (on impact printers).

%f1 is the normal print font, in black. %f2 is the large print size in black. %f3 is the normal print size in
red. %f4 is the large print size in red. Red print is only possible on impact or inkjet printers that have
the proper ribbon / cartridge installed. Thermal printers can only print in a single color, so color
changes are ignored.

Another limitation on character-based printing is that the printer must print an entire line using the
currently selected font size and color. You cannot change sizes (or color) on the same line. You have to
go to a new line before a change can be made. Graphical mode can print any font anywhere. Color is
generally not supported on POS printers in graphical mode, so POS Pizza presently only sends black in
graphical mode.

Remember that while in text mode, the printer has to print the entire line in the same font, so font
change commands after the start of a new line will be ignored.
Line Spacing
Line spacing can be controlled in graphical mode by using the %h1, %h2, %h3, and %h4 commands.
%h1 is the loosest line spacing, while %h4 is the tightest.

Line spacing cannot be changed while in text mode. This is handled by the printer itself and cannot be
changed. %h commands will be ignored in text scripting modes.

Lines & Boxes


The %ln command will print a line. In graphics mode, it will be an actual solid horizontal line. In text
mode it will be a series of - - dashes with a + plus sign at each end.

The %bx command will print centered text with a box around it. This will be made up of + plus signs
and - - dashes in text mode, and be made of a dashed line in graphics mode.
%bxHELLO, WORLD!

Would generate the following in graphical mode;

In text mode it would generate the following;

You can add multiple lines to boxed text by adding %bx commands on lines immediately above one
another.
%bxThis is line 1
%bxThis is line 2

The above 2 lines would generate a box with line 1 centered above line 2. You can do this for as many
lines as needed, provided that there are no spaces between these lines. As soon as a space or comment
or some other command is encountered, the box will end. If you put a space between the above two
%bx commands, you would end up with 2 boxes with 1 line of text each instead of 1 bigger box.

Other formatting commands


The remainder of the formatting commands are briefly covered below, and work exactly the same way
in both text-based and graphical print modes.
%el – Prints an empty line. Empty lines within the script are ignored, so use the %el command to move
the next line of text down by 1

%nn – No Newline. This command will continue from what was on the line directly above, printing on
the same line.

%lj – Left justify (default). All text following this command will be left justified. Justification will remain
until a new justify command is reached in the script.

%rj – Right justify. All text following this command will be right justified. Justification will remain until a
new justify command is reached in the script.

%cl – Centered. All text following this command will be centered. Centering will remain until a new
justify command is reached in the script.

Conditional Printing
Conditional printing allows you to print certain things only when certain conditions are true. For
example you might only want to print a table name/number if there was one set on that particular
order, or maybe you only want to print something on delivery orders, but not on others. The
conditional print commands will allow you to do this.

The first command in a conditional print is %po which means “print only if” the condition immediately
following it is true. If the thing that follows it is a text field, then if that text field contains data, the
remaining part will be printed. Conditional printing consists of 3 parts.

The first part is the %po. The second part is another %xx code that immediately follows it. The third
part is what will be printed if that condition is true.
%po%fd%f3DELIVERY

The above command will switch to font 3, and print the word DELIVERY if the order type is “delivery”.
The %fd is a flag that is set to TRUE only on delivery orders, otherwise it is false. The %po will only do
what follows, if the part immediately following it is true, otherwise the line is skipped.

Below is a list of special flags that are intended to be used with the %po command.

%fd – Order is a delivery order.

%fc – Order is a carryout order.

%fn – Order is a dine-in order.

%fp – Always Print Phone is enabled OR if order is a delivery.

%fa – Always Print Addr is enabled OR if order is a delivery.

%fx – Customer is set as Tax Exempt.

%ft – Customer *NOT* set as Tax Exempt.

%fe – Order is “edited”


%fo – Order Is Future Order.

%nd – "Is Negative Discount" returns 1 if the discount applied is a negative value (surcharge), otherwise
returns 0.

%sd – "Is standard/positive Discount" returns 1 if the discount applied is greater than zero, otherwise
returns 0.

The %po command can also be used with other regular %xx codes that can return text data. Text data
will be checked to see if there is data present. If so, the condition is true, then the part following the
tested condition will be printed. An example of this would be to print a table name or number only if it
is present on the current order. The line below would do that.
%po%tbTable: %tb

The code %tb contains the table name (if present), or it is blank. If the table name is present then the
%po%tb will not actually print anything itself, since it is the condition. The part immediately following it
will be printed which is Table: %tb. If %tb contained the text Front #5, then Table: Front #5 would be
printed on the receipt.

%xx Variables Summary

Header and layout codes


The following are codes that can be contained within the main body of the receipt. These will not work
within the order items section.

Script Description
Variable
%i0 Item Count: Line Items only. Qty not considered. If Qty > 1 then this would still be
counted as 1.
%i1 Item Count: All Items, including account payments, gift purchases, and coupons.
%i2 Item Count: All Inventory Items with Prices => 0.00 & All Non-Inventory Items with
prices > 0.00
%i3 Item Count: All Inventory Items with Prices => 0.00
%li Legal License Name/City/Phone. MUST APPEAR 1 TIME or will be automatically
inserted at top of receipt.
%ln Line
%bx Box printed around text. See detailed description explained earlier in this document
%lg Logo (Graphic mode only!)
%ed Extra Data
%ef Extra Data Field Name
%rp Reprint (is "Reprint" if receipt is a reprint otherwise it is empty)
%on Order Number
%tp Order Type (Dine, Cary, Deliv)
%tb Table Name/# if dine-in module order (should be used with the %po command to test
for data first)
%cn Cashier (Display Name)
%sn Station Name (Computer Name)
%ca Customer Name
%cp Customer Phone #
%ce Customer Email Address
%cf Customer Full (Street) Address w/Name (First + Last + House + Street + AddrLine2 +
City, St + Zip)
%cg Customer Full Address excluding Customer Name (House + Street + AddrLine2 + City,
St + Zip)
%cs Customer Street Address (House + Street Only)
%c2 Customer Address Line2
%ct Customer Points Available
%ot Order Time/Date (SQL Format)
%dy Order Year
%dm Order Month Number
%dd Order Date (Day number)
%dM Order Month Name (Abbreviated 3 characters)
%dD Order Day Name (Abbreviated 3 characters)
%d2 Order Time (12 Hour)
%d4 Order Time (24 Hour)
%pt Print Time/Date (SQL Format)
%py Print Year
%pm Print Month Number
%pd Print Date (Day number)
%pM Print Month Name (Abbreviated 3 characters)
%pD Print Day Name (Abbreviated 3 characters)
%p2 Print Time (12 Hour)
%p4 Print Time (24 Hour)
%di Delivery Instructions (Directions)
%pr Promo Message
%s1 Slogan Message (single-spaced)
%s2 Slogan Message (double-spaced)
%em Store’s Email Address
%dc Delivery Charge Name eg. "Delivery Fee"
%n1 Tax 1 Name
%n2 Tax 2 Name
%n3 Tax 3 Name
%n4 Tax 4 Name
%x0 Actual Item Subtotal (less tax when using "included" taxes like VAT)
%x1 Tax 1 Percentage
%x2 Tax 2 Percentage
%x3 Tax 3 Percentage
%x4 Tax 4 Percentage
%x5 Delivery Tax Percentage
%dn Discount Name
%g0 Suggested Gratuity Header Text
%g1 Suggested Gratuity Amount 1
%g2 Suggested Gratuity Amount 2
%g3 Suggested Gratuity Amount 3
%g4 Suggested Gratuity Amount 4
%ea All edits that have occurred on this order
%er The most recent edit that occurred on this order

Totals section codes


Script Description
Variable
%c4 Custom Currency 1 Name
%c5 Custom Currency 1 Amount
%c6 Custom Currency 2 Name
%c7 Custom Currency 2 Amount
%u1 Custom Currency 3 Name
%u2 Custom Currency 3 Amount
%u3 Custom Currency 4 Name
%u4 Custom Currency 4 Amount
%cc Credit Card Surcharge Amount
%cd Cash Discount Amount
%z1 Cash Tendered Amount
%z2 Check Tendered Amount
%z3 Credit Card Tendered Amount
%z4 Gift Card Tendered Amount
%z5 Billed To Account Amount
%z6 Customer Credit Awarded Amount
%z7 Points charged (taken from customer) Amount
%z8 Points earned (given to customer) Amount
%z9 Change given back to customer Amount
%z0 CashBack Amount (Debit Card Purchase)
%za Debit Card Tendered Amount
%zb Payment Due Amount
%b1 Gift Card Balance ( Prints NULL if no balance returned so can be used conditionally
with %po )
%b2 Prepaid Card Balance ( Prints NULL if no balance returned so can be used
conditionally with %po )
%tt Total Tax Amount
%t1 Tax 1 Amount
%t2 Tax 2 Amount
%t3 Tax 3 Amount
%t4 Tax 4 Amount
%t5 Delivery Tax Amount
%df Delivery Fee Amount
%ds Discount Amount
%ti Tip Amount
%ta Auto Gratuity Amount
%st Sub-Total
%to Total

Per Order Item codes


These are used between the order item block markers (:For Each Item / :End Item)

Script Description
Variable
%fi Full Item Info (No other codes needed). Uses the same format as standard receipts
%if Item Name + Toppings (traditional style)
%qt Quantity
%it Item Name
%nf Next Topping (Full Name as it appears in the database) - Must appear twice to show
layout for all of the toppings and only if %fi or %if NOT USED!
%nF Next Topping (Full Name UPPER CASE) – Must appear twice to show layout for all of
the toppings and only if %fi or %if are not used.
%nt Next Topping (Abrv Name) - Must appear twice to show layout for all of the toppings
and only if %fi or %if NOT USED!
%ic Item Charge
%si Special Instructions

Please see the example scripts. You can use the “test script” button in the script editor to view what the
printed version would look like (doesn’t actually print).

You might also like