End-to-end flow

Appointment → visit → sales order → invoice

How a booking becomes money owed. The appointment is the booking, the visit is the encounter, the sales order collects charges at the desk, and the clinic invoice freezes them under the Legal Entity. Payments, credit notes, tips, and commissions follow the invoice.

Appointment, visit, sales order, invoice, payments shipped Processors, PDF, cash-up later 3 Nov 2026

Overview

Appointment (scheduled) patient optional = walk-in Schedule appointments.manage │ check-in (needs a patient; open deposit blocks) ▼ Visit (checked_in → in_room ⇄ waiting) Whiteboard visits.manage │ visit services, SOAP, diagnostic orders (lab works), treatment plans │ owner approves plan ─────────────┐ ▼ │ charges (home order) Visit (ready_to_bill) ── Checkout ──► SalesOrder (open) Checkout checkout.manage │ │ split / merge / void / discounts / deposits ▼ ▼ Visit (completed) Invoice (issued) per Legal Entity · taxes · commissions │ ▼ Payments / credit notes / tips (record-only)
RecordCodeStatusesScope
Appointment—scheduled | checked-in | canceled | no-showLocation
DepositDEP-000123pending | partially_paid | paid | waived | voidedLocation (+ Legal Entity)
VisitVI-000123checked_in → in_room ⇄ waiting → ready_to_bill → completedLocation
TreatmentPlanTP-000123draft → pending_approval → approved | rejectedPatient, origin Location
LabWorkvia DX-000123requested … completed | cancelledDiagnostic order
SalesOrderSO-000123open | merged | voided | invoicedLocation (one Legal Entity, one currency)
InvoiceINV-000123issued → partially_paid → paid | creditedLegal Entity header, Location attribution

1. Book

2. Arrive

3. Care

The visit moves across the Whiteboard (in_room in any room; waiting when seen and sent back). These sources become sales order lines, appended to the visit's open home order when one exists, otherwise picked up at checkout:

SourceBillable whenPrice
Visit service (type fee from check-in, or added on the visit)Item sellable at the Location (typed: type enabled there)Patient price; a bundle is one line at the bundle price
Treatment plan (visit-linked)approved by the owner (email link / QR) or staffEach item at the price snapshotted on the plan (patient group price at the issuing Location); plus an adjustment line when the final price was overridden (price − items_total, may be negative)
Lab work on a visit-linked diagnostic orderHas a catalog item and is not cancelledPatient price for the visit's patient at the Location when charged
SOAP noteNeverClinical record only
Patient price The lowest or highest effective price among the item's patient group prices that match the patient and are enabled at the Location; otherwise the Location-effective standard price. Snapshotted on the line.

Draft, pending, and rejected plans are never charged. Chart-origin plans and orders (no visit) are not charged. Cancelling a lab work or removing a visit service removes its line from an open order.

4. Ready to bill

5. Checkout (sales order)

POST /app/visits/:id/checkout picks the target order, appends every visit charge not already on an order, and redirects to it.

  1. The visit’s linked open sales order (home), else
  2. an open order at this Location that already holds lines for the visit, else
  3. a new open order (payer = primary pet parent, opened_by = current Staff).

Each visit gets its own order by default; staff merge or split at the desk. After a partial split a visit may span several open orders: automatic charges stay on the home order; the visit cart can add a line to another associated open order. A full split or merge retargets the home. Lines are grouped by patient and show the visit code.

Keeping the order in sync

EventEffect on open orders
Checkout clicked againAppends only charges added since (idempotent)
Visit-linked plan approved, diagnostic order issued, or visit service addedLines appended to the visit's open home order
Lab work cancelled / visit service removedIts line is removed from any open order
Catalog price changedExisting lines keep their snapshotted price

There is no separate “Sync charges” action; re-run Checkout instead.

At the desk

Split and merge keep the combined total to the cent. Details: docs/functional/checkout.md.

6. Invoice Built

Clinic AR vs SaaS Clinic invoices live under Clinic → Invoices (invoices.*). BillingInvoice / Settings → Billing / billing.* remain SaaS (TaskPaws charging the clinic).

7. Collect and correct

See Billing and finance.

8. Complete

Key rules

Who does what

RoleBookCheck-in / move visitApprove planCheckoutInvoicesPayments
Organization administratorYesYesYesManageManageManage
Location administratorYesYesYesManageManageManage
ReceptionistYesYesNoManageManageManage
VeterinarianNoYesYesRead (edits visit cart)ReadRead

Plan approval by staff needs soap.manage; owners approve from the emailed link without a session. Veterinarians edit the visit cart with visits.manage but not desk checkout. Full grants: RBAC.

Related: Appointments · Visits · SOAP notes · Catalog and pricing · Inventory · Billing and finance · Clinic tips · Clinic commissions.