Sales Tax - Pakistan - MRP

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

  1. Two price lists per item:

    • MRP price list → 236 (used as invoice rate base for discount calculation)
    • MRP Base price list → 200 (used exclusively for ST calculation)
  2. Sales Taxes and Charges Template:

    • Charge Type = Actual (since ST is on MRP base, not on invoice net total)
    • Account Head = Sales Tax Payable
  3. Hidden custom field custom_st_base on Sales Invoice Item to store fetched MRP Base per row

  4. Client Script on Sales Invoice that:

    • On item_code trigger: fetches MRP Base rate from MRP Base price list via frappe.client.get_value
    • Stores it in custom_st_base on 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
  5. Invoice price list set to MRP so ERPNext shows MRP as rate, discount % applied to derive trade price


Questions

  1. Is Charge Type = Actual with a Client Script the recommended approach for 3rd Schedule ST in v16, or is there a cleaner native method I am missing?

  2. 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?

  3. 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?

  4. Are there any known issues or breaking changes in ERPNext v16 that affect Client Scripts on tax calculation or calculate_taxes_and_totals?

  5. 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.

HI @Hussain_Shabbir

The FMCG based secondary sales market pricing mechanism requires high customization based on items, item groups, territory and some other factors where ordering, warehousing and invoices controls are different than simple ones existing in ERPNext.

Some server and client side scripts are not going to serve the purpose as secondary sales distribution and invoicing along with pricing controls and warehousing requires heavy custom handling.

Thank you for the insight.