Pak Compliance adds Pakistan FBR digital invoicing workflows to ERPNext. The user-facing app name is Pak Compliance; the technical app/package name used for installation is fbr_e_invoicing.
This app currently covers:
- FBR setup and credential storage
- Sales Invoice and POS Invoice payload generation and submission
- queue-based background processing and submission logs
- Pakistan tax-account and template setup helpers
- FBR print formats
- provincial sales tax reports
- FBR digital invoicing support for both Sales Invoice and POS Invoice
FBR E-Inv Setupwith sandbox and production modes- payload preview from invoice forms through
Show FBR Payload - direct invoice submission through
Post to FBR - bulk Sales Invoice submission from list view through
Submit to FBR - POS auto-submission on submit
- queue-based background processing with
FBR QueueandFBR Logs - Pakistan tax-account, item tax-template, province tax-template, and withholding setup helpers
- provincial sales tax reports
- FBR Sales Invoice and FBR POS Invoice print formats
- Pak Compliance workspace with setup, masters, queue, logs, and report access
Use the branch that matches your Frappe / ERPNext major version.
| Frappe / ERPNext | Git branch |
|---|---|
| Version 15 | version-15 |
| Version 16 | version-16 |
Clone the branch that matches your stack, then install the technical app name fbr_e_invoicing.
# Frappe / ERPNext v15
bench get-app --branch version-15 https://github.com/DeliveryDevs-ERP/Pakistan-Compliance.git
# Frappe / ERPNext v16
bench get-app --branch version-16 https://github.com/DeliveryDevs-ERP/Pakistan-Compliance.git
bench --site <site-name> install-app fbr_e_invoicingAfter installation, run migration if your site already existed:
bench --site <site-name> migrateOn install and migrate, the app provisions the app metadata it ships with, including:
- workspace and navigation entries
- custom fields and client scripts
- FBR setup, queue, log, and master doctypes
- fixtures and setup instructions block
- provincial sales tax reports
- FBR Sales Invoice and FBR POS Invoice print formats
- Pakistan tax-account and tax-template setup hooks
These masters are populated automatically:
- provinces
- FBR sale types
HS Codes and UOMs are not fetched on a fresh install. The sync requires a valid PRAL authorization token, and that token is normally empty until you configure FBR E-Inv Setup. Treat HS Code and UOM fetching as a manual post-setup step through Fetch Master Data.
Open FBR E-Inv Setup from the Pak Compliance workspace and complete the setup in this order:
- Enter
PRAL Authorization Token. - Choose
Mode. - Enter the matching
API Endpoint. - Save the document.
- Click
Fetch Master Data. - Click
Setup Tax Accounts + Templatesif you need to create or backfill Pakistan tax accounts and templates for existing companies.
Mode controls whether the app is working against FBR's sandbox-testing flow or the live production flow.
| Mode | Endpoint to use | Purpose |
|---|---|---|
Sandbox Testing |
https://gw.fbr.gov.pk/di_data/v1/di/postinvoicedata_sb |
test submissions and sandbox payload behavior |
Production |
https://gw.fbr.gov.pk/di_data/v1/di/postinvoicedata |
live submissions to FBR |
Important notes:
- The app does not auto-switch the endpoint for you. The value in
API Endpointmust match the selected mode. Sandbox Testinguses sandbox-specific payload behavior, includingscenarioId.Productionis for real submission and should only be used with the live endpoint and live credentials.
The app adds FBR validation and submission controls to Sales Invoice.
Available actions and behavior:
Show FBR Payloadlets users inspect the payload that will be sent.Post to FBRis available on submitted invoices.- Sales Invoice list view includes a bulk action:
Submit to FBR. - Submission status is reflected on the form through FBR status fields and indicators.
The app adds FBR validation and POS submission behavior to POS Invoice.
Available actions and behavior:
Show FBR Payloadlets users inspect the POS payload.- on submit, the app automatically submits or queues the POS invoice for FBR processing
Post to FBRis available for submitted invoices in failure or retry states- submission status is reflected on the form through FBR status fields and indicators
POS is not auto-submitted on save. The automatic flow happens on submit.
The operational doctypes are available from the Pak Compliance workspace:
FBR QueueFBR Logs
Queue processing runs through the scheduler. The shipped scheduler event processes the FBR queue every 15 minutes.
The app includes Pakistan-specific setup helpers and data for:
- tax accounts
- item tax templates
- province-specific tax charge templates
- withholding defaults
Use Setup Tax Accounts + Templates from FBR E-Inv Setup when you need to create or backfill this data for existing Pakistan companies.
The app ships and exposes these main records and masters:
FBR E-Inv SetupFBR QueueFBR LogsHS CodeFBR Sale TypeProvince
The workspace also links to standard UOM records because they are part of the FBR master-data workflow.
The app ships provincial sales tax reports for:
- Punjab
- Sindh
- KPK
- Balochistan
- Capital Territory
- Gilgit Baltistan
- Azad Jammu and Kashmir
The app ships these print formats:
FBR Sales InvoiceFBR POS Invoice
- If
Fetch Master Datafails, verify thatPRAL Authorization Token,Mode, andAPI Endpointare all set correctly and match each other. - If you are using
Sandbox Testing, make sure you are using the sandbox endpoint. If you are usingProduction, make sure you are using the live endpoint. - Do not expect HS Codes and UOMs to appear on a clean install until credentials are configured and
Fetch Master Datahas been run successfully. - If queue items stay pending, remember that scheduled processing runs every 15 minutes.
- If you are updating an existing site, run
bench --site <site-name> migrateafter pulling the new code.
- a dedicated operational dashboard with a route/UI, real-time stats, queue counts, and recent activity
- richer retry-policy controls such as priority-based processing, configurable retry limits, and backoff strategy controls
- user-facing alerts and notification workflows
- GitHub repository:
https://github.com/DeliveryDevs-ERP/Pakistan-Compliance - user-facing name:
Pak Compliance - technical install name:
fbr_e_invoicing
This project is licensed under the MIT License. See license.txt.