[ {"name": "a domestic electricity month at the January 2026 cap rates less VAT, 5% VAT, no levy", "args": [{"fuel": "electricity", "openingRead": {"date": "2026-01-01", "value": 12000}, "closingRead": {"date": "2026-01-31", "value": 12350}, "meterDigits": 5, "gasUnit": null, "calorificValue": null, "unitRate": 26371, "standingCharge": 52143, "qualifyingUse": true, "vatCategory": "REDUCED"}, "half-up"], "expect": {"units": 350, "wattHours": 350000, "days": 30, "energyCharge": {"minor": 9230, "currency": "GBP"}, "standingCharge": {"minor": 1564, "currency": "GBP"}, "climateChangeLevy": {"minor": 0, "currency": "GBP"}, "net": {"minor": 10794, "currency": "GBP"}, "vat": {"minor": 540, "currency": "GBP"}, "vatBasisPoints": 500, "total": {"minor": 11334, "currency": "GBP"}}}, {"name": "the same bill rounding its lines down; VAT still rounds half-up", "args": [{"fuel": "electricity", "openingRead": {"date": "2026-01-01", "value": 12000}, "closingRead": {"date": "2026-01-31", "value": 12350}, "meterDigits": 5, "gasUnit": null, "calorificValue": null, "unitRate": 26371, "standingCharge": 52143, "qualifyingUse": true, "vatCategory": "REDUCED"}, "down"], "expect": {"units": 350, "wattHours": 350000, "days": 30, "energyCharge": {"minor": 9229, "currency": "GBP"}, "standingCharge": {"minor": 1564, "currency": "GBP"}, "climateChangeLevy": {"minor": 0, "currency": "GBP"}, "net": {"minor": 10793, "currency": "GBP"}, "vat": {"minor": 540, "currency": "GBP"}, "vatBasisPoints": 500, "total": {"minor": 11333, "currency": "GBP"}}}, {"name": "a business electricity month: CCL at 0.801p/kWh and 20% VAT on top of it", "args": [{"fuel": "electricity", "openingRead": {"date": "2026-04-01", "value": 50000}, "closingRead": {"date": "2026-05-01", "value": 52000}, "meterDigits": 5, "gasUnit": null, "calorificValue": null, "unitRate": 25000, "standingCharge": 60000, "qualifyingUse": false, "vatCategory": "STANDARD"}, "half-up"], "expect": {"units": 2000, "wattHours": 2000000, "days": 30, "energyCharge": {"minor": 50000, "currency": "GBP"}, "standingCharge": {"minor": 1800, "currency": "GBP"}, "climateChangeLevy": {"minor": 1602, "currency": "GBP"}, "net": {"minor": 53402, "currency": "GBP"}, "vat": {"minor": 10680, "currency": "GBP"}, "vatBasisPoints": 2000, "total": {"minor": 64082, "currency": "GBP"}}}, {"name": "a domestic gas month on a metric meter at 39.5 MJ/m\u00b3", "args": [{"fuel": "gas", "openingRead": {"date": "2025-10-01", "value": 4500}, "closingRead": {"date": "2025-10-31", "value": 4600}, "meterDigits": 5, "gasUnit": "cubic-metres", "calorificValue": 39500, "unitRate": 5990, "standingCharge": 32410, "qualifyingUse": true, "vatCategory": "REDUCED"}, "half-up"], "expect": {"units": 100, "wattHours": 1122063, "days": 30, "energyCharge": {"minor": 6721, "currency": "GBP"}, "standingCharge": {"minor": 972, "currency": "GBP"}, "climateChangeLevy": {"minor": 0, "currency": "GBP"}, "net": {"minor": 7693, "currency": "GBP"}, "vat": {"minor": 385, "currency": "GBP"}, "vatBasisPoints": 500, "total": {"minor": 8078, "currency": "GBP"}}}, {"name": "a business gas month on an imperial meter that rolled over, at the 2023 gas levy rate", "args": [{"fuel": "gas", "openingRead": {"date": "2024-03-01", "value": 9990}, "closingRead": {"date": "2024-03-31", "value": 10}, "meterDigits": 4, "gasUnit": "hundreds-cubic-feet", "calorificValue": 39000, "unitRate": 4000, "standingCharge": 30000, "qualifyingUse": false, "vatCategory": "STANDARD"}, "half-up"], "expect": {"units": 20, "wattHours": 627049, "days": 30, "energyCharge": {"minor": 2508, "currency": "GBP"}, "standingCharge": {"minor": 900, "currency": "GBP"}, "climateChangeLevy": {"minor": 421, "currency": "GBP"}, "net": {"minor": 3829, "currency": "GBP"}, "vat": {"minor": 766, "currency": "GBP"}, "vatBasisPoints": 2000, "total": {"minor": 4595, "currency": "GBP"}}}, {"name": "domestic electricity in October 2026 under the temporary zero rate", "args": [{"fuel": "electricity", "openingRead": {"date": "2026-10-01", "value": 20000}, "closingRead": {"date": "2026-10-31", "value": 20300}, "meterDigits": 5, "gasUnit": null, "calorificValue": null, "unitRate": 26320, "standingCharge": 54830, "qualifyingUse": true, "vatCategory": "ZERO"}, "half-up"], "expect": {"units": 300, "wattHours": 300000, "days": 30, "energyCharge": {"minor": 7896, "currency": "GBP"}, "standingCharge": {"minor": 1645, "currency": "GBP"}, "climateChangeLevy": {"minor": 0, "currency": "GBP"}, "net": {"minor": 9541, "currency": "GBP"}, "vat": {"minor": 0, "currency": "GBP"}, "vatBasisPoints": 0, "total": {"minor": 9541, "currency": "GBP"}}}, {"name": "a de minimis business supply: 5% VAT and no levy", "args": [{"fuel": "electricity", "openingRead": {"date": "2026-06-01", "value": 300}, "closingRead": {"date": "2026-07-01", "value": 1200}, "meterDigits": 5, "gasUnit": null, "calorificValue": null, "unitRate": 25000, "standingCharge": 40000, "qualifyingUse": true, "vatCategory": "REDUCED"}, "half-up"], "expect": {"units": 900, "wattHours": 900000, "days": 30, "energyCharge": {"minor": 22500, "currency": "GBP"}, "standingCharge": {"minor": 1200, "currency": "GBP"}, "climateChangeLevy": {"minor": 0, "currency": "GBP"}, "net": {"minor": 23700, "currency": "GBP"}, "vat": {"minor": 1185, "currency": "GBP"}, "vatBasisPoints": 500, "total": {"minor": 24885, "currency": "GBP"}}}, {"name": "reads on the same day with no use: no standing days, nothing to pay", "args": [{"fuel": "electricity", "openingRead": {"date": "2026-06-01", "value": 300}, "closingRead": {"date": "2026-06-01", "value": 300}, "meterDigits": 5, "gasUnit": null, "calorificValue": null, "unitRate": 25000, "standingCharge": 40000, "qualifyingUse": false, "vatCategory": "STANDARD"}, "half-up"], "expect": {"units": 0, "wattHours": 0, "days": 0, "energyCharge": {"minor": 0, "currency": "GBP"}, "standingCharge": {"minor": 0, "currency": "GBP"}, "climateChangeLevy": {"minor": 0, "currency": "GBP"}, "net": {"minor": 0, "currency": "GBP"}, "vat": {"minor": 0, "currency": "GBP"}, "vatBasisPoints": 2000, "total": {"minor": 0, "currency": "GBP"}}}, {"name": "a gas bill without a calorific value is refused", "args": [{"fuel": "gas", "openingRead": {"date": "2025-10-01", "value": 4500}, "closingRead": {"date": "2025-10-31", "value": 4600}, "meterDigits": 5, "gasUnit": "cubic-metres", "calorificValue": null, "unitRate": 5990, "standingCharge": 32410, "qualifyingUse": true, "vatCategory": "REDUCED"}, "half-up"], "expectError": "a gas bill needs gasUnit and calorificValue"}, {"name": "gas details on an electricity bill are refused", "args": [{"fuel": "electricity", "openingRead": {"date": "2026-01-01", "value": 12000}, "closingRead": {"date": "2026-01-31", "value": 12350}, "meterDigits": 5, "gasUnit": "cubic-metres", "calorificValue": 39500, "unitRate": 26371, "standingCharge": 52143, "qualifyingUse": true, "vatCategory": "REDUCED"}, "half-up"], "expectError": "gasUnit and calorificValue are for gas bills only"}, {"name": "a closing read dated before the opening read is refused", "args": [{"fuel": "electricity", "openingRead": {"date": "2026-01-31", "value": 12000}, "closingRead": {"date": "2026-01-01", "value": 12350}, "meterDigits": 5, "gasUnit": null, "calorificValue": null, "unitRate": 26371, "standingCharge": 52143, "qualifyingUse": true, "vatCategory": "REDUCED"}, "half-up"], "expectError": "the closing read must not be dated before the opening read"}, {"name": "an unknown VAT category is refused by the VAT table", "args": [{"fuel": "electricity", "openingRead": {"date": "2026-01-01", "value": 12000}, "closingRead": {"date": "2026-01-31", "value": 12350}, "meterDigits": 5, "gasUnit": null, "calorificValue": null, "unitRate": 26371, "standingCharge": 52143, "qualifyingUse": true, "vatCategory": "DOMESTIC"}, "half-up"], "expectError": "no VAT rule for GB/DOMESTIC on 2026-01-31"}, {"name": "a negative unit rate is refused", "args": [{"fuel": "electricity", "openingRead": {"date": "2026-01-01", "value": 12000}, "closingRead": {"date": "2026-01-31", "value": 12350}, "meterDigits": 5, "gasUnit": null, "calorificValue": null, "unitRate": -1, "standingCharge": 52143, "qualifyingUse": true, "vatCategory": "REDUCED"}, "half-up"], "expectError": "unitRate must be a whole number of thousandths of a penny"}, {"name": "an unknown fuel is refused", "args": [{"fuel": "oil", "openingRead": {"date": "2026-01-01", "value": 12000}, "closingRead": {"date": "2026-01-31", "value": 12350}, "meterDigits": 5, "gasUnit": null, "calorificValue": null, "unitRate": 26371, "standingCharge": 52143, "qualifyingUse": true, "vatCategory": "REDUCED"}, "half-up"], "expectError": "unknown fuel \"oil\""}, {"name": "a business supply dated before the earliest levy rate is refused", "args": [{"fuel": "electricity", "openingRead": {"date": "2023-02-01", "value": 100}, "closingRead": {"date": "2023-03-01", "value": 200}, "meterDigits": 5, "gasUnit": null, "calorificValue": null, "unitRate": 25000, "standingCharge": 40000, "qualifyingUse": false, "vatCategory": "STANDARD"}, "half-up"], "expectError": "no Climate Change Levy rate for electricity on 2023-03-01"} ]