Sales and Order-to-Cash
Lesson opener
In one line: Order-to-cash (OTC) is the chain quote → order → credit/stock check → delivery → invoice → cash — and every skip is a policy you must write down, not a habit.
Why it matters: If credit is optional and quantities live in a spreadsheet, you ship what you cannot collect and invoice what you did not ship. The 300-row customer file is the demand side of that chain: 49 already churned, 2 are still active with more than five tickets. Those two would fail a "block at order if tickets > 5" rule. OTC is not a sales process — it is a cash-generation machine. Every skip in the chain is a policy decision you must write down, not a habit.
Before this lesson: Master Data Management and Governance. Pairs with Sales dashboards.
Prerequisites
| Prerequisite | Why it matters |
|---|---|
| Completed ERP2 | Understands master data dependencies (customer, item, price, credit) |
| Completed ERP1 | Understands document chain and ERP as integrated system |
| Basic sales process awareness | Knows what a quote, order, delivery, and invoice are |
Lesson roadmap
By the end of this lesson you will:
- Expand OTC as quote → order → credit/ATP → delivery → invoice → cash.
- Place five control points: price, credit, ATP, partials, returns.
- Size a credit hold against 300 real customers (49 churned, 2 high-ticket active).
- Name four design mistakes (CRM-won-without-order, free-text discount, ship without GI, invoice from Excel).
- Write a hold rule as code and check it against real data.
- Diagnose an order blocked by credit, stock, pricing, or missing master data.
The OTC backbone
Lead / Opportunity (CRM)
→ Quote (price, validity)
→ Sales Order (the promise)
→ Credit + ATP (can we collect, can we ship?)
→ Delivery / PGI (stock moves)
→ Invoice (what finance books)
→ Receipt / Clearance (cash)A skip is allowed only as a written exception ("counter sales: quote = order"). Tribal "we always skip credit for Gold customers" is how disputes start. Every bypass must be a documented policy with an owner and an expiry date.
Teacher note: This lesson uses a 300-row customer file (data/customers.csv) to size controls on real data. The Python is only to size the control — how many real customers would a given hold catch.
Teacher demonstration: Size two holds on real customers
Scenario: You manage credit for a distributor with 300 customers. You need to size two hold rules before implementing them in ERP.
Customer file structure (data/customers.csv):
| Column | Meaning |
|---|---|
| customer_id | Unique key (C0001–C0300) |
| segment | Gold / Silver / Platinum |
| churned | 1 = churned, 0 = active |
| support_tickets | Open tickets count |
| credit_limit | Approved limit (₹) |
| current_exposure | Current open AR + open orders (₹) |
Step 1 — Churned customers are not new-order demand
Policy: No new sales orders for churned customers without a win-back approval.
Data:
import pandas as pd
df = pd.read_csv("data/customers.csv")
print(int((df["churned"] == 1).sum())) # churned
print(int((df["churned"] == 0).sum())) # activeExpected output:
49
251Interpretation: 49 of 300 customers are churned. A "won" CRM flag on those 49 rows without an ERP sales order is the first common design mistake — CRM "won" with no ERP order means revenue never hits OTC.
Step 2 — A ticket hold: block new orders for active customers with >5 support tickets
Policy: Block a new order if the account is active and support_tickets > 5.
import pandas as pd
df = pd.read_csv("data/customers.csv")
hold = (df["churned"] == 0) & (df["support_tickets"] > 5)
print(int(hold.sum()))
print(list(df.loc[hold, "customer_id"]))Expected output:
2
['C0004', 'C0068']Interpretation: Two active customers (C0004, C0068) have >5 open tickets. C0004 is Silver with 6 tickets. If credit sits only at invoice, those two already consumed stock. The control is early or it is theatre.
Key insight: Credit at order stops the promise before stock moves. Credit at invoice is too late — goods may already have left.
The five control points every manager must answer
| Point | Question a manager must answer | ERP configuration |
|---|---|---|
| Pricing | Price list, contract, or override with an approval? | Pricing procedure; condition types; approval workflow for manual overrides |
| Credit | Block at order, at delivery, or at invoice? | Credit management: risk category, credit limit, check at order/delivery/invoice |
| ATP / Stock | Promise only what can ship this week? | Checking rule (ATP check); checking group; scope of check |
| Partial Delivery | Allowed? How is the leftover invoiced? | Delivery completeness flag; partial delivery agreement; invoice split config |
| Returns | RMA required before a credit note? | Return order type; inspection type; credit memo block until GR |
Teacher note: These are not IT settings — they are business policies that IT configures. If the business cannot answer the question, IT should not configure the setting.
Four design mistakes that leak revenue
| # | Mistake | What happens | Why it matters | Fix |
|---|---|---|---|---|
| 1 | CRM "won" with no ERP order | Deals marked won in CRM never become sales orders | Revenue never hits OTC; CRM "win" is a ghost | CRM won = ERP order mandatory; nightly reconciliation |
| 2 | Free-text discount, no approval | Sales types discount in free text; no approval trail | Price list becomes a rumour; margin leaks | Discount condition type with approval workflow; no free-text |
| 3 | Ship without Goods Issue (PGI) | Warehouse ships from spreadsheet; no PGI in ERP | Stock and COGS stay wrong; finance cannot reconcile | No shipment without PGI; system-enforced sequence |
| 4 | Invoice from spreadsheet quantities | Finance types invoice from Excel, not from PGI | Finance cannot reconcile to PGI; quantity mismatches | Invoice created from delivery (PGI) only; no manual qty entry |
Teacher demonstration: The deliberate mistake — month-end "sales" in CRM is 40 orders higher than ERP invoices. Diagnosis: deals marked won never became sales orders, or invoices were typed from Excel after a skip. Correction: one backbone, written skips, credit before stock moves. Prevention: each morning, count CRM-won minus ERP orders. That gap is the design leak.
Guided practice: Gold and churned
Task: How many Gold customers have already churned? Those need a win-back path, not a silent new quote.
import pandas as pd
df = pd.read_csv("data/customers.csv")
print(int(((df["segment"] == "Gold") & (df["churned"] == 1)).sum()))Expected output:
11Interpretation: 11 Gold customers are churned. They need a win-back path, not a silent new quote. If Sales quotes them without a win-back plan, you're quoting dead accounts.
Independent practice: Platinum still active
Task: Print how many Platinum customers are still active (churned == 0).
import pandas as pd
df = pd.read_csv("data/customers.csv")
print(int(((df["segment"] == "Platinum") & (df["churned"] == 0)).sum()))Expected output:
21Acceptance criteria: Code runs without error; output matches 21.
Teacher demonstration: Diagnose an order blocked by credit, stock, pricing, or missing master data
Scenario: Order SO-2026001 for Customer C0045 (Gold, active) for 100 units of Item WIDGET-X @ ₹500/unit is blocked.
Step-by-step diagnosis:
| Check | Question | How to check in ERP | Result | Action |
|---|---|---|---|---|
| Credit | Is customer over limit or blocked? | Credit management: risk category, credit limit, current exposure | Exposure ₹48L, Limit ₹50L, Order ₹5L → would exceed | Request credit limit increase or partial delivery |
| ATP | Is stock available in delivering plant? | ATP check: checking rule, scope, plant | 50 units available, need 100 | Offer partial (50 now, 50 next week) or backorder |
| Pricing | Is there a valid price for this customer/item/date? | Condition technique: access sequence, condition records | No condition record for this customer/item | Create condition record or use manual price with approval |
| Master Data | Are all master records complete and valid? | Customer: payment terms, credit limit, reconciliation account. Item: base UoM, valuation class, MRP type. | Customer missing reconciliation account | Block order until master data complete |
Diagnosis result: All four checks fail on this illustrative order. Credit fails because ₹48 lakh exposure plus a ₹5 lakh order exceeds the ₹50 lakh limit. ATP fails because only 50 of 100 units are available. Pricing fails because there is no condition record. Master data fails because the customer has no reconciliation account. Fixing only the price record would still leave the order blocked.
Resolution path:
- Finance creates a condition record for this customer, item, and date.
- Finance adds a reconciliation account on the customer master.
- Sales agrees a partial quantity that ATP can promise, or waits for supply.
- A named finance approver raises the credit limit or splits the order. The order stays blocked until credit, price, stock, and master data all pass. Amounts are illustrative.
Pause and think
Q1. Why block at order rather than at invoice for credit control?
Invoice is too late: goods may already have left. Credit at order stops the promise.
Q2. What does PGI (Post Goods Issue) change that a packing list does not?
Goods issue (some products label this PGI) moves stock in the ERP. It reduces unrestricted stock and posts cost of goods. A packing list is a document only. It moves no stock and hits no ledger.
Q3. Are the two hold customers (C0004, C0068) "bad" customers?
They are a policy test. The file says they are active with more than five tickets. The manager decides whether that is a hold.
Q4. A salesperson creates a quote with a 15% discount typed in free text. No approval workflow exists. What control is missing?
Discount condition type with approval workflow. Free-text discount makes the price list a rumour.
Second workplace example: The "Gold customer exception" trap
Scenario: "Gold customers never need credit approval" — tribal knowledge. Six months later:
- Gold customer C0089 places a ₹50L order.
- Credit limit: ₹20L. Current exposure: ₹18L.
- Order would take exposure to ₹68L (340% of limit).
- Sales ships anyway because "Gold customers are exempt."
- Customer pays ₹5L and disputes the rest. Legal battle ensues.
Root cause: "Gold customer exception" was never a written policy with an owner and expiry. It was tribal knowledge.
Correction:
- Write the exception as a formal policy: "Gold customers with >2 years tenure and <5% overdue may exceed limit by 20% with Finance Controller approval."
- Configure in ERP: Risk category "Gold-Exception" with 20% tolerance, requires Finance Controller approval workflow.
- Add expiry date: policy reviewed quarterly.
Lesson: Every exception must be a documented policy with an owner, conditions, and expiry date. No tribal knowledge in credit.
Guided practice: Diagnose a blocked order
Task: Order SO-2026001 for Customer C0045 (Gold, active) for 100 units of Item WIDGET-X @ ₹500/unit is blocked. Use the diagnosis table to find the root cause.
Step-by-step hints:
- Check credit: Customer C0045 — limit ₹50L, exposure ₹48L. Order value ₹5L. Would exceed limit by ₹3L.
- Check ATP: Item WIDGET-X in Plant Pune — 50 units available. Order needs 100.
- Check Pricing: No condition record for Customer C0045 / Item WIDGET-X / valid date.
- Check Master Data: Customer C0045 missing reconciliation account. Item WIDGET-X base UoM = PC, vendor sells in BOX.
Expected diagnosis:
- Primary block: Credit (would exceed limit by ₹3L) and Pricing (no condition record).
- Secondary: ATP (only 50 of 100 available), Master Data (missing reconciliation account, UoM mismatch).
Proposed resolution:
- Finance creates a condition record for this customer, item, and price.
- Finance adds a reconciliation account on the customer master.
- Sales agrees a partial delivery: 50 units now, 50 next week, and the invoice follows the goods issue.
- Finance approves a credit-limit increase before the full order is released. Amounts here are illustrative.
Independent practice: Design an order-to-cash control matrix and exception report
Task: Design a one-page OTC control matrix and a weekly exception report for your organization.
Control Matrix (one page):
| Control Point | Policy | ERP Config | Owner | Monitoring Frequency | Exception Report |
|---|---|---|---|---|---|
| Pricing | |||||
| Credit | |||||
| ATP / Stock | |||||
| Partial Delivery | |||||
| Returns / RMA |
Weekly Exception Report (sample):
| Exception Type | Count | Top 3 Customers | Owner Action | SLA |
|---|---|---|---|---|
| Credit Block | ||||
| ATP Shortfall | ||||
| Pricing Missing | ||||
| Master Data Incomplete | ||||
| Return without RMA |
Acceptance criteria:
- All 5 control points addressed with policy, config, owner, frequency.
- Exception report has measurable columns (count, top offenders, owner, SLA).
- At least one KPI per control point (e.g., % orders blocked by credit, % lines with ATP shortfall).
Model approach: Start with the five control points. For each, write the policy in one sentence. Map to ERP config (e.g., credit check at order = "Check at order" in credit management). Assign a named owner (not a department). Set frequency (daily/weekly). Define the exception report column that triggers action.
Common mistakes
| # | Mistake | Cause | Consequence | Correction | Preventive control |
|---|---|---|---|---|---|
| 1 | CRM "won" with no ERP order | Sales uses CRM as primary | Revenue never hits OTC; CRM "win" is ghost | CRM won = ERP order mandatory; nightly reconciliation | Nightly job: CRM Won (open) minus ERP Open Orders = design leak |
| 2 | Free-text discount, no approval | No discount condition type | Price list becomes a rumour; margin leaks | Discount condition type with approval workflow | Condition type with approval workflow; no free-text discount field |
| 3 | Ship without PGI | Warehouse uses spreadsheet | Stock and COGS stay wrong; finance cannot reconcile | No shipment without PGI; system-enforced sequence | System-enforced: no delivery without PGI |
| 4 | Invoice from spreadsheet quantities | Finance types from Excel | Finance cannot reconcile to PGI; quantity mismatches | Invoice created from PGI only; no manual qty entry | Invoice program reads from PGI; manual qty disabled |
| 5 | Credit check only at invoice | "We check at invoice" | Goods ship, then customer can't pay | Credit check at order (or delivery); block before promise | Credit management: check at order = mandatory |
| 6 | Partial delivery without agreement | "We'll ship what we have" | Customer receives partial, invoiced for full | Partial delivery agreement in master; invoice split config | Customer master: partial delivery flag; invoice split config |
Assessment: Quick check
- OTC in erp3 expands to what chain?
- How many of the 300 customers are already churned?
- Active customers with >5 tickets: how many?
- The two hold customer_ids are:
- What does PGI change that a packing list does not?
- Why block at order rather than at invoice for credit?
- A skip in the OTC chain is allowed when:
- The deliberate mistake in erp3 is:
Answers
- Quote → Order → Credit/ATP → Delivery/PGI → Invoice → Cash
- 49
- 2
- C0004 and C0068
- PGI moves stock and hits COGS/Inventory ledgers. A packing list is just a PDF.
- Invoice is too late: goods may already have left. Credit at order stops the promise.
- Only as a written exception (e.g., counter sales: quote = order).
- CRM-won higher than ERP invoices because deals never became orders, or invoices typed from Excel.
Closure
What you can now do:
- Expand OTC as quote → order → credit/ATP → delivery → invoice → cash.
- Place five control points: price, credit, ATP, partials, returns.
- Size a credit hold against 300 real customers (49 churned, 2 high-ticket active).
- Name four design mistakes (CRM-won-without-order, free-text discount, ship without PGI, invoice from Excel).
- Write a hold rule as code and check it against real data.
- Diagnose an order blocked by credit, stock, pricing, or missing master data.
Essential ideas:
- OTC is a cash-generation machine, not a sales process.
- Every skip in the chain is a policy decision you must write down, not a habit.
- Credit at order stops the promise; credit at invoice is too late.
- The five control points (price, credit, ATP, partials, returns) are business policies, not IT settings.
- CRM "won" without ERP order is the #1 revenue leak.
One workplace action:
Run the two Python snippets against your customer file (or a sample). How many churned? How many high-ticket active? Share with your Sales Ops lead.
Bridge to next lesson:
What's next: Procurement and Procure-to-Pay — cash-out has the same discipline on the buy side. Three-way match, approval matrices, and blanket vs spot buys.