Sales & distribution

Counter sales, customer orders, invoices, delivery notes, customer payments, and returns. The credit limit is checked before an invoice is raised, not after. A4 and 80mm thermal print templates.

In this module
  • Counter sale and customer orders
  • Credit-limit check before invoicing
  • Delivery notes and customer payments
  • Returns that credit the customer account

A sale starts at the counter or as a customer order, and ends as an invoice, a delivery note, and a payment against the customer account. Nothing in that chain is retyped.

What is in it

  • Counter sale for walk-in trade, and customer orders for delivery
  • Invoices, delivery notes, and customer payments with partial settlement
  • Sales returns that credit the customer and put the stock back
  • A4 and 80mm thermal print for every document

The credit limit is a hard block, not a warning: an invoice that would take a customer past their limit does not post. Finance sets the limit, Sales lives inside it.

Module shape

How Sales & distribution fits the rest of the system

Bounded

The module owns its tables and its service interface. Other modules reach in only through services and async events — never SQL.

Test-vector verified

Every domain rule has two implementations — Dart and Java — and a single shared test vector. CI fails on any divergence.

Audit-logged

Every command writes an entry to the append-only audit log with a chain hash. The daily verifier proves the log has not been tampered with.