Turning a POS order into accounting documents

To turn an order from the Hospitality module into accounting documents, the system described in this guide follows these steps:

  • Payment of the order in the POS, performed for each order. Invoices can also be issued for the products sold after the fiscal receipt;
  • Run Goods Issue Reconciliation (Sales -> Production) STEP 1 (job) breaks products down into raw materials and can be run for information and analysis;
  • Run Goods Receipt Reconciliation (Production -> Warehouse) STEP 2 (job) allocates consumption and deducts inventory. Run it only after all purchase goods receipts (NIRs) have been entered.

Paying an order

The POS works with Order entities until payment. The Bill button issues the preliminary bill; after collecting payment, Cash confirms the payment operation.

Order on the POS screen

After payment, orders generate accounting documents. In the workflow described here, those documents represent the completed customer transaction after payment.

Collecting payment in the POS

The documents are recorded as journal transactions (JournalRecord and JournalRecordLine), with references to products (ProductDefinition), taxes (Tax), inventory movements (BinLocationTransaction), customers (BusinessPartner) and the issuing company’s FinancialAccountingUnit.

Turning an order into a journal record

When an order is paid, the system performs the following operations:

  • Creates a JournalRecord of type SalesReceipt, with JournalRecordLine entries for the ordered products. Quantities, prices and taxes are copied from the order. If a customer is linked to the order, for example for delivery, advance payment or loyalty, the BusinessPartner reference is retained.
  • Creates warehouse movements as BinLocationTransaction entries associated with the journal lines. For products with a recipe, these are not the final raw-material movements: a subsequent process expands the recipe and performs the corresponding stock allocation.
  • Creates an AccountingDocument of type SalesReceipt and AccountingDocumentLine entries linked to the journal. This stores the document issued by the fiscal printer.
  • Creates CashJournalTransaction entries for cash, card or voucher payments, referenced by the order and accounting document.
  • Sends the fiscal receipt command to the printer. A successful response provides receipt and Z-report details for the AccountingDocument. If fiscal printing fails, the order remains open. The device’s actual fiscal result must be checked before any manual recovery or retry.
  • After successful fiscal receipt issuance, marks the order as paid and removes it from the active POS screen.

Generated documents and lines contain transaction details in Description and/or Note, making them easier to identify in tables and reports.

The system’s fiscal integration can be extended to different printers and cash registers. The original implementation described here supports DATECS; other suppliers require the corresponding integration.

Breaking products down into raw materials

Sold items generally fall into two groups:

  • Raw materials sold as they are (RawMaterial), such as bottled drinks;
  • Products with a recipe (BillOfMaterial).

Run Goods Issue Reconciliation (Sales -> Production) STEP 1 (job) creates one JournalRecord of type GoodsIssue. Its lines represent the raw materials required by recipes of products sold in SalesReceipt or SalesInvoice documents, as well as raw materials sold directly. The operation runs as a background job.

This document is the basis for processing inventory movements.

Each line references the raw material (ProductDefinition) and a new inventory transaction carrying the sale date, the quantity calculated from the recipe and sold quantity, and the unit of measure. Generated lines become children of the original sales-document lines, allowing the system to identify processed sales.

GoodsIssue lines are children of SalesReceipt or SalesInvoice lines. The generated GoodsIssue journal documents also retain parent-child relationships with the source sales documents.

Generated documents and lines contain transaction details in Description and/or Note to support identification.

Reconciling goods issues with goods receipts

Deducting stock from inventory

After all purchase documents have been entered, run Run Goods Receipt Reconciliation (Production -> Warehouse) STEP 2 (job) to allocate consumed quantities against received stock. This links ingredients consumed by sales with available purchase receipts, which is why complete receipt entry matters.

The inventory allocation described here uses FIFO.

CAUTION: If purchase receipts are missing and the reconciliation needs correcting, the historical workflow requires removing the generated document, entering missing receipts and running reconciliation again. Documents locked by month closing cannot be edited or deleted.

Before creating the final documents, the process finds PurchaseGoodsReturn entries and creates the corresponding GoodsIssue documents.

The job creates two JournalRecord documents: ReconciliationOfGoodsIssuesAndGoodsReceipts and MismatchedReconciliationOfGoodsIssues. Their lines reference the previously generated GoodsIssue lines and, for matched quantities, the purchase GoodsReceipt lines:

  • ReconciliationOfGoodsIssuesAndGoodsReceipts lines are children of the corresponding GoodsIssue lines;
  • Matched reconciliation lines also reference the parent GoodsReceipt lines providing the stock.

When purchase receipts are complete and stock is correct, MismatchedReconciliationOfGoodsIssues should normally contain no lines.

All generated documents and lines contain transaction details in Description and/or Note. If unmatched lines exist, these fields help identify the underlying problem.

Lines in both reconciliation documents are children of the source GoodsIssue lines. The documents also retain parent-child relationships with the source GoodsIssue journal documents.

Inventory

After both jobs finish successfully, the quantities in the inventory report should reflect the recorded business movements.