Receipts tab — history, preview, print
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.
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)
- SALE — green (
- 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
fiscalIdis empty
- Fiscal: <id> in green when the receipt has a
- 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.
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 card —
receipt.type.toUpperCase()(e.g.SALE,REFUND,STORNO) and the creation date/time on a centered card. - ITEMS section — one row per
receipt.itemsentry: name on the left,quantity x unit priceunderneath, 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).
Print flow
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.
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 (1–9). 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.
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.Where to next
- Daily operations — the per-device New Receipt variant inside Device Detail and every other one-shot fiscal command.
- Devices browser & device detail — pair a fiscal printer (without one, the print button raises No Device).
- Portal Receipts — issue stornos and review the org-wide receipt log.
- App settings & location switching — switching the active location changes which device sorts first for ADR-001.
Browse and manage paired devices
Browse the fiscal printers paired at your active location, add new ones via Bluetooth or network discovery, and open the four-tab device detail screen — Overview, Operations, History, Settings — for any printer the app controls.
Sign in & guest mode
Sign in to the E-BON Android app with your Portal email and password, or open the app as a guest to look around — what each option does, what guest mode actually gives you, the most common error messages, and where the app takes you next.