Invoicing Overview
The invoicing module transforms sales transactions into formal invoices, providing a complete system for invoice generation, numbering, payment tracking, and compliance. It bridges the gap between informal sales records and official business documents required for accounting and tax purposes.
Core Concepts
Invoices: Official business documents that formalize sales transactions. Once confirmed, invoices become immutable legal records with sequential numbering. They contain detailed line items, tax calculations, customer information, and payment terms.
Invoice Types: Configurable templates that define how invoices behave - whether they require customer details, generate receipts, allow credit notes, or have amount limits. Common types include regular invoices, proformas, credit notes, and simplified receipts.
Invoice Lines: Individual items within an invoice, each referencing products, services, or sales records. Lines contain pricing, tax information, discounts, and quantities with full traceability to original transactions.
Receipts: Payment acknowledgments automatically generated when invoices are paid. They provide customers with proof of payment and maintain sequential numbering for audit compliance.
Credit Notes: Rectification invoices that cancel or adjust previously issued invoices. They automatically reference the original invoice and update its payment status.
Main Database Tables
Core Invoice Structure
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β Invoice ββββββββββΆβ InvoiceType β β Customer β
β β β βββββββββββ (billing) β
ββββββββ¬βββββββ βββββββββββββββ βββββββββββββββ
β
β 1:n
βΌ
βββββββββββββββ βββββββββββββββ βββββββββββββββ
βInvoiceLine ββββββββββΆβ Product β β Sale β
β β β (billing) β β (billing) β
βββββββββββββββ βββββββββββββββ βββββββββββββββ
Invoice Generation Flow
Customer makes purchase
β
βΌ
βββββββββββββββ βββββββββββββββ
β Sale ββββββββββΆβ Payment β
β (draft) β β β
ββββββββ¬βββββββ βββββββββββββββ
β
β payment triggers
βΌ
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β Generate ββββββββββΆβ Invoice ββββββββββΆβInvoiceNumberβ
β Invoice β β (draft) β β (counter) β
ββββββββ¬βββββββ ββββββββ¬βββββββ βββββββββββββββ
β β
β β confirmation
βΌ βΌ
βββββββββββββββ βββββββββββββββ βββββββββββββββ
βInvoiceLines β β Invoice ββββββββββΆβ Receipt β
β (products) β β (confirmed) β β (optional) β
βββββββββββββββ βββββββββββββββ βββββββββββββββ
Payment Tracking System
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β Invoice ββββββββββΆβInvoicePaymentββββββββββΆβ Payment β
β β β β β (billing) β
ββββββββ¬βββββββ βββββββββββββββ βββββββββββββββ
β β
β status updates β
βΌ βΌ
βββββββββββββββ βββββββββββββββ
βPayment β βPayment β
βStatus β βMethod β
β(0,1,2) β β β
βββββββββββββββ βββββββββββββββ
Credit Note Management
Original Invoice (Confirmed)
β
β error discovered
βΌ
βββββββββββββββ βββββββββββββββ
β Cancel ββββββββββΆβCredit Note β
β Request β β (negative) β
βββββββββββββββ ββββββββ¬βββββββ
β
β references
βΌ
βββββββββββββββ
β Original β
β Invoice β
β (updated) β
βββββββββββββββ
Core Entities
- invoice: Primary invoice document with customer, totals, and status information
- invoiceLine: Individual line items containing products, quantities, and pricing
- invoiceType: Configuration templates defining invoice behavior and validation rules
- invoiceCounter: Sequential numbering system with company-specific series
- invoicePayment: Payment tracking with links to actual payment records
- invoiceReceipt: Payment acknowledgment documents with their own numbering
Supporting Systems
- invoiceTemplate: PDF template configurations for different invoice types
- invoiceEmail: Email sending configuration and tracking
- invoiceTax: Tax calculation details for compliance and reporting
Invoice Lifecycle
- Creation from Sales: When a customer pays for products/services, the system automatically generates a draft invoice
- Line Item Generation: Products from the sale become invoice lines with proper pricing and tax calculations
- Confirmation: Staff confirms the draft, which assigns a sequential number and makes it immutable
- Payment Tracking: System tracks payments received against the invoice amount
- Receipt Generation: Optional receipts are created when payments are processed
- Completion: Invoice reaches “Paid” status when full amount is received
Invoice Status Flow
Draft (0) βββββββββ
β
ββββΆ Confirmed (1) βββ
β β
β ββββΆ Business Operations
β β
ββββΆ Canceled (2) ββββ
β
βΌ
Credit Note Generated
Payment Status Tracking:
Pending (0) βββββΆ Partial (1) βββββΆ Paid (2)
β β²
β β
βββββββββββββββββββββββββββββββββ
(direct full payment)
Key Features
Automatic Generation: Invoices are automatically created when sales are paid, with intelligent grouping by customer and appropriate invoice type selection.
Sequential Numbering: Company-specific numbering sequences ensure compliance with tax regulations and provide audit trails. Supports year-based resets and custom prefixes.
Multiple Invoice Types: Configure different behaviors for regular invoices, proformas, credit notes, and simplified receipts with specific validation rules and generation patterns.
Tax Compliance: Comprehensive tax calculation system supporting multiple rates, tax-included/excluded pricing, and integration with regional tax reporting systems.
Payment Integration: Full integration with the billing module’s payment system, supporting partial payments, multiple payment methods, and automatic receipt generation.
PDF Generation: Professional invoice PDFs with customizable templates, company branding, and multi-language support based on customer preferences.
Email Automation: Automatic email delivery upon confirmation with customizable templates and attachment of PDF invoices.
Credit Note Support: Complete rectification system for errors or cancellations, maintaining legal compliance while updating payment statuses.
Business Rules
- Draft invoices can be edited and deleted; confirmed invoices become immutable
- Sequential numbering cannot have gaps - canceled invoices maintain their numbers
- Credit notes must reference an original invoice and cannot exceed the original amount
- Customer invoices require complete customer information including tax details
- Payment status automatically updates based on payment records linked to the invoice
- Invoice types control validation rules - some require addresses, others have amount limits
- Tax calculations depend on customer tax-exempt status and product tax configuration
Working with Invoices - Step by Step
For New Users:
- Understanding the Flow: Sales β Payment β Invoice Generation β Confirmation β Receipt
- Invoice Types: Learn which type to use for different scenarios (regular, proforma, simplified)
- Customer Requirements: Ensure customer has complete information (address, tax ID) before invoicing
- Confirmation Process: Review draft invoices carefully before confirming - they cannot be changed afterward
- Payment Tracking: Monitor payment status and use receipts for customer communication
- Error Handling: Use credit notes for corrections rather than trying to modify confirmed invoices
For Administrators:
- Setup Invoice Types: Configure types with appropriate validation rules and behaviors
- Number Sequences: Set up company-specific numbering with proper prefixes and formatting
- Templates: Customize PDF templates with company branding and required legal information
- Email Configuration: Set up automatic email templates and sending preferences
- User Permissions: Assign appropriate access levels for invoice creation and management
- Compliance Settings: Configure tax rules and reporting integration for your jurisdiction
Advanced Workflows
Bulk Processing: Generate multiple invoices from sales batches with consistent formatting and numbering.
Summary Invoices: Consolidate multiple invoices into summary documents for simplified customer communication while maintaining detailed records.
Multi-Currency Support: Handle international customers with currency-aware calculations and proper formatting.
Integration Points: Connect with external accounting systems through webhooks and API endpoints for seamless data flow.
API Integration
The invoicing module provides comprehensive APIs for:
- Generating invoices from sales transactions
- Managing invoice confirmation and cancellation workflows
- Processing payments and updating invoice status
- Creating and managing credit notes
- Generating receipts and delivery confirmations
- Customizing PDF templates and email communications
- Retrieving customer invoice history and details
- Bulk operations for administrative efficiency
Common Scenarios
Regular Sale: Customer buys products β Payment received β Invoice automatically generated β Staff confirms β Receipt sent to customer
Corporate Invoice: Company customer orders services β Invoice created with complete company details β Payment terms applied β Invoice sent for approval β Payment processed β Receipt generated
Error Correction: Invoice sent with wrong amount β Credit note generated to cancel original β New correct invoice created β Customer receives updated documents
Proforma Invoice: Customer requests quote β Proforma invoice generated with no payment β Customer approves β Convert to regular invoice β Payment processed
This system ensures that all financial transactions are properly documented, legally compliant, and integrated with your business processes, providing both operational efficiency and regulatory compliance.