Sales #customers #accounts #credit #terms #contacts #addresses #risk Raw .md

Customer Accounts

Manage customer profiles, credit limits, price scales, delivery addresses, and trading terms.

Routes: /customers /customers/new /customers/:id

Customer Accounts

The Customers module manages commercial accounts, credit controls, pricing scales, payment terms, and delivery addresses.


Business Logic & Inheritance Cascades

1. Data Inheritance Hierarchy

When creating or updating customer orders, the system automatically resolves commercial defaults through a strict order of precedence:

Commercial SettingResolution Cascade (First Match Wins)Default / Fallback
Credit Limit1. Customer Record → 2. Customer Group0.00 (Cash Basis only)
Trading / Payment Terms1. Customer Record → 2. Customer Group → 3. System DefaultImmediate / Cash Basis
Early Payment Discount %1. Customer Record → 2. Customer Group0% (No discount)
Early Payment Window (Days)1. Customer Record → 2. Customer GroupNone (0 days)
Price Scale (1–4)1. Customer Group Price ScaleScale 1 (Retail List Price)
flowchart TD
    A[Order Creation / Progression] --> B{Customer Setting Defined?}
    B -- Yes --> C[Use Customer Level Setting]
    B -- No --> D{Group Setting Defined?}
    D -- Yes --> E[Inherit Group Level Setting]
    D -- No --> F[Apply System Default / Cash Basis Fallback]

2. Trading Terms & Settlement Schedule Mechanics

When a sales invoice is posted, the customer’s effective trading term calculates the official Payment Due Date:

  • Net Terms (net): Due Date = Invoice Date + Days (e.g. NET30 sets due date 30 days after invoice date).
  • End of Month Terms (end_of_month): Due Date = Last Day of Invoice Month + Days (e.g. EOM30 sets due date 30 days after the end of the invoice month).
  • Cash on Delivery (cash_on_delivery): Due Date = Invoice Date (zero credit window; immediate settlement required).

Early Payment Cash Discounts

Organizations can incentivize prompt customer payments by specifying early settlement terms:

  • Early Payment Discount % (early_payment_discount): Percentage reduction applied to the total gross amount if paid early (e.g. 2.00 for 2%).
  • Early Payment Window (early_payment_discount_days): Number of calendar days from the invoice date during which the discount is valid (e.g. 10 days).
  • Example (2/10 Net 30): A 1,000.00 invoice on NET30 with 2% discount within 10 days allows the customer to settle for 980.00 if paid within 10 days of the invoice date.

3. Credit Exposure & Assessment Formula

The system evaluates customer financial risk whenever an order is moved to Quoted or Confirmed:

Total Financial Exposure = Total Unpaid Invoice Balance + Additional Open Order Exposure
  • Unpaid Invoice Balance: Sum of all posted, non-cancelled Sales Invoices minus credited amounts and unallocated customer receipts.
  • Additional Open Order Exposure: Gross total value of open Sales Orders in Confirmed, Picking, or Shipped states that have not yet been fully invoiced.

4. Credit Hold Evaluation (Logical OR-Gate)

An account’s effective credit hold status is evaluated as a logical OR-gate:

Is Sales Blocked = (Customer is on Credit Hold) OR (Customer Group is on Credit Hold) OR (Overdue Balance > 0) OR (Total Exposure > Effective Credit Limit)
  • Overdue Balance Block: If an invoice remains unpaid past its computed due date (Current Date > Due Date), Overdue Balance > 0 immediately triggers the credit hold gate.
  • Active Override: If an authorized user has granted a Credit Hold Override, the block is bypassed until overrideCreditHoldUntil timestamp expires (overrideCreditHoldUntil > Current Time).
  • Hard vs. Soft Limit Behavior: Under hard limit configuration (default), exceeding credit limits strictly prevents confirming or quoting orders. Under soft limit mode, operators receive a non-blocking financial warning.

Step-by-Step Workflows

1. Creating a New Customer

  1. Go to Sales → Customers (/customers).
  2. Click New Customer.
  3. Enter the Company Name, Customer Group, and Currency.
  4. Select the Trading / Payment Terms and set the Credit Limit.
  5. Add the primary Billing Address and at least one Delivery Address.
  6. (Optional) Add primary and billing Contact Persons with email and phone details.
  7. Click Save Customer.

2. Managing Credit Holds & Overrides

  1. Open the customer details page (/customers/:id).
  2. In the Financial Standing section, review total outstanding receivables, open order exposure, and remaining credit headroom.
  3. To manually suspend ordering, toggle Credit Hold: ON.
  4. To authorize a temporary override for a blocked account:
    • Click Apply Credit Override.
    • Select an expiry date/time and enter a mandatory Business Justification Reason.
    • Confirm the override to allow order confirmation within the authorized window.

Field Reference

FieldDescription
Customer NameTrading business name.
Customer GroupClassification tier setting default price scale (1–4), terms, and group limits.
CurrencyTransaction currency for all sales orders and invoices.
Credit LimitMaximum approved exposure in customer currency (inherits from group if null).
Credit HoldManual or automated flag blocking new sales order confirmations.
Payment TermsStandard settlement timeline (e.g. Net 30, COD).
Early Payment DiscountDiscount percentage for early settlement before due date.
Early Payment DaysDays from invoice date eligible for early payment discount.
Tax PositionRelational link defining tax rules and exemptions.
Delivery AddressesDestination addresses for physical shipments.

Field Reference & Data Dictionary

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

Field / Parameter Display Name Description & Rules
name Customer Name Legal trade name of the customer company or individual.
customer_group_id Customer Group Assigns group defaults for Price Scale (1–4), default payment terms, group credit limit, and group discounts.
currency_code Operating Currency Transaction currency for sales orders and invoices (e.g. EUR, SGD, USD).
credit_limit Credit Limit Maximum allowable financial exposure. Inherits from Customer Group or defaults to 0.00 (Cash Basis) if unspecified.
is_on_credit_hold Credit Hold Blocks order progression to Quoted or Confirmed. Evaluated via an OR-gate across customer and group levels.
trading_terms_id Payment Terms Standard payment window (e.g. Net 30, COD, Prepayment) resolved via customer -> group -> system default.
early_payment_discount Early Payment Discount % Percentage discount eligible if settled within early discount window.
early_payment_discount_days Early Payment Window (Days) Number of calendar days from invoice date to qualify for early payment discount.
tax_position_id Tax Position Tax exemption and specialized rules handled relationally via Tax Positions.
delivery_addresses Delivery Addresses Multiple destination addresses selectable during sales order creation.