Printing service

The printing service contains all the printing functionality for LS One POS. The functionality to parse the receipt design that can be created in the Site Manager is in this service as well as the actual printing functionality both for the Windows printer and OPOS printer.

 

Configurations

For the printing functionality to work form layouts and form profiles need to be configured. Please see further information in the LS One Online help.

The hardware profile also needs to be configured for the printer that should be used.

Main functionality

Each of the "Print" functions calls a private function called DoPrinting which calls the actual printing functions that should be used depending on if the printing should be done using a windows printer, OPOS printer or slip printer.

Almost all of the receipts the LS One POS prints out can be designed and changed through the Receipt designer in the Site Manager. See list here below of receipts that either have a coded backup of a receipt (if none has been designed) for printing or are done in code and any changes will need to be done as a customization.

Name Description
GetInfoForForm Used by the email receipt functionality in the Transaction service to retrieve information about a specific printout without displaying any dialogs
GetTransformedTransaction Retrieves a receipt design and then uses FormModulation to parse it and create the OPOS string.

PrintBankDrop

PrintBankDropReversal

Prints out the receipt when bank drop operations are done on the POS
PrintCardReceipt

Prints out card payment receipts for all card payment lines.

If the EFT implementation itself prints out the card slips then PrintEFTReceipt function should return true and the form layouts for the card payments (payment and returns) should be configured to "Not print"

PrintFloatEntryReceipt Prints out the receipt when a float entry is done on the POS
PrintGiftReceipt Prints the gift receipt. Used by the Transaction service
PrintInvoice Prints the form layout for Invoice.

PrintCustomerReceipt

PrintCreditMemo

PrintGiftCertificate

PrintLoyaltyReceipt

These functions retrieve information about a receipt design (form type) for these payment lines, using FormModulation parses the design and creates the OPOS string and then prints the receipt using the configurations on the hardware profile.

PrintOpenDrawer Prints out a receipt when the operation Open drawer is done on the POS
PrintReceipt(IConnectionManager, FormSystemType, IPosTransaction, bool) This function retrieves information about any receipt design (form type), using FormModulation parses the design and creates the OPOS string and then prints the receipt using the configurations on the hardware profile.
PrintReceipt(IConnectionManager, FormSystemType, FormInfo, IPosTransaction, bool) This function receives the parsed receipt with the OPOS string already created and prints the receipt using the configurations on the hardware profile.

PrintSafeDrop

PrintSafeDropReversal

Prints out the receipt when safe drop operations are done on the POS
PrintSuspendedTransaction Prints information from the suspended transaction (the answers) onto the header of the receipt and then prints a receipt with suspended sale information
PrintTenderDeclaration Prints out the receipt when tender declaration is done on the POS
PrintTransaction Goes through the entire sale (or transaction) and prints out all the form layouts (receipts) that are necessary and are configured to be printed. The main code for this function is in TransactionPrinting.cs
PrintVoidedTransaction If the sale has been voided this prints out the form layout for a voided transaction
ShowPrintPreview An overloaded function. One creates the receipt that should be previewed and then displays it. The other one only displays a preview of the receipt printout string that has already been created.

 

Form Modulation

This code unit parses the receipt design that is created in the Site Manager and creates the actual print string from the variables and texts that are on the receipt (form) using the information on the transaction.

Name Description
GetInfoForForm Sets the configurations on the FormInfo object that are necessary for the printing to go forward as it is set i.e. printer selection, printing type and etc.
GetTransformedCardTender Retrieves a form layout (receipt design) and using the information on the transaction creates a header, line and footer OPOS string. This function is used for receipts needed for a card payment
GetTransformedTransaction Retrieves a form layout (receipt design) and using the information on the transaction creates a header, line and footer OPOS string. This function is used for all receipt types that don't have a specific "Transformed" function

On the header/lines/footer of each receipt variables called ExtraInfo can be added to each section. The code to implement these variables is in the FormModulation.Partner.cs file which makes the maintenance of the customization easier. Please see more information here.

In addition the functions that get and print information for the tax lines on the receipt as well as the tender lines also call a function in FormModulation.Partner.cs where a partner can add information to the receipt using the ExtraInfo variables.

 

Windows printouts

When printing a form layout using a windows printer or when creating an attachment to be sent with an email LS One uses a LS Retail component called WinPrinter. The entire functionality surrounding this functionality is in a partial class called PritingService.CreateWinPrintReceipt.cs

To create the printout the OPOS string needs to be created using the appropriate Printing functions and then CreateWinPrintReceipt function creates the printout the WinPrinter understands. Function WinPrinterPrinting in the Peripherals module then actually creates the printout or attachment.

Name Description
CreateWinPrintReceipt(IConnectionManager, string, IPosTransaction, List<BarcodePrintInfo>, int)

Receives a receipt string to be printed and converts it into the format the WinPrinter understands.

CreateWinPrintReceipt(IConnectionManager, FormInfo, IPosTransaction, List<BarcodePrintInfo>)

Receives a FormInfo object that has already been parsed into an OPOS string converts it into the format the WinPrinter understands.

CreateWinPrintReceipt(IConnectionManager, FormSystemType, IPosTransaction, bool, List<BarcodePrintInfo>)

Receives a form type, uses functions in the Printing service to create a FormInfo object with receipt strings to be printed and converts it into the format the WinPrinter understands.

 

Custom form layouts

In the Site Manager you can create your own custom form layouts and print them from the POS using the Reprint receipt operation.
This tutorial will get you started with custom receipt printing.

POS Operations

Many operations in the POS directly call the Printing service. Here below is a list of all the operations and which functions they call

Name Description
Bank drop Calls function PrintBankDrop
Bank drop reversal Calls function PrintBankDropReversal
Float entry Calls function PrintFloatEntryReceipt
Open drawer Calls function OpenDrawer
Suspend transaction Calls function PrintSuspendedTransaction
Tender declaration Calls function PrintTenderDeclaration
Tender removal Calls function PrintRemoveTenderReceipt
Print invoice (Daily journal) Calls function PrintInvoice

Development pack

To find this service in the development pack go to DevPack\Source\POS\Services

See also

Hardware profile (printing tab)

Transaction service