Training home / Pricing engine

How a sales line gets its price

For Sales, Accounts, Plant Head and Admin. This page explains where the price on a quotation or order line comes from, how the optional formula pricing works, when a price is re-worked, and what to do when a price is held.

At a glance

Day-to-day selling is in the Sales guide. Switching features on is in the Admin guide.

The big picture

Every quotation and order line is priced by the system, not by the form.

There are two layers:

While formula pricing is off, prices come only from price lists and customer prices. Nothing on the formula screens has any effect on sales lines until it is switched on.

1. The base lookup (always on)

For each line the system checks these places in order and uses the first that has a price:

  1. The quotation. If the order comes from a quotation, the price the customer was quoted wins.
  2. The customer's own price for the part (Configuration › Customer Prices), in the same currency as the document.
  3. The customer's price list (the list chosen on the customer, shown under Configuration › Price Lists). It is used only if the list is active and in the document's currency.
  4. The standard price list for that currency (the active list ticked Standard).
  5. The part's own selling price. For a foreign-currency document it is converted at the document's exchange rate.

If none of these has a price, the form keeps whatever you typed. A line with no part (free text) is always treated as a manual price.

Dated rows and quantity breaks

The price chip

On quotation and order forms, the chip next to each price tells you where it came from: customer price, a price list, the part's selling price, a formula, or manual.

Price lists

Open Configuration › Price Lists. Each list has a code, name and currency, and can be ticked Standard for that currency.

Price Lists screen showing each list with its currency, whether it is the standard list, and how many prices and customers use it.
Price Lists: one row per list, with its currency, Standard flag, number of prices and number of customers using it.

Customer prices

Open Configuration › Customer Prices to give one customer an agreed price for one part. Pick the customer, part and currency, then enter minimum quantity, unit price and the dates.

Customer Prices screen listing customer, part, currency, minimum quantity, unit price and validity dates.
Customer Prices: each row is a dated price for one customer, part and quantity tier.

2. The optional formula engine

An Admin switches it on in Configuration › Instance Settings with the Sales pricing engine switch.

Its description there reads: turn on formula-based pricing (raw-material indices, repricing at confirmation and dispatch). While off, prices come from price lists and customer prices only.

Instance Settings screen where an Admin switches the Sales pricing engine on or off.
Instance Settings: the Sales pricing engine switch lives here, alongside the other company-wide switches.

With the engine on, a formula is set up in three steps: record the raw-material rates, write the formula, then assign it to customers and parts.

Step 1: Price indices (raw-material rates)

Open Configuration › Price Indices. An index is a named rate such as a metal price per kg, with a code, name and unit.

Price Indices screen showing each index with its latest rate, rate date, stale-after days and a Stale badge when the rate is too old.
Price Indices: the latest rate, its date, the stale limit and a Stale badge when the rate is too old to use.
Keep rates current. A stale index stops every formula that uses it, so the order or dispatch that needs the price cannot be saved until a fresh rate is added.

Step 2: Pricing formulas

Open Configuration › Pricing Formulas and press New formula. A formula has:

You can add your own parameters (each with a name, label and default value), for example a markup percentage.

Pricing Formulas list with code, name, version, status and the reprice-at-confirm and reprice-at-dispatch columns.
Pricing Formulas: tabs for All, Active, Draft and Retired; each row shows version, status, when it reprices and its tolerance.

What a formula can say

A formula is a calculation written with numbers and names. It works in exact decimals, not approximate ones.

You can useDetails
Arithmetic+ - * / and brackets. Dividing by zero gives an error.
Comparisons and logic< <= > >= == !=, with and, or, not. A true result counts as 1 and false as 0.
Functionsif(test, then, else), min and max (two or more values), round(value, places), ceil, floor, abs.
Raw-material ratesindex("CODE") gives the latest rate on the pricing date. index_on("CODE", date) gives the rate on or before another date, for example order_date - 30 for thirty days earlier. The code goes in quotes.
Built-in valuesbase_price, qty, net_weight, gross_weight, quote_date, order_date, phase_date, lead_days, fx_rate. Dates behave as day numbers, so subtracting two dates gives the number of days between them.
Your parametersAny parameter you define on the formula, by its name.

Things to know:

Two examples, checked against the formula rules:

A formula that adds a raw-material cost would use the index, in the form base_price + net_weight * index("STEEL"), where STEEL is an index code you created.

Use Test bench with two or three realistic quantities before activating. It is the quickest way to catch a wrong bracket.

Step 3: Pricing assignments

A formula does nothing until it is assigned. Open Configuration › Pricing Assignments and add a row with:

Which row wins. Among rows that are in date and match the customer and part, the most specific one is used. The order is:

  1. Customer and part.
  2. Part with a customer tag.
  3. Part only.
  4. Customer only.
  5. Tag only.
  6. All.

An assignment follows the formula code, always using the latest Active version. So when you activate a new version you do not change the assignment.

