Sales #sales #quotes #estimates #margins #credit-limit #pricing #pricing-scales Raw .md

Sales Quotes

Create commercial price proposals, evaluate customer credit limits and profit margins, and convert quotes to confirmed orders.

Routes: /sales-quotes

Sales Quotes

The Sales Quotes module manages the commercial quotation process. Sales representatives can prepare price proposals, evaluate gross profit margins, check customer credit limits, and seamlessly convert winning proposals into confirmed sales orders.


Quote Lifecycle & Architecture

In HeroBM, quotes and sales orders share a unified underlying entity (sales_orders table). A quote is simply an order residing in the Draft or Quoted lifecycle state:

stateDiagram-v2
    [*] --> Draft : Create Quote
    Draft --> Quoted : Send Quote to Customer
    Draft --> Cancelled : Reject / Cancel
    Quoted --> Confirmed : Accept / Convert to Order (Stock Reserved)
    Quoted --> Cancelled : Customer Declined

1. Unified Entity Pipeline

  • Creating a quote generates a standard order record in Draft or Quoted state.
  • Converting a quote executes the confirm action, advancing the status to Confirmed. No duplicate records or messy data migrations occur.

2. Live Margin & Credit Verification

  • Real-Time Margin Tracking: As products and discounts are entered, each line calculates real-time gross margin based on the product’s active Moving Weighted Average Cost (WAC).
  • Credit Limit Verification: The system evaluates total customer exposure (Open Invoices + Unbilled Confirmed Orders + This Quote) against their pre-configured credit limit.

3. CRM Opportunity Linkage

  • Quotes can be initiated directly from a CRM Opportunity via /sales-quotes/new?opportunityId=<id>.
  • The quote total automatically rolls up into the opportunity’s Live Deal Revenue, providing real-time visibility into pipeline performance.

Step-by-Step Workflows

1. Creating and Emailing a Quote

  1. Go to Sales → Quotes (/sales-quotes).
  2. Click New Quote (opens the order workbench at /sales-orders/new).
  3. Select the Customer. Price scale, currency, and tax positions load automatically.
  4. (Optional) Select or link an active CRM Opportunity.
  5. Set the Expiry Date (valid_until).
  6. Add items, enter negotiated prices or line discounts.
  7. Click Save as Quote (sets status to Quoted).
  8. Click Email to send the branded Typst PDF quotation directly to the customer.

2. Converting a Quote to a Confirmed Order

  1. Open the winning quote.
  2. Click Convert to Order (or Confirm Order).
  3. The order advances to Confirmed, reserving available stock and queuing lines for warehouse picking.

Field Reference

FieldDescription
CustomerAccount receiving the quotation.
Quote NumberUnique identifier (ORD-...).
OpportunityCRM sales deal associated with the quotation.
Expiry DateCommercial validity cut-off date.
Gross Margin %Calculated profitability metric ((Price - WAC) / Price).
StatusStage (Draft, Quoted, Confirmed, Cancelled).

Field Reference & Data Dictionary

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

Field / Parameter Display Name Description & Rules
customer_id Customer Account Debtor account. Automatically populates currency, credit limits, price scale, and default tax position.
valid_until Quote Expiry Date Date through which quoted pricing, promotional discounts, and terms are commercially guaranteed.
margin_percent Real-Time Gross Margin Calculated profit margin ((Price - Cost) / Price) updated dynamically per line.
opportunity_id Sales Opportunity Associated CRM sales deal tracking commercial revenue rollups.
state_code Quote Status State within the order pipeline (Draft or Quoted).