buildFbrInvoice
function buildFbrInvoice(input): | FbrInvoiceBuild | null;Defined in: fbr-invoice.ts:257
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.
salesTaxWithheldAtSource, totalValues and
fixedNotifiedValueOrRetailPrice default to 0, and invoiceRefNo and
buyerNTNCNIC to "", as in FBR’s samples. Nothing else is filled in or
changed; check the result with validateFbrInvoice.
Also returns column totals, which are for your own records: the specification has no invoice-level totals.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
input |
FbrInvoiceInput |
Returns
Section titled “Returns”| FbrInvoiceBuild
| null
The invoice and totals, or null if input is not an object
with an items array. Never throws.