---
title: "Discussion on \"PO Numbers, Net Terms, and Late Payment Clauses in a Multi-Region Invoice Generator — TypeScript and pdf-lib\" | Hashnode"
description: "Discussion on \"PO Numbers, Net Terms, and Late Payment Clauses in a Multi-Region Invoice Generator — TypeScript and pdf-lib\". How we extended a browser-rendered invoice tool with UK VAT Exempt, Sort Code bank details, Net Terms date arithmetic, and late payment clause text using TypeScript and pdf-lib"
url: "https://hashnode.com/posts/po-numbers-net-terms-and-late-payment-clauses-in-a-multi-region-invoice-generator-typescript-and-pdf-lib/69f9598946610fd60653578e"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [PO Numbers, Net Terms, and Late Payment Clauses in a Multi-Region Invoice Generator — TypeScript and pdf-lib](https://ultimatetools.hashnode.dev/po-numbers-net-terms-and-late-payment-clauses-in-a-multi-region-invoice-generator-typescript-and-pdf-lib?utm_source=hashnode&utm_medium=feed)

How we extended a browser-rendered invoice tool with UK VAT Exempt, Sort Code bank details, Net Terms date arithmetic, and late payment clause text using TypeScript and pdf-lib

May 5 · 8 min read · ultimatetools.hashnode.dev  
Read the article

-   [#typescript](https://hashnode.com/tag/typescript)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#web-development](https://hashnode.com/tag/web-development)
-   [#nextjs](https://hashnode.com/tag/nextjs)

## Written by

[Shaishav Patel](https://hashnode.com/@shaishavap)

@shaishavap · Mumbai, India

  
[View profile](https://hashnode.com/@shaishavap)

## Responses 1

Markdown supported · ⌘↵ to post

[TrueNorth API](https://hashnode.com/@m1s4gh)

[Oct 6](https://hashnode.com/posts/po-numbers-net-terms-and-late-payment-clauses-in-a-multi-region-invoice-generator-typescript-and-pdf-lib/69f9598946610fd60653578e/comment/6ac53e87059c640f62caeb79)

Good topic. One thing that bites invoice generators hard on the Canada leg is that the tax depends on the buyer's province and on what the product is, so the same line item can total differently on two invoices that look identical. Manitoba is a good example. Groceries are 5 percent GST only while general merchandise is 5 percent GST plus 7 percent RST, so a category error quietly changes the total. Quebec has its own quirk. The QST is calculated on the price before GST is applied, not on the GST inclusive amount, so adding the two rates together overstates the tax. When a buyer in Ontario gets a 13 percent HST total on an invoice from a seller in Alberta, support tickets follow if the invoice does not show the breakdown. TrueNorth API has a calculate tax endpoint that covers all 13 provinces and territories with 41 product tax categories, which fits this use case well since you can resolve the tax per line item before the PDF renders.
