Understanding invoice workflow
The invoice creation process is built around a comprehensive form that captures all necessary information. The form automatically generates unique invoice numbers and provides real-time calculations of totals. Invoices in the system have four possible statuses (defined inapp/lib/types.ts:27):
draft- Invoice is being preparedsent- Invoice has been sent to customerpaid- Payment has been receivedcancelled- Invoice has been cancelled
Creating a new invoice
Navigate to invoice creation
Go to
/invoices/create to access the invoice form. The form will automatically generate a unique invoice number using the format INV-{timestamp}{random} (see app/lib/invoice.ts:100-106).Configure invoice details
The Invoice Details card contains:The currency you select here will be used for all monetary values and totals on the invoice.
- Invoice Number: Auto-generated but editable (e.g.,
INV-123456789) - Currency: Select from 11 supported currencies (USD, EUR, GBP, CAD, AUD, JPY, CHF, CNY, INR, MXN, NGN)
- Invoice Date: Defaults to today’s date
- Due Date: Defaults to 30 days from invoice date
Add customer information
You can either select an existing customer or enter new customer details:Select existing customer:
- Use the “Select Customer” dropdown to choose from saved customers
- All customer fields will auto-populate when you select one
- Click “Manage customers” to add new customers to the list
- Customer Name (required): Full name or business name
- Email (required): Customer’s email address
- Address: Street address
- City, State/Province, Zip/Postal Code: Location details
- Country: Select from 85+ countries (defaults to United Kingdom)
Customer information entered here will be saved with the invoice but won’t automatically create a new customer entry. To save customers for reuse, use the Customers page.
Add line items
Line items represent the products or services you’re billing for. Each item includes:Managing items:
- Description: What you’re charging for (e.g., “Web Design Services”)
- Quantity: Number of units (supports decimals like 2.5)
- Rate: Price per unit
- Amount: Automatically calculated as
quantity × rate
- Click Add Item to add more line items
- Click Remove to delete an item (minimum one item required)
- All amounts display in the selected currency with proper formatting
Configure tax and view totals
The Tax & Totals section provides:The totals update automatically as you modify items or tax rates.
- Tax Rate (%): Enter a percentage (e.g., 20 for 20% VAT)
- Tax is calculated on the subtotal after any item-level discounts
- Real-time summary showing:
- Subtotal
- Tax amount
- Total amount due
Add notes (optional)
The Notes field allows you to add:
- Payment terms (e.g., “Payment due within 30 days”)
- Special instructions
- Thank you messages
- Legal disclaimers
Save the invoice
Click Create Invoice to save. The form validates:The invoice is created with:
- Customer name and email are required
- Invoice number is unique
- At least one line item exists
- Status:
draft - Created timestamp
- Customer snapshot (preserves customer details even if the customer record changes)
Using invoice templates
To speed up invoice creation, you can save frequently used invoice configurations as templates.Save current invoice as template
While creating an invoice:- Fill in customer information, line items, tax rate, and notes
- Click Save as Template
- Enter a template name (e.g., “Monthly Retainer”)
- Add an optional description
- Click Save Template
- Customer information (partial)
- All line items with descriptions, quantities, and rates
- Tax rate
- Currency
- Notes
Use a saved template
Templates are loaded via sessionStorage when you select one from the templates page. The invoice form automatically populates with the template data on load (seeInvoiceForm.tsx:166-206).
Currency formatting
All monetary values are formatted using the Intl.NumberFormat API based on the selected currency:Database structure
Invoices are stored with the following schema (fromapp/lib/schema.sql:16-30):
Best practices
Next steps
- Learn how to manage customers for faster invoice creation
- Set up your company profile to appear on invoices
- Configure payment details to tell customers how to pay