#include /help/en/posc/poschead.htm Output Formatting

Output formatting is used to prepare the appearance of output for devices such as screens and receipts. The tokens below supply the means by which text can be arranged before display. Price Formatting

Simple Symbols

These are symbols or keywords, where a value is substituted into the output string at the point the symbol is encountered. Each of these symbols is prefixed and suffix by the percent sign (%). For example TIME is actually written as %TIME%

SymbolDescription
SYSDATEThe current system date. This value should not normally be used on receipts, as this will result in the current time being used for the sale, rather than the original time the sale was made.
SYSTIMEThe current system time
TIMEThe time of the sale
DATEThe date of the sale
RULEDraws a single pixel high horizontal line. Only used on receipt printers to generate ruled lines.
CHANGEThe total amount of change owing.
SALETOTALOUTCASHTotal amount outstanding on the sale, after rounding. This is typically the cash payment amount still due.
SALETOTALThe total value of the sale
SALETOTALTENDERTotal amount tendered for this sale from all sources.
TELLERThe active teller for this sale.
UNDODisplays the next action that will be undone for this sale, if the sale(undo) command is given.
GSTInserts the GST number on this sale. Use of this symbol is not recommended
SALEGSTThe total amount of GST in this sale for countries that have a single rate of product taxation.
FIELDNot documented at this time
PADWhen a line length is known, this symbol inserts as many spaces as required to completely fill the line to the width. If the line length is unknown, or the line is already longer than the length, this symbol does nothing.
BLANKIf the line contains only static text and totals that evaluate to zero, this symbol causes the complete line to be blanked, and where possible, not output.
BLANKNODISCOUNTBlank this line, if the current sale being processed does not have any discounts (line or sale discounts) present. This option is commonly used on receipts to provide different total formats for discounted and non discounted sales.(Implemented: V2.4.4.29)
BLANKDISCOUNTThe reverse of BLANKNODISCOUNT described above. Blank this line if the current sale has discounts present.

Example
%BLANKNODISCOUNT%Gross Sale Total%%salevalue(0,9)%
%BLANKDISCOUNT%Total Sale%%SALETOTAL%

The above example shows how a different line can be printed depending on whether the current sale has discounts present or not. Only one of the two lines above will actually cause output on the customer receipt.

nnnInserts the single ASCII character given by nnn. This must be exactly three decimal digits.
LASTSALE.N.SALETOTALThe total value of the Nth completed sale in history. N must range from 0 (last sale completed) to 4 (being the 5th oldest sale completed). This symbol is used for display on operator screen as a reminder of the value of the last sale.
LOCNAMEThe current name of the store location being used. Useful for printing on End of Day sheets and when using a Head Office Server.
SCREENThe current screen name. If the screen is a variant screen, then the variant name is used. This symbol is most useful when creating programmable buttons on variant menu screens.
RIDThe current RID value on the system.
message.G.MInserts the value of the message given by G.M from the message file. The message is fetched from the language file for the current teller. This means the message can be language/teller dependant.



Current Context

A range of symbols that reflect the current state of the system. Most of these symbols are useful to POS Script writers.

SymbolDescription
CTX.BARCODE.keywordSymbols that reflect the state of the current scanned barcode.
KeywordDescription
ScanThe actual barcode as scanned and presented by the scanner.
QuantityHow many items this barcode represents.
TimeTime the barcode was actually scanned and received by the POS
CTX.HTTPREQUEST.keywordIf the context relates to a Web Http Request, these context values hold the incoming client details
KeywordDescription
ipaddrHost Address in dotted IP form
ipnameDNS Name value of the ipaddr
urlActual URL being requested
argsArguments supplied to the URL
methodHTTP method being used to request the URL
nameIf the keyword cannot be identifed, then the header value coresponding to the keyword is returned. Common symbols used in header values are
KeywordDescription
acceptAcceptable MIME types for the browser in question
refererThe web site before this one
accept-language 
pragma 
ua-pixelsX and Y size of the browser
ua-colorNumber of colours on the client browser
ua-os 
ua-cpu 
user-agent 
host 
connection 
if-modified-since 
CTX.setting.keywordSymbols that show the current underlying settings on the context and system. These context symbols are not frequently used.

The keyword can be any valid Setting Name




Hard Totals

A range of totals that get reset on user demand, typically at the end of a shift.

General form:
     hardtotal.scope.item

Scope, either system, lane or user. lane gives on the totals for this lane, while system gives the totals for the whole store. The user scope is used to fetch user managed counters

itemScopeDescription
salecountlaneNumber of sales run within the scope.
totalcashlaneAmount of Cash received. Technically, identical to totalpayment.1
totalpayment.typelaneTotal amount of money received as payment type. The type field indicates the payment type number as set in the Payment configuration section.

Example:
   hardtotal.lane.salecount
Display the number of sales run on this lane since last close.


System Information

This is an optional set of symbols which provide information about the Windows environment in which the POS is running. This symbols can be used individually, or via the System Information report page. These symbols are documented under the sysinfo section


System Configuration

