Inventory → Invoices
Purpose
Capture the invoice / packing-slip document for each shipment of controlled substances you receive. Each invoice belongs to one supplier and is linked to one or more containers received under that invoice.
Regulatory basis: DEA rules require receipts to include date, source, and identifying detail. The invoice is the document side of that record.
When to use it
- Before receiving a container: create the invoice first, then reference it during the receive flow
- After the fact: if you forgot, you can still create the invoice and edit the container to link it
- Supplier billing reconciliation: track which invoices have been paid (status:
pending→received→reconciled) - DEA audit prep: ensure every container has a linked invoice with date and supplier
Walkthrough
Step 1 — Open the invoices list
Navigate to /home/<your-clinic>/inventory/invoices. The list shows invoice number, supplier, date, total, status, and linked container count.

After clicking Add invoice, the New Invoice page (/inventory/invoices/new) opens. The supplier select is required first; the Invoice Document (PDF) upload field is at the bottom and is optional:


After picking the supplier and filling invoice number, date, and subtotal, the total auto-calculates from subtotal + tax + shipping. After saving, the invoice appears in the list:

Step 2 — Click "Add invoice"
You're taken to the New Invoice page (/inventory/invoices/new). A ‹ Back to invoices link returns you to the list without saving.
Step 3 — Fill in invoice details
Required:
- Supplier — select from your supplier list. Cannot be changed after creation (the invoice is permanent paperwork; supplier reassignment would break the audit chain).
- Invoice number — the supplier's invoice number from their paperwork (e.g.,
INV-2026-0341). Should be unique per supplier; the system warns on duplicates. - Invoice date — when the supplier issued the invoice. Format
YYYY-MM-DD.
Recommended:
- Subtotal — pre-tax line-item total
- Tax — sales / use tax
- Shipping — shipping charges
- Total — auto-calculated as
subtotal + tax + shipping. Read-only. - Status —
pending(default; not yet shipped/received) →received(shipment arrived) →reconciled(you've checked contents and balanced the books) - Received date — when the shipment physically arrived (often different from invoice date)
- Notes — anything else worth recording
- Document file — upload the supplier's invoice PDF. Strongly recommended for DEA audit chain — inspectors want to see the source document, not just data entry.
Click Save.
Step 4 — Use the invoice when receiving containers
In the Receive container form, the Invoice field shows a dropdown filtered by the supplier you select. Choose the invoice you just created — that links the container to the invoice (and through it, to the supplier).
One invoice can be linked to multiple containers (a single shipment often contains several controlled substances).
Step 5 — Update status as the shipment progresses
- When the shipment arrives, edit the invoice and change status to
received. Set the Received date. - After you've physically counted the contents and matched them against the invoice, change status to
reconciled.
This is for your internal billing / inventory workflow — DEA inspectors don't care about your status field, but you do.
Field reference
Invoice form
| Field | Label | Type | Required | Validation |
|---|---|---|---|---|
supplier_id |
Supplier | select | ✓ on create | uuid; read-only after creation |
invoice_number |
Invoice number | text | ✓ | 1-100 chars; should be unique per supplier |
invoice_date |
Invoice date | date | ✓ | format YYYY-MM-DD |
subtotal |
Subtotal | number | optional | ≥ 0; 2 decimal places |
tax |
Tax | number | optional | ≥ 0; 2 decimal places |
shipping |
Shipping | number | optional | ≥ 0; 2 decimal places |
total |
Total | number | auto | read-only; computed subtotal + tax + shipping |
status |
Status | select | optional | enum: pending, received, reconciled; default pending |
received_date |
Received date | date | optional | format YYYY-MM-DD or empty |
notes |
Notes | textarea | optional | no length limit enforced |
document_file |
Invoice document (PDF) | file | optional | type: PDF only |
Hidden / system fields: accountId, id (set on creation), created_by, created_at, updated_at.
Edge cases
Cannot change supplier after creation
Once you've saved an invoice, the Supplier field becomes read-only. This is deliberate — an invoice is a permanent record of a transaction with a specific supplier. If you accidentally selected the wrong supplier, the safest fix is:
- Mark the existing invoice's status as
cancelled(via Notes) or void - Create a new invoice with the correct supplier
- Edit any containers linked to the old invoice to point to the new one
Currency and decimals
All monetary fields are stored to 2 decimal places. Entering 100 becomes 100.00. The total auto-calculates and won't drift due to rounding.
Missing PDF attachment
The PDF upload is optional in the form, but strongly recommended for DEA audit prep. If you don't have a digital invoice, scan the paper one. CS Logbook stores the file in encrypted Supabase Storage; only your clinic can access it.
Historical invoices for paper-migration
When entering legacy data (receivingType = paper_migration on the Receive container form), you may not have a real supplier invoice. Create a placeholder invoice like:
- Supplier: "Unknown - Historical" (a placeholder supplier)
- Invoice number:
MIGRATION-<YYYY-MM-DD> - Invoice date: receipt date or 1900-01-01 if unknown
- Notes: "Migrated from paper logs on
; original invoice not available"
This satisfies the schema (every container needs an invoice) without falsifying records.
Common mistakes
- Skipping the PDF upload. Five extra seconds to upload now saves you scrambling during a DEA audit. Make it a habit.
- Reusing one invoice across many shipments. One invoice = one shipment / packing slip. If you receive a second shipment from the same supplier on the same day, create a second invoice.
- Setting status to
reconciledwithout actually reconciling. Status is for your workflow; treat it accurately or you lose the value of the field. - Editing the invoice number on a delivered invoice. Invoice numbers from suppliers are reference IDs — don't rewrite them in the system to match your own scheme.
Related
- Suppliers — every invoice belongs to a supplier
- Containers — receive containers under an invoice
- Glossary § Invoice