Functional Weave
Code in Python

finance.tax.vat-rate@1.2.1

README.md

1,364 bytes · view raw

# finance.tax.vat-rate

The rate is not a constant in the code. It is a dated row in
data/vat-rules.json, and the lookup takes the date of supply.

That is the difference between a system that can still reprint a 2009 invoice
correctly and one that silently reprints it at today's rate. UK VAT was 15% in
2009, 17.5% in 2010 and 20% since 2011; UK hospitality was 5% for part of the
pandemic; and the Irish tourism rate has moved between 9% and 13.5% four times
since 2011.

When a rate changes, publish a new version of this capability's data.
Application code does not change at all - that is what 1.1.0 is: 1.0.0 plus the
Irish hospitality history, no implementation change. And 1.2.0 is 1.1.0 plus
Ireland's temporary 21% standard rate from 1 September 2020 to 28 February
2021, which 1.1.0 missed (source: Revenue, "Current VAT rates",
https://www.revenue.ie/en/vat/vat-rates/search-vat-rates/current-vat-rates.aspx).

This version also declares its effective-date columns, so a project can install
`history=current` and ship only the rules still in force. A build that does will
refuse a date before its horizon rather than answer it with today's rate.

1.2.1 fixes Python accepting a trailing newline or non-ASCII digits in onDate, and names the parameter `onDate` in the malformed-date error in every language (Python and Rust said `on_date`); adds tests.