XMLReceiptStructure

XMLReceiptStructure

iVend POS – Receipt XML Structure

This article explains the XML structure for the iVend POS Transaction Receipt.Any user with basic XML and programming knowledge can customise the iVend POS Transaction Receipt.

You can locate the admin screen in the iVend Management Console in the following menu location: Administration > Retail Configuration > Print Profile

Figure 1 print Profile Search

Choose the available print profile and click the [F4 Edit] button to edit the record.

You can edit the XML format of any of the following POS receipts however this cannot be performed directly within the Print Profile window. The user must export the design via the Receipt Print Format window (Receipt Designer).:

Administration > Retail Configuration > Receipt Print Formats


Figure 2 Receipt Designer

1. Labor Chit

2. Day labor Chit

3. Transaction receipt

4. XTape Report

5. Gift Receipt

6. Quotation Receipt

7. Coupon

8. CashInCashOut

9. Gift Certificate

10. DrawerCountChit

11. ExpenseChit

12. ZtapeReport

The following image represents the standard output of the iVend Transaction Receipt:


Figure 3 Receipt

This Receipt can be customised by modifying the XML structure of the receipt.

The sample XML document for the Transaction Receipt is available at the following location on the iVend Server:

<ivend installation folder> \ManagementConsole\Receipt Formats\TransactionReceipt.xml.

Example: C:\Program Files (x86)\CitiXsys\iVend Retail\ManagementConsole\Receipt Formats\TransactionReceipt.xml

Document Structure:

1. The first element is “Document” <Document>. This is the parent tag for the receipt.

2. The next element is “Image” <Image fileName="" width="250" alignment="center"/>.

This element has the following attributes:

· fileName: This refers to the logo that needs to be printed on the receipt. It is a mandatory requirement that the logo image file needs to be in the ‘C:’ drive and is in a monochrome BMP format.

· width: This refers to the width of the image. This value should be the width of the image in pixels.

· alignment: This refers to the horizontal alignment of the image. Valid values are “left”, “centre”, “right”.

1. The next element is “Row” and “Element”.

<Row printblankrow="false" >

<Element colspan="4" align="center" doubleHeight="true" fontStyle="bold" object0="Transaction.Store.Id" object1=" Transaction.Store.Description" string="{0} {1}"/>

</Row>

<Row>

<Element colspan="2" align="left" string="Transaction Date:"/>

<Element colspan="2" align="left" format="MMM d, yyyy h:m tt" object0="Transaction.ActualDate" string="{0}"/>

</Row>

<Row>

<Element colspan="1" align="left" object0="SaleItemProxy.Price" string="{0}"/>

<Element colspan="1" align="left" object0="SaleItemProxy.DiscountAmount" string="{0}"/>

<Element colspan="1" align="left" object0="SaleItemProxy.SurchargeTotal" string="{0}"/>

<Element colspan="1" align="right" object0="SaleItemProxy.TotalPostSaleDiscount - SaleItemProxy.TaxProxy + SaleItemProxy.SaleDiscountAmountProxy" string="{0}"/>

</Row>

The “Row” element has the following attributes:

· printblankrow: This refers to the boolean value which defines whether the row needs to be printed at runtime if no data is retrieved for the property defined in the element->object0 attribute.

The “Element” element has the following attributes:

· colspan: This refers to the column spanning of the receipt. In iVend receipts, by design are divided into 4 columns. If you need to print anything in a full row then define colspan=”4” for the element.

· align: This refers to the horizontal alignment of the row. Valid values are “left”, “centre”, “right”.

· doubleHeight: This refers to the Boolean value which defines the double height of the row. By design the single row is taking the height equals to font size 8.

· fontStyle: This refers to the font style. Valid values are “italic” or “bold”

· object0: This refers to the object property for which the value needs to be printed. A mathematical calculation can be done between the object properties.

· object1: This refers to the object property for which the value needs to be printed. A mathematical calculation can be done between the object properties

Note: The object series can be any long, i.e. object0, object1,…., object<n>.

· string: This refers to the value printing of the properties defined in the ‘object0’ till object<n> attributes. This attribute takes values as defined in the argument pattern ‘{<n>}’. Any unicode character including Blank Space is allowed to be printed before or after the argument printing. Alternatively, this attribute can be used to print the label values without referring to the object values.


· format: This refers to the general string formats allowed in C# language. E.g. date time format : MMM d, yyyy h:m tt.

1. The Next element is “Separator”. <Separator object="-"/>

The “Separator” element has the following attributes:

