CRM · Customer receipts tab & ticket/stamp generation
Inside an existing customer record: register purchase receipts (date, code, amount, store, campaign) and generate the raffle tickets or loyalty stamps they earn, with a preview of what will be created before confirming.
| Area | CRM |
| Routes | crm.users.edit |
| Centre modules | loyalty-cards · tickets |
| Staff levels | root · admin · manager · crmmanager · crmoperator · weboperator |
| Models | campaign · commerce · receipt · ticket |
| UI label | users.receipts |
| Coverage | 3 use cases · 1 happy · 4 failure |
How it works
Only present when the centre has the tickets or loyalty-cards module and the customer already exists. activeCampaigns restricts which campaigns a receipt can be attributed to. The preview tables (ticketsPreviewColumns, stampsPreviewColumns) show the computed entitlement — including accumulated and pending balance — before generateTickets commits. Receipt validation errors are bubbled up to the parent form through onReceiptErrors, so the receipts tab shows an error badge. Submission wraps receipt.validate() in an explicit promise that rejects with the model errors.
Use cases
Why someone opens this (3)
- Desk staff entering a paper receipt a customer brings in so they get their raffle entries.
- Awarding loyalty-card stamps for a qualifying purchase.
- Correcting or cancelling a wrongly entered receipt.
Path map
flowchart LR F(["Customer receipts tab and ticket/stamp generati…"]):::feat F --> H1["Receipt registered and tickets generated"]:::ok F -.-> X1["Receipt fields missing"]:::bad F -.-> X2["Ticket generation fails"]:::bad F -.-> X3["Invalid record on cancel"]:::bad F -.-> X4["No active campaign"]:::bad classDef feat fill:#157068,stroke:#157068,color:#ffffff,font-weight:bold classDef ok fill:#e3f1ea,stroke:#0d6b42,color:#0d4a2e classDef bad fill:#f7e6e2,stroke:#9a2d1c,color:#6e1f13
Happy paths
Receipt registered and tickets generated
- Operator opens the receipts tab on a customer and adds a receipt with date, code, amount and store.
- A campaign is selected from the active list; the accumulated/pending balance updates.
submitReceiptvalidates and saves the receipt.- Operator opens the generate-tickets modal, reviews the preview and confirms.
ticket.generate-success-messageis shown and the tickets appear under the loyalty tab.
Failure paths
Receipt fields missing
Cause — Date, amount, store or code blank.
What happens —
error.tickets.date.required,error.tickets.amount.required,error.tickets.commerce.required,error.tickets.code.required; the promise rejects with the model errors and the tab badge turns red.
Ticket generation fails
Cause — API error while creating tickets.
What happens —
ticket.generate-error-message— explicitly tells the operator nothing was created and to contact support.
Invalid record on cancel
Cause —
cancelReceiptcalled with a bad model.What happens — Throws
TypeError('model' is not a valid receipt).
No active campaign
Cause — No campaign is currently open for attribution.
What happens — The campaign picker is empty, so no entitlement can be generated — the receipt can still be stored.
QA checklist
Tick these off while regression-testing this feature. The boxes are plain Markdown, so progress is visible in git diffs.
- ✅ Receipt registered and tickets generated
- ⛔ Receipt fields missing
- ⛔ Ticket generation fails
- ⛔ Invalid record on cancel
- ⛔ No active campaign
Implementation
Translation keys (12)
Key English users.receiptsReceipts receipt.save-messageThe receipt has been saved correctly receipt.campaign.accumulated-balanceAccumulated balance receipt.campaign.accumulative-amountAccumulative amount receipt.pending-balancePending balance receipt.stamps-numberStamps number ticket.generate-success-messageThe tickets has been generated correctly. ticket.generate-error-messageThere was a problem when generating the tickets and they haven’t beend created. Please, contact with the support team. error.tickets.date.requiredDate is required error.tickets.amount.requiredAmount is required error.tickets.commerce.requiredStore is required error.tickets.code.requiredCode is required
Related
- Same area — Customer list & filtering · Customer create & edit · Customer deletion with unsubscribe notice · Customer CSV export with column picker · Customer CSV import · Children CSV import · AI natural-language customer filter · Save current filters as a segment · Segment list, refresh & export · Segment builder with automatic tag actions · Segment categories · User tags (user types) · Customer loyalty — raffle tickets · Customer loyalty — cards & stamps · Customer loyalty — rewards · Customer loyalty — coupon exchanges · Customer children (dependants) · Receipt verification queue · Store list, filters & exports · Store create & edit · Store CSV import · Store labels (store types) · Customer action log (dormant)
- Shares data with — Activity editor (loyalty mechanics, rules & targeting) · Proposal editor (content, coupon, push, AI images) · Activity list & duplication · Activity report & PDF · Activity campaigns (programme grouping) · Push notification editor (scheduling, geofencing, deep links) · App button manager (MOFs) · Multicentre proposals
- Behind the same module — Customer loyalty — cards & stamps · Customer loyalty — raffle tickets · Receipt verification queue · Activity editor (loyalty mechanics, rules & targeting)
Generated from doc/feature-inventory.json · id crm-customer-receipts-tab · commit 276788ca6