Invoicing
The Invoicing app is a comprehensive billing system. It covers the full invoicing lifecycle: managing a customer database and product catalog, generating invoices and quotations, recording payments, and tracking financial metrics like revenue, outstanding balances, and overdue amounts.
Key Features
Section titled “Key Features”- Invoice creation with line items, tax calculations, discounts, and shipping
- Quotation management with conversion to invoices
- Customer database with contact details, addresses, and balance tracking
- Product catalog for reusable line items with pricing and tax configuration
- Payment recording with method, receipt URLs, and notes
- Recurring invoices with configurable intervals and next recurrence dates
- Configurable settings — invoice/quotation/payment number prefixes, default currency, tax method, and due days
- Financial dashboard with revenue, outstanding, overdue, and invoice count stats
Page Structure
Section titled “Page Structure”| Route | Purpose |
|---|---|
/business/apps/invoicing | Dashboard with financial stats and recent invoices |
/business/apps/invoicing/invoices | Full invoice listing |
/business/apps/invoicing/invoices/new | Create a new invoice |
/business/apps/invoicing/invoices/[id] | Invoice detail view |
/business/apps/invoicing/invoices/[id]/edit | Edit an existing invoice |
/business/apps/invoicing/quotations | Quotation listing |
/business/apps/invoicing/quotations/new | Create a new quotation |
/business/apps/invoicing/customers | Customer listing |
/business/apps/invoicing/customers/[id] | Customer detail view |
/business/apps/invoicing/catalog | Product/service catalog |
/business/apps/invoicing/payments | Payment listing |
/business/apps/invoicing/settings | Invoicing configuration (prefixes, defaults) |
Data Model Overview
Section titled “Data Model Overview”Invoice
Section titled “Invoice”The primary entity with customer_id, auto-generated number, hash for public access, line-item totals (subtotal, total_tax, total_discount, shipping, grand_total), paid_amount, and status (draft, sent, viewed, partial, paid, overdue, canceled). Supports recurring billing with is_recurring, recurring_interval, and next_recurrence_date.
InvoiceItem
Section titled “InvoiceItem”Line items with optional catalog_item_id reference, quantity, unit_price, discount, computed discount_amount, tax_amount, subtotal, and total.
Quotation
Section titled “Quotation”Mirrors the invoice structure with its own status lifecycle: draft, sent, accepted, declined, expired, converted. The converted_invoice_id links to the resulting invoice when a quotation is accepted.
Customer
Section titled “Customer”Contact records with name, company, email, phone, full address fields, and a running balance.
CatalogItem
Section titled “CatalogItem”Reusable products/services with name, description, price, and tax_method.
InvoicePayment
Section titled “InvoicePayment”Payment records tied to invoices with amount, method, date, optional receipt_url, and a sequential number.
InvoicingSettings
Section titled “InvoicingSettings”Per-user configuration: number prefixes (invoice_prefix, quotation_prefix, payment_prefix), auto-incrementing counters, default_currency, default_tax_method, and default_due_days.
InvoiceStats
Section titled “InvoiceStats”Aggregate dashboard metrics: totalRevenue, totalOutstanding, totalOverdue, invoiceCount, paidCount, overdueCount, draftCount.
Key Components
Section titled “Key Components”- Stats grid — four cards: Revenue (green), Outstanding, Overdue (destructive red), and Invoice count with paid/overdue/draft breakdown
- Quick nav grid — six icon-linked cards: Invoices, Quotations, Customers, Catalog, Payments, Settings
- Recent invoices — uses the
InvoiceCardcomponent from$lib/apps/invoicing/modules/invoicesfor consistent rendering across views - Currency formatting —
Intl.NumberFormatwith USD currency style
Notable Integrations
Section titled “Notable Integrations”- Services:
getStatsandlistInvoicesfrom$lib/apps/invoicing/services - Shared components:
InvoiceCardfrom$lib/apps/invoicing/modules/invoices— a reusable card component for invoice list items - Platform payments: Invoices have an optional
platform_payment_idlinking to the platform’s payment system - Database: Stored in a separate
ext_invoicingschema