Apply Pricing Rules
A Pricing Rule changes the price in a sales or purchase transaction when the transaction meets its conditions. The rule can:
- replace the price list rate with a fixed rate
- give a discount as a percentage or an amount
- add a margin to the rate
- add a free item
Conditions can be the Item, Item Group, or Brand; the customer or supplier; the quantity or amount; the dates; the warehouse; the company; and the currency. ERPNext checks the rules each time you add an Item to a transaction or change a row.
Use a Pricing Rule for an exception that repeats. For a one-time change, enter the discount in the transaction. For a campaign with several quantity or amount slabs, use a Promotional Scheme. It creates the Pricing Rules for you.
For every field of the Pricing Rule form, see the Pricing Rule fields reference.
Prerequisites
- The Items, Item Groups, or Brands that the rule covers.
- The customers, suppliers, or groups that the rule is for.
- The price list the rule applies to, if any.
- Look for other active Pricing Rules for the same Items and parties. Decide which rule must win before you start.
Create a Pricing Rule
- Open the Pricing Rule list and select Add Pricing Rule.
- Enter a Title that names the offer and the audience, for example
Wholesale 5% on laptops. - In Apply On, select what the rule checks: Item Code, Item Group, Brand, or Transaction (the whole document).
- In Price or Product Discount, select Price for a rate, discount, or margin. Select Product to add a free item.
- Add the Items, Item Groups, or Brands to the table. Skip this step for Transaction.
- Under Party Information, select Selling, Buying, or both.
- Optionally, limit the rule to one party in Applicable For: Customer, Customer Group, Territory, Sales Partner, Campaign, Supplier, or Supplier Group. Then select the party.
- Under Quantity and Amount, set Min Qty and Max Qty, or Min Amt and Max Amt. A
0maximum means no upper limit. - Under Period Settings, set Valid From, Valid Up To, Company, and Currency.
- Enter the result of the rule. See Give a special rate or discount or Give a free item.
- Save the Pricing Rule. It applies to new transactions immediately.
Give a special rate or discount
With Price or Product Discount set to Price, set Rate or Discount under Price Discount Scheme:
- Rate: replaces the price list rate with the Rate in the rule.
- Discount Percentage: reduces the price list rate by a percentage.
- Discount Amount: reduces the price list rate by a fixed amount in the rule currency.
For a percentage or amount discount, you can set For Price List. The rule then applies only to transactions that use that price list. The price list currency must be the rule currency.
For a rule that applies on Transaction, select Apply Discount On: Grand Total or Net Total.
To add a margin instead of a discount, set Margin Type (Percentage or Amount) and Margin Rate or Amount under Margin. Learn more about adding a margin.
A Pricing Rule does not change the Item Price. Transactions that do not meet the rule still get the normal price.
Give a free item
With Price or Product Discount set to Product, fill in Product Discount Scheme:
- To give more of the same Item, select Same Item, for example for "buy 2, get 1 free". To give a different Item, clear Same Item and select the Free Item.
- Enter the free Qty and its UOM.
- Enter the Free Item Rate. If it is
0, the item is free. - Optionally, select:
- Round Free Qty: rounds a free quantity that is a fraction.
- Don't Enforce Free Item Qty: lets users reduce or remove the free item in the transaction, for example when stock is short.
- Is Recursive: gives the free quantity again for every Recurse Every quantity, for example buy 1 get 1, buy 2 get 2.
For a full example, see Set up a Buy 1 Get 1 Free Pricing Rule.
Combine the quantity of several Items
By default, ERPNext checks the quantity and amount of each row alone. Select Mixed Conditions to add up the rows of all Items in the rule before it checks Min Qty or Min Amt.
Select Is Cumulative to add up the quantity and amount of earlier transactions in the rule's date range. The rule applies to the transaction that crosses the threshold, not to the earlier transactions. Is Cumulative needs both Valid From and Valid Up To.
Check that the rule works
- Create a transaction that the rule covers, for example a Quotation, Sales Order, Sales Invoice, or Purchase Order.
- Set the party, company, currency, price list, and date that the rule needs.
- Add an Item that the rule covers, with a quantity or amount in the rule's range.
- Check the rate, the discount, or the free item row.
To skip all Pricing Rules in one transaction, select Ignore Pricing Rule in its Currency and Price List section. Use it only for an approved exception.
Control overlapping rules
When two or more rules match the same row, ERPNext:
- Keeps the rules in the transaction currency.
- Keeps the rules with the highest Priority. A higher number wins.
- For discount percentage rules, keeps the rules for the transaction price list.
- Stops with an error if more than one rule is left.
To let rules add up instead, select Apply Multiple Pricing Rules on each of them in the Advanced Settings tab. Select Apply Discount on Discounted Rate as well to apply each discount to the rate after the previous discount, instead of adding the percentages.
Disable a Pricing Rule
Select Disable. ERPNext keeps the rule and its history but stops applying it. To use it again, clear Disable, then check the dates and conditions.
Troubleshooting
| Problem or message | Cause | Fix |
|---|---|---|
| The rule does not apply | A condition is not met. | Check Disable, Selling or Buying, the Items, the party, the quantity and amount, the dates, the company, the currency, the warehouse, and the price list. Then remove the row and add it again. |
| The discount disappears after you change the order | The new quantity, amount, party, date, or price list no longer meets the rule. | Check the conditions against the new values. |
| A free item comes back after you remove it | ERPNext enforces the free quantity. | Select Don't Enforce Free Item Qty in the rule. |
| A cumulative rule does not apply | The total of the date range is below the threshold, or a condition is not met. | Check Min Amt, Max Amt, the dates, the party, and the Item. |
| Multiple Price Rules exists with same criteria, please resolve conflict by assigning priority. | Two or more rules match with the same priority. | Select Has Priority and set a different Priority on the rules, or select Apply Multiple Pricing Rules. |
| At least one of the Selling or Buying must be selected | Both checkboxes are clear. | Select Selling, Buying, or both. |
| Selling must be checked, if Applicable For is selected as Customer | Applicable For names a sales party, but Selling is clear. | Select Selling. For a supplier party, select Buying. |
Max discount allowed for item: <item> is <n>% | The discount is above the Max Discount (%) of the Item. | Lower the discount, or raise the Item's limit. |
| Valid from and valid upto fields are mandatory for the cumulative | Is Cumulative is selected without both dates. | Set Valid From and Valid Up To. |
Common questions
Can one rule cover all Items? Yes. Apply it on Item Group with the top group, such as All Item Groups, or apply it on Transaction. Limit a broad rule by party, dates, or amount.
Can a rule be for one customer only? Yes. Select Selling, set Applicable For to Customer, and select the customer.
Pricing Rule or Promotional Scheme? Use a Pricing Rule for one condition and one result. Use a Promotional Scheme for several quantity or amount slabs.