Hello. In this tutorial I’ll show you how printing works and how to configure it for most common cases.
#How it works?
In this section I’ll show you how SambaPOS printing system works.
##Printers
These are the printers that are used on your system. To configure your printer start by adding a printer here. For this example I’ll add a Bar Printer
Enter a name for your printer and select your printer from drop down list. If it is a network printer you can also type it’s network name here.
###Printer Types
-
Ticket Printer: Native printing for
ESC/POS
compatible thermal or dot matrix printers. If lines starts with unexpected characters be sure your printer supports ESC/POS emulation and it is enabled. Some driver or hardware issues can also cause that. Try with different printer to ensure. - Text: Just prints plain text. All formatting tags skipped.
- HTML: Select this printer type for postscript (graphical) printing. If your printer is not ESC/POS compatible (inkjet, laser) or you need to print in mixed languages you can try using this printer type.
-
Port Printer: This printer directly sends data to serial port. This printer type is useful for configuring LCD customer displays or similar devices that you can send data through serial port. In this case you should enter PORT name to
Printer Share Name / Port Name
area. -
Demo Printer: This printer type sends printing content to notepad. Very useful to test printouts without wasting paper. Enter a dummy
Printer Share Name
as.
or something similar not to leave it empty. OpenNotepad
application and send prints to see how it appears. -
Windows Printer:
This printer type shows regular windows print dialog to let you choose a printer. - Raw Printer: Use this printer type if you need to configure a printer that supports a unique command set. Useful for programming Barcode Printers or Card Printers.
-
Custom Printer Some Samba Market add-ons installs custom printers. For example
Url Printer
module adds a custom printer to let you send a printer output to a web service. For example you can prepare a printer template to send SMS messages to customers through SMS webservices. There is also a pre-installed custom printer that prints output to text files.
Other Settings
-
Character Set: If your printer is ESC/POS compatible and you selected
Ticket Printer
type enter your printers language code here to support printing language specific characters. - RTL Support: Some ESC/POS compatible printers does not support RTL printing. In this case you can try fixing printer output by using this setting.
- Line Count: This setting is useful for configuring Customer LCD Displays. If you enter 2 here it printer will print only last two lines of the output.
- Line Character Count: Enter how many characters per line your printer supports.
-
Char Replacement: If your printer does not support language specific characters you can replace them by using this setting. For example
ß=ss
will printss
instead ofß
character.
##Printer Templates
After adding our bar printer we’ll see how Printer Templates works. Printer Templates used to configure how printouts appears.
On first install we should have three pre-installed printer templates. Ticket Template
is used to configure output for printing Bills
and Kitchen Orders Template
is used for configuring the printouts for that we send to Kitchen
to inform kitchen staff for new orders. Let’s say I also have a Bar Printer
and I need to configure a printer template for Bar Orders
. First we need to talk about some printing features.
###Replacement Tags
Basically printer templates configured as Text files. If you just enter Hello
in your printer template and print it, it prints Hello
. Of course we need more features than just printing hello. We use replacement tags to configure where specific data will appear. For example if your printer template is Hello {TICKET DATE}
SambaPOS will replace {TICKET DATE}
tag with the date of the ticket you’re printing and you’ll see something like Hello 1.1.2014
There are two types of Replacement Tags.
-
Printing Tags. A printing tag replaces with a dynamic data. For example
{TICKET DATE}
replaces with the date of the ticket,{TICKET TOTAL}
replaces with the total amount of the ticket or{ENTITY NAME:Customer}
tag replaces with the Customer Name. You can find a list of all supported tags at the right side of the screen. -
Section Tags. A section tag appears in
Blue
color and that tag replaces with a section’s content.
We have [ORDERS]
section in our template. Lines under this section defines how a single order line appears in ticket output. SambaPOS will format each order line by using this format and replace whole printout with {ORDERS}
section tag. You’ll notice [ORDERS] section contains another section tag called {ORDER TAGS}. That means SambaPOS will format each Order Tag
that assigned to an order by using [ORDER TAGS]
template and replace output with {ORDER TAGS }
tag. You can also configure specific formats for specific order lines. For example [ORDERS:Gift]
section defines output for Gift
Orders. Or [ORDERS:Void]
section used for orders that have Void
state.
You can read more info about formatting your printouts.
For this sample I’ve prepared a Bar Orders Template
and only change header to make them appear from different from other printouts. I’ll use this template to send bar orders to bar printer.
##Print Jobs
I have two pre-configured print jobs. Print Bill
job works when I hit Print
button inside a ticket and Print Orders to Kitchen Printer
works automatically when I add new orders to a ticket and close ticket.
Before continuing I want to show you how these two Print Jobs triggers. Understanding it will be very useful to be able to customize it for your needs.
###Print Bill
That one is simple. When I hit Print Bill
button it sends bill to printer.
This button appears there because of this Automation Command
configuration.
When we check how it mapped we’ll see that button configured to appear in ticket and payment screens.
It is always visible but only enabled when ticket state is one of New Orders
, Unpaid
or Closed
. As you know when we print a bill Ticket’s state changes to Locked
so Print Bill
button becomes disabled until I unlock ticket (change ticket state to Unpaid)
OK. That’s nice but how it prints when I click Print Bill
button?
Print Bill Rule
controls this. Edit Print Bill Rule
to see what happens when I click that button.
- It executes
Execute Bill Print Job
action. - Locks ticket
- It updates table state to appear it as
Maroon
color. - Updates ticket’s state as
Locked
- Closes Ticket.
So for example if you don’t want to close ticket when you click Print Bill
button you can just remove it from actions list.
So Execute Print Bill Action
action starts printing. Let’s see how this action configured.
Nothing special here. It just starts printing by using “Print Bill” job.
So we can see how Print Bill
Job is configured.
This configuration tells SambaPOS Print Bill Job sends output to Ticket Printer
by using Ticket Template
.
In summary when we click on Print Bill
button.
-
Print Bill
Automation Command executes. -
Print Bill Rule
handles it and startsExecute Print Bill Job
action. -
Execute Print Bill Job
action starts printing by usingPrint Bill
Print Job. -
Print Bill
Print Job formats output by usingTicket Template
and sends it toTicket Printer
##Printing to Kitchen.
That one uses same mechanism but it works automatically without the need of printing a button. Ticket Closing Rule
controls it.
When we close a ticket Ticket Closing Rule
works and …
- Executes
Kitchen Orders Print Job
- Updates Ticket status as
Unpaid
. - Updates Orders statuses as
Submitted
So how SambaPOS knows which orders should be printed to Kitchen? When we add a new order to a ticket that order’s status becomes New
Let’s see how Execute Kitchen Orders Print Job
action configured.
This action configured slightly differently from Execute Print Bill Job
action. It configured to filter only New
orders. If there are no New
orders it prints nothing.
After printing Ticket Closing Rule
executes Update Order Status
rule to change New
orders statuses to Submitted
. That’s why these lines does not prints again.
Let’s see what will happen when I Void
an already printed order.
Void command changes order state back to New
so that line prints again to Kitchen Printer
to inform Kitchen staff that previously printed order voided.
Now we can configure Bar items to print from Bar printer.
Configuring Bar Items
We know all new orders sends to kitchen printer by using Print Orders to Kitchen Printer
Print Job. I can change this job to map beverages to Bar Printer
I’ve added a new mapping line and mapped Beverages
to Bar Printer
. It will also use Bar Orders Template
. That means if a product is a beverage it will be sent to Bar Printer
. Everything else to Kitchen Printer
I’ll continue adding more tutorials to answer some common questions.