pakdatakit/fbr-invoice
Interfaces
Section titled “Interfaces”| Interface | Description |
|---|---|
| FbrInvoiceItem | One line of an invoice (spec §4.1, items). Amounts are in rupees. |
| FbrInvoice | The invoice body for postinvoicedata and validateinvoicedata (spec §4.1, §4.2). |
| FbrInvoiceTotals | Column totals of an invoice, in rupees. Not sent to FBR. |
| FbrInvoiceBuild | Result of buildFbrInvoice. |
| FbrInvoiceError | One problem found by validateFbrInvoice. |
| FbrInvoiceValidation | Result of validateFbrInvoice. |
| FbrInvoiceValidationOptions | Options for validateFbrInvoice. |
Type Aliases
Section titled “Type Aliases”| Type Alias | Description |
|---|---|
| FbrInvoiceType | invoiceType values in the specification. |
| FbrRegistrationType | buyerRegistrationType values in the specification. |
| FbrInvoiceItemInput | An item for buildFbrInvoice: the tax may be left out. |
| FbrInvoiceInput | Input for buildFbrInvoice. |
Variables
Section titled “Variables”| Variable | Description |
|---|---|
| FBR_DI_SPEC_VERSION | Version of PRAL’s technical specification this module follows. |
Functions
Section titled “Functions”| Function | Description |
|---|---|
| expectedSalesTax | The sales tax FBR expects on a line, in rupees, or null when the rate is not a plain percentage or per-unit amount (spec §7, errors 0102, 0104, 0105): |
| buildFbrInvoice | Builds an FBR digital invoice from your own fields, working out salesTaxApplicable on each line where you leave it out (see expectedSalesTax; uses calculateSalesTax). Lines with a rate that is neither N% nor Rs.N (Exempt, combined rates) get 0 unless you give the tax. |
| validateFbrInvoice | Checks an FBR digital invoice against the rules of PRAL’s specification (v1.12) and Error Message Guide that need no call to FBR, and returns every problem with FBR’s error code. |