Pakistan Payroll Withholding Tax Pro - Advanced Tax Slabs & Fiscal Year Engine
by Ayyan Saddiqui https://ayyan420.github.io/ayyan-saddiqui-senior-software-engineer-portfolio/$ 39.71
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Discuss (mail)
• Employees (hr) • Payroll (hr_payroll) • Employee Contracts (hr_contract) |
| Lines of code | 695 |
| Technical Name |
payroll_withholding_tax_pk |
| License | LGPL-3 |
| Website | https://ayyan420.github.io/ayyan-saddiqui-senior-software-engineer-portfolio/ |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Discuss (mail)
• Employees (hr) • Payroll (hr_payroll) • Employee Contracts (hr_contract) |
| Lines of code | 695 |
| Technical Name |
payroll_withholding_tax_pk |
| License | LGPL-3 |
| Website | https://ayyan420.github.io/ayyan-saddiqui-senior-software-engineer-portfolio/ |
Odoo 17 Payroll • Automated Tax Slabs • Fiscal Year Logic
Pakistan Payroll Withholding Tax Pro
Multi-tier progressive tax engine for Odoo 17 HR. Handles fiscal year (July–June), medical allowance deduction, monthly projections, and complete payslip audit trail.
📞 Purchase & Direct Support — Ayyan Saddiqui
WhatsApp: +92 316 4705102 | Call: 0316 4705102 | Email: ayyansaddiqui420@gmail.com
🔗 https://github.com/Ayyan420/ayyan-saddiqui-senior-software-engineer-portfolio | github.com/ayyan420
Complete Withholding Tax Control
Manage tax slabs, preview yearly projections, and let Odoo auto-calculate monthly deductions based on fiscal year rules.
Slab assignment & yearly income preview
Tax slabs FY 2026-27 & medical allowance toggle
Progressive Tax Slabs with Threshold & Variable %
Configure unlimited brackets: lower amount, upper amount, fixed amount, threshold, and variable rate. Perfect for income tax models (e.g., Pakistan, India, or custom fiscal regimes).
Easy editable tax brackets – lower/upper, fix amount, and dynamic variable %
- ✔️ 6 built-in demo slabs (Category 1 – Category 6) covering up to 999M income
- ✔️ "Threshold" logic: tax = fix_amount + (salary - threshold) * variable%
- ✔️ Medical allowance deduction before tax calculation (toggle)
- ✔️ Real-time chat & activity tracking on tax configuration changes
Smart Fiscal Year Projection (July–June)
Automatically aggregates previous payslips from current fiscal year, estimates remaining months using contract salary, and applies correct tax slab on pro-rata basis.
Payslip July 2026: Gross 127,630, Withholding tax -421.82 based on projected yearly income
- 📆 Detects current month (July 2026) -> fiscal year 2026-27 starts Jul 1
- 📊 Sums up previous months (July only if first month, plus historical done/paid payslips)
- 🔮 Estimates missing months (Aug 2026 – Jun 2027) using basic monthly wage
- 🧾 Tax for year = fix + (projected_annual - threshold)*var% → then divided by remaining months
Native Payslip Integration – Withholding Tax Tab
Each payslip shows the exact slab applied, annual projected salary, medical allowance, and calculated tax. Full transparency for HR and employee.


- ✅ "Withholding Tax (Slab)" page inside payslip form, visible only when tax line exists
- ✅ Custom salary rule type: "Compute From Withholding Tax Slabs" → calls tax engine
- ✅ Audit: Medical allowance, yearly salary, tax applied, slab name, thresholds stored per payslip
- ✅ Works with payslip editing wizard: re-computes tax after manual line edits
Flexible Salary Rule & Editable Structure
Add a "Withholding Tax" deduction rule, set amount type to 'Compute From Withholding Tax Slabs', and Odoo automatically invokes the progressive tax calculator.
Rule "Withholding Tax" uses new amount selection 'based_on_wht' — fully integrated.
📋 Example Tax Slabs (FY 2026-27)
| Slab Name | Lower (Rs) | Upper (Rs) | Fix Amount | Threshold | Variable % |
|---|---|---|---|---|---|
| Category 1 | 0 | 600,000 | 0 | 0 | 0% |
| Category 2 | 600,001 | 1,200,000 | 0 | 600,000 | 2.5% → 1% * |
| Category 3 | 1,200,001 | 2,400,000 | 15,000 | 1,200,000 | 12.5% |
| Category 4 | 2,400,001 | 3,600,000 | 165,000 | 2,400,000 | 22.5% |
| Category 5 | 3,600,001 | 6,000,000 | 435,000 | 3,600,000 | 27.5% |
| Category 6 | 6,000,001 | 100,000,000 | 1,095,000 | 6,000,000 | 35% |
*customizable via 'payroll.withholding.tax.line' model – supports any progressive regime.
Complete UI Walkthrough













🔧 Developer & Technical Highlights (Odoo 17)
- ✓ Models:
payroll.withholding.tax,payroll.withholding.tax.line - ✓ Override
hr.salary.rule._compute_rulefor 'based_on_wht' type - ✓ Fiscal year helper: July–June projection engine
- ✓
hr.payslipextension with one2many tax lines - ✓ Medical allowance toggle: deduct 10% before tax if enabled
- ✓ Tracking & chatter integration on tax slabs
- ✓ Access rights via CSV + group_user / hr_payroll manager
- ✓ 100% Owl 18 compatible views, no monkey-patch risk
✔️ Compatible with Odoo 17 EE. ✔️ Handles retroactive payslip recomputation. ✔️ Dynamic remaining month estimation.
ENTERPRISE READY • LIFETIME LICENSE
Pakistan Payroll Withholding Tax Pro
One-time payment, free updates for Odoo 17.x, and priority support.
Delivery within 24h after payment. Customizations available upon request.
© 2026 Ayyan Saddiqui – Senior Odoo Engineer. Withholding Tax Module v1.0 for Odoo 17. Fully compatible with hr_payroll and fiscal year projections.
⚙️ Screenshots reflect actual module behavior: slab configuration, payslip withholding tax lines, and monthly deduction examples.
Please log in to comment on this module