Introduction & Overview
This document explains what the Digital Invoicing app does and how it fits into
an ERPNext v15 deployment.
Scope
The app integrates ERPNext with Pakistan FBR services for:
- Digital Invoicing for sales invoices
- Digital Invoicing for purchase invoices
- POS Fiscalization
- buyer registration verification through STATL
- reference data synchronization from FBR
- QR code generation for posted invoices
Runtime Dependencies
- Frappe Framework v15
- ERPNext v15
- Python 3.10+
- valid FBR bearer tokens for DI, STATL, reference sync, and optionally POS
Required App Relationship
di declares erpnext as a required app and extends ERPNext doctypes such as:
Sales InvoicePurchase InvoiceSales Invoice ItemPurchase Invoice ItemCustomerSupplierCompanyItemPOS ProfileMode of PaymentSales Taxes and Charges
Main Building Blocks
Configuration
The central company-level configuration doctype is DI Settings.
It stores:
- whether DI is enabled
- sandbox or production mode
- automatic posting behavior
- DI bearer token
- POS fiscal configuration
- company NTN/CNIC and address information
- allowed sale types
- sandbox scenarios
Master and Reference Data
The app maintains FBR-facing reference doctypes:
ProvinceHS CodeHS UomSale TypeTransaction TypeSRO ScheduleSRO ItemSandbox Scenario
These are seeded from fixtures and can be refreshed from FBR APIs.
Audit Trail
Every external interaction is logged to DI Log, including:
- API type
- target document
- payload
- response
- FBR invoice number
- error code
- error message
Last updated 3 hours ago
Was this helpful?