This is a custom app for ERPNext, enhancing the standard pricing and discount mechanisms in sales-related documents.
This app provides the following enhancements:
- New pricing option: "Rate from Price List"
Introduced in theRate or Discountfield of Pricing Rule.
When selected, a new fieldRate from Price Listappears, 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 Sellingwith rate100 EUR - One for
Wholesale Sellingwith 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 Sellingprice list - If Qty ≥ 10, the price will be overridden using the rate from the
Wholesale Sellingprice 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_rulesThis 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 installPre-commit is configured to use the following tools for checking and formatting your code:
- ruff
- eslint
- prettier
- pyupgrade
mit