· object: This refers to the Unicode character which draws the separator line to differentiate the multiple rows.

1. The next element is the “Enumerator” element.

<Enumerator object="Transaction.SalesPersons">

<Row>

<Element colspan="4" align="left" object0="User.Id" object1="User.FirstName" object2="User.MiddleName" object3="User.LastName" string="Sales Person: {0}, {1} {2} {3}"/>

</Row>

</Enumerator>

The “Enumerator” element has following attributes:

· object: : This refers to the object property on which looping needs to be executed.

Note: There will be at least one <Row> element and multiple <Element> element based on the element colspan value.

1. The next element is the “Header” element.

<Header>

<Separator object="-"/>

<Row>

<Element colspan="4" align="left" string="Delivery Items"/>

</Row>

<Separator object="-"/>

</Header>

“Header” element has no attributes and it is more of giving separation in the code to identify different sections in the report.

1. The next element is the “If-else conditon” to give programming condition to print the data.

<Enumerator object="TransactionPayments">

<If object="TenderType" operator="Equal" value="GiftCertificate">

<Then>

<Row>

<Element colspan="3" align="left" object0="PaymentType.Id" object1="CardNumber" string="{0} {1}"/>

<Element colspan="1" align="right" object0="Amount" string="{0}"/>

</Row>

<Row>

<Element colspan="4" align="left" object0="GiftCertificate.BalanceAmount" string="Gift Card Balance {0}"/>

</Row>

</Then>

<Else>

<Row>

<Element colspan="3" align="left" object0="PaymentType.Id" object1="AccountType" object2="CardNumber" string="{0}-{1} {2}"/>

<Element colspan="1" align="right" object0="Amount" string="{0}"/>

</Row>

</Else>

</If>

</Enumerator>

<If object="Transaction.Store.CashCustomerKey" operator="Equal" compareobject="Customer.Key">

<Then>

<BlankLine/>

</Then>

<Else>

<Row>

<Element colspan="1" align="left" string="Customer: "/>

<Element colspan="3" align="left" object0="Customer.FirstName " object1="Customer.Id" string="{0} - {1}"/>

</Row>

</Else>

</If>

The “If” element has the following attributes:

· object: This refers to the object property on which the condition is executed.

· Operator: This refers to the conditional operators. Valid values are "NotEqual","Equal", "GreaterThan", "GreatherThanOrEqual", "LessThan", "LessThanOrEqual".

· Value: This is a fixed string value to compare with.

· compareobject: This refers to the object property to compare with.

Note: The “Then” element is mandatory as mentioned in the example. However, the “Else” element is optional.

1. The next element is the “BlankLine” element.

<BlankLine/>

BlankLine does not have any attribute and is used to give blank rows in the receipt.

1. The next element is the “BarCode” element.

<BarCode symbol="Code128" height="40" width="60" alignment="center" textPosition="bottom" barcodePosition="bottom">

<Element object0="Transaction.Key" string="{0}"/>

</BarCode>

The “BarCode” element has following attributes:

· symbol: This refers to the barcode format. Valid values are "EAN", "UPC", "Code128", "ITF-14","Code39".

· height: This refers to the height of the barcode.

· width: This refers to the width of the barcode.

· alignment: This refers to the horizontal alignment of the barcode. Valid values are “left”, “centre”, “right”.

· textPosition: This refers to the vertical position of the text. Valid values are “top”, “bottom”.

· barcodePosition: This refers to the vertical position of the barcode. Valid values are “top”, “bottom”.

1. The next element is the “PaperCut” element.

<PaperCut/>

The “PaperCut” element does not have any attribute and is used to give a paper cut feature in the receipt if supported by the hardware.

1. The next element is the “Variable” element.

<Variable variablename="ExchangeRate"/>

The “Variable” element has following attributes:

· variablename: This refers to the name of the variable to be used in the receipt.

1. The next element is the “VariableSetValue” element.

This element is used to set the value of the variable declared by the “Variable” element.

<VariableSetValue variablename="ExchangeRate" string="2.3"/>

<If object="SaleAttribute.Name" operator="Equal" value="ConversionRate">

<Then>

<VariableSetValue variablename="ExchangeRate" object0="AttributeValue"/>

</Then>

</If>

The “VariableSetValue” element has the following attributes:

· variablename: This refers to the name of the variable which is defined earlier in the script.

· string: This refers to the constant value to the variable.

· object0: This refers to the object property whose value will be set in the variable.

Note: The “VariableSetValue” element cannot be defined inside the “Row” element.