This is a custom app for ERPNext, enhancing the standard pricing and discount mechanisms in sales-related documents.
This app provides the following enhancements:
-
"Ignore Pricing Rules" checkbox
Added at the Item level in the following documents:- Quotation
- Sales Order
- Sales Invoice
- Delivery Note
When checked, pricing rules will be bypassed for that specific item.
-
New pricing option: "Rate from Price List"
Introduced in theRate or Discount
field of Pricing Rule.
When selected, a new fieldRate from Price List
appears, allowing the user to choose a specific Price List from which the item price should be fetched directly.
These improvements allow greater flexibility when applying pricing rules, overriding them per item and selectively using custom price lists.
This example demonstrates how to configure a dynamic pricing rule that fetches the rate from a specific price list when a quantity threshold is met.
-
Create Price List:
Standard Selling
- Go to Selling > Price List
- Click Add Price List
- Set:
- Price List Name:
Standard Selling
- Selling: ✔️
- Currency: e.g.,
EUR
- Price List Name:
- Save
-
Create Price List:
Wholesale Selling
- Repeat the steps above
- Set Price List Name:
Wholesale Selling
-
Create an Item
- Go to Stock > Item
- Click Add Item
- Set:
- Item Code:
ITEM-001
- Item Name:
Example Product
- Item Code:
- Save
-
Add Item Prices
- Go to Stock > Item Price
- Create two records:
- One for
Standard Selling
with rate100 EUR
- One for
Wholesale Selling
with rate80 EUR
- One for
-
Create a Pricing Rule
- Go to Selling > Pricing Rule
- Click Add Pricing Rule
- Set:
- Apply On:
Item Code
- Item Code:
ITEM-001
- Min Qty:
10
- Rate or Discount:
Rate from Price List
- Rate from Price List:
Wholesale Selling
- Apply On:
- Save and Submit
When adding ITEM-001
to a Sales Order:
- If Qty < 10, the price will be taken from the
Standard Selling
price list - If Qty ≥ 10, the price will be overridden using the rate from the
Wholesale Selling
price list
This allows you to define quantity-based pricing logic that pulls directly from different price lists.
You can install this app using the bench CLI:
cd $PATH_TO_YOUR_BENCH
bench get-app $URL_OF_THIS_REPO --branch develop
bench install-app advanced_pricing_rules
This app uses pre-commit
for code formatting and linting. Please install pre-commit and enable it for this repository:
cd apps/advanced_pricing_rules
pre-commit install
Pre-commit is configured to use the following tools for checking and formatting your code:
- ruff
- eslint
- prettier
- pyupgrade
mit