payment_terms v1
The day a commercial invoice falls due when no day was agreed: the last day of the 30 days beginning with the day the buyer had the invoice. As this module reads the Late Payment of Commercial Debts (Interest) Act 1998, section 4(2A) and (2H); it says nothing of how the law is read
- File
payment_terms.cal(dates payment_terms v1, sha256:44ffa0c627623eb3)- koyomi
- 0.56.0
koyomi 0.56.0 made this page by checking the files above. If a file's digest is no longer what it says here, the page is out of date.
Every date computes on all 730 days of invoiced (2026-01-01..2027-12-31); 2 examples match.
How the dates are computed
Each date, operation by operation from the top, in words. The code after each is the line as the .cal writes it (# starts a comment).
due
From invoiced, in this order:
29 days later
+ 29 days # the last of the 30 days
What was checked
Every date was computed, and every claim checked, on all 730 days of invoiced (2026-01-01..2027-12-31).
The file states no claims.
Days a month does not have
No operation of this file can land on a day its month does not have, such as 30 February.
Edge cases
Inputs koyomi picked from the range: month ends, closed days and the days around them, inputs that land on a missing day, the least room a claim has, and so on. Each row is the first input the check computed of those that do what its last column says.
| invoiced | due | Why |
|---|---|---|
| 2026-01-31 Sat | 2026-03-01 Sun | invoiced is the 31st, the end of its month |
| 2026-02-28 Sat | 2026-03-29 Sun | invoiced is 28 February, the end of the month in a year that is not a leap year |
| 2026-04-30 Thu | 2026-05-29 Fri | invoiced is the 30th, the end of its month |
Examples
The rows the .cal writes under examples, and what the computation gives.
| invoiced | → due | Result |
|---|---|---|
| 2026-03-02 Mon | 2026-03-31 Tue | matches |
| 2027-12-31 Fri | 2028-01-29 Sat | matches |
Calendar
The file reads no calendar, so no day is closed.
Month by month
The inputs and the dates computed from them fall in the 25 months of 2026-01..2028-01. Only the 5 months that hold an input a claim fails on, or an edge case's input or dates, are shown; 20 are left out.
- ◆the input day of an edge case
| Mon | Tue | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | 31 |
| Mon | Tue | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 |
| Mon | Tue | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 | 31 |
| Mon | Tue | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 30 |
| Mon | Tue | Wed | Thu | Fri | Sat | Sun |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |