Invoices / Billing
A complete guide to the Invoices module — creating invoices, managing line items, applying discounts and tax, tracking payment status, and linking invoices to appointments.
Written By Dev010
Last updated 19 days ago
The Invoices module manages the complete billing workflow for patient visits. Invoices can be linked to appointments, include multiple line items, apply discounts and tax, and track payment status from unpaid through to paid. Together with the Payments and Expenses modules, Invoices forms the financial backbone of CareNova.
Accessing the Module
Sidebar → Invoices
Direct URL:
https://yourdomain.com/dashboard/invoicesWho can access:
Invoices are accessible to Admin and Receptionist roles by default. Doctors and Nurses do not see the Invoices module in the sidebar. Adjust in Dashboard → Permissions if needed.
Invoice List
The main invoices page shows a paginated, searchable list of all clinic invoices.
Each row displays:
Invoice number
Patient name
Doctor
Service
Total amount
Discount
Tax
Status badge
Issue date
Due date
Action buttons (view, edit, delete)
Search
The search bar filters invoices by:
Invoice number
Patient name
Doctor name
Results update as you type.
Invoice Statuses
Every invoice has one of three statuses:
Status flows in a typical billing workflow:
unpaid → paid
↓
cancelledAn invoice marked
paidshould have a corresponding payment record in the Payments module. Status is not automatically updated when a payment is recorded — it must be updated manually or at the time of payment entry.
Creating an Invoice
Click the New Invoice button on the invoices list page.
Direct URL:
https://yourdomain.com/dashboard/invoices/newRequired Fields
Optional Fields
Clinical Link:
Financial:
Insurance:
Notes:
Invoice Line Items
Below the main invoice fields, add one or more line items to detail exactly what is being charged:
The line item total is calculated automatically: quantity × unit_price.
Multiple line items can be added to a single invoice — for example a consultation fee, a procedure charge, and a medication cost all on the same invoice.
The Total Amount field on the invoice header is the final billed amount and is set manually. It should reflect the sum of all line items minus any discount plus tax. CareNova displays line items for reference but the header total is the binding amount.
Invoice Number
Invoice numbers are assigned automatically using a unique identifier format when the invoice is created. The format ensures each invoice has a unique, traceable reference number.
You can view and search invoices by their invoice number in the invoices list.
Saving the Invoice
Click Create Invoice to save. The invoice appears immediately in the list with unpaid status and is linked to the patient's billing history.
Invoice Detail Page
Each invoice has a dedicated detail page showing the complete invoice breakdown.
Direct URL:
https://yourdomain.com/dashboard/invoices/[id]The detail page shows:
Invoice header — number, patient, doctor, service, dates, status
Financial summary — subtotal, discount, tax, total
Line items table — all itemized charges
Insurance information
Notes
Payment history if payments have been recorded
Editing an Invoice
Click the Edit button on any invoice row or the detail page.
All fields are editable including line items, amounts, dates, and status.
Edit with care on invoices that already have payments recorded against them. Changing the total amount on a paid invoice does not automatically update or reverse the payment records.
Discounts and Tax
Discount
The Discount field applies a flat amount deduction to the invoice:
Total = Subtotal - Discount + Tax AmountExample:
Subtotal: 500.00
Discount: -50.00
Tax (10%): +45.00
Total: 495.00Discounts are useful for:
Returning patient loyalty discounts
Insurance negotiated rates
Staff discounts
Promotional offers
Tax
The Tax Percent field applies a percentage-based tax on the post-discount amount:
Tax Amount = (Subtotal - Discount) × (Tax Percent / 100)Set to 0 if your clinic does not charge tax on medical services. Tax rules vary by jurisdiction — configure according to your local requirements.
Insurance Billing
For patients with insurance coverage, record the insurance details on the invoice:
Insurance Provider — enter the insurance company name
Insurance Policy Number — enter the patient's policy reference
Payment Method — set to
InsuranceAdjust the total amount to reflect the insured portion
CareNova does not integrate with insurance billing systems or automatically calculate covered amounts. Insurance details are recorded for reference and manual reconciliation purposes.
Marking an Invoice as Paid
When a patient pays their invoice:
Option A — Update status directly:
Edit the invoice
Set Status to
paidSet Paid At to the payment date
Set Payment Method if not already set
Save
Option B — Record via Payments module:
Sidebar → Payments → Record Payment
Select the patient and link to this invoice
Enter the amount and payment method
Save the payment
Return to the invoice and manually update status to
paid
Recording a payment in the Payments module does not automatically update the invoice status. Both steps must be completed for accurate financial reporting. See the Payments guide for full details.
Overdue Invoices
The Admin dashboard includes an Overdue Invoice Banner that appears when invoices are past their due date (due_at < now()) and still have unpaid status.
The banner shows:
Count of overdue invoices
Total overdue amount outstanding
To review all overdue invoices:
SELECT invoice_number,
p.full_name as patient,
total_amount, due_at,
CURRENT_DATE - due_at::date as days_overdue
FROM invoices i
JOIN patients p ON i.patient_id = p.id
WHERE i.status = 'unpaid'
AND i.due_at < now()
ORDER BY due_at ASC;Cancelling an Invoice
If an invoice was created in error or a visit was cancelled:
Edit the invoice
Set Status to
cancelledSave
Cancelled invoices are preserved in the database for audit purposes. They appear in the list with a red status badge and are excluded from revenue calculations.
Deleting an Invoice
Click the Delete option from the invoice row action menu.
A confirmation dialog appears before deletion.
⚠️ Deleting an invoice also deletes all linked invoice line items (ON DELETE CASCADE). Payment records linked to this invoice have
invoice_idset to null (ON DELETE SET NULL) — they are preserved but lose the invoice reference. Cancel instead of delete to preserve a complete audit trail.
One Invoice Per Appointment
Each appointment can have at most one linked invoice. This is enforced by a unique constraint on invoices.appointment_id.
If you need to bill multiple services from a single visit, add them as separate line items on one invoice rather than creating multiple invoices for the same appointment.
Financial Analytics
Invoice data feeds directly into the Admin dashboard financial charts:
Database Schema Reference
invoices
invoice_items
Indexes are set on patient_id, appointment_id, doctor_id, service_id, and invoice_number for fast filtering and lookup.
Relationship to Other Modules
Workflow Examples
Creating an invoice after a completed appointment:
Sidebar → Invoices → New Invoice
Select patient
Link to the completed appointment
Select doctor and service
Add line items:
Consultation fee: 1 × 50.00
Procedure charge: 1 × 120.00
Medication: 2 × 15.00
Set total amount: 200.00
Set discount if applicable: 20.00
Set tax percent if applicable: 10
Set due date: 30 days from today
Save — invoice created with
unpaidstatus
Processing payment at the front desk:
Patient arrives to pay
Sidebar → Invoices
Find invoice by patient name or invoice number
Click Edit
Set Status to
paidSet Paid At to today
Set Payment Method to
CashorCardSave
Also record in Payments module for complete financial tracking
Applying an insurance claim:
Create invoice as normal
Set Payment Method to
InsuranceFill in Insurance Provider and Policy Number
Adjust total to reflect insured amount
When insurer pays, update status to
paid
Reviewing unpaid invoices for follow-up:
Admin dashboard → Overdue Invoice Banner
Or Sidebar → Invoices
Scan for
unpaidstatus badgesContact patients for payment
Update status when paid
Issuing a corrected invoice:
Cancel the incorrect invoice — Edit → Status: cancelled → Save
Create a new invoice with the correct amounts
Add a note referencing the cancelled invoice number
Troubleshooting
Invoices not visible in sidebar:
Confirm your role has
billing.viewpermission in Dashboard → PermissionsDoctor and Nurse do not have billing access by default
Cannot link appointment to invoice — appointment already has an invoice:
Each appointment can only have one linked invoice
Check if an invoice already exists for that appointment — search by appointment in Supabase → Table Editor → invoices
Use line items on the existing invoice instead of creating a second one
Invoice total not matching line item sum:
The header total amount is set manually and is independent of line items
Recalculate: sum all line item totals, subtract discount, add tax amount
Update the total amount field to match the correct calculation
Overdue banner not appearing on Admin dashboard:
Confirm invoices have a
due_atdate set — invoices without a due date do not trigger the overdue bannerConfirm the invoice status is
unpaid— paid and cancelled invoices are excludedHard refresh the dashboard
Cannot delete an invoice:
Invoice deletion is Admin only
Receptionist can create and edit but not delete invoices
Consider cancelling instead of deleting
Revenue chart showing incorrect amounts:
Revenue is calculated from invoices with
status = 'paid'Confirm paid invoices have their status correctly set to
paidConfirm
paid_atdate is within the chart's date range
Next Step
Continue to the Payments module guide to learn how to record and track patient payments against invoices in CareNova.