The invoice is the legal record of "this clinic sold this patient this thing for this price on this date". Every status change touches accounting, every void leaves a trail, every mixed-payment splits cleanly across cash, card, and link. This article is the full operational playbook for invoicing at the desk.
Where it lives#
- Sales → Sales list: all invoices.
- Sales → + New sale: create an invoice.
- Patient profile → Invoices tab: just this patient's invoices.
- Session detail → Invoice: the invoice generated for this session.
How invoices come into existence#
Auto-generated (asynchronous)#
- A session marked Done queues an invoice-create background job for the service delivered, unless the session draws from a package credit.
- The job runs in seconds. If it fails (rare, usually a price-list mismatch or a missing tax code), the session is still marked Done but no invoice appears. Ask an administrator to inspect the failed background task, fix its cause, and retry through the supported operations tooling. Do not flip the session status to force a retry.
- Quick-sale (no session) at the desk creates an invoice synchronously and immediately.
- Package sale creates an invoice for the package's full price; the per-session credits draw revenue from the deferred-liability account later.
- Subscription billing (Clinic Wave SaaS model) auto-creates monthly invoices in the central tenant against the source tenant carried on
source_tenant.
Manual#
- Reception clicks + New sale.
- Picks the patient.
- Adds line items: services, packages, products, fees.
- Applies discounts.
- Saves as Pending (created, unpaid, sitting on AR) or, if one of the line items is out of stock, Pending stock (parked until the linked purchase request lands in inventory).
Anatomy of an invoice#
- Invoice number: tenant-formatted, sequential. Cannot be reused.
- Issue date: the day the invoice was created (it is collectible from this moment).
- Due date: when payment is expected.
- Patient (the bill-to).
- Payer if different (insurer, corporate).
- Line items: service / package / product, quantity, unit price, discount, tax, total.
- Subtotal, total discount, total tax (per tax code), grand total.
- Status (see below).
- Linked records: session(s), treatment plan, package.
- Seller tag (drives commission).
- Branch (drives revenue allocation).
- Notes (visible to patient on the printed invoice).
- Internal notes (staff only, not on print).
Status meaning#
The invoice has five locked statuses. There is no separate Draft step. an invoice is collectible the moment it is created.
| Status | Means | Next |
|---|---|---|
| Pending | Created, awaiting payment. Receivable sits on AR. This is the default for any new invoice. | Pay (full or partial), void. |
| Pending stock | One or more line items had no stock at checkout. Reception confirmed the back-order dialog and the invoice is parked. A linked purchase request is open against the supplier. When the inventory listener sees a CONFIRMED GRN for the missing product, the invoice flips back to Pending automatically. Cannot be paid in this state; line items are locked. Reception can void the invoice at any time, which also closes the dependency on the purchase request. | Auto-flips to Pending on GRN CONFIRMED, or void. |
| Overdue | Past due date and still unpaid. No new GL impact, this is a flag for AR ageing and dunning automation. | Pay, void, or arrangement. |
| Paid | Full amount collected. Closed. | Refund (creates a refund record, original stays Paid). |
| Void | "This invoice should not exist." Status flipped, GL reversed, inventory restocked, commissions reversed, package sessions restored. Requires no settled payment, refund first for paid invoices. See Void deep workflow. | None, terminal. |
Partial payments are not a status#
If a patient pays half the invoice, the status stays Pending. The remaining balance is computed from total minus sum-of-payments, not stored on a status field. Reports and reminders use the balance, not a status flag.
Bad debt write-off#
There is no Written-off status. To remove a bad-debt receivable from collectible AR, void the invoice with reason "Bad debt write-off". The void flow posts the reversing entries and the audit log carries the reason, which is what reporting needs anyway.
Locked vs custom statuses#
The five above are system-locked. Tenants can layer custom invoice tags (e.g. "With insurer", "Awaiting pre-auth") that show alongside but never replace the locked status. Custom tags are visual aids for reception and AR queues. they do not change the accounting impact.
Editing an invoice, the rules#
Pending, nothing paid yet#
- Adding a line item: allowed by reception. New total recalculates.
- Editing a line item amount: allowed within the rep's discount floor. Below floor needs owner override with audit.
- Removing a line item: allowed, audited.
- Changing patient or branch: not allowed. Void and re-create.
Pending, with a partial payment#
- Only additive edits (add line items, add tax) allowed without owner override. Reducing total below paid amount is owner-only.
- Always audited.
Pending stock#
- Line items locked while waiting for the purchase request. Reception can void the invoice or wait for stock.
- When the linked GRN confirms the missing product, the inventory listener flips the invoice back to Pending automatically.
Paid#
- Read-only at the line level.
- Refund creates a separate refund record, the paid invoice stays as the original.
- Corrections issue a credit note (refund) plus a fresh invoice if needed.
Void#
- Read-only forever. Reason (including "Bad debt write-off") and author logged.
Discounts#
- Per line item or whole-invoice.
- Fixed amount or percentage.
- Reason required (campaign code, manager approval, loyalty).
- Within rep's floor: applied immediately.
- Below floor: requires owner override at apply-time. The override is captured in the audit and shows on the invoice's discount line.
- Loyalty cashback redeemed at this invoice shows as a separate line, not a discount (different accounting).
Tax handling#
- Per line item, tax code applies based on the service / product configuration.
- UAE VAT 5% by default for taxable lines.
- Some clinical services may be VAT-exempt or zero-rated, configured per service in Catalog.
- Tax shows on the invoice broken down per code, not just a total.
- VAT registration number on the invoice header, mandatory for tenants registered for VAT.
Taking payment#
One-shot#
- Open the issued invoice.
- Click Take payment.
- Pick method: cash, card (via terminal), bank transfer, wallet credit, insurance, mixed.
- Enter amount, change is computed for cash.
- Receipt prints / emails / WhatsApps depending on patient preference.
Mixed payment#
- The patient pays AED 300 cash + AED 200 card on a 500 invoice.
- Two payment lines, each with method, amount, reference, terminal id (for card).
- Invoice status flips to Paid only when total payment = total invoice.
- Select the relevant source payment when recording a credit-note refund. Confirm the external payout separately; selecting card does not itself trigger a gateway refund.
Partial payment#
- Patient pays half today, half later.
- Invoice stays Pending (partial-paid is not a separate status, balance is computed).
- System sends a balance reminder per the configured automation.
- The remaining balance is still collectible on AR.
Payment link#
- Reception sends a hosted payment link via WhatsApp or email.
- Patient pays from their phone, Stripe (or configured PSP) handles the card.
- Webhook updates the invoice, status flips to Paid.
- Useful for off-site collection (no terminal needed) and deferred collection (patient takes the link home).
Insurance payment#
- Patient pays the copay at the desk; the insurer share is marked "Submitted to insurer" and held on AR-Insurance.
- The invoice stays in Pending even after the copay is fully collected, because the total is not yet covered. There is no separate "Partially paid" status, partial-payment is a computed balance, not a stored flag.
- When the insurer settles in full, the matching Payment row brings the sum to total and the invoice flips to Paid.
- Down-coded or partially-approved claims leave a variance that either falls on the patient (collect at next visit) or writes off per tenant policy.
Receipt#
- Generated automatically on every payment.
- Printable, email-able, WhatsApp-able.
- For tax purposes, the receipt itself is not the tax invoice. The tax invoice is the invoice. The receipt is proof of payment against the invoice.
- Receipt has a unique number, tied to the invoice.
Void, refund, credit note, the call#
Void#
- The single "this invoice should not exist" terminal status. There is no separate Cancel, it was merged into Void.
- Allowed only when no payment on the invoice is settled, refund first for paid invoices.
- One atomic transaction: status → Void, audit row,
InvoiceVoidedevent, GL reversal posted, inventory restocked (or written off for items physically handed over), commissions reversed, package sessions restored, linked session flipped back to unbilled. - Requires a reason (min 10 chars) and the
invoices.void_invoicepermission. - Full playbook with role responsibilities and scenarios: Voiding an invoice.
Refund#
- Use when payment was collected and you are giving cash back (or issuing a credit note).
- Creates a refund record. Original invoice stays Paid.
- The credit note reverses the credited sale; a separate refund payment records the payout through the selected eligible method or account. See the refund guide before recording either.
- Commission claw-back fires automatically if the rule was on-delivery.
Credit note#
- Use when you do not give cash but a credit the patient can use on a future sale.
- Credit note is a credit on the patient ledger, applied at next invoice.
- VAT treatment per tax authority rules.
Accounts receivable hygiene#
- Pending invoices that have not been collected sit on AR.
- Past due date moves to Overdue badge.
- Automations create collection tasks at T+7, T+14, T+30.
- Write-off is the formal admission of uncollectability, owner-only, drives "bad debt expense" on the income statement.
- AR aging report shows the bucket distribution and is the accountant's morning view.
Quick sale (no session)#
- For walk-in product purchases (skincare, cosmetic kits) or one-off services.
- Sales → + New sale → no session linked.
- Stock decrements per the line's delivery mode: by default at Invoice Paid (on_paid); some products can be configured to decrement on Delivery (on_delivery) or on Session Done (on_session_done). Quick-sale lines use the catalog default, which is on_paid.
- Otherwise treated identically to a session-linked invoice.
Who can do what#
| Action | Reception / Sales | Manager | Owner |
|---|---|---|---|
| Create invoice | Yes | Yes | Yes |
| Apply discount within floor | Yes | Yes | Yes |
| Apply discount below floor | With sales.invoice_item.override_floor permission | Owner override | Yes |
| Edit paid invoice line | No | No | Yes, audited |
| Void unpaid invoice | Yes (with reason) | Yes | Yes |
| Refund (any amount) | With sales.refund permission | Yes | Yes |
| Write off | No | No | Yes |
Amount-based refund tiering is not enforced today. If the tenant needs a per-amount approval threshold, raise an ops ticket, it ships behind a feature flag.
Common mistakes#
- Deleting an issued invoice: not possible by design. Void instead, the number stays in the sequence for audit.
- Edit Paid line item: tax authorities frown. Use refund + new invoice.
- Wrong tax code on a clinical service: VAT computed wrong, regulator unhappy. Configure tax in Catalog, not on the invoice.
- Cash payment without receipt: opens dispute later. Always print or send.
- Forgetting to tag the seller: no commission accrues. Default-fill on create, allow correction.
- Editing the invoice's seller tag after it is paid. Use the edit-paid-invoice flow with a correction reason (typically Operator data-entry error). The cross-module reconciliation listener reverses the old seller's commission and accrues the new one automatically; no manual payroll line is needed.
- Issuing without due date: overdue logic does not fire. Default due-on-issue or T+N per tenant policy.
- Mixing patient ledger and invoice line item for cashback: cashback is its own line, not a discount.
How invoices connect to the rest of the system#
- Booking: session Done generates the invoice.
- Sales packages: package sale creates the upfront invoice.
- Payments: collection updates invoice status.
- Refunds and credit notes: downstream reversal.
- Inventory: stock decrements on Issue for products, on Done for service consumption.
- Commissions: seller tag drives accrual.
- Accounting: AR, revenue, tax, all driven by invoice status.
- Insurance: claim and settlement.
- Loyalty: cashback earn and redeem at invoice.
- NABIDH (UAE): regulated tenants transmit billing data on invoice events.
Pending stock, how an invoice parks and unparks#
A line item with no available stock blocks the desk. The Out-of-stock dialog gives reception three choices:
- Remove the line, invoice stays in Pending, ready to take payment.
- Substitute, pick another available product, line gets a substitution note.
- Back-order, invoice parks at Pending stock; a purchase request opens against the configured supplier with the missing quantity.
While parked the invoice cannot be paid and line items are locked. When the inventory module records a CONFIRMED GRN for the missing product on the linked purchase request, the invoice automatically flips back to Pending and reception can take payment.
If the supplier never delivers, void the invoice, the purchase-request dependency is closed at the same time.
Refund modes, manual amount vs by item#
The refund dialog offers two mutually exclusive modes:
- Manual amount, type the amount (must be positive, ≤ invoice paid total). Useful for goodwill refunds or when the line-level split is messy.
- By item, tick the line items to refund. The system sums
quantity × unit_pricefor each ticked line. Used for actual returns.
Both produce one negative Payment row on the invoice. The original invoice stays at Paid; reports surface refunded invoices via the negative-payment join, not via a status field.
What freezes when the invoice goes Paid#
The moment an invoice transitions to Paid, the system freezes the economic snapshot on every line item:
- Unit cost, broken down: base (product cost), consumed (BOM materials), extra (service overhead), and the rollup.
- Tax rate and tax amount per line, pro-rated from the invoice total.
- Allocated discount (coupon + membership) per line.
- NSR (net sales revenue) per line, the commission base.
- Cost components JSON, forensic per-material breakdown for COGS audits.
- Marketing snapshot, lead source, campaign id, ad id, channel, so later edits to the lead do not rewrite history.
Reports and the GL read these frozen columns. The live InvoiceItem properties exist for the UI, but financial trust comes from the snapshots. An admin Recompute action can rewrite them (bumps snapshot_version), with a full audit row.
Subscription invoice (Clinic Wave SaaS billing)#
Subscription invoices for the SaaS tier are created in the central Clinic Wave tenant, not in the customer tenant. Each carries a source_tenant FK pointing back to the BusinessTenant being billed. This keeps the customer's books clean of platform billing and gives Finance a single ledger for SaaS revenue.
Subscription billing is monthly. Pricing tiers, prorated upgrades, and dunning are configured under Settings → Subscriptions in the central tenant.
Retroactive price change on a paid invoice#
Finance spots that a service was billed at the wrong price three days after the invoice was paid. Two correct paths:
- Edit-paid-invoice (Finance Officer or higher): open the invoice → Edit → change the line's unit price → pick correction reason Price correction. The system fires
sales.invoice_item.corrected.v2, which (a) reverses the old commission, (b) posts an adjustment journal entry for the GL delta, (c) reverses the old stock move and posts the new one, (d) recomputes commission against the new NSR. The "Corrected (1x)" badge appears on the invoice list. - Refund + new invoice: refund the full original amount, issue a fresh invoice at the correct price. Use this when the price change crosses a VAT-finalized period boundary.
Do not void the original and re-invoice, voiding a paid invoice is blocked, and forcing a refund-then-void just to fix a price is unnecessary churn. The correction path is built for exactly this.
