Primitives Guides
Library Primitives Introduction Cheat Sheet Primitive Areas :Sale :GetData :General Reference State Variables

:Sale Primitives

Primary Commands

:sale id X
Selects the sale to operate on. The sale selected is remembered and used automatically on all following primitive commands issued in this single call.

Possible values of X are

XDescriptionExamples
A numberUses the exact sale number given. This sale number must exist, this command cannot create specific numbered sales:sale id 818282
newCreate a new sale:sale id new
activeSelects the active sale, being the one you most recently worked with and did not close using the phase command. If no active sale exists and one is required and new sale will be automatically created.:sale id active
A PhyskeyUses the sale identified by the physkey given. Physkey are globally unique and not repeated:sale id KAPQJJK82NBKPAZAZYYAZ

If you do not supply a sale id, the POS will default to "id active"

:sale phase X
Sets the current sales phase to X. The sale is removed from memory and updates will be no longer be sent to callers.

Possible values of X are

XDescriptionExamples
voidMarks the sale as void. Any open sale can be voided at any time.:sale phase void
parkParks the sale into a holding state, from which it can be recalled at a later time.:sale phase park
pickSend the sale onto the picking list, which is used to process sales for later pick and dispatch. Often used for eCommerce sales:sale phase pick

:sale add line [key-values]
Adds a new saleline to the sale

Example

:sale add line pid 614 quantity 2

:sale delete line [key-values]
Removes the indicated saleline from the sale. The key value sequence must be provided.

Example

:sale delete line sequence 6

:sale alter line [key-values]
Updates fields values on the saleline. The key value sequence must be provided.

Example

:sale alter line sequence 3 serial ABC37289J

:sale set field value
Sets values into the sale header.

"Field" may be followed by an encoding qualifer relating to the "value"

Example - setting the cutomers order number

:sale set orderno(12344)

Possible fields are

Field NameDescriptionExamples
OrderNoStores the customer purchase order number against the complete sale. It is also possible to store the order number against individual sale lines to handle multiple order numbers in a single sale
CommentsRecords internal use comments against this sale
ReceiptWillPrintToggles an internal indicator as to whether this sale should generate a receipt or not. This command may be overridden and receipts forced to print if other components on the sale require a printed receipt.receiptwillprint=1
ReceiptFormatNameName of the receipt format to be used

:sale prompt serialno
Prompts the user for the serial number and stores the value they enter

Key Values

sequence N
Indicates the sequence number of the item. Sequence numbers are not ordinal array indexes, they are values that should be extracted from the SaleObject. Sequence numbers may include zero and are positive integers. They may not be sequential.

Possible values of N are

NDescriptionExamples
IntegerLocates the Saleline with the explicit sequence numbersequence=8
-1Reserved to indicate explicit "don't know". Developers can use this value as an initialisation placeholder.sequence(-1)
activeUses the saleline most recently used. This is often used when additional primitives are sent directly after adding an item to a salesequence active

serial X
Sets the recorded serial number of the saleline to X

Infrequent Commands

:sale send event
Forces the Point of Sale to send a Sale Event and UIState event again. This is sometimes needed when the page javascript no longer has this information and needs to refresh it.