GolfManager Logo V3 API
Version 2025-07-21

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

Supporting Systems

Invoice Lifecycle

  1. Creation from Sales: When a customer pays for products/services, the system automatically generates a draft invoice
  2. Line Item Generation: Products from the sale become invoice lines with proper pricing and tax calculations
  3. Confirmation: Staff confirms the draft, which assigns a sequential number and makes it immutable
  4. Payment Tracking: System tracks payments received against the invoice amount
  5. Receipt Generation: Optional receipts are created when payments are processed
  6. 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

Working with Invoices - Step by Step

For New Users:

  1. Understanding the Flow: Sales β†’ Payment β†’ Invoice Generation β†’ Confirmation β†’ Receipt
  2. Invoice Types: Learn which type to use for different scenarios (regular, proforma, simplified)
  3. Customer Requirements: Ensure customer has complete information (address, tax ID) before invoicing
  4. Confirmation Process: Review draft invoices carefully before confirming - they cannot be changed afterward
  5. Payment Tracking: Monitor payment status and use receipts for customer communication
  6. Error Handling: Use credit notes for corrections rather than trying to modify confirmed invoices

For Administrators:

  1. Setup Invoice Types: Configure types with appropriate validation rules and behaviors
  2. Number Sequences: Set up company-specific numbering with proper prefixes and formatting
  3. Templates: Customize PDF templates with company branding and required legal information
  4. Email Configuration: Set up automatic email templates and sending preferences
  5. User Permissions: Assign appropriate access levels for invoice creation and management
  6. 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:

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.

↑