Template description
Z-report closing receipt template
The template has a strictly defined but extensible structure. The receipt template is described in JSON format and contains required variables.
Z-report closing receipt example
Basic receipt template structure:
{
"margin_left": 0,
"margin_right": 10,
"body":[ ]
}
Variables that control data display:
- "margin_left" - Left margin in pixels;
- "margin_right" - Right margin in pixels;
- "alignment" - Text alignment: 0 - left, 1 - center, 2 - right;
- Fill with spaces (" "); - Fill with dashes ("-"); - Fill with underscores ("_"); - Fill with equals signs ("="); - Fill with plus signs ("+"); - Fill with asterisks ("*").
The template structure contains one section:
body - Receipt template body.
Contains information about the Z-report, its opening and closing dates, and other details.
"body":[
{
"text" : "ЗАКРЫТИЕ ZReport",
"font" : "Lucida Console, 8pt, style=bold",
"interval" : 3,
"alignment": 1
},
{
"text" : "#<zreport.close_datetime>",
"font" : "Lucida Console, 8pt, style=bold",
"interval" : 3,
"alignment": 1
},
{
"text" : "<AF>",
"font" : "Lucida Console, 8pt",
"interval" : 3,
"alignment": 1
},
]
The following variables are available in this section:
- company.inn - Company TIN
- company.name - Company name
- company.address - Retail outlet or company address
- company.phone - Contact phone number
- zreport.terminal_id - Fiscal module ID
- zreport.id - Z-report number
- zreport.start_datetime - Z-report opening date
- zreport.close_datetime - Z-report closing date
- receipt.total.count - Number of receipts in the Z-report
- receipt.sale.count - Number of sale receipts
- receipt.refund.count - Number of refund receipts
- payment.sale.total - Total payments for sales
- payment.sale.cash - Cash payments for sales
- payment.sale.card - Bank card payments for sales
- payment.sale.vat - VAT amount for sales
- payment.refund.total - Total payments for refunds
- payment.refund.cash - Cash payments for refunds
- payment.refund.card - Bank card payments for refunds
- payment.refund.vat - VAT amount for refunds
- payment.total - Total payments
- payment.total.cash - Total cash payments
- payment.total.card - Total bank card payments
- payment.total.vat - Total VAT
If a text block in the section contains the following tags, its text content is ignored and the specified image is displayed instead:
- "img_src":"\Cheque\regos.png" - Image path
- "img_width":180 - Image width in pixels
- "img_height":180 - Image height in pixels
Example:
{
"text" : "",
"font" : "",
"interval" : 30,
"alignment": 1,
"img_src":"\\Cheque\\regos.png",
"img_width":180,
"img_height":180
},
If a text block in this section contains the following tags, its text content is encoded as the specified barcode type and displayed in the block:
- "barcode_height":50 - Barcode height in pixels
- "barcode_module":2 - Barcode size, expressed as a scale factor. The minimum value is 1.
- "barcode_show_text":(true, false) - Display text below the barcode
- "barcode_type":1 - Barcode type: 1 - Code128, 2 - EAN13, 3 - QRCode
Example:
{
"font" : "Lucida Console, 8pt",
"text" : "<company.name>",
"barcode_height":50,
"barcode_module":2,
"barcode_show_text":false,
"barcode_type":1,
"interval" : 30,
"alignment": 1
},