Overview
The template system allows you to save frequently used invoice configurations as reusable templates. This is ideal for recurring services, monthly retainers, or any invoice type you create regularly. Templates store customer information, line items, notes, and tax settings without invoice numbers or dates.What are templates?
Templates are pre-configured invoice structures that include:- Customer information (name, email, address)
- Line items with descriptions, quantities, and rates
- Tax rate percentage
- Currency
- Notes or payment terms
- Invoice numbers (generated when you create an invoice from the template)
- Invoice dates (set to current date)
- Due dates (calculated from current date)
- Status (all new invoices start as “draft”)
Template data structure
customer and items use Partial<> types, meaning fields can be incomplete or omitted entirely, giving you flexibility in how much information to pre-fill.
Creating templates
Templates are created from the invoice creation form:Step 1: Fill out the invoice form
Navigate to/invoices/create and complete the invoice form with:
- Customer details
- Line items
- Tax rate
- Currency
- Any notes or terms
Step 2: Click “Save as Template”
Instead of creating the invoice, click the Save as Template button. This opens a modal dialog.Step 3: Name your template
Provide:- Template name (required): A descriptive name like “Monthly Consulting Invoice” or “Website Maintenance”
- Description (optional): Additional notes about when to use this template
Step 4: Save
Click Save Template to store the template. The modal closes and you can continue editing the invoice or discard it. The template save implementation fromapp/components/InvoiceForm.tsx:267:
Viewing templates
Navigate to/templates to see all saved templates in a grid layout.
Each template card displays:
- Template name (heading)
- Description (if provided)
- Customer name or “Template” if no customer set
- Number of line items
- Creation date
- Use Template button
- Delete button (trash icon)
Empty state
When no templates exist:No templates yet. Create an invoice and save it as a template to reuse it.With a Create Invoice button to get started.
Using templates
To create an invoice from a template:- Go to
/templates - Click Use Template on any template card
- You’re redirected to
/invoices/create - The form auto-fills with template data
- Modify any fields as needed
- Click Create Invoice
sessionStorage for temporary data transfer between pages:
app/components/InvoiceForm.tsx:165):
The template data is cleared from sessionStorage after loading to prevent it from applying to future invoice creations.
Deleting templates
To delete a template:- Click the Delete button (trash icon) on the template card
- Confirm the deletion in the dialog: “Are you sure you want to delete this template?”
- The template is permanently removed
Common use cases
Monthly retainer invoices
Create a template with:- Customer: Your client’s information
- Items: “Monthly Retainer - [Service]” with fixed quantity and rate
- Notes: Standard payment terms
- Tax rate: Standard rate for your region
Hourly consulting
Create a template with:- Customer: Leave blank or use a placeholder
- Items: “Consulting Services” with quantity=1, rate=your hourly rate
- Notes: Include your billing terms
Product bundles
Create templates for common product combinations:- Items: Multiple line items for each product in the bundle
- Rates: Pre-filled with current pricing
- Customer: Leave blank to use with any customer
Data persistence
Templates are stored in IndexedDB using these functions fromapp/lib/storage.ts:76:
Template editing is not currently available in the UI. To modify a template, create an invoice from it, make changes, and save as a new template with the same name (delete the old one afterward).