Functional Weave
Code in Rust

energy.climate-change-levy@1.0.2

README.md

3,117 bytes · view raw

# energy.climate-change-levy

The Climate Change Levy (CCL) a supplier adds to a business energy bill:

```
levy = quantity x main rate for the commodity on the date of supply
```

Electricity and gas are charged per kWh; LPG and "any other taxable
commodity" (coal, coke, petroleum coke) per kg. The rates are dated data from
HMRC, from 1 April 2023 to the rates already announced for 1 April 2027.

## Qualifying use: the domestic and de minimis exclusion

CCL does not apply to supplies for **domestic use** or **charity non-business
use**, and supplies small enough to be **de minimis** are excluded too. Those
are the same supplies that get VAT at the reduced 5% rate as "qualifying use"
(VAT Notice 701/19): for a business, up to an average of 33 kWh a day (1,000
kWh a month) of electricity, or 145 kWh a day (4,397 kWh a month) of piped
gas. Pass `qualifyingUse: true` for any of these and the result has
`excluded: true` and a zero levy; the rate is still returned, so a bill can
show which rate it did not charge. Deciding whether a supply qualifies
(including the 60% mixed-use rule) is the caller's, because it depends on
the customer, not the kWh alone.

## Units and rounding

- Quantities are integers in **thousandths** of the unit (watt-hours or
  grams), so part-units are exact.
- Rates are integers in **thousandths of a penny** per unit, exactly the five
  decimal places of pounds HMRC publishes (£0.00775 per kWh is `775`).
- The levy is rounded once to a whole penny by `mode` (suppliers usually
  round half-up per bill). Quantity times rate must stay within 2^53.

## Not covered

- **Reduced rates for climate change agreement holders** (a percentage
  discount off the main rate: 92% for electricity, 89% for gas from April
  2024) — apply the discount to the result if the site holds a CCA.
- **Carbon Price Support rates** paid by generators.
- Supplies spanning a rate change on 1 April: split the quantity by date and
  call once per part.

## Dates and pruning

Each rate applies from `validFrom` to `validTo` inclusive; the latest has a
null `validTo`. A build installed with `history=current` keeps only rates
still in force, and a date before the earliest surviving rate is refused with
an explanation rather than charged at a newer rate.

## Sources

- HMRC, "Climate Change Levy rates",
  https://www.gov.uk/guidance/climate-change-levy-rates (main rates from
  1 April 2023, 2024, 2025, 2026 and 2027; last updated 27 November 2025).
- HMRC, "VAT on fuel and power (VAT Notice 701/19)",
  https://www.gov.uk/guidance/vat-on-fuel-and-power-notice-70119 (paragraph
  2.8: the levy does not apply to domestic or charity non-business use, and
  de minimis supplies are excluded; paragraphs 4.2 and 5.2: the de minimis
  limits).

1.0.1 fixes Python accepting a trailing newline or non-ASCII digits in onDate; adds tests.

## Notices

Contains public sector information licensed under the Open Government
Licence v3.0 (https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/).

1.0.2 adds its attribution notices (NOTICE). The code and the tests are unchanged.