POS/Session
This section contains POS cash session APIs.
GetXReportPrinted returns HTML for the accepted cash register's current open shift. GetZReportPrinted takes session_uuid and returns HTML for a closed shift of the same cash register, including repeat printing. Both return result.print_data; closing is a separate Close operation.
Both forms use template type 2. Retrieve it through OperatingCash/GetChequeTemplate and edit the returned id through OperatingCash/EditChequeTemplate. The template type comes from the stored record; no type parameter is needed. Configure the logo with logo, logo_width and logo_height rather than a local image path.
The JSON template contains width (millimeters), margin_left, margin_right, and the row arrays header, sale_totals, payment_sale, payment_sale_totals, return_totals, payment_return, payment_return_totals, cash_totals, footer. All arrays are required; only header and cash_totals must be nonempty. Rows support text, font, alignment (0 left, 1 center, 2 right), interval, and the same barcode/QR settings as sale receipts. Font sizes must be 1 through 72 pt in either object or string notation. Line fillers are limited to 80 characters. Margins use millimeters; each interval unit equals 24.8 / 300 mm, as in sale receipts. Payment rows repeat for each payment type.
Markers: <session.code>, <session.operating_cash>, <session.start_datetime>, <session.start_user_name>, <session.close_datetime>, <session.close_user_name>; <sale.closed.counter>, <sale.canceled.counter>, <sale.position.counter>, <sale.units.counter>; <payment.name>, <payment.amount>, <payment.totals>; <cash.start_amount>, <cash.close_amount>, <cash.income>, <cash.income.sale>, <cash.income.change>, <cash.outcome>, <cash.outcome.return>, <cash.outcome.change>, <cash.outcome.payment>. <SF> follows the shared receipt column rules. <DF>, <EF>, <AF>, <UF> and <PF> fill a line with dashes, equals signs, asterisks, underscores and plus signs respectively.
Sales and return sections use separate totals. Closed shift reports retain the recorded closing amount; an X-report shows the current cash balance from completed cheques and cash operations. Closing fields show - while the shift is open. HTML text is escaped.
The regular XReport and its printed form use the same shift totals and current balance.
Standard X/Z and opening templates follow the sale receipt formatting, including fonts, margins, row spacing, logos and date/amount formatting.
GetOpenReportPrinted takes session_uuid and returns the opening receipt HTML in result.print_data. Call it after Open, or repeat it for an open or closed shift of the accepted cash register. It requires an accepted cashier and shift opening permission. The receipt uses the shift's stored opening time, opening cashier and initial amount; printing does not change the shift or calculate current totals.
Opening receipts use template type 3, managed through the same OperatingCash/GetChequeTemplate and EditChequeTemplate methods. Its JSON contains width (80 mm by default), margin_left, margin_right, and a nonempty body array. Rows use the same fonts, layout, line fillers and barcode/QR settings as other receipts. Configure images through the template's logo fields.
Opening receipt markers: <session.code>, <session.operating_cash>, <session.start_datetime>, <session.start_user_name>, <cash_operation.open_value>. The amount marker prints the stored start_amount, including when reprinting a closed shift.