e-bon
e-bon.ro
E-BON App

Receipts tab — history, preview, print

The standalone Receipts bottom-tab in the E-BON Android app — a chronological history of every issued receipt, the per-receipt preview & print screen, and the standalone New Receipt entry point.

The Receipts tab is the fourth bottom-tab in the app, sitting alongside Home, Devices and Settings. It is a standalone, location-independent receipt log: every receipt the operator has issued from this install — whether through this tab's own Create receipt flow or through the per-device flow under Device Detail → Operations — appears here in reverse-chronological order. Tapping a row opens the preview/print screen; the FAB opens a standalone create form.

This page covers the standalone Receipts bottom-tab. The per-device variant of the New Receipt form, accessed from inside Device Detail, is documented under Daily operations and is not duplicated here. Storno (reversal) issuance is portal-only — see Portal Receipts.

Browse receipt history

The tab opens straight onto a FlatList of every receipt in the local ReceiptStore. There is no header bar, no search box, no filter chips, no date-range picker, no per-row edit/delete and no export button — it is a flat, chronological history.

Empty state

When receipts.length === 0 the list is replaced by a unified EmptyState with:

  • title No Receipts
  • description Issued receipts will appear here. Tap the button below to create the first receipt.
  • a primary action Create receipt that opens the standalone New Receipt form

Row shape

Each row is a tappable card with three blocks:

  • A type badge on the left, color-coded by receiptTypeColor:
    • SALE — green (colors.success)
    • REFUND — amber (colors.warning)
    • STORNO — red (colors.error)
  • A middle column with the total (formatted via formatCurrency, e.g. 123,45 RON), the date and time the receipt was created (toLocaleDateString + toLocaleTimeString) and a fiscal-state line:
    • Fiscal: <id> in green when the receipt has a fiscalId (it has been printed)
    • Not printed in amber when fiscalId is empty
  • A right-side item count (5 items / 1 item)

Tapping anywhere on the row navigates to Receipt Preview for that receipt id.

Floating action button

When at least one receipt exists, a + Create receipt floating action button anchored bottom-right takes the place of the empty-state CTA. Tapping it opens the standalone New Receipt form.

The STORNO type appears in this list when a storno receipt exists in the store, but the standalone Receipts tab does not issue stornos. Storno reversal is a portal-only flow — see Portal Receipts.

Preview and print a receipt

Tapping a row in the history opens the Receipt Preview screen, which is also where the standalone create flow lands after Preview & Print. It is a single scroll view that re-renders the receipt and exposes the print action.

If the receipt id no longer exists in the store, the screen renders a single error line Receipt not found and stops — there is no auto-back.

Layout

Top to bottom, when the receipt is found:

  • Success banner — only visible after a successful print. Shows Receipt Printed (large, green) and Fiscal ID: <id> underneath.
  • Header cardreceipt.type.toUpperCase() (e.g. SALE, REFUND, STORNO) and the creation date/time on a centered card.
  • ITEMS section — one row per receipt.items entry: name on the left, quantity x unit price underneath, line total on the right.
  • Total — a heavy top-bordered row with Total on the left and the formatted total on the right.
  • VAT BREAKDOWN card — one row per entry in receipt.vatBreakdown: rate (19%, 9%, 5%, 0%), Base: <amount> and VAT: <amount>.
  • PAYMENT section — one card per entry in receipt.payments: payment METHOD in upper-case (CASH, CARD, VOUCHER) on the left, amount on the right.
  • Action row — either the print button (before printing) or the done button (after printing).

Tap Print Receipt

The button calls printReceipt(receipt, devices[0]) from services/device/FiscalPrinterService, switches to a disabled state, and renders an inline spinner with Printing....

Wait for the driver

On success, the receipt is patched in ReceiptStore with the returned fiscalId and fiscalDate, the success banner appears at the top of the screen with the new fiscal id, and the print button is replaced by a Done button.

Tap Done

Done calls clearDraft() on the receipt store and navigation.popToTop(), returning the operator to the root of the current navigation stack.

If the driver throws, the error is logged and a native alert is raised with the title Print Failed and the error's message. The receipt is left as-is (no fiscalId) and the print button re-enables — the operator can retry.

First device wins. The receipt is printed on the first fiscal printer paired to your active location. There is no device picker on this screen. To print on a different device, switch your active location to one paired with the printer you want (see App settings & location switching), or remove the printer you don't want to use (see Devices browser).
If no fiscal printer is paired to your active location, tapping Print shows the alert No Device with the message Please pair a fiscal printer first. Add a printer from Devices → Add Device before printing any receipt.

Create a new receipt

Tapping + Create receipt (FAB) or the empty-state CTA opens the standalone New Receipt form. The form has three blocks stacked top to bottom and a Cancel action that calls clearDraft() and pops back to the Receipts list.

  • ADD ITEM — text inputs for Item name, Quantity and Price, a VAT RATE chip row (the Romanian VAT rates from ROMANIA_VAT_RATES, e.g. 19%, 9%, 5%, 0%) and a DEPARTMENT chip row (19). The Add Item button validates the inputs (non-empty name, positive numeric quantity, positive numeric price — each raising a native alert under Validation if it fails) and pushes a new item into the draft.
  • ITEMS (<count>) — appears once at least one item is in the draft. Each item card shows name, quantity x price = line total, a VAT <rate>% badge and a Dept <n> badge, plus a destructive Remove button. Below the list, a Total row sums everything (rounded to 2 decimals).
  • PAYMENT — appears once at least one item is in the draft. A METHOD chip row (Cash, Card, Voucher) and an AMOUNT input that defaults to the running total. The Preview & Print button validates that at least one item exists (alert No Items) and that the payment amount is at least the total (alert Insufficient Payment), finalises the draft and navigates to Receipt Preview.
The Receipts tab's New Receipt form is a standalone entry point — it does not pre-bind to a specific device, and the print step on Receipt Preview falls back to devices[0] per ADR-001 (see above). For the per-device variant of the same form — accessed from inside Device Detail and bound to that device for the print step — see Daily operations.
The standalone form lets the operator create Sale receipts. Storno (reversal of a previously fiscalized receipt) is a portal-only flow with its own audit trail — see Portal Receipts.

Where to next