Sales #invoices #sales #billing #ar #tax #payments Raw .md

Sales Invoices

Issue customer invoices, manage payment terms, record tax, and post directly to Accounts Receivable.

Routes: /sales-invoices /sales-invoices/:id

Sales Invoices

The Sales Invoices module handles customer billing. Generating and posting an invoice records tax liabilities, posts Accounts Receivable to the General Ledger, and updates order completion states.


Invoicing Rules & Accounting Integration

1. Generating Invoices from Orders

  • Invoices can be generated directly from confirmed or shipped Sales Orders.
  • Partial Invoicing: If an order is delivered in stages, multiple partial invoices can be raised against individual shipments.
  • Auto-Completion: When 100% of an order’s line items have been billed across invoices, the Sales Order automatically transitions to invoiced.

2. General Ledger Posting

Posting a sales invoice creates an automatic balanced journal entry in the General Ledger:

  • Debit: Accounts Receivable (Customer balance increases)
  • Credit: Sales Revenue (Product income accounts)
  • Credit: Tax / GST Payable (Tax output liability)

3. Tax Compliance & Immutability Guarantees

  • No Hard Deletions: Invoices, credit notes, and invoice line items are protected by PostgreSQL database triggers (herobm_core.prevent_financial_deletion). Once created, they cannot be deleted or truncated.
  • Compensating Corrections: Errors or cancellations must be handled via Cancellation (which posts an automatic reversing journal entry) or by issuing a Sales Credit Note.
  • Continuous Sequence Monitoring: Invoices follow chronological sequential numbering. An automated background verification engine runs scheduled audits to guarantee gapless continuity and timestamp monotonicity.

Step-by-Step Workflows

1. Generating a Sales Invoice

  1. Go to SalesSales Invoices (/sales-invoices).
  2. Click New Invoice.
  3. Select the Sales Order from the search list.
  4. Review the billed quantities, unit prices, discounts, and tax rates.
  5. Verify the Invoice Date and calculated Due Date.
  6. Click Post Invoice to finalize the billing and update the General Ledger.
  7. Click PDF or Email to send the official tax invoice to the customer.

Field Reference

FieldDescription
Invoice NumberLegal tax invoice identifier.
CustomerBilled customer account.
Sales OrderOriginating sales order reference.
Invoice DateOfficial billing date.
Due DatePayment settlement deadline based on terms.
SubtotalNet amount before tax.
Tax AmountCalculated GST / VAT.
Total AmountGross payable amount in customer currency.

Field Reference & Data Dictionary

Key database fields, input parameters, and definitions associated with this workflow screen:

Field / Parameter Display Name Description & Rules
invoice_number Invoice Number Sequential tax invoice number (e.g. INV-2026-00312).
customer_id Customer Customer account billed for goods or services.
sales_order_id Sales Order Originating sales order linked to this invoice.
invoice_date Invoice Date Date of issue for tax and reporting purposes.
due_date Due Date Payment due date calculated from customer trading terms.
currency_code Currency Invoice currency, matching the sales order.
total_amount Invoice Total Grand total including line amounts and tax.