Pricing Assignments screen listing formula, customer, customer tag, part, overrides, validity and status.
Pricing Assignments: which formula applies to which customer and part, with any parameter overrides.

3. When prices are re-worked

When you save a quotation or order line, the system works out the price in this order of authority:

  1. A quoted price first. No formula is run on it.
  2. The formula price, if the engine is on and an assignment applies.
  3. The base lookup.

Then it marks the source. If the price you typed equals the formula price, the line is marked as formula priced. If it equals the base lookup, it keeps that source. Otherwise it is manual.

Formula-priced lines can be re-worked later, but only if the formula's tick boxes allow it:

WhenWhat happens
Order confirmationOn the day you confirm a Draft order, formula lines are re-priced using that day's index rates. A line that still sits on a quote whose validity has not expired keeps its quoted price. Manual lines are never re-priced. Return orders are not re-priced. Confirming twice does not re-work the same lines again.
DispatchWhen a delivery challan is created, formula lines whose formula has Reprice at dispatch ticked are priced on the challan date. The new price is stored on the challan line. If it is the same as the order price, the challan line simply bills at the order price. Return orders are not re-priced.

If a needed index is stale or missing at either point, the confirmation or dispatch is stopped with a readable message and nothing is saved. Add a fresh index rate and try again.

Tolerance and approval

Each change goes through a price revision. The formula's Tolerance % decides what happens:

What a held line means

When invoicing, an order line that has dispatch-priced challan lines is invoiced one line per challan line, in the order they were dispatched. Held lines are left out until released.

Other lines invoice as before. The Dashboard also has a "Price approvals pending" card.

Editing a Draft order removes its decided revisions from the order; the activity timeline on the order still keeps the record.

Manual prices

If you type a price that differs from what the lookup or formula gave, the line is stamped Manual. You can enter a reason, and the line shows up in the Price Overrides report.

4. Reports

All three are under Accounting in the sidebar and take a From and To date.

ReportWhat it shows
Accounting › Price RevisionsEvery time a line's price was re-worked: date, order, customer, part, phase (quote, order, confirm, dispatch), old and new price, change %, quantity, rupee impact and status (auto, pending, approved, rejected). A footer sums the impact. Filter by phase and status.
Accounting › Price OverridesQuotation and order lines for catalogue parts whose price was typed by hand: document, customer, part, quantity, saved price, the part's own selling price, the difference %, who entered it and the reason.
Accounting › Index RatesFor each raw-material index: how many rates fell in the period, first and latest rate, latest date and change %; plus the individual rates with their date and source.
Price Revisions report with phase and status filters and a list of revisions showing old price and impact.
Price Revisions: filter by phase (Quote, Order, Confirm, Dispatch) and by status, with the net rupee impact at the top.

Use Price Overrides in your monthly review to spot salespeople who regularly type prices instead of using the agreed ones.

5. Who can edit what

ScreenRoles that can open and change it by default
Price Lists, Customer PricesSales, Accounts, Admin
Price IndicesSales, Accounts, Procurement, Admin
Pricing Formulas, Pricing AssignmentsSales, Accounts, Admin
Price Revisions, Price Overrides, Index Rates reportsSales, Accounts, Plant Head, Admin
Sales pricing engine switch (Instance Settings)Admin
Approving a price revisionPlant Head up to Rs 50,000 impact; Admin also above that
An Admin can change who sees which screens, so your sidebar is the final word. Editing a price master needs the matching role even if you can see the page.

Common mistakes

Why is my price blocked? (FAQ)

You seeWhat it means and what to do
"Price index ... is stale"The latest rate is older than the index's stale limit. Add a current rate under Configuration › Price Indices (Procurement, Sales or Accounts can).
"Price index ... has no rate on or before ..."No rate exists yet for that date. Add one dated on or before the document or challan date.
"Price index ... is inactive"Someone switched the index off. Make it active again or change the formula.
A formula error message naming the formula and versionThe expression failed with your inputs, for example a division by zero or a negative price. Fix it in a new version and test it first.
"... price revisions are awaiting approval - get them decided before you confirm this order"A price change beyond tolerance is waiting. Ask the approver (Plant Head, or Admin for larger amounts) to decide it in My Approvals.
Order stays in Draft after you pressed ConfirmConfirmation re-priced a line beyond tolerance and is waiting for approval.
A challan line is not on the invoiceIts dispatch price is waiting for approval, so the line is held from billing. Once approved or rejected it can be invoiced.
"A price revision for this line is already awaiting approval"That line already has one revision pending. Decide it first.
The price chip says ManualThe price you typed differs from the lookup or formula. Retype the suggested price if you did not mean to override, or leave a reason.
The formula price is not usedCheck that the engine is switched on, the formula has an Active version, an assignment covers the customer and part on that date, and a more specific assignment is not winning.
"There is already a price for this ... starting that day"Use a later valid-from date.
"This price has already started. Add a newer price instead of deleting it."Started prices are kept for history. Add a newer row.

Back to Training home, the Sales guide or the Admin guide.