Provides values relating the the system configuration currently being used. This allows you to retrieve the exact setup of a database and POS system. These symbols are most useful for remotely checking the configuration of a system. All these symbols are prefixed with config.

KeywordDescription
accountsPOS controlled accounts are enabled
pluPLU encoding on products present
gihInwards Goods History Recording
fuelIntegrated Fuel Controller Present
approGoods on Approval support
tnotesPer Customer Notes
cloths 
shifts 
maxbuy 
future 
avecost 
fashion 
writeoff 
dispatch 
multipluEnable a product to have more than one PLU code
securityFull Security, where tellers are required to login to perform restricted functions
custtrack 
multilangMultiple Language Support for tellers
multistore 
slavestore 
extloyaltyExternal Loyalty System installed
purchasing 
stockrecon 
qtymultiple 
splitscreenSystem is configured for split screen operation where two tellers can share a POS PC at the same time, using separate keyboards.
productposc 
headproducts 
productreward 
tellerbarcodeTellers can login using a barcode scan
paymentfilters 
paymentpreposc 
foreigncurrency 
paymentpostposc 
zeropointIs Stock level zero pointing enabled
floatlogSeparate recording and management of Cash Drawer Floats


Sale Data

These symbols display data about the current sale as a whole, such as the customer, the account and various totals.


Sale Values

These symbols display data about totals on the current sale as a whole.

KeywordDescription
salevalue(0,0)Total value of sale
salevalue(0,1)Total amount of sale still to be paid
salevalue(0,2)Total amount of sale still to be paid, if paying in cash. That is, the amount is rounded according to current rounding rules.
salevalue(0,3)Total value of sale when rounded for cash
salevalue(0,5)Total value of sale, excluding any items not eligible for discounts
salevalue(0,6)Total value of sale, excluding items not eligible for discounts, and less any discounts currently applied
salevalue(0,8)Total discounts on the sale, both line and sale discounts
salevalue(0,9)Total raw price from salelines, ie excluding all discounts
salevalue(0,10)The difference between rawprice and totalprice
salevalue(0,11)Total amount of item discounts
salevalue(0,12)Total amount of sale discounts
salevalue(0,13)Total amount of sale, less line and sale discounts. Since sale discounts are treated as payments, this figure will be after sale discounts have been applied, and will not equal the total amount of physical payments (such as cash).


Saleline and Product Data

The printing of product fields cannot be accomplised using the above simple symbol method. This is because the range and variation of product fields available across different industries would make the number of symbols required very large.

Product data is displayed instead using a format block, which involves wrapping details of the product field inside the block, along with instructions on how to format the data. These blocks are not placed inside percent signs, where-as the symbols described above are.

General form:
     [sl(field-name),format]

Examples:
     [sl(description),20]
     [sl(totalprice),R8]

The field name argument, is any field from the salelines or product table in the database. You can therefore print any field that relates to this product or saleline.

The format argument takes one of the following values:

ValueMeaning
LnnA number alone. Indicates that the data should be placed in a field nncharacters wide. The data is padded or truncated as required.
nnA number alone is treated as if a leading 'L' had been specified, see above.
RnnA number prefixed with the letter R. Indicates that the data should be placed in a field nncharacters wide, and right justified. The data is padded or truncated as required.
b*1Used for True/False fields. If the value of the field is 0,N or n, then the output field contains a single space, otherwise it contains an asterik (*)

In version V2.4.4.8, an alternative form a saleline totals was enabled. This form is %salevalue.total.field.list-of-values% This symbol takes on the total price for all salelines which meet the selection criteria. The field argument is any valid saleline or product field, and the list of values is a comma separated list of values. If the value of field is in the list of values, then the total for that line is included in the total, otherwise it is not. The field argument must specify a field that can be expressed as a number.

Examples:

%salevalue.total.mmid.0,1%The total of all unit measured items (mmid either 0 or 1). Note the 0 and 1 are separated by a comma.
%salevalue.total.r_depid.6%The total of all products in department number 6



Payment Data

Printing of payment fields is accomplised using the same method as saleline and product data, execpt that the prefix changes from sl to pay. The following payment specific information fields are available.

General form:
     [pay(field-name),format]

The field name argument takes one of the following values, or any other field on the payments table:

ValueMeaning
amountThe value amount of the payment
typeThe type of the payment, such as cash, EFT or rounding
foreignrateThe rate of exchange used on this payment, if the payment is a foreign currency.
foreignamountThe original foreign currency amount before being converted to the local currency


Format Parameters

Where the symbol uses a formatting extension, you can specify the way in which the data should be presented on the screen or paper, such as right or left aligning text.

   Syntax: [ L | R ] width

The first parameter specifies left or right justifcation respectively. If not specified, the format usually defaults to left justified output.

The second parameter defines the width of the output. This width is formatted using text -widths for the current font, not pixels or other fixed metrics.

If you wish a line to be centered, see the PAD keyword above.

   Example:L22 - Left justified in a field 22 characters wide.

   Example:R8 - Right justified in a field 8 characters wide.