Pakistan 3rd Schedule Sales Tax — Auto Calculation on MRP Base with Customer Discount | ERPNext v16
ERPNext Version: v16
Module: Sales (Sales Invoice, Sales Order)
Country: Pakistan
Business Requirement
Under the 3rd Schedule of Pakistan Sales Tax Act, Sales Tax is levied on the Maximum Retail Price (MRP) printed on product packaging — not on the trade/invoice price charged to the retailer.
Our per-unit pricing structure:
| Field | Value | Logic |
|---|---|---|
| MRP (printed on pack) | 236 | Fixed on packaging |
| MRP Base (ex-ST) | 200 | MRP ÷ 1.18 |
| Sales Tax @ 18% | 36 | MRP Base × 18% |
| Trade price to retailer | 180 | MRP minus trade discount |
| Trade discount on MRP | 23.73% | (236 − 180) ÷ 236 |
Invoice example (20 qty):
- Trade amount: 20 × 180 = 3,600
- Sales Tax: 20 × 36 = 720
- Grand Total = 4,320
Key point: ST is always 36/unit regardless of discount given to retailer. Discount affects trade price only — not FBR liability.
What I Have Implemented
-
Two price lists per item:
MRPprice list → 236 (used as invoice rate base for discount calculation)MRP Baseprice list → 200 (used exclusively for ST calculation)
-
Sales Taxes and Charges Template:
- Charge Type =
Actual(since ST is on MRP base, not on invoice net total) - Account Head = Sales Tax Payable
- Charge Type =
-
Hidden custom field
custom_st_baseon Sales Invoice Item to store fetched MRP Base per row -
Client Script on Sales Invoice that:
- On
item_codetrigger: fetches MRP Base rate fromMRP Baseprice list viafrappe.client.get_value - Stores it in
custom_st_baseon the row - Calculates total ST = sum of (
custom_st_base × 18% × qty) across all rows - Updates the Actual tax row amount and triggers
calculate_taxes_and_totals
- On
-
Invoice price list set to
MRPso ERPNext shows MRP as rate, discount % applied to derive trade price
Questions
-
Is
Charge Type = Actualwith a Client Script the recommended approach for 3rd Schedule ST in v16, or is there a cleaner native method I am missing? -
Is maintaining two separate price lists (MRP and MRP Base) the best practice for this scenario, or is it better to store MRP Base as a custom field directly on the Item master?
-
Will this Client Script approach carry forward correctly through the Sales Order → Delivery Note → Sales Invoice workflow, or will the ST calculation need to be re-triggered at each stage?
-
Are there any known issues or breaking changes in ERPNext v16 that affect Client Scripts on tax calculation or
calculate_taxes_and_totals? -
Would a Server Script (on_submit or validate hook) be more reliable than a Client Script for this use case?
Would really appreciate input from anyone who has implemented 3rd Schedule Sales Tax in ERPNext for a Pakistan-based manufacturer or FMCG company. Happy to share the full client script if useful for others.
Thank you.