diff --git a/.github/workflows/core_master.yaml b/.github/workflows/core_master.yaml new file mode 100644 index 0000000000..d29d21daa0 --- /dev/null +++ b/.github/workflows/core_master.yaml @@ -0,0 +1,74 @@ +# The firm entity and the code that reads policyengine-core internals, +# tested against core's default branch, master. +# +# policyengine-uk gives the firm entity a root population by replacing core's +# TaxBenefitSystem.instantiate_entities and Simulation.clone, imports core's +# private _branch_clone, and reads private Simulation and Holder attributes in +# simulation.py. A core release that renames any of them would break +# `import policyengine_uk` for every user. pyproject.toml caps core below the +# next minor version, and this job runs the tests that use those internals on +# core's master, so a rename shows here before a release reaches the cap. +# +# It is not a required check: a red run means core master has moved, not that +# the pull request is wrong. The core version gate +# (tests/code_health/test_core_version_gate.py) is left out, because it fails +# by design on any core it has not qualified. It runs on pull requests that +# change code, every Monday, and by hand. + +name: Core master +on: + pull_request: + branches: + - main + paths: + - policyengine_uk/** + - pyproject.toml + - uv.lock + - .github/workflows/core_master.yaml + schedule: + - cron: "0 7 * * 1" + workflow_dispatch: + +concurrency: + group: core-master-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + Core-Master: + name: Firm and core-internals tests on policyengine-core master + runs-on: ubuntu-latest + permissions: + contents: read + timeout-minutes: 45 + steps: + - name: Checkout repo + uses: actions/checkout@v6 + - name: Install the locked environment + uses: ./.github/actions/test-environment + - name: Install policyengine-core from master + run: | + set -euo pipefail + uv pip install --python .venv/bin/python \ + "policyengine-core @ git+https://github.com/PolicyEngine/policyengine-core@master" + python -c "import importlib.metadata as m; print('policyengine-core', m.version('policyengine-core'))" + - name: Smoke-import + run: python -c "import policyengine_uk; print('import OK')" + - name: Python tests + run: >- + pytest -n 4 + policyengine_uk/tests/test_firm_entity.py + policyengine_uk/tests/test_firm_incidence.py + policyengine_uk/tests/test_firm_regression_gate.py + policyengine_uk/tests/test_firm_yaml_guard.py + policyengine_uk/tests/test_entity_ids.py + policyengine_uk/tests/test_subsample.py + policyengine_uk/tests/test_input_dataframe_export.py + policyengine_uk/tests/test_dataframe_dataset.py + policyengine_uk/tests/test_supplied_inputs.py + policyengine_uk/tests/test_measurement_branches.py + - name: Firm YAML tests + run: >- + policyengine-core test -c policyengine_uk + policyengine_uk/tests/policy/integration/firm + policyengine_uk/tests/policy/baseline/gov/hmrc/corporation_tax + policyengine_uk/tests/policy/baseline/gov/hmrc/business_rates/firm diff --git a/changelog.d/firm-entity-engine-rules-4.added.md b/changelog.d/firm-entity-engine-rules-4.added.md new file mode 100644 index 0000000000..8a229276e5 --- /dev/null +++ b/changelog.d/firm-entity-engine-rules-4.added.md @@ -0,0 +1 @@ +Added off-payroll employer National Insurance, Class 1A on termination awards, Class 1B, group relief, the Patent Box, the VAT partial exemption de minimis tests and direct attribution, Northern Ireland business rates, the soft drinks industry levy, the plastic packaging tax, the residential property developer tax, the digital services tax and the energy profits levy to the firm entity, all inert at their default inputs. diff --git a/changelog.d/firm-entity-engine.added.md b/changelog.d/firm-entity-engine.added.md new file mode 100644 index 0000000000..df91d94b31 --- /dev/null +++ b/changelog.d/firm-entity-engine.added.md @@ -0,0 +1,13 @@ +Added a firm entity beside person, benefit unit and household, with firm-level rules for employer National Insurance and the Employment Allowance, the apprenticeship levy, corporation tax with capital allowances, R&D relief and the bank surcharge, business rates in England, firm-side VAT and employer auto-enrolment contributions. Household results are unchanged. +Added a firm-level National Minimum Wage floor: firm_minimum_wage_cost tops low-paid hours up to the adult rate, and the apprenticeship levy and default employer National Insurance and auto-enrolment approximations read the higher paybill. +Added the R&D expenditure credit notional tax deduction to the payable credit, and to the bank surcharge the exclusion of the credit from surcharge profits, a group share of the allowance and day-weighting of the rate across the 1 January 2027 change. +Added firm business rates for Wales and Scotland with charitable relief, the live music venue limit on the pubs relief large-venue rate, the three-decimal small business rate relief taper factor, and firm employer Class 1A National Insurance. +Added the PAYE and National Insurance cap on the payable R&D expenditure credit. +Added the 2026-27 Welsh retail multiplier and the public-service exclusions from the Welsh higher multiplier. +Rounded the VAT partial exemption recovery percentage up as reg 101(4)-(5) of the VAT Regulations 1995 requires. +Added the balancing charge on disposals of fully expensed plant (section 59A) and the exclusion of plant for leasing from full expensing, which gets the annual investment allowance and the main-rate first-year allowance instead. +Applied the English RHL multipliers to occupied property only, the standard multiplier to empty and charity property before 2024-25, and the empty property exemption below £2,900 rateable value. +Set the SME R&D payable credit's trading loss against the same period's non-trading profits (CTA 2009 s.1056(2)(a)), capped that credit by PAYE and NIC from April 2021, and added `firm_small_profits_rate_excluded` for close investment-holding and non-resident companies. +Capped policyengine-core below 3.38, because the firm entity reads core internals, and added a Core master workflow that runs the firm and core-internals tests against core's default branch. +Changed firm_tax_change_total to subtract the full change in the Employment Allowance, computed on each simulation's own employer National Insurance liabilities, so that with the gross change in household ni_employer a firm that stays under the allowance after a rate rise nets to zero. +Added the change in firm VAT from VAT rules other than the rates (the registration threshold, the flat rate scheme and partial exemption), with the rates held at baseline, to firm_tax_change_total. diff --git a/docs/book/programs/gov/hmrc/firm-vat.md b/docs/book/programs/gov/hmrc/firm-vat.md index 9c0fc0f45a..44769e594e 100644 --- a/docs/book/programs/gov/hmrc/firm-vat.md +++ b/docs/book/programs/gov/hmrc/firm-vat.md @@ -1,19 +1,20 @@ -# Firm-level VAT (planned) - -```{warning} -**Not yet modelled.** PolicyEngine UK models VAT only on *household -consumption*: the `vat` variable applies `gov.hmrc.vat.standard_rate` and -`gov.hmrc.vat.reduced_rate` to each household's standard- and reduced-rate -spending (`full_rate_vat_consumption`, `reduced_rate_vat_consumption`), then -grosses the result up to VAT receipts. VAT on the household's own electricity -and gas bills (`domestic_energy_vat`, at `gov.hmrc.vat.domestic_electricity_rate` -and `gov.hmrc.vat.reduced_rate`) is added once, without the gross-up. There is -no business side. This page -sets out the scope for adding firm-level VAT and a `Firm` entity, tracked in -[#1320](https://github.com/PolicyEngine/policyengine-uk/issues/1320), which is -still open (October 2026). The companion analysis issue, -[#1333](https://github.com/PolicyEngine/policyengine-uk/issues/1333), was -closed on 20 October 2026 as a duplicate of #1320. +# Firm-level VAT + +```{note} +**Partly modelled.** PolicyEngine UK now has a `Firm` entity and firm-side +VAT rules (see [Firms](../../../usage/firms.md)): the registration threshold +(`gov.hmrc.vat.registration.threshold`, £90,000 since 1 April 2024), +output VAT on standard- and reduced-rated supplies, recoverable input VAT +with a partial exemption share, net liability (`firm_vat`) and the flat +rate scheme, including the limited cost trader rate. Supplies are firm +inputs; the sector-driven supply split, VAT groups, cross-border rules and +a calibrated firm dataset are not yet modelled. The household-side `vat` +variable is unchanged, and firm-side VAT is not yet linked to it. Tracked +in [#1320](https://github.com/PolicyEngine/policyengine-uk/issues/1320). +The design notes below predate the implementation: the `Firm` entity was +built as a population of its own, with no person members, rather than the +group entity with an owner role sketched under "Entity", and the variable +and parameter names differ. ``` ## Why firm-level VAT? diff --git a/docs/book/usage/firm-reforms.md b/docs/book/usage/firm-reforms.md new file mode 100644 index 0000000000..613531876a --- /dev/null +++ b/docs/book/usage/firm-reforms.md @@ -0,0 +1,176 @@ +# Firm reforms + +This page runs three static reforms to firm taxes through the Python API. The first two change corporation tax rules for a few firms in a situation. The third changes the Employment Allowance in a small dataset of households and firms, and spreads the change in firm tax over households with non-default incidence shares. The [Firms](firms.md) page describes the firm entity, its inputs and the programmes it models. + +```{note} +The figures on this page come from small, made-up firms and households. They show how the model computes a reform; they are not estimates of UK revenue or of household impacts. Population totals need a calibrated firm dataset, which does not exist yet. `firm_tax_incidence` is not yet a term of `household_tax` or `gov_tax`, so these reforms leave household net income unchanged. +``` + +Every example uses the 2026-27 tax year. `policyengine_uk/tests/test_firm_docs_examples.py` repeats each example and checks every figure below. + +## Raise the corporation tax main rate + +This reform raises the corporation tax main rate from 25% to 27%. A reform passed to `Simulation` keeps the current law in `sim.baseline`, so one simulation gives both sets of results. + +```python +from policyengine_uk import Simulation + +firms = { + "large_company": {"firm_taxable_trading_profit": {2026: 2_000_000}}, + "mid_company": {"firm_taxable_trading_profit": {2026: 150_000}}, + "small_company": {"firm_taxable_trading_profit": {2026: 40_000}}, + "sole_trader": { + "firm_legal_form": "SOLE_TRADER", + "firm_taxable_trading_profit": {2026: 80_000}, + }, +} +reform = {"gov.hmrc.corporation_tax.main_rate": {"2026-01-01.2100-12-31": 0.27}} + +sim = Simulation(situation={"firms": firms}, reform=reform) +sim.baseline.calculate("corporation_tax", 2026) # [500_000, 36_000, 7_600, 0] +sim.calculate("corporation_tax", 2026) # [540_000, 39_000, 7_600, 0] +``` + +| Firm | Taxable profit | Current law | Reform | Change | +|---|---|---|---|---| +| Large company | £2,000,000 | £500,000 | £540,000 | +£40,000 | +| Mid-sized company | £150,000 | £36,000 | £39,000 | +£3,000 | +| Small company | £40,000 | £7,600 | £7,600 | £0 | +| Sole trader | £80,000 | £0 | £0 | £0 | + +- The large company's profit exceeds the £250,000 upper limit, so it pays the main rate on all of it: 27% × £2,000,000 = £540,000. +- The mid-sized company's profit falls between the £50,000 lower limit and the upper limit. It pays the main rate less marginal relief of 3/200 × (£250,000 − £150,000) = £1,500. The reform leaves the relief unchanged and raises the tax from 25% × £150,000 − £1,500 = £36,000 to 27% × £150,000 − £1,500 = £39,000. +- The small company's profit is below the lower limit, so it pays the 19% small profits rate under both systems: 19% × £40,000 = £7,600. +- Only companies pay corporation tax, so the sole trader pays none under either system. + +## Change the main-pool writing-down allowance + +Companies deduct a writing-down allowance on the reducing balance of their main pool of plant and machinery. The rate is `gov.hmrc.corporation_tax.capital_allowances.writing_down_allowance.main_rate`, which is 14% for 2026-27. This reform raises it to 18%. + +```python +firms = { + "manufacturer": { + "firm_taxable_trading_profit": {2026: 1_000_000}, + "firm_main_pool_brought_forward": {2026: 500_000}, + }, + "workshop": { + "firm_taxable_trading_profit": {2026: 100_000}, + "firm_main_pool_brought_forward": {2026: 200_000}, + }, +} +reform = { + "gov.hmrc.corporation_tax.capital_allowances.writing_down_allowance.main_rate": { + "2026-01-01.2100-12-31": 0.18 + } +} + +sim = Simulation(situation={"firms": firms}, reform=reform) +sim.calculate("firm_main_pool_writing_down_allowance", 2026) # [90_000, 36_000] +sim.calculate("firm_taxable_profit", 2026) # [910_000, 64_000] +sim.calculate("corporation_tax", 2026) # [227_500, 13_210] +``` + +| | Manufacturer, current law | Manufacturer, reform | Workshop, current law | Workshop, reform | +|---|---|---|---|---| +| Writing-down allowance | £70,000 | £90,000 | £28,000 | £36,000 | +| Taxable profit | £930,000 | £910,000 | £72,000 | £64,000 | +| Corporation tax | £232,500 | £227,500 | £15,330 | £13,210 | +| Main pool carried forward | £430,000 | £410,000 | £172,000 | £164,000 | + +The reform raises the manufacturer's allowance by 4% × £500,000 = £20,000. Its taxable profit is above the upper limit, so its corporation tax falls by 25% × £20,000 = £5,000. + +The workshop's allowance rises by 4% × £200,000 = £8,000. Its taxable profit stays in the marginal relief band, where each pound of profit carries tax of 25% + 3/200 = 26.5%. Its corporation tax falls by 26.5% × £8,000 = £2,120: + +- Current law: 25% × £72,000 − 3/200 × (£250,000 − £72,000) = £18,000 − £2,670 = £15,330. +- Reform: 25% × £64,000 − 3/200 × (£250,000 − £64,000) = £16,000 − £2,790 = £13,210. + +A higher allowance this year leaves a smaller balance to carry forward, so the reform also lowers the allowances available in later years. + +## Cut the Employment Allowance and allocate the change to households + +`firm_tax_change_total` and `firm_tax_incidence` compare a reform with its baseline across a population, so they need a dataset: in a situation both are 0. This example builds a dataset of two households, each with a weight of 1,000, and three kinds of firm. It cuts the Employment Allowance from £10,500 to £5,000 and sets the incidence shares to 50% capital, 25% consumers and 25% workers in place of the default 100% capital. + +```python +import pandas as pd +from policyengine_uk import Microsimulation +from policyengine_uk.data import UKSingleYearDataset + +dataset = UKSingleYearDataset( + person=pd.DataFrame( + { + "person_id": [1, 2], + "person_benunit_id": [1, 2], + "person_household_id": [1, 2], + "age": [30, 50], + "employment_income": [25_000.0, 75_000.0], + } + ), + benunit=pd.DataFrame({"benunit_id": [1, 2]}), + household=pd.DataFrame( + { + "household_id": [1, 2], + "household_weight": [1_000.0, 1_000.0], + "region": "LONDON", + "rent": 0.0, + "tenure_type": "OWNED_OUTRIGHT", + "council_tax": 0.0, + "corporate_sector_wealth": [0.0, 100_000.0], + "consumption": [20_000.0, 30_000.0], + } + ), + firm=pd.DataFrame( + { + "firm_id": [1, 2, 3], + "firm_weight": [100.0, 300.0, 50.0], + "firm_paybill": [2_000_000.0, 150_000.0, 60_000.0], + "firm_employees": [40.0, 5.0, 2.0], + } + ), + fiscal_year=2026, +) +reform = { + "gov.hmrc.national_insurance.employment_allowance.amount": { + "2026-01-01.2100-12-31": 5_000 + }, + "gov.contrib.policyengine.firm_incidence.capital": {"2026-01-01.2100-12-31": 0.5}, + "gov.contrib.policyengine.firm_incidence.consumer": {"2026-01-01.2100-12-31": 0.25}, + "gov.contrib.policyengine.firm_incidence.labour": {"2026-01-01.2100-12-31": 0.25}, +} + +sim = Microsimulation(dataset=dataset, reform=reform) +sim.baseline.calculate("employment_allowance", 2026) # [10_500, 10_500, 7_500] +sim.calculate("employment_allowance", 2026) # [5_000, 5_000, 5_000] +sim.calculate("firm_tax_change_total", 2026) # [2_325_000, 2_325_000] +sim.calculate("firm_tax_incidence", 2026) # [377.81, 1_947.19] +``` + +### Firm tax change + +Each firm's employer National Insurance before the allowance is 15% of its pay above £5,000 per employee. The allowance covers that liability up to the allowance amount. + +| Firm | Weight | Employer NI before allowance | Allowance, current law | Allowance, reform | Extra tax per firm | +|---|---|---|---|---|---| +| 1 | 100 | £270,000 | £10,500 | £5,000 | £5,500 | +| 2 | 300 | £18,750 | £10,500 | £5,000 | £5,500 | +| 3 | 50 | £7,500 | £7,500 | £5,000 | £2,500 | + +`firm_tax_change_total` weights each firm's extra tax by `firm_weight`: 100 × £5,500 + 300 × £5,500 + 50 × £2,500 = £2,325,000. Every household carries the same total. + +### Household incidence + +`firm_tax_incidence` gives each household a share of the total. The share combines three keys, weighted by the incidence parameters: + +| Key | Household 1 | Household 2 | Incidence share | +|---|---|---|---| +| Capital: `shareholding` | 0 | 0.001 | 50% | +| Consumers: `consumption_shareholding` | 0.0004 | 0.0006 | 25% | +| Workers: share of weighted employment income | 0.00025 | 0.00075 | 25% | + +Household 2 holds all of the corporate sector wealth: £100,000 out of a weighted total of 1,000 × £100,000, a share of 0.001. Consumption shares are £20,000 and £30,000 out of 1,000 × £50,000. Employment income shares are £25,000 and £75,000 out of 1,000 × £100,000. + +- Household 1: £2,325,000 × (50% × 0 + 25% × 0.0004 + 25% × 0.00025) = £377.81. +- Household 2: £2,325,000 × (50% × 0.001 + 25% × 0.0006 + 25% × 0.00075) = £1,947.19. + +Weighted by household, the incidence adds back to the firm total: 1,000 × (£377.81 + £1,947.19) = £2,325,000. The reform leaves `household_tax` and `gov_tax` unchanged for both households, since `firm_tax_incidence` is not yet a term of either. + +Household `ni_employer` counts the change in gross employer National Insurance, so `firm_tax_change_total` subtracts the full change in the Employment Allowance, each simulation computing it on its own liabilities. Together they count the change in what firms pay after the allowance. A firm that stays under the allowance after a rate rise nets to zero: its gross liability and its allowance rise by the same amount, so the household side adds the rise and the firm side takes it off. The firm-side total is then negative, and with the default incidence it is spread by shareholding rather than to the workers whose gross National Insurance rose. That is acceptable only while `firm_tax_incidence` stays out of `household_tax`. diff --git a/docs/book/usage/firms.md b/docs/book/usage/firms.md new file mode 100644 index 0000000000..6c36e7838f --- /dev/null +++ b/docs/book/usage/firms.md @@ -0,0 +1,186 @@ +# Firms + +PolicyEngine UK has a firm entity beside the person, benefit unit and household entities. Firm-level variables compute the statutory liability of a business to corporation tax, the bank surcharge, the apprenticeship levy, employer National Insurance (Class 1, 1A and 1B), business rates, VAT, the soft drinks industry levy, the plastic packaging tax, the residential property developer tax, the digital services tax and the energy profits levy, together with the Employment Allowance and the employer's minimum auto-enrolment pension contribution. + +```{note} +Firm-side results are not yet part of the household totals. `household_tax`, `gov_tax`, the budget lists in `programs.yaml` and `fiscal_partition.yaml` leave out every firm variable, so household results are the same with or without firms. The firm aggregates join those totals once a calibrated firm dataset is available. +``` + +## The firm entity + +`Firm` is a root population, not a group of people: + +- Each firm has its own identifier (`firm_id`) and weight (`firm_weight`). Firm weights come from business data, not from survey households. +- No person is a member of a firm. A firm variable cannot be mapped to a person, benefit unit or household, and the model raises an error if a formula tries (for example `firm.household` or `map_result` between firms and households). +- A situation or dataset without firms has a firm count of 0, so existing household situations and datasets work unchanged. +- `firm_weight` is the number of firms in the population that a record represents. It defaults to 1, so each firm in a situation counts once. Weighted firm sums, such as `sim.calculate("firm_paybill", 2025).sum()`, use `firm_weight`, never a household weight. +- Firm variables are left out of per-person data exports. + +Since per-employee pay is not linked to firms yet, employee data is held at firm level: the paybill (`firm_paybill`), the number of employees (`firm_employees`) and earnings that carry a zero rate of employer National Insurance (`firm_zero_rated_class_1_earnings`). + +### Firms in a situation + +A situation takes an optional `firms` entry that maps each firm's name to its inputs. Firms have no `members` list. + +```python +from policyengine_uk import Simulation + +situation = { + "people": {"adult": {"age": {2025: 40}, "employment_income": {2025: 45_000}}}, + "benunits": {"benunit": {"members": ["adult"]}}, + "households": {"household": {"members": ["adult"]}}, + "firms": { + "manufacturer": { + "firm_paybill": {2025: 4_000_000}, + "firm_employees": {2025: 100}, + "firm_taxable_trading_profit": {2025: 600_000}, + "firm_turnover": {2025: 12_000_000}, + "firm_standard_rated_supplies": {2025: 12_000_000}, + }, + "corner_shop": { + "firm_legal_form": "SOLE_TRADER", + "firm_paybill": 40_000, + "firm_employees": 2, + }, + }, +} + +sim = Simulation(situation=situation) +sim.calculate("corporation_tax", 2025) # [150_000, 0] +sim.calculate("firm_employer_ni", 2025) # [514_500, 0] +sim.calculate("employment_allowance", 2025) # [10_500, 4_500] +``` + +The manufacturer pays corporation tax at the 25% main rate on £600,000 of profit. Its employer National Insurance is 15% of the £3.5 million of pay above the £5,000 secondary threshold for each of its 100 employees, less the £10,500 Employment Allowance. The corner shop is a sole trader, so it pays no corporation tax, and its £4,500 of employer National Insurance is covered by the Employment Allowance. + +A situation of firms alone (`{"firms": {...}}`) has no people. Firm variables compute in it, but household variables do not, since it has no benefit units. + +### Firms in a dataset + +`UKSingleYearDataset` and `UKMultiYearDataset` take an optional `firm=` table with one row per firm. A table without a `firm_id` column numbers its firms 0, 1, 2 and so on, in the order it gives them. Each year of a multi-year dataset must give the same firms. + +```python +import pandas as pd +from policyengine_uk import Microsimulation +from policyengine_uk.data import UKSingleYearDataset + +dataset = UKSingleYearDataset( + person=pd.DataFrame( + { + "person_id": [1], + "person_benunit_id": [1], + "person_household_id": [1], + "age": [40], + "employment_income": [45_000.0], + } + ), + benunit=pd.DataFrame({"benunit_id": [1]}), + household=pd.DataFrame( + { + "household_id": [1], + "household_weight": [1_000.0], + "region": "LONDON", + "rent": 0.0, + "tenure_type": "OWNED_OUTRIGHT", + "council_tax": 0.0, + } + ), + firm=pd.DataFrame( + { + "firm_id": [1, 2], + "firm_weight": [100.0, 2_000.0], + "firm_paybill": [4_000_000.0, 40_000.0], + "firm_employees": [100, 2], + } + ), + fiscal_year=2025, +) + +sim = Microsimulation(dataset=dataset) +sim.calculate("firm_employer_ni", 2025).sum() # £51.45 million: 100 × £514,500 +``` + +The firm table is kept out of the dataset's `tables`, so uprating and household subsetting work as before. `subsample` raises `NotImplementedError` when a dataset has firms. The dataset loaders also read an optional firm table from an H5 file. + +## Programmes + +Every firm variable uses `entity = Firm` and a yearly period. Each parameter cites legislation or GOV.UK guidance. Values announced but not yet enacted are marked in their YAML files and are kept in the baseline, as for other announced Budget measures: the 12% main writing-down allowance from April 2027, the 50% main-rate first-year allowance from 1 January 2027 and the 6% bank surcharge from 1 January 2027. Finance Bill 2026-27 had not received Royal Assent on 22 November 2026. + +| Programme | Main variables | Rules | +|---|---|---| +| Employer National Insurance | `firm_employer_ni`, `firm_employer_ni_before_allowance` | Class 1 secondary contributions with the `gov.hmrc.national_insurance.class_1` rates and thresholds. Pay above the secondary threshold can be an input; by default it is approximated from the paybill and the number of employees, less any staff supplied as paid at or below the secondary threshold (see the pay-distribution inputs below). | +| Employment Allowance | `employment_allowance`, `employment_allowance_eligible` | The amount from 2014 (now £10,500), capped at employer National Insurance liability. Excludes single-director companies and public bodies, and applies the £100,000 prior-year liability limit from 2020-21 to 2024-25. | +| Apprenticeship levy | `apprenticeship_levy` | 0.5% of the paybill (after any National Minimum Wage top-up) less the £15,000 allowance, which connected employers share. | +| Auto-enrolment | `firm_auto_enrolment_employer_contribution`, `firm_auto_enrolment_qualifying_earnings` | The 3% employer minimum contribution on qualifying earnings between £6,240 and £50,270. Qualifying earnings can be an input; by default they are approximated from the paybill and the number of employees, less any staff supplied as paid at or below the earnings trigger or above the upper limit (see the pay-distribution inputs below). | +| Corporation tax | `corporation_tax`, `firm_taxable_profit`, `firm_marginal_relief`, `firm_losses_used` | Main and small profits rates, marginal relief at a 3/200 fraction with limits divided by associated companies, and loss relief with the £5 million deductions allowance, and group relief: a claimed amount (`firm_group_relief_claimed`) capped at total profits and deducted before carried-forward losses, and from April 2017 group relief for carried-forward losses (`firm_group_relief_for_carried_forward_losses_claimed`) within the room the firm's own losses leave. Only companies are liable (`firm_legal_form`). A close investment-holding company or a non-UK-resident company gets no small profits rate or marginal relief (CTA 2010 ss.18A, 18B and 18N): set `firm_small_profits_rate_excluded` (default false). | +| Capital allowances | `firm_capital_allowances` and its components | Full expensing, the 50% special-rate first-year allowance, the annual investment allowance, the main-rate first-year allowance (40% from 1 January 2026), writing-down allowances, the structures and buildings allowance, and balancing charges. A company that disposes of fully expensed main-rate plant pays a balancing charge on the disposal value outside the main pool (`firm_full_expensing_balancing_charge`); the same disposal of special-rate plant that had the 50% allowance, and disposals of super-deduction assets, are not modelled, so `firm_disposal_proceeds_full_expensing` should be 0 before April 2023. The charge applies only while the full expensing rate is above 0, so a reform that sets that rate to 0 also removes the charge on assets fully expensed earlier. New main-rate plant for leasing (`firm_capex_main_pool_new_for_leasing`) gets no full expensing: it takes the annual investment allowance, then the main-rate first-year allowance. New special-rate plant for leasing gets no first-year allowance; enter it as `firm_capex_special_rate_used` so it takes the annual investment allowance and then the special rate pool. | +| R&D relief | `firm_rd_expenditure_credit`, `firm_rd_additional_deduction`, `firm_rd_payable_credit` | The merged-scheme expenditure credit (20%), the SME scheme for every SME before April 2024 and enhanced support for R&D-intensive loss-making SMEs from then. `firm_rd_payable_credit` is paid on the trading loss left after setting it against the same period's non-trading profits (CTA 2009 s.1056(2)(a)), capped at the qualifying expenditure plus the additional deduction. `firm_rdec_excess_payable` is the expenditure credit paid out after it discharges the year's corporation tax, less the notional tax deduction: corporation tax on the credit at the main rate, or at the small profits rate where the company has no profits chargeable at the main rate ignoring the credit. A loss-making company with £1 million of R&D in 2025-26 is paid £200,000 less 19% notional tax, £162,000. The notional tax is not paid in the year. The PAYE and National Insurance cap applies when its inputs are supplied (see below). | +| Bank surcharge | `bank_surcharge` | 8% above a £25 million allowance from 2016, and 3% above £100 million from April 2023. The 6% rate announced for 1 January 2027 to 31 March 2028 is marked as not yet enacted. Surcharge profits leave out the R&D expenditure credit, and `firm_bank_surcharge_allowance_share` (default 1) gives a bank in a group its share of the allowance. | +| Business rates (England, Wales, Scotland, Northern Ireland) | `firm_business_rates` and its reliefs | England: multipliers for 2023-24 to 2027-28, including the 2026 retail, hospitality and leisure (RHL) and high-value multipliers; small business rate relief, charitable relief, RHL relief to 2025-26, pubs and live music venues relief, and empty property relief. Wales and Scotland: multipliers or poundage, the small business scheme and mandatory charitable relief (80%), 2023-24 to 2026-27. In Wales a charity gets charitable relief instead of SBRR; in Scotland it gets the larger of SBBS and charitable relief. Northern Ireland, 2023-24 onwards, for a firm with `firm_northern_ireland_district` set: the regional and district rates, small business rate relief, the charity exemption and unoccupied property at half rate. | +| Employer Class 1A NIC | `firm_class_1a_ni`, `firm_termination_award_class_1a_ni` | Class 1A percentage times `firm_class_1a_benefits`, the cash equivalent of benefits in kind. From 6 April 2020, Class 1A on termination awards above the £30,000 threshold for each recipient (`firm_termination_awards`, `firm_termination_award_recipients`). | +| Employer Class 1B NIC | `firm_class_1b_ni` | The Class 1B percentage of the chargeable earnings in PAYE settlement agreements plus the tax paid under them (`firm_psa_chargeable_earnings`, `firm_psa_income_tax`). | +| Off-payroll working | `firm_off_payroll_employer_ni` | Secondary Class 1 on deemed direct payments the firm makes as fee-payer (`firm_off_payroll_deemed_payments`, `firm_off_payroll_deemed_workers`): public authorities from April 2017, other clients from April 2021. No Employment Allowance against it; the payments count in the apprenticeship levy pay bill. | +| Soft drinks industry levy | `soft_drinks_industry_levy` | The higher and lower rates per litre from 6 April 2018 (`firm_sdil_litres_higher_rate`, `firm_sdil_litres_lower_rate`), with the 1 million litre small producer exemption (`firm_sdil_annual_production_litres`). | +| Patent Box | `firm_patent_box_deduction` | A deduction from trading profits so that supplied relevant IP profits (`firm_relevant_ip_profits`, after streaming and the nexus fraction) are taxed at 10%: RP × (rate − 10%) / rate, with the main rate before April 2023 and, from then, the small profits rate where the company is charged at it and otherwise the main rate, including in the marginal relief band (CTA 2010 s.357A; F(No.2)A 2023 s.11). Phased in from 60% in 2013-14 to 100% from April 2017. | +| Residential property developer tax | `residential_property_developer_tax` | 4% of supplied RPD profits (`firm_rpd_profits`) above the £25 million allowance, shared in a group by `firm_rpdt_allowance_share`, from April 2022. Companies only; not deductible for corporation tax. | +| Digital services tax | `digital_services_tax` | 2% of the group's UK digital services revenues (`firm_group_uk_digital_services_revenues`, defaulting to the firm's own `firm_uk_digital_services_revenues`) above £25 million, where worldwide revenues (`firm_group_digital_services_revenues`, defaulting to the group's UK total, so a firm that supplies only its UK revenues pays 0) exceed £500 million and UK revenues exceed £25 million, shared by each member's UK revenues, from April 2020. | +| Energy profits levy | `energy_profits_levy` | The levy rate on supplied levy profits (`firm_epl_profits`, after the investment and decarbonisation allowances): 25% from 26 May 2022, 35% from 1 January 2023, 38% from 1 November 2024, to 31 March 2030, day-weighted over each 6 April to 5 April year. | +| Plastic packaging tax | `plastic_packaging_tax` | The rate per tonne from 1 April 2022 on packaging with less than 30% recycled plastic (`firm_plastic_packaging_tonnes_chargeable`), for a firm at or above the 10 tonne registration threshold (`firm_plastic_packaging_tonnes_total`). | +| VAT | `firm_vat`, `firm_vat_registered`, `firm_output_vat` | The registration threshold (£85,000, then £90,000 from April 2024), output VAT less recoverable input VAT with the partial exemption standard method (percentage rounded up, reg 101(5)), optional input VAT directly attributable to taxable or exempt supplies, the de minimis tests when `firm_applies_partial_exemption_de_minimis` is set (regs 105A and 106), and the flat rate scheme with the 16.5% limited cost trader rate. Uses the existing `gov.hmrc.vat` rate parameters. | + +Six optional inputs describe how a firm's pay is spread, so the employer National Insurance and auto-enrolment approximations need not assume every employee earns the firm's average pay. Each pair is a headcount and the total pay of those employees, and all default to 0: + +- `firm_employees_below_secondary_threshold` and `firm_paybill_below_secondary_threshold`: staff paid at or below the annual secondary threshold, who pay no secondary contributions. +- `firm_employees_below_auto_enrolment_earnings_trigger` and `firm_paybill_below_auto_enrolment_earnings_trigger`: staff paid at or below the £10,000 earnings trigger, who need not be enrolled. +- `firm_employees_above_auto_enrolment_upper_limit` and `firm_paybill_above_auto_enrolment_upper_limit`: staff paid above the qualifying earnings upper limit, who each contribute the full band. + +A supplied `firm_class_1_earnings_above_secondary_threshold` is used as given; otherwise the split below the secondary threshold, when supplied, sets the employer National Insurance base, and without it the plain average applies. The split must be measured at the simulated year's secondary threshold (£9,100 in 2022-23 to 2024-25, £5,000 from 2025-26): the formula applies that year's threshold, so a split measured at another threshold, or a reform to the threshold, gives an approximate base. The formulas clip inconsistent values silently: negative values count as 0, a headcount is capped at the employees left, and a paybill at the paybill left (and, at or below the secondary threshold, at that headcount times the threshold). If the paybill above the upper limit is less than that headcount times the limit, those staff are treated as part of the remaining group. With the defaults, every employee is enrolled at the firm's average pay, so the £10,000 earnings trigger is not applied. + +`policyengine_uk/programs.yaml` lists these programmes with the years their parameters and tests cover. + +### National Minimum Wage + +Two optional inputs describe the firm's low-paid workers as one block: `firm_low_paid_hours`, their annual hours, and `firm_low_paid_paybill`, the pay for those hours (part of `firm_paybill`). Both default to 0. `firm_minimum_wage_cost` is the extra pay needed to bring the block up to the adult rate (the national living wage): the rate times the hours, less their pay, floored at zero. The rate is the top age band of `gov.hmrc.minimum_wage.non_apprentice`, read at 30 April like other yearly parameters, so 2026 uses the £12.71 rate from April 2026. + +`firm_paybill_after_minimum_wage` is `firm_paybill` plus that cost. The apprenticeship levy and the default employer National Insurance and auto-enrolment approximations read it, so they rise with the floor. A supplied `firm_class_1_earnings_above_secondary_threshold` or `firm_auto_enrolment_qualifying_earnings` is used as given. With the pay-distribution inputs supplied, the extra pay falls in the remaining group, which overstates the base if the low-paid staff are at or below the secondary threshold or the earnings trigger. The cost is a firm cost, not a tax, so it is not a term of `firm_tax` or `firm_only_tax`. Where pay already meets the rate the cost is 0 and every result is unchanged. + +The block is treated as paid its average hourly wage, so the cost is understated where pay within it varies: hours paid above the rate offset hours paid below it. Negative inputs count as 0. The model's rates start in October 2010, so the cost is 0 for 2010 and earlier. The younger-worker and apprentice rates are not modelled. `firm_taxable_trading_profit` is an input, so the extra pay, though deductible, does not reduce the firm's taxable profit or corporation tax; reduce that input yourself if you want the deduction. + +## Aggregates and incidence + +Four variables combine the firm-level results: + +- **`firm_tax`** (firm): the firm's total statutory liability to corporation tax, the bank surcharge, the apprenticeship levy, employer National Insurance (Class 1 after the Employment Allowance, off-payroll Class 1, Class 1A and Class 1B), business rates, VAT, the soft drinks industry levy, the plastic packaging tax, the residential property developer tax, the digital services tax and the energy profits levy, less R&D tax credits paid out to the firm. +- **`firm_only_tax`** (firm): the liability set by rules that only the firm side models: corporation tax, the bank surcharge, the apprenticeship levy, business rates, Class 1A on termination awards, Class 1B, the soft drinks industry levy, the plastic packaging tax, the residential property developer tax, the digital services tax and the energy profits levy, less R&D tax credits paid out. It leaves out Class 1 employer National Insurance, including off-payroll contributions, and Class 1A on benefits in kind, whose rates and thresholds reach households through `ni_employer`, and VAT, whose rates reach households through `vat`. It also leaves out the Employment Allowance. +- **`firm_tax_change_total`** (household): the reform's `firm_only_tax` less the baseline's, summed over firms with `firm_weight`, less the change in the weighted Employment Allowance, each simulation computing it on its own employer National Insurance liabilities. Household `ni_employer` counts the gross change, so together they count the change in what firms pay after the allowance; a firm that stays under the allowance after a rate rise nets to zero. It also adds the change in weighted `firm_vat` from VAT rules other than the rates (the registration threshold, the flat rate scheme and partial exemption, including the de minimis tests), with the rates held at baseline, since household `vat` already carries rate changes. A firm whose registration flips counts its full liability at baseline rates, with no behavioural response. A reform that changes both the rates and those rules drops their interaction, and with the default incidence a VAT rule change falls on shareholders. Without a supplied prior-year input, the 2020-21 to 2024-25 prior-year limit reads this year's liabilities under each simulation's own rules, so a rate rise can take a firm over it. Every household carries the same total. It is 0 without a baseline, in a simulation built from a situation, and where the simulation has no firms. +- **`firm_tax_incidence`** (household): each household's share of `firm_tax_change_total`, split between capital (by `shareholding`), consumers (by `consumption_shareholding`) and workers (by the household's share of weighted employment income). The shares are the `gov.contrib.policyengine.firm_incidence` parameters `capital`, `consumer` and `labour`, which default to 1, 0 and 0. + +`firm_tax` is a receipts measure. Summed over firms it must not be added to `gov_tax`, whose household terms already count employer National Insurance, VAT and business rates as incidence. None of the four variables is a term of `gov_tax` or `household_tax` yet. + +Worked examples of firm reforms, including incidence, are in [Firm reforms](firm-reforms.md). + +## Known simplifications + +- Every firm has an April to March financial year. +- Most yearly parameters are read at 30 April, so changes dated 1 January are not apportioned. This affects the 40% and 50% main-rate first-year allowances. The annual investment allowance limit, the bank surcharge rate and the energy profits levy rate are day-weighted over 6 April to 5 April instead: 2026-27 has a surcharge rate of (270 × 3% + 95 × 6%) / 365 ≈ 3.78%. Because the window starts on 6 April, a change dated 1 April counts for 5 days of the year before, so 2027-28 has a surcharge rate of about 5.96% and 2022-23 about 7.93%. +- Employer National Insurance and auto-enrolment use firm-level approximations, since there is no per-employee pay yet. They treat the employees outside the optional pay-distribution inputs as all paid the same, and apply thresholds annually rather than per pay period. Without the auto-enrolment inputs the £10,000 earnings trigger is not applied, and the age conditions, opt-outs and opt-ins are not modelled. +- The National Minimum Wage floor treats the low-paid workers as one block paid its average hourly wage and applies only the adult rate (see above). +- Business rates assume one aggregate property per firm and have no transitional relief. Northern Ireland rates are modelled from 2023-24 only where `firm_northern_ireland_district` is set; at its default, `UNKNOWN`, a Northern Ireland firm's rates are 0. +- Firm amounts are stored in single precision (float32), as for every policyengine-core variable. A firm with £10 million to £50 million of turnover can show rounding of about £1, so tests use small absolute margins. +- **Business rates in Wales and Scotland.** The nation comes from `firm_region`; a Welsh, Scottish or Northern Irish region overrides `firm_in_england`, and the English reliefs apply only where `firm_rates_in_england` is true. Wales uses one multiplier to 2025-26 (0.535, 0.562, 0.568), and in 2026-27 a standard multiplier of 0.502, a retail multiplier of 0.350 for shops, kiosks, pharmacies and post offices below £51,000 (`firm_is_wales_retail_property`), and a higher multiplier of 0.515 above £100,000, except for the 19 public-service descriptions in WSI 2025/1163 reg 4, such as hospitals and schools (`firm_is_wales_higher_multiplier_excluded`). Welsh small business rates relief is 100% at £6,000 or less, tapering in a straight line to 0% at £12,000, for occupied property of a firm with at most two properties. Scotland charges the basic property rate (49.8p to 2025-26, 48.1p in 2026-27), plus the intermediate supplement above £51,000 up to £100,000 and the higher supplement above £100,000. The Small Business Bonus Scheme gives single-property firms 100% relief at £12,000 or less, tapering to 25% at £15,000 and to 0% at £20,000. Not modelled: Welsh childcare and post office relief, SBBS for several properties, and empty property, hospitality and transitional reliefs in Wales and Scotland. From 1 April 2027 WSI 2026/133 renames the Welsh retail multiplier the lower multiplier, widens it to about 37 descriptions (including pubs, restaurants, hotels and leisure) and raises the higher multiplier to 1.042 times the standard; this is not modelled. Central-list properties (WSI 2025/1163 reg 5) are not distinguished. Values for 2027-28 onwards carry forward the 2026-27 ones, and years before 2023-24 reuse the 2023-24 values, which are not verified for those years. Empty property relief applies in England only; property with rateable value below £2,900 is exempt for as long as it is empty. In England the RHL multipliers apply to occupied property only, and before 2024-25 unoccupied and charity property paid the standard multiplier whatever its rateable value (SI 2024/111 extended the small business multiplier to them). The independent school exclusions from charitable relief are not modelled, nor is SSI 2026/68 reg 6(5). +- **R&D expenditure credit PAYE and NIC cap.** After the notional tax deduction, the payable credit is capped. Under the merged scheme (from April 2024) the cap is £20,000 plus three times the company's relevant PAYE and Class 1 NIC liabilities, for all employees adjusted for connected-company workers (CTA 2009 s.1042I step 3, ss.1112B–1112D); supply them as `firm_relevant_paye_nic_liabilities`. Before April 2024 the cap was the PAYE and NIC on staff directly engaged in R&D, with no fixed amount (s.104N step 3, s.104P); supply it as `firm_rd_staff_paye_nic`. The cap applies only when `firm_rdec_paye_nic_cap_supplied` is true (default false). The excess is carried to the next period's credit (s.1042J), which is not modelled, nor are the short-period reduction of the £20,000 and the s.1112E exemption. The same flag and `firm_relevant_paye_nic_liabilities` cap the SME payable credit `firm_rd_payable_credit` for accounting periods beginning on or after 1 April 2021, at £20,000 plus three times the company's PAYE and Class 1 NIC on all employees (s.1058(1A) and ss.1058A–1058C, from April 2024 s.1112B). The exemption for companies creating or managing their own intellectual property (s.1058D, from April 2024 s.1112E) is not tested: leave the flag false for such a company. +- **Pubs and live music venues relief.** 15% in 2026-27, rising to 35% in 2027-28 and 2028-29 (BRIL 8/2026). The 15% rate is kept only for live music venues with rateable value of £1m or more; pubs get 35% at any rateable value. Set `firm_is_live_music_venue` as well as `firm_is_pub_or_live_music_venue` to mark a live music venue. Not modelled: the 1p Transitional Relief Supplement (2026-27, extended to 2027-28 and 2028-29) and the 2027-28 and 2028-29 cap on RHL, pub and live music venue bills at CPI (BRIL 8/2026). +- **Small business rate relief taper (England).** Under LGFA 1988 Sch 4ZA para 4(1) and SI 2023/1250 reg 3, the bill in the taper is the gross bill divided by E = 3,000 / (rateable value − £12,000), calculated to three decimal places, so relief is the gross bill less the gross bill divided by E. At £14,999, E rounds to 1.000 and no relief is given. The model rounds to the nearest third decimal (the regulation does not say whether to round or truncate). For qualifying RHL properties in 2027-28 and 2028-29 the model assumes the same form with £18,000 and £21,000; the amending regulations are not yet made. +- **Northern Ireland rates.** The bill is the net annual value (enter it as `firm_rateable_value`) times the non-domestic regional rate plus the district council's rate (Rates (NI) Order 1977 Art 6), with the 2023-24 to 2026-27 poundages; 2026-27 values carry forward. Small business rate relief is 50% up to £2,000, 25% up to £5,000 and 20% up to £15,000 for a wholly occupied, non-industrial property of a firm with at most three properties (SR 2010/4 reg 3), applied to the firm's aggregate value; the scheme is extended only to 31 March 2027 (SR 2026/45), so from 2027-28 the model gives none. A charity's occupied property is exempt (Art 41). Unoccupied property pays half the bill after its first three months empty, and nothing below £2,000 or if industrial (Sch 8A). Not modelled: industrial and freight derating, sport and recreation relief, the post office bands and other exclusions from small business relief, hardship relief, Back in Business, part-exempt apportionment, the contiguous-hereditaments rule, and the other unoccupied-property exclusions (such as listed buildings and insolvency); unoccupied charity property is charged like other unoccupied property. Northern Ireland poundages for 2027-28 onwards carry forward the 2026-27 values and are not verified. +- **Group relief.** Enter what other group companies surrender to the firm. The surrenderer's own carry-forward is not reduced, the claimant and surrenderer are not checked against each other, and consortium relief and overlapping periods are not modelled. A bank adds back group relief from non-banking companies (`firm_non_banking_group_relief_claimed`) to its surcharge profits. A loss the firm surrenders (`firm_trading_loss_surrendered`) reduces its R&D surrenderable loss. +- **VAT partial exemption de minimis.** With `firm_applies_partial_exemption_de_minimis` true, all input VAT is recoverable where exempt input tax is at most £625 a month on average and at most half of all input tax (reg 106), or, from April 2010, where input tax less that used exclusively for taxable supplies is at most £625 a month and exempt supplies are at most half of all supplies (reg 105A). The tests are applied to the year. The tests are mandatory in law ("shall be treated"), but the flag defaults to false so that existing results are unchanged; with it unset, VAT is overstated for small partly exempt firms, so a data builder should set it. +- **Patent Box.** Relevant IP profits are an input: streaming, the nexus fraction and relevant IP losses are not modelled. They are capped at the positive trading profit after capital allowances and the R&D additional deduction, a model guard. From April 2023 the small profits test that sets the rate uses profits before the deduction, following HMRC's CIRD201020. As a model simplification, not HMRC's, it also ignores group relief and carried-forward losses, so a company brought under the lower limit only by those reliefs takes the main rate and its deduction is overstated. Firm corporation tax runs from 2015-16, so the 60% and 70% phase-in years are not reached. +- **Residential property developer tax, digital services tax and energy profits levy.** Each is a rate times a supplied base. Not modelled: the derivation of RPD profits, including the RPDT loss and group reliefs (supply RPD profits net of them) and the other RPDT reliefs; the DST alternative charge and the cross-border marketplace relief; the energy profits levy allowances and loss relief (they are in the input), ring fence corporation tax, the supplementary charge and the price floor. +- Corporation tax has no quarterly instalment payments. The bank surcharge does not add back pre-2016 or non-banking carried-forward losses (s.269DC), and the 25% cap on a bank's pre-April 2015 losses (s.269CA) is not applied. +- Not modelled at all: the bank levy, the electricity generator levy, the diverted profits tax, insurance premium tax, air passenger duty, the climate change levy, landfill tax and the aggregates levy. +- **Soft drinks industry levy and plastic packaging tax.** Litres and tonnes are inputs. The small producer and registration tests use the firm's year, not a rolling period. Not modelled: the milk-based drinks exemption, export and dilution reliefs, the packaging exemptions in Finance Act 2021 s.52 and the credits for exported or converted packaging. Rates after 2026-27 carry forward. +- **Off-payroll working, termination awards and Class 1B.** Each per-worker threshold is netted across the headcount, as in the average-pay approximation. Leave the deemed payments at 0 for a small private-sector client. Class 1A on termination awards in 2022-23 uses 15.05% for the whole year; awards paid from 6 November 2022 at 13.8% are not separated. +- VAT registration is tested on annual turnover, not a rolling 12 months, and there is no cash or annual accounting. +- Freeport employer National Insurance relief enters through `firm_zero_rated_class_1_earnings`, and so does investment zone relief; `firm_in_freeport` on its own changes nothing. Veterans relief enters the same way: earnings of a veteran in the first year of civilian employment up to the veterans upper secondary threshold (£50,270 in 2026-27) carry a 0% secondary rate, in tax years 2022-23 to 2027-28 (National Insurance Contributions Act 2022 s.6(4)). The apprenticeship levy is UK-wide and does not depend on `firm_region`. +- Class 1A National Insurance (`firm_class_1a_ni`) is the Class 1A percentage times `firm_class_1a_benefits` (SSCBA 1992 s.10). The percentage equals the secondary Class 1 rate read at 30 April (13.8%, then 15% from 2025-26), except 14.53% in 2022-23. There is no threshold and the Employment Allowance cannot be set against it. It is part of `firm_tax` but not `firm_only_tax`, because households already carry Class 1A through `ni_class_1a` in `ni_employer`. +- In a simulation of firms alone, household variables cannot be computed, since there are no benefit units. diff --git a/myst.yml b/myst.yml index a6d0de6414..4e02ea1d68 100644 --- a/myst.yml +++ b/myst.yml @@ -17,6 +17,8 @@ project: - file: docs/book/usage/simulations.md - file: docs/book/usage/scenarios.md - file: docs/book/usage/dynamics.md + - file: docs/book/usage/firms.md + - file: docs/book/usage/firm-reforms.md # A `file:` entry fixes its page's place in a section. A `pattern:` entry # adds, at its own place, any other Markdown page in a section's folder, so a # new page needs no change here. The patterns match only Markdown, so each diff --git a/policyengine_uk/data/dataset_schema.py b/policyengine_uk/data/dataset_schema.py index 708d510877..3736a680ac 100644 --- a/policyengine_uk/data/dataset_schema.py +++ b/policyengine_uk/data/dataset_schema.py @@ -86,6 +86,7 @@ def __init__( energy_price_basis: dict[str, str | int] | EnergyPriceBasis | None = None, isa_income_contract: dict | None = None, savings_income_projection: str | None = None, + firm: pd.DataFrame | None = None, ): basis = parse_energy_price_basis(energy_price_basis) file_path = str(file_path) if file_path else None @@ -105,6 +106,8 @@ def __init__( self._person = f["person"] self._benunit = f["benunit"] self._household = f["household"] + # Optional: a dataset of households alone has no firm table. + self._firm = f["firm"] if "/firm" in f.keys() else None self.time_period = str(f["time_period"].iloc[0]) basis = merge_energy_price_basis(basis, read_energy_price_basis(file_path)) else: @@ -126,6 +129,7 @@ def __init__( self._person = person self._benunit = benunit self._household = household + self._firm = firm self.time_period = str(fiscal_year) self._energy_price_basis = basis @@ -139,7 +143,8 @@ def __init__( ) self.data_format = "arrays" # tables tuple points at the raw (int16) DataFrames used by the - # simulation engine internals - do not decode these. + # simulation engine internals - do not decode these. It holds the + # household-side tables only: the optional firm table is ``firm``. self.tables = (self._person, self._benunit, self._household) self.table_names = ("person", "benunit", "household") # Populated by _pre_encode_enum_columns in simulation.py after the @@ -199,12 +204,27 @@ def household(self, df: pd.DataFrame): self._household = df self.tables = (self._person, self._benunit, self._household) + @property + def firm(self) -> pd.DataFrame | None: + """The firm table, one row per firm, or None for a dataset without + firms. Kept out of ``tables`` and ``table_names``, which hold the + household-side tables that uprating and subsampling read.""" + if self._firm is None: + return None + return self._decode_enum_df(self._firm) + + @firm.setter + def firm(self, df: pd.DataFrame | None): + self._firm = df + def save(self, file_path: str): contract = validate_contract(self.isa_income_contract) with pd.HDFStore(file_path) as f: f.put("person", self.person, format="table", data_columns=True) f.put("benunit", self.benunit, format="table", data_columns=True) f.put("household", self.household, format="table", data_columns=True) + if self._firm is not None: + f.put("firm", self.firm, format="table", data_columns=True) f.put("time_period", pd.Series([self.time_period]), format="table") write_energy_price_basis(file_path, self._energy_price_basis) with h5py.File(file_path, "a") as f: @@ -215,7 +235,9 @@ def save(self, file_path: str): def load(self): data = {} - for df in (self.person, self.benunit, self.household): + for df in (self.person, self.benunit, self.household, self.firm): + if df is None: + continue for col in df.columns: data[col] = df[col].values @@ -226,18 +248,43 @@ def copy(self): person=self.person.copy(), benunit=self.benunit.copy(), household=self.household.copy(), + firm=None if self._firm is None else self.firm.copy(), fiscal_year=self.time_period, energy_price_basis=self._energy_price_basis, isa_income_contract=validate_contract(self.isa_income_contract), savings_income_projection=self.savings_income_projection, ) - def validate(self): + def validate(self, tax_benefit_system=None): + """Check the tables hold no NaNs and the firm table, if any, gives + only firm variables (or columns naming no variable, which loading + skips). ``tax_benefit_system`` defaults to the baseline system.""" # Check for NaNs in the tables - for df in self.tables: + tables = self.tables if self._firm is None else (*self.tables, self._firm) + for df in tables: for col in df.columns: if df[col].isna().any(): raise ValueError(f"Column '{col}' contains NaN values.") + if self._firm is None: + return + if tax_benefit_system is None: + from policyengine_uk.tax_benefit_system import system + + tax_benefit_system = system + variables = tax_benefit_system.variables + misplaced = { + col: variables[col].entity.key + for col in self._firm.columns + if col in variables and variables[col].entity.key != "firm" + } + if misplaced: + details = ", ".join( + f"'{col}' (a {entity} variable)" for col, entity in misplaced.items() + ) + raise ValueError( + f"The firm table gives variables that are not firm variables: " + f"{details}. Give them in their own entity's table." + ) @staticmethod def from_simulation( @@ -262,10 +309,31 @@ def from_simulation( input_variables, period=fiscal_year ) + # The firm table, only for a simulation with firms: one row per firm, + # in the population's order, with every firm input. + firm = None + firm_population = getattr(simulation, "populations", {}).get("firm") + if firm_population is not None and firm_population.count > 0: + firm_variables = [ + variable + for variable in simulation.input_variables + if simulation.tax_benefit_system.variables[variable].entity.key + == "firm" + ] + firm = pd.DataFrame( + { + variable: np.asarray(simulation.calculate(variable, fiscal_year)) + for variable in firm_variables + } + ) + if "firm_id" not in firm.columns: + firm["firm_id"] = np.arange(firm_population.count) + return UKSingleYearDataset( person=entity_dfs["person"], benunit=entity_dfs["benunit"], household=entity_dfs["household"], + firm=firm, fiscal_year=fiscal_year, energy_price_basis=energy_price_basis, isa_income_contract=simulation_contract(simulation, fiscal_year), @@ -316,10 +384,13 @@ def __init__( person_df = f[year] benunit_df = f[f"/benunit/{fiscal_year}"] household_df = f[f"/household/{fiscal_year}"] + firm_key = f"/firm/{fiscal_year}" + firm_df = f[firm_key] if firm_key in f.keys() else None self.datasets[fiscal_year] = UKSingleYearDataset( person=person_df, benunit=benunit_df, household=household_df, + firm=firm_df, fiscal_year=fiscal_year, isa_income_contract=contracts[fiscal_year], savings_income_projection=stored_savings_rule, @@ -385,6 +456,13 @@ def save(self, file_path: str): format="table", data_columns=True, ) + if dataset.firm is not None: + f.put( + f"firm/{year}", + dataset.firm, + format="table", + data_columns=True, + ) f.put( f"time_period/{year}", pd.Series([year]), @@ -456,7 +534,14 @@ def validate_file_path(file_path: str, raise_exception: bool = False): def load(self): data = {} for year, dataset in self.datasets.items(): - for df in (dataset.person, dataset.benunit, dataset.household): + for df in ( + dataset.person, + dataset.benunit, + dataset.household, + dataset.firm, + ): + if df is None: + continue for col in df.columns: if col not in data: data[col] = {} diff --git a/policyengine_uk/data/filter_dataset.py b/policyengine_uk/data/filter_dataset.py index 550eb629ab..b4fbe43ebb 100644 --- a/policyengine_uk/data/filter_dataset.py +++ b/policyengine_uk/data/filter_dataset.py @@ -77,6 +77,9 @@ def filter_dataset( person=new_dataset.person, household=new_dataset.household, benunit=new_dataset.benunit, + # Firms are not members of households, so filtering to one household + # does not select among them: the firm table passes through whole. + firm=new_dataset.firm, fiscal_year=year, energy_price_basis=new_dataset.energy_price_basis, isa_income_contract=new_dataset.isa_income_contract, diff --git a/policyengine_uk/entities.py b/policyengine_uk/entities.py index d83ee53b28..004e23ec25 100644 --- a/policyengine_uk/entities.py +++ b/policyengine_uk/entities.py @@ -43,4 +43,25 @@ is_person=True, ) -entities = [Household, BenUnit, Person] +# A firm is a root entity: a population of its own, with its own count, ids, +# weight and dataset table, and no members. People are not members of firms. +# policyengine-core has no root entity type, so Firm is a plain ``Entity`` +# (``is_person`` is True, as for every non-group entity). Core takes the +# first ``is_person`` entity in the system's list as its person entity and +# makes the rest of the non-person entities its group entities, so Firm must +# come after Person in ``CountryTaxBenefitSystem``'s entity list: it is then +# neither the person entity nor a group entity, and +# ``CountryTaxBenefitSystem.instantiate_entities`` adds its population. +Firm = build_entity( + key="firm", + plural="firms", + label="Firm", + doc=( + "A business: a company, sole trader or partnership. Firms form a " + "population of their own, with no members. A simulation built from a " + "household situation or dataset without firms has no firms." + ), + is_person=True, +) + +entities = [Household, BenUnit, Person, Firm] diff --git a/policyengine_uk/parameters/gov/contrib/policyengine/firm_incidence/README.md b/policyengine_uk/parameters/gov/contrib/policyengine/firm_incidence/README.md new file mode 100644 index 0000000000..d002a6910b --- /dev/null +++ b/policyengine_uk/parameters/gov/contrib/policyengine/firm_incidence/README.md @@ -0,0 +1,3 @@ +# Firm tax incidence + +How a change in firm-only tax liability (`firm_only_tax`, summed over firms with `firm_weight`) is shared between households in `firm_tax_incidence`. The three shares should sum to 1. The default puts all of it on capital, as `corporate_incident_tax_revenue_change` does today. diff --git a/policyengine_uk/parameters/gov/contrib/policyengine/firm_incidence/capital.yaml b/policyengine_uk/parameters/gov/contrib/policyengine/firm_incidence/capital.yaml new file mode 100644 index 0000000000..0644363e48 --- /dev/null +++ b/policyengine_uk/parameters/gov/contrib/policyengine/firm_incidence/capital.yaml @@ -0,0 +1,10 @@ +description: >- + Share of a change in firm-only tax liability that falls on owners of capital, allocated by each household's shareholding. +values: + 2010-01-01: 1 +metadata: + label: Firm tax capital incidence + unit: /1 + reference: + - title: PolicyEngine-UK corporate-incident tax allocation by shareholding (corporate_incident_tax_revenue_change) + href: https://github.com/PolicyEngine/policyengine-uk/blob/70014b3c12dea44773d0b06370416ed12e64f32e/policyengine_uk/variables/contrib/policyengine/corporate_incident_tax_revenue_change.py diff --git a/policyengine_uk/parameters/gov/contrib/policyengine/firm_incidence/consumer.yaml b/policyengine_uk/parameters/gov/contrib/policyengine/firm_incidence/consumer.yaml new file mode 100644 index 0000000000..24ed4b3438 --- /dev/null +++ b/policyengine_uk/parameters/gov/contrib/policyengine/firm_incidence/consumer.yaml @@ -0,0 +1,10 @@ +description: >- + Share of a change in firm-only tax liability that falls on consumers through prices, allocated by each household's share of UK consumption. +values: + 2010-01-01: 0 +metadata: + label: Firm tax consumer incidence + unit: /1 + reference: + - title: PolicyEngine-UK consumer-incident tax allocation by consumption share (consumer_incident_tax_revenue_change) + href: https://github.com/PolicyEngine/policyengine-uk/blob/70014b3c12dea44773d0b06370416ed12e64f32e/policyengine_uk/variables/contrib/policyengine/consumer_incident_tax_revenue_change.py diff --git a/policyengine_uk/parameters/gov/contrib/policyengine/firm_incidence/labour.yaml b/policyengine_uk/parameters/gov/contrib/policyengine/firm_incidence/labour.yaml new file mode 100644 index 0000000000..f0d47cf7fe --- /dev/null +++ b/policyengine_uk/parameters/gov/contrib/policyengine/firm_incidence/labour.yaml @@ -0,0 +1,10 @@ +description: >- + Share of a change in firm-only tax liability that falls on workers through lower pay, allocated by each household's share of UK employment income. +values: + 2010-01-01: 0 +metadata: + label: Firm tax labour incidence + unit: /1 + reference: + - title: PolicyEngine-UK employer NI employee incidence parameter + href: https://github.com/PolicyEngine/policyengine-uk/blob/70014b3c12dea44773d0b06370416ed12e64f32e/policyengine_uk/parameters/gov/contrib/policyengine/employer_ni/employee_incidence.yaml diff --git a/policyengine_uk/parameters/gov/dwp/auto_enrolment/README.md b/policyengine_uk/parameters/gov/dwp/auto_enrolment/README.md new file mode 100644 index 0000000000..3dc83e7f73 --- /dev/null +++ b/policyengine_uk/parameters/gov/dwp/auto_enrolment/README.md @@ -0,0 +1 @@ +# Automatic enrolment diff --git a/policyengine_uk/parameters/gov/dwp/auto_enrolment/earnings_trigger.yaml b/policyengine_uk/parameters/gov/dwp/auto_enrolment/earnings_trigger.yaml new file mode 100644 index 0000000000..6a417c6a24 --- /dev/null +++ b/policyengine_uk/parameters/gov/dwp/auto_enrolment/earnings_trigger.yaml @@ -0,0 +1,40 @@ +description: Annual earnings above which an employer must automatically enrol an eligible jobholder in a pension scheme. +# The firm-level formulas do not read this value, because they do not observe +# each employee's pay. The caller applies it by supplying the employees paid +# below it and their pay (firm_employees_below_auto_enrolment_earnings_trigger +# and firm_paybill_below_auto_enrolment_earnings_trigger), whom the formula +# treats as not enrolled. +# The first value is the trigger in force when employer duties began (from +# 1 October 2012); it is applied to earlier years. +values: + 2012-06-15: + value: 8_105 + metadata: + reference: + - title: Pensions Act 2008 s.3(1)(c), as substituted by SI 2012/1506 art 2 + href: https://www.legislation.gov.uk/ukpga/2008/30/section/3/2012-06-15 + 2013-04-06: + value: 9_440 + metadata: + reference: + - title: Pensions Act 2008 s.3(1)(c), as substituted by SI 2013/667 art 2 + href: https://www.legislation.gov.uk/ukpga/2008/30/section/3/2013-04-06 + 2014-04-06: + value: 10_000 + metadata: + reference: + - title: Pensions Act 2008 s.3(1)(c), as substituted by SI 2014/623 art 2(1) + href: https://www.legislation.gov.uk/ukpga/2008/30/section/3 + 2026-04-06: + value: 10_000 + metadata: + reference: + - title: "DWP: Review of the automatic enrolment earnings trigger and qualifying earnings band for 2026/27" + href: https://www.gov.uk/government/publications/review-of-the-automatic-enrolment-earnings-trigger-and-qualifying-earnings-band-for-202627/review-of-the-automatic-enrolment-earnings-trigger-and-qualifying-earnings-band-for-202627 +metadata: + unit: currency-GBP + period: year + label: Automatic enrolment earnings trigger + reference: + - title: Pensions Act 2008 s.3(1)(c) + href: https://www.legislation.gov.uk/ukpga/2008/30/section/3 diff --git a/policyengine_uk/parameters/gov/dwp/auto_enrolment/employer_minimum_contribution_rate.yaml b/policyengine_uk/parameters/gov/dwp/auto_enrolment/employer_minimum_contribution_rate.yaml new file mode 100644 index 0000000000..318272772c --- /dev/null +++ b/policyengine_uk/parameters/gov/dwp/auto_enrolment/employer_minimum_contribution_rate.yaml @@ -0,0 +1,42 @@ +description: Minimum employer contribution to a money purchase scheme used for automatic enrolment, as a share of the jobholder's qualifying earnings. +# Employer duties began with the largest employers on 1 October 2012 and were +# staged in by employer size to 2018. The first transitional period (1%) ran +# to 5 April 2018 and the second (2%) to 5 April 2019 (SI 2010/4 reg 5, as +# amended by SI 2016/719). +values: + 0000-01-01: 0 + # SI 2012/1682 brought the automatic enrolment provisions not already in + # force into force on 30 June 2012; duties applied to employers in stages + # from 1 October 2012, so the model dates the first rate to the first + # staging date. + 2012-10-01: + value: 0.01 + metadata: + reference: + - title: The Pensions Act 2008 (Commencement No. 13) Order 2012 (SI 2012/1682), explanatory note + href: https://www.legislation.gov.uk/uksi/2012/1682/note/made + - title: Pensions Act 2008 s.29(1)(a) (first transitional period) + href: https://www.legislation.gov.uk/ukpga/2008/30/section/29/2018-04-06 + 2018-04-06: + value: 0.02 + metadata: + reference: + - title: Pensions Act 2008 s.29(3)(a) (second transitional period) + href: https://www.legislation.gov.uk/ukpga/2008/30/section/29/2018-04-06 + - title: The Employers' Duties (Implementation) Regulations 2010 reg 5 + href: https://www.legislation.gov.uk/uksi/2010/4/regulation/5 + 2019-04-06: + value: 0.03 + metadata: + reference: + - title: Pensions Act 2008 s.20(1)(b) + href: https://www.legislation.gov.uk/ukpga/2008/30/section/20 + - title: The Employers' Duties (Implementation) Regulations 2010 reg 5 + href: https://www.legislation.gov.uk/uksi/2010/4/regulation/5 +metadata: + unit: /1 + period: year + label: Automatic enrolment employer minimum contribution rate + reference: + - title: Pensions Act 2008 s.20(1)(b) + href: https://www.legislation.gov.uk/ukpga/2008/30/section/20 diff --git a/policyengine_uk/parameters/gov/dwp/auto_enrolment/qualifying_earnings/README.md b/policyengine_uk/parameters/gov/dwp/auto_enrolment/qualifying_earnings/README.md new file mode 100644 index 0000000000..2845a6b810 --- /dev/null +++ b/policyengine_uk/parameters/gov/dwp/auto_enrolment/qualifying_earnings/README.md @@ -0,0 +1 @@ +# Qualifying earnings band diff --git a/policyengine_uk/parameters/gov/dwp/auto_enrolment/qualifying_earnings/lower_limit.yaml b/policyengine_uk/parameters/gov/dwp/auto_enrolment/qualifying_earnings/lower_limit.yaml new file mode 100644 index 0000000000..d5d9ddbc64 --- /dev/null +++ b/policyengine_uk/parameters/gov/dwp/auto_enrolment/qualifying_earnings/lower_limit.yaml @@ -0,0 +1,65 @@ +description: Annual earnings above which earnings count as qualifying earnings for automatic enrolment pension contributions. +# The first value is the band in force when employer duties began (from +# 1 October 2012); it is applied to earlier years. +values: + 2012-06-15: + value: 5_564 + metadata: + reference: + - title: Pensions Act 2008 s.13(1)(a), as substituted by SI 2012/1506 art 2 + href: https://www.legislation.gov.uk/ukpga/2008/30/section/13/2012-06-15 + 2013-04-06: + value: 5_668 + metadata: + reference: + - title: Pensions Act 2008 s.13(1)(a), as substituted by SI 2013/667 art 2 + href: https://www.legislation.gov.uk/ukpga/2008/30/section/13/2013-04-06 + 2014-04-06: + value: 5_772 + metadata: + reference: + - title: Pensions Act 2008 s.13(1)(a), as substituted by SI 2014/623 art 2 + href: https://www.legislation.gov.uk/ukpga/2008/30/section/13/2014-04-06 + 2015-04-06: + value: 5_824 + metadata: + reference: + - title: Pensions Act 2008 s.13(1)(a), as substituted by SI 2015/468 art 2 + href: https://www.legislation.gov.uk/ukpga/2008/30/section/13/2015-04-06 + 2017-04-06: + value: 5_876 + metadata: + reference: + - title: Pensions Act 2008 s.13(1)(a), as substituted by SI 2017/394 art 2 + href: https://www.legislation.gov.uk/ukpga/2008/30/section/13/2017-04-06 + 2018-04-06: + value: 6_032 + metadata: + reference: + - title: Pensions Act 2008 s.13(1)(a), as substituted by SI 2018/367 art 2 + href: https://www.legislation.gov.uk/ukpga/2008/30/section/13/2018-04-06 + 2019-04-06: + value: 6_136 + metadata: + reference: + - title: Pensions Act 2008 s.13(1)(a), as substituted by SI 2019/374 art 2(a) + href: https://www.legislation.gov.uk/ukpga/2008/30/section/13/2019-04-06 + 2020-04-06: + value: 6_240 + metadata: + reference: + - title: Pensions Act 2008 s.13(1)(a), as substituted by SI 2020/372 art 2 + href: https://www.legislation.gov.uk/ukpga/2008/30/section/13 + 2026-04-06: + value: 6_240 + metadata: + reference: + - title: "DWP: Review of the automatic enrolment earnings trigger and qualifying earnings band for 2026/27" + href: https://www.gov.uk/government/publications/review-of-the-automatic-enrolment-earnings-trigger-and-qualifying-earnings-band-for-202627/review-of-the-automatic-enrolment-earnings-trigger-and-qualifying-earnings-band-for-202627 +metadata: + unit: currency-GBP + period: year + label: Automatic enrolment qualifying earnings lower limit + reference: + - title: Pensions Act 2008 s.13(1)(a) + href: https://www.legislation.gov.uk/ukpga/2008/30/section/13 diff --git a/policyengine_uk/parameters/gov/dwp/auto_enrolment/qualifying_earnings/upper_limit.yaml b/policyengine_uk/parameters/gov/dwp/auto_enrolment/qualifying_earnings/upper_limit.yaml new file mode 100644 index 0000000000..ca32a07801 --- /dev/null +++ b/policyengine_uk/parameters/gov/dwp/auto_enrolment/qualifying_earnings/upper_limit.yaml @@ -0,0 +1,71 @@ +description: Annual earnings up to which earnings count as qualifying earnings for automatic enrolment pension contributions. +# The first value is the band in force when employer duties began (from +# 1 October 2012); it is applied to earlier years. +values: + 2012-06-15: + value: 42_475 + metadata: + reference: + - title: Pensions Act 2008 s.13(1)(b), as substituted by SI 2012/1506 art 2 + href: https://www.legislation.gov.uk/ukpga/2008/30/section/13/2012-06-15 + 2013-04-06: + value: 41_450 + metadata: + reference: + - title: Pensions Act 2008 s.13(1)(b), as substituted by SI 2013/667 art 2 + href: https://www.legislation.gov.uk/ukpga/2008/30/section/13/2013-04-06 + 2014-04-06: + value: 41_865 + metadata: + reference: + - title: Pensions Act 2008 s.13(1)(b), as substituted by SI 2014/623 art 2 + href: https://www.legislation.gov.uk/ukpga/2008/30/section/13/2014-04-06 + 2015-04-06: + value: 42_385 + metadata: + reference: + - title: Pensions Act 2008 s.13(1)(b), as substituted by SI 2015/468 art 2 + href: https://www.legislation.gov.uk/ukpga/2008/30/section/13/2015-04-06 + 2016-04-06: + value: 43_000 + metadata: + reference: + - title: Pensions Act 2008 s.13(1)(b), as substituted by SI 2016/435 art 2 + href: https://www.legislation.gov.uk/ukpga/2008/30/section/13/2016-04-06 + 2017-04-06: + value: 45_000 + metadata: + reference: + - title: Pensions Act 2008 s.13(1)(b), as substituted by SI 2017/394 art 2 + href: https://www.legislation.gov.uk/ukpga/2008/30/section/13/2017-04-06 + 2018-04-06: + value: 46_350 + metadata: + reference: + - title: Pensions Act 2008 s.13(1)(b), as substituted by SI 2018/367 art 2 + href: https://www.legislation.gov.uk/ukpga/2008/30/section/13/2018-04-06 + 2019-04-06: + value: 50_000 + metadata: + reference: + - title: Pensions Act 2008 s.13(1)(b), as substituted by SI 2019/374 art 2(b) + href: https://www.legislation.gov.uk/ukpga/2008/30/section/13/2019-04-06 + 2021-04-06: + value: 50_270 + metadata: + reference: + - title: Pensions Act 2008 s.13(1)(b), as substituted by SI 2021/314 art 2 + href: https://www.legislation.gov.uk/ukpga/2008/30/section/13 + 2026-04-06: + value: 50_270 + metadata: + reference: + - title: "DWP: Review of the automatic enrolment earnings trigger and qualifying earnings band for 2026/27" + href: https://www.gov.uk/government/publications/review-of-the-automatic-enrolment-earnings-trigger-and-qualifying-earnings-band-for-202627/review-of-the-automatic-enrolment-earnings-trigger-and-qualifying-earnings-band-for-202627 +metadata: + unit: currency-GBP + period: year + label: Automatic enrolment qualifying earnings upper limit + reference: + - title: Pensions Act 2008 s.13(1)(b) + href: https://www.legislation.gov.uk/ukpga/2008/30/section/13 diff --git a/policyengine_uk/parameters/gov/hmrc/apprenticeship_levy/README.md b/policyengine_uk/parameters/gov/hmrc/apprenticeship_levy/README.md new file mode 100644 index 0000000000..2a4ed0a8fb --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/apprenticeship_levy/README.md @@ -0,0 +1 @@ +# Apprenticeship levy diff --git a/policyengine_uk/parameters/gov/hmrc/apprenticeship_levy/allowance.yaml b/policyengine_uk/parameters/gov/hmrc/apprenticeship_levy/allowance.yaml new file mode 100644 index 0000000000..75d4a956bf --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/apprenticeship_levy/allowance.yaml @@ -0,0 +1,20 @@ +description: Levy allowance deducted from an employer's apprenticeship levy charge, shared between the members of a company unit of connected companies. +values: + 0000-01-01: 0 + 2017-04-06: + value: 15_000 + metadata: + reference: + - title: Finance Act 2016 s.99(5) + href: https://www.legislation.gov.uk/ukpga/2016/24/section/99 + - title: Finance Act 2016 s.120(2) + href: https://www.legislation.gov.uk/ukpga/2016/24/section/120 +metadata: + unit: currency-GBP + period: year + label: Apprenticeship levy allowance + reference: + - title: Finance Act 2016 s.99(5) + href: https://www.legislation.gov.uk/ukpga/2016/24/section/99 + - title: Finance Act 2016 s.101 (connected companies share one allowance) + href: https://www.legislation.gov.uk/ukpga/2016/24/section/101 diff --git a/policyengine_uk/parameters/gov/hmrc/apprenticeship_levy/rate.yaml b/policyengine_uk/parameters/gov/hmrc/apprenticeship_levy/rate.yaml new file mode 100644 index 0000000000..d1e11177f6 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/apprenticeship_levy/rate.yaml @@ -0,0 +1,20 @@ +description: Relevant percentage of an employer's pay bill charged as apprenticeship levy, before the levy allowance. +# The levy is charged for tax years beginning on or after 6 April 2017 +# (Finance Act 2016 s.120(2)), so the model states a zero before then. +values: + 0000-01-01: 0 + 2017-04-06: + value: 0.005 + metadata: + reference: + - title: Finance Act 2016 s.99(6) + href: https://www.legislation.gov.uk/ukpga/2016/24/section/99 + - title: Finance Act 2016 s.120(2) (tax year means the 12 months beginning with 6 April 2017 or any subsequent year) + href: https://www.legislation.gov.uk/ukpga/2016/24/section/120 +metadata: + unit: /1 + period: year + label: Apprenticeship levy rate + reference: + - title: Finance Act 2016 s.99 + href: https://www.legislation.gov.uk/ukpga/2016/24/section/99 diff --git a/policyengine_uk/parameters/gov/hmrc/bank_surcharge/allowance.yaml b/policyengine_uk/parameters/gov/hmrc/bank_surcharge/allowance.yaml new file mode 100644 index 0000000000..898d948126 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/bank_surcharge/allowance.yaml @@ -0,0 +1,23 @@ +description: Bank corporation tax surcharge allowance, the amount of a banking company's surcharge profits not charged to the surcharge. For a group it is shared between the group's banking companies. +values: + 2016-01-01: + value: 25_000_000 + metadata: + reference: + - title: Finance (No. 2) Act 2015 Sch. 3 (Corporation Tax Act 2010 s. 269DJ(3) as inserted) + href: https://www.legislation.gov.uk/ukpga/2015/33/schedule/3/enacted + 2023-04-01: + value: 100_000_000 + metadata: + reference: + - title: Finance Act 2022 s. 6(2)(c) and (3) + href: https://www.legislation.gov.uk/ukpga/2022/3/section/6 + - title: Corporation Tax Act 2010 s. 269DJ(3) + href: https://www.legislation.gov.uk/ukpga/2010/4/section/269DJ +metadata: + unit: currency-GBP + period: year + label: Bank surcharge allowance + reference: + - title: Corporation Tax Act 2010 ss. 269DA(3)-(4), 269DE and 269DJ + href: https://www.legislation.gov.uk/ukpga/2010/4/section/269DJ diff --git a/policyengine_uk/parameters/gov/hmrc/bank_surcharge/rate.yaml b/policyengine_uk/parameters/gov/hmrc/bank_surcharge/rate.yaml new file mode 100644 index 0000000000..0f1485cd51 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/bank_surcharge/rate.yaml @@ -0,0 +1,58 @@ +description: Bank corporation tax surcharge rate charged on a banking company's surcharge profits above its surcharge allowance. Dates are the legal start dates; each year label is the day-weighted average over 6 April to 5 April, which approximates the apportionment of an accounting period that straddles a change (1 January 2016, 1 January 2027). +values: + 2015-04-01: + value: 0 + metadata: + reference: + - title: Finance (No. 2) Act 2015 Sch. 3 para. 14 and 18 (surcharge from 1 January 2016) + href: https://www.legislation.gov.uk/ukpga/2015/33/schedule/3/enacted + 2016-01-01: + value: 0.08 + metadata: + reference: + - title: Finance (No. 2) Act 2015 Sch. 3 (Corporation Tax Act 2010 s. 269DA(1) as inserted) + href: https://www.legislation.gov.uk/ukpga/2015/33/schedule/3/enacted + 2023-04-01: + value: 0.03 + metadata: + reference: + - title: Finance Act 2022 s. 6(1) and (3) + href: https://www.legislation.gov.uk/ukpga/2022/3/section/6 + - title: Corporation Tax Act 2010 s. 269DA(1) + href: https://www.legislation.gov.uk/ukpga/2010/4/section/269DA + # Finance Bill 2026-27 (Bill 173) clause 7, per HMRC BKM409200. Not enacted: + # as at 22 November 2026 the Bill has had its Commons first reading (3 + # November 2026), with second reading set for 23 November 2026. The 6% rate + # and the 2028-04-01 return to 3% have provisional statutory effect only + # (Provisional Collection of Taxes Act 1968). + 2027-01-01: + value: 0.06 + metadata: + reference: + - title: HMRC policy paper, Increase in rate of Banking Surcharge for a temporary period (Budget 2026) + href: https://www.gov.uk/government/publications/increase-in-the-banking-surcharge-rate-for-a-temporary-period/increase-in-rate-of-banking-surcharge-for-temporary-period + - title: HMRC Banking Manual BKM409200 + href: https://www.gov.uk/hmrc-internal-manuals/banking-manual/bkm409200 + 2028-04-01: + value: 0.03 + metadata: + reference: + - title: HMRC Banking Manual BKM409200 (rate reverts to 3% from 1 April 2028) + href: https://www.gov.uk/hmrc-internal-manuals/banking-manual/bkm409200 + - title: HMRC policy paper, Increase in rate of Banking Surcharge for a temporary period (Budget 2026) + href: https://www.gov.uk/government/publications/increase-in-the-banking-surcharge-rate-for-a-temporary-period/increase-in-rate-of-banking-surcharge-for-temporary-period +metadata: + unit: /1 + period: year + label: Bank surcharge rate + # Commencement provisions split an accounting period that straddles a rate + # change in two and apportion profits between the parts by time (for + # example Finance Act 2022 s. 6(4)-(6) with Corporation Tax Act 2010 + # s. 1172). Day-weighting over the fiscal year approximates that for a firm + # with an April to March year, as for the annual investment allowance + # limit. The window runs from 6 April, so a change dated 1 April (2023, + # 2028) puts 5 days at the new rate into the previous year label. + fiscal_year_blend: true + reference: + - title: Corporation Tax Act 2010 s. 269DA + href: https://www.legislation.gov.uk/ukpga/2010/4/section/269DA diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/multipliers/high_value.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/multipliers/high_value.yaml new file mode 100644 index 0000000000..a0b3a3a4dc --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/multipliers/high_value.yaml @@ -0,0 +1,29 @@ +description: High-value non-domestic rating multiplier for England, for all properties with rateable value at or above the high-value threshold. +# Dates are the start of each English rating year (1 April). England only: +# Scotland (poundage), Wales and Northern Ireland set their own rates. +# The high-value multiplier starts on 1 April 2026 (Non-Domestic Rating +# (Multipliers and Private Schools) Act 2025). Before then these properties +# paid the standard multiplier, repeated here so the series does not backdate. +values: + 2023-04-01: 0.512 + 2024-04-01: 0.546 + 2025-04-01: 0.555 + 2026-04-01: 0.508 + 2027-04-01: 0.525 +metadata: + label: Business rates high-value multiplier + unit: /1 + period: year + reference: + - title: Local Government Finance Act 1988 Schedule 4ZA para 10 and Schedule 7 (multipliers) + href: https://www.legislation.gov.uk/ukpga/1988/41/schedule/4ZA + - title: Business Rates Information Letter 1/2023, notice of the 2023-24 multipliers (small business 49.9p, standard 51.2p) + href: https://assets.publishing.service.gov.uk/media/63eceb47d3bf7f62e8c34981/BRIL_1-_multiplier___demand_notice_-_14_Feb.pdf + - title: Business Rates Information Letter 1/2024 (2024-25 multipliers, standard 54.6p, small business 49.9p) + href: https://www.gov.uk/government/publications/12024-confirmation-of-business-rates-multipliers-and-relief-information/12024-confirmation-of-business-rates-multipliers-and-relief-information + - title: MHCLG, National non-domestic rates collected by councils in England, forecast 2025 to 2026 (2025-26 multipliers, standard 55.5p, small business 49.9p) + href: https://www.gov.uk/government/statistics/national-non-domestic-rates-collected-by-councils-in-england-forecast-2025-to-2026/national-non-domestic-rates-collected-by-councils-in-england-forecast-for-2025-to-2026 + - title: Business Rates Information Letter 5/2025, para 2 (2026-27 multipliers) + href: https://www.gov.uk/government/publications/52025-confirmation-of-budget-package-and-the-non-domestic-rating-multipliers-for-20262027/52025-confirmation-of-budget-package-and-the-non-domestic-rating-multipliers-for-20262027 + - title: Business Rates Information Letter 8/2026, main letter para 7 (2027-28 multipliers) + href: https://www.gov.uk/government/publications/82026-details-of-the-budget-package-and-the-multipliers-for-20272028/82026-details-of-the-budget-package-and-the-multipliers-for-20272028 diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/multipliers/high_value_threshold.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/multipliers/high_value_threshold.yaml new file mode 100644 index 0000000000..e4e9fc0a45 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/multipliers/high_value_threshold.yaml @@ -0,0 +1,14 @@ +description: Properties with rateable value at or above this amount pay the high-value multiplier in England. +# Before 2026-27 the high-value multiplier equals the standard multiplier, so +# this threshold has no effect in those years. +values: + 2026-04-01: 500_000 +metadata: + label: Business rates high-value multiplier threshold + unit: currency-GBP + period: year + reference: + - title: Local Government Finance Act 1988 Schedule 4ZA para 10(9B)(b) (£500,000 or more) + href: https://www.legislation.gov.uk/ukpga/1988/41/schedule/4ZA + - title: Business Rates Information Letter 5/2025, paras 1 and 3 + href: https://www.gov.uk/government/publications/52025-confirmation-of-budget-package-and-the-non-domestic-rating-multipliers-for-20262027/52025-confirmation-of-budget-package-and-the-non-domestic-rating-multipliers-for-20262027 diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/multipliers/index.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/multipliers/index.yaml new file mode 100644 index 0000000000..c919e15afb --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/multipliers/index.yaml @@ -0,0 +1,3 @@ +description: Non-domestic rating multipliers for England, in pounds of rates per pound of rateable value. +metadata: + label: Business rates multipliers diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/multipliers/small_business.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/multipliers/small_business.yaml new file mode 100644 index 0000000000..ee9bd55a27 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/multipliers/small_business.yaml @@ -0,0 +1,26 @@ +description: Small business non-domestic rating multiplier for England, for properties with rateable value below the small business threshold that are not retail, hospitality or leisure (RHL) properties. +# Dates are the start of each English rating year (1 April). England only: +# Scotland (poundage), Wales and Northern Ireland set their own rates. +values: + 2023-04-01: 0.499 + 2024-04-01: 0.499 + 2025-04-01: 0.499 + 2026-04-01: 0.432 + 2027-04-01: 0.447 +metadata: + label: Business rates small business multiplier + unit: /1 + period: year + reference: + - title: Local Government Finance Act 1988 Schedule 4ZA para 10 and Schedule 7 (multipliers) + href: https://www.legislation.gov.uk/ukpga/1988/41/schedule/4ZA + - title: Business Rates Information Letter 1/2023, notice of the 2023-24 multipliers (small business 49.9p, standard 51.2p) + href: https://assets.publishing.service.gov.uk/media/63eceb47d3bf7f62e8c34981/BRIL_1-_multiplier___demand_notice_-_14_Feb.pdf + - title: Business Rates Information Letter 1/2024 (2024-25 multipliers, standard 54.6p, small business 49.9p) + href: https://www.gov.uk/government/publications/12024-confirmation-of-business-rates-multipliers-and-relief-information/12024-confirmation-of-business-rates-multipliers-and-relief-information + - title: MHCLG, National non-domestic rates collected by councils in England, forecast 2025 to 2026 (2025-26 multipliers, standard 55.5p, small business 49.9p) + href: https://www.gov.uk/government/statistics/national-non-domestic-rates-collected-by-councils-in-england-forecast-2025-to-2026/national-non-domestic-rates-collected-by-councils-in-england-forecast-for-2025-to-2026 + - title: Business Rates Information Letter 5/2025, para 2 (2026-27 multipliers) + href: https://www.gov.uk/government/publications/52025-confirmation-of-budget-package-and-the-non-domestic-rating-multipliers-for-20262027/52025-confirmation-of-budget-package-and-the-non-domestic-rating-multipliers-for-20262027 + - title: Business Rates Information Letter 8/2026, main letter para 7 (2027-28 multipliers) + href: https://www.gov.uk/government/publications/82026-details-of-the-budget-package-and-the-multipliers-for-20272028/82026-details-of-the-budget-package-and-the-multipliers-for-20272028 diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/multipliers/small_business_applies_to_empty_and_charities.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/multipliers/small_business_applies_to_empty_and_charities.yaml new file mode 100644 index 0000000000..c792626c76 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/multipliers/small_business_applies_to_empty_and_charities.yaml @@ -0,0 +1,13 @@ +description: Whether the English small business multiplier also applies to unoccupied property and to property getting mandatory charitable relief; before 2024-25 those were charged at the standard multiplier. +values: + 2005-04-01: false + 2024-04-01: true +metadata: + unit: bool + period: year + label: Small business multiplier applies to empty and charity property + reference: + - title: Local Government Finance Act 1988 s.43(5) and s.45(4) as at 1 April 2023 (charities and unoccupied property charged on the non-domestic rating multiplier B) + href: https://www.legislation.gov.uk/ukpga/1988/41/section/43/2023-04-01 + - title: The Non-Domestic Rating (Multipliers and Private Information) Regulations 2024 (SI 2024/111), regs 2-3 (small business multiplier where rateable value is not more than £50,999, for Sch 4ZA charitable relief and Sch 4ZB unoccupied property, from 2024-25) + href: https://www.legislation.gov.uk/uksi/2024/111/made diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/multipliers/small_business_rhl.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/multipliers/small_business_rhl.yaml new file mode 100644 index 0000000000..e0adf0d921 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/multipliers/small_business_rhl.yaml @@ -0,0 +1,29 @@ +description: Small business retail, hospitality and leisure (RHL) non-domestic rating multiplier for England, for qualifying RHL properties with rateable value below the small business threshold. +# Dates are the start of each English rating year (1 April). England only: +# Scotland (poundage), Wales and Northern Ireland set their own rates. +# The RHL multipliers start on 1 April 2026 (Non-Domestic Rating (Multipliers +# and Private Schools) Act 2025). Before then RHL properties paid the general +# small business multiplier, repeated here so the series does not backdate. +values: + 2023-04-01: 0.499 + 2024-04-01: 0.499 + 2025-04-01: 0.499 + 2026-04-01: 0.382 + 2027-04-01: 0.395 +metadata: + label: Business rates small business RHL multiplier + unit: /1 + period: year + reference: + - title: Local Government Finance Act 1988 Schedule 4ZA para 10 and Schedule 7 (multipliers) + href: https://www.legislation.gov.uk/ukpga/1988/41/schedule/4ZA + - title: Business Rates Information Letter 1/2023, notice of the 2023-24 multipliers (small business 49.9p, standard 51.2p) + href: https://assets.publishing.service.gov.uk/media/63eceb47d3bf7f62e8c34981/BRIL_1-_multiplier___demand_notice_-_14_Feb.pdf + - title: Business Rates Information Letter 1/2024 (2024-25 multipliers, standard 54.6p, small business 49.9p) + href: https://www.gov.uk/government/publications/12024-confirmation-of-business-rates-multipliers-and-relief-information/12024-confirmation-of-business-rates-multipliers-and-relief-information + - title: MHCLG, National non-domestic rates collected by councils in England, forecast 2025 to 2026 (2025-26 multipliers, standard 55.5p, small business 49.9p) + href: https://www.gov.uk/government/statistics/national-non-domestic-rates-collected-by-councils-in-england-forecast-2025-to-2026/national-non-domestic-rates-collected-by-councils-in-england-forecast-for-2025-to-2026 + - title: Business Rates Information Letter 5/2025, para 2 (2026-27 multipliers) + href: https://www.gov.uk/government/publications/52025-confirmation-of-budget-package-and-the-non-domestic-rating-multipliers-for-20262027/52025-confirmation-of-budget-package-and-the-non-domestic-rating-multipliers-for-20262027 + - title: Business Rates Information Letter 8/2026, main letter para 7 (2027-28 multipliers) + href: https://www.gov.uk/government/publications/82026-details-of-the-budget-package-and-the-multipliers-for-20272028/82026-details-of-the-budget-package-and-the-multipliers-for-20272028 diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/multipliers/small_business_threshold.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/multipliers/small_business_threshold.yaml new file mode 100644 index 0000000000..30cf9a74f7 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/multipliers/small_business_threshold.yaml @@ -0,0 +1,15 @@ +description: Properties with rateable value below this amount pay a small business multiplier in England. +# BRIL 5/2025 para 1: "less than £51,000 RV", unchanged from 2026-27. The 2017 +# Order sets "not more than £50,999". So £50,999 pays the small multiplier and +# £51,000 the standard one. +values: + 2017-04-01: 51_000 +metadata: + label: Business rates small business multiplier threshold + unit: currency-GBP + period: year + reference: + - title: The Non-Domestic Rating (Reliefs, Thresholds and Amendment) (England) Order 2017 art 2 (not more than £50,999) + href: https://www.legislation.gov.uk/uksi/2017/102/article/2/made + - title: Business Rates Information Letter 5/2025, para 1 + href: https://www.gov.uk/government/publications/52025-confirmation-of-budget-package-and-the-non-domestic-rating-multipliers-for-20262027/52025-confirmation-of-budget-package-and-the-non-domestic-rating-multipliers-for-20262027 diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/multipliers/standard.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/multipliers/standard.yaml new file mode 100644 index 0000000000..f45081a379 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/multipliers/standard.yaml @@ -0,0 +1,27 @@ +description: Standard non-domestic rating multiplier for England, for properties with rateable value from the small business threshold up to the high-value threshold that are not retail, hospitality or leisure (RHL) properties. +# Dates are the start of each English rating year (1 April). England only: +# Scotland (poundage), Wales and Northern Ireland set their own rates. +# 2023-24 is 51.2p (BRIL 1/2023); 54.6p is the 2024-25 value (BRIL 1/2024). +values: + 2023-04-01: 0.512 + 2024-04-01: 0.546 + 2025-04-01: 0.555 + 2026-04-01: 0.48 + 2027-04-01: 0.497 +metadata: + label: Business rates standard multiplier + unit: /1 + period: year + reference: + - title: Local Government Finance Act 1988 Schedule 4ZA para 10 and Schedule 7 (multipliers) + href: https://www.legislation.gov.uk/ukpga/1988/41/schedule/4ZA + - title: Business Rates Information Letter 1/2023, notice of the 2023-24 multipliers (small business 49.9p, standard 51.2p) + href: https://assets.publishing.service.gov.uk/media/63eceb47d3bf7f62e8c34981/BRIL_1-_multiplier___demand_notice_-_14_Feb.pdf + - title: Business Rates Information Letter 1/2024 (2024-25 multipliers, standard 54.6p, small business 49.9p) + href: https://www.gov.uk/government/publications/12024-confirmation-of-business-rates-multipliers-and-relief-information/12024-confirmation-of-business-rates-multipliers-and-relief-information + - title: MHCLG, National non-domestic rates collected by councils in England, forecast 2025 to 2026 (2025-26 multipliers, standard 55.5p, small business 49.9p) + href: https://www.gov.uk/government/statistics/national-non-domestic-rates-collected-by-councils-in-england-forecast-2025-to-2026/national-non-domestic-rates-collected-by-councils-in-england-forecast-for-2025-to-2026 + - title: Business Rates Information Letter 5/2025, para 2 (2026-27 multipliers) + href: https://www.gov.uk/government/publications/52025-confirmation-of-budget-package-and-the-non-domestic-rating-multipliers-for-20262027/52025-confirmation-of-budget-package-and-the-non-domestic-rating-multipliers-for-20262027 + - title: Business Rates Information Letter 8/2026, main letter para 7 (2027-28 multipliers) + href: https://www.gov.uk/government/publications/82026-details-of-the-budget-package-and-the-multipliers-for-20272028/82026-details-of-the-budget-package-and-the-multipliers-for-20272028 diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/multipliers/standard_rhl.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/multipliers/standard_rhl.yaml new file mode 100644 index 0000000000..b92c0b011d --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/multipliers/standard_rhl.yaml @@ -0,0 +1,29 @@ +description: Standard retail, hospitality and leisure (RHL) non-domestic rating multiplier for England, for qualifying RHL properties with rateable value from the small business threshold up to the high-value threshold. +# Dates are the start of each English rating year (1 April). England only: +# Scotland (poundage), Wales and Northern Ireland set their own rates. +# The RHL multipliers start on 1 April 2026 (Non-Domestic Rating (Multipliers +# and Private Schools) Act 2025). Before then RHL properties paid the general +# standard multiplier, repeated here so the series does not backdate. +values: + 2023-04-01: 0.512 + 2024-04-01: 0.546 + 2025-04-01: 0.555 + 2026-04-01: 0.43 + 2027-04-01: 0.445 +metadata: + label: Business rates standard RHL multiplier + unit: /1 + period: year + reference: + - title: Local Government Finance Act 1988 Schedule 4ZA para 10 and Schedule 7 (multipliers) + href: https://www.legislation.gov.uk/ukpga/1988/41/schedule/4ZA + - title: Business Rates Information Letter 1/2023, notice of the 2023-24 multipliers (small business 49.9p, standard 51.2p) + href: https://assets.publishing.service.gov.uk/media/63eceb47d3bf7f62e8c34981/BRIL_1-_multiplier___demand_notice_-_14_Feb.pdf + - title: Business Rates Information Letter 1/2024 (2024-25 multipliers, standard 54.6p, small business 49.9p) + href: https://www.gov.uk/government/publications/12024-confirmation-of-business-rates-multipliers-and-relief-information/12024-confirmation-of-business-rates-multipliers-and-relief-information + - title: MHCLG, National non-domestic rates collected by councils in England, forecast 2025 to 2026 (2025-26 multipliers, standard 55.5p, small business 49.9p) + href: https://www.gov.uk/government/statistics/national-non-domestic-rates-collected-by-councils-in-england-forecast-2025-to-2026/national-non-domestic-rates-collected-by-councils-in-england-forecast-for-2025-to-2026 + - title: Business Rates Information Letter 5/2025, para 2 (2026-27 multipliers) + href: https://www.gov.uk/government/publications/52025-confirmation-of-budget-package-and-the-non-domestic-rating-multipliers-for-20262027/52025-confirmation-of-budget-package-and-the-non-domestic-rating-multipliers-for-20262027 + - title: Business Rates Information Letter 8/2026, main letter para 7 (2027-28 multipliers) + href: https://www.gov.uk/government/publications/82026-details-of-the-budget-package-and-the-multipliers-for-20272028/82026-details-of-the-budget-package-and-the-multipliers-for-20272028 diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/district_rate.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/district_rate.yaml new file mode 100644 index 0000000000..6993380b3d --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/district_rate.yaml @@ -0,0 +1,188 @@ +description: Non-domestic district rate in Northern Ireland, in pounds per pound of net annual value, set by each district council for the rate year beginning 1 April. Years before 2023-24 are not modelled, and 2026-27 values carry forward until later rates are added. +UNKNOWN: + values: + 2023-04-01: 0 + metadata: + label: Northern Ireland non-domestic district rate, unknown district + unit: currency-GBP +ANTRIM_AND_NEWTOWNABBEY: + values: + 2023-04-01: 0.262079 + 2024-04-01: 0.275128 + 2025-04-01: 0.288790 + 2026-04-01: 0.297391 + metadata: + label: Northern Ireland non-domestic district rate, Antrim and Newtownabbey + unit: currency-GBP + reference: + - title: Department for Communities Circular LG 09/2023, district rates 2023-24, Table 4 + href: https://www.communities-ni.gov.uk/sites/default/files/publications/communities/lg-09-2023.pdf + - title: Department of Finance, rate poundages 2024-25 to 2026-27 + href: https://www.finance-ni.gov.uk/articles/rate-poundages + - title: Department for Communities, district rates 2026-27 + href: https://www.communities-ni.gov.uk/sites/default/files/2026-02/district-rates-2026-2027.pdf +ARDS_AND_NORTH_DOWN: + values: + 2023-04-01: 0.262740 + 2024-04-01: 0.278467 + 2025-04-01: 0.288537 + 2026-04-01: 0.301556 + metadata: + label: Northern Ireland non-domestic district rate, Ards and North Down + unit: currency-GBP + reference: + - title: Department for Communities Circular LG 09/2023, district rates 2023-24, Table 4 + href: https://www.communities-ni.gov.uk/sites/default/files/publications/communities/lg-09-2023.pdf + - title: Department of Finance, rate poundages 2024-25 to 2026-27 + href: https://www.finance-ni.gov.uk/articles/rate-poundages + - title: Department for Communities, district rates 2026-27 + href: https://www.communities-ni.gov.uk/sites/default/files/2026-02/district-rates-2026-2027.pdf +ARMAGH_CITY_BANBRIDGE_AND_CRAIGAVON: + values: + 2023-04-01: 0.284645 + 2024-04-01: 0.299353 + 2025-04-01: 0.311069 + 2026-04-01: 0.319765 + metadata: + label: Northern Ireland non-domestic district rate, Armagh City, Banbridge and Craigavon + unit: currency-GBP + reference: + - title: Department for Communities Circular LG 09/2023, district rates 2023-24, Table 4 + href: https://www.communities-ni.gov.uk/sites/default/files/publications/communities/lg-09-2023.pdf + - title: Department of Finance, rate poundages 2024-25 to 2026-27 + href: https://www.finance-ni.gov.uk/articles/rate-poundages + - title: Department for Communities, district rates 2026-27 + href: https://www.communities-ni.gov.uk/sites/default/files/2026-02/district-rates-2026-2027.pdf +BELFAST: + values: + 2023-04-01: 0.293221 + 2024-04-01: 0.309162 + 2025-04-01: 0.327692 + 2026-04-01: 0.342388 + metadata: + label: Northern Ireland non-domestic district rate, Belfast + unit: currency-GBP + reference: + - title: Department for Communities Circular LG 09/2023, district rates 2023-24, Table 4 + href: https://www.communities-ni.gov.uk/sites/default/files/publications/communities/lg-09-2023.pdf + - title: Department of Finance, rate poundages 2024-25 to 2026-27 + href: https://www.finance-ni.gov.uk/articles/rate-poundages + - title: Department for Communities, district rates 2026-27 + href: https://www.communities-ni.gov.uk/sites/default/files/2026-02/district-rates-2026-2027.pdf +CAUSEWAY_COAST_AND_GLENS: + values: + 2023-04-01: 0.276325 + 2024-04-01: 0.295282 + 2025-04-01: 0.306049 + 2026-04-01: 0.316287 + metadata: + label: Northern Ireland non-domestic district rate, Causeway Coast and Glens + unit: currency-GBP + reference: + - title: Department for Communities Circular LG 09/2023, district rates 2023-24, Table 4 + href: https://www.communities-ni.gov.uk/sites/default/files/publications/communities/lg-09-2023.pdf + - title: Department of Finance, rate poundages 2024-25 to 2026-27 + href: https://www.finance-ni.gov.uk/articles/rate-poundages + - title: Department for Communities, district rates 2026-27 + href: https://www.communities-ni.gov.uk/sites/default/files/2026-02/district-rates-2026-2027.pdf +DERRY_CITY_AND_STRABANE: + values: + 2023-04-01: 0.354362 + 2024-04-01: 0.377408 + 2025-04-01: 0.395993 + 2026-04-01: 0.413735 + metadata: + label: Northern Ireland non-domestic district rate, Derry City and Strabane + unit: currency-GBP + reference: + - title: Department for Communities Circular LG 09/2023, district rates 2023-24, Table 4 + href: https://www.communities-ni.gov.uk/sites/default/files/publications/communities/lg-09-2023.pdf + - title: Department of Finance, rate poundages 2024-25 to 2026-27 + href: https://www.finance-ni.gov.uk/articles/rate-poundages + - title: Department for Communities, district rates 2026-27 + href: https://www.communities-ni.gov.uk/sites/default/files/2026-02/district-rates-2026-2027.pdf +FERMANAGH_AND_OMAGH: + values: + 2023-04-01: 0.244180 + 2024-04-01: 0.255700 + 2025-04-01: 0.265309 + 2026-04-01: 0.270502 + metadata: + label: Northern Ireland non-domestic district rate, Fermanagh and Omagh + unit: currency-GBP + reference: + - title: Department for Communities Circular LG 09/2023, district rates 2023-24, Table 4 + href: https://www.communities-ni.gov.uk/sites/default/files/publications/communities/lg-09-2023.pdf + - title: Department of Finance, rate poundages 2024-25 to 2026-27 + href: https://www.finance-ni.gov.uk/articles/rate-poundages + - title: Department for Communities, district rates 2026-27 + href: https://www.communities-ni.gov.uk/sites/default/files/2026-02/district-rates-2026-2027.pdf +LISBURN_AND_CASTLEREAGH: + values: + 2023-04-01: 0.247146 + 2024-04-01: 0.256984 + 2025-04-01: 0.267250 + 2026-04-01: 0.278596 + metadata: + label: Northern Ireland non-domestic district rate, Lisburn and Castlereagh + unit: currency-GBP + reference: + - title: Department for Communities Circular LG 09/2023, district rates 2023-24, Table 4 + href: https://www.communities-ni.gov.uk/sites/default/files/publications/communities/lg-09-2023.pdf + - title: Department of Finance, rate poundages 2024-25 to 2026-27 + href: https://www.finance-ni.gov.uk/articles/rate-poundages + - title: Department for Communities, district rates 2026-27 + href: https://www.communities-ni.gov.uk/sites/default/files/2026-02/district-rates-2026-2027.pdf +MID_AND_EAST_ANTRIM: + values: + 2023-04-01: 0.341696 + 2024-04-01: 0.382215 + 2025-04-01: 0.397448 + 2026-04-01: 0.409175 + metadata: + label: Northern Ireland non-domestic district rate, Mid and East Antrim + unit: currency-GBP + reference: + - title: Department for Communities Circular LG 09/2023, district rates 2023-24, Table 4 + href: https://www.communities-ni.gov.uk/sites/default/files/publications/communities/lg-09-2023.pdf + - title: Department of Finance, rate poundages 2024-25 to 2026-27 + href: https://www.finance-ni.gov.uk/articles/rate-poundages + - title: Department for Communities, district rates 2026-27 + href: https://www.communities-ni.gov.uk/sites/default/files/2026-02/district-rates-2026-2027.pdf +MID_ULSTER: + values: + 2023-04-01: 0.254449 + 2024-04-01: 0.269452 + 2025-04-01: 0.283324 + 2026-04-01: 0.292958 + metadata: + label: Northern Ireland non-domestic district rate, Mid Ulster + unit: currency-GBP + reference: + - title: Department for Communities Circular LG 09/2023, district rates 2023-24, Table 4 + href: https://www.communities-ni.gov.uk/sites/default/files/publications/communities/lg-09-2023.pdf + - title: Department of Finance, rate poundages 2024-25 to 2026-27 + href: https://www.finance-ni.gov.uk/articles/rate-poundages + - title: Department for Communities, district rates 2026-27 + href: https://www.communities-ni.gov.uk/sites/default/files/2026-02/district-rates-2026-2027.pdf +NEWRY_MOURNE_AND_DOWN: + values: + 2023-04-01: 0.272846 + 2024-04-01: 0.290334 + 2025-04-01: 0.301884 + 2026-04-01: 0.310337 + metadata: + label: Northern Ireland non-domestic district rate, Newry, Mourne and Down + unit: currency-GBP + reference: + - title: Department for Communities Circular LG 09/2023, district rates 2023-24, Table 4 + href: https://www.communities-ni.gov.uk/sites/default/files/publications/communities/lg-09-2023.pdf + - title: Department of Finance, rate poundages 2024-25 to 2026-27 + href: https://www.finance-ni.gov.uk/articles/rate-poundages + - title: Department for Communities, district rates 2026-27 + href: https://www.communities-ni.gov.uk/sites/default/files/2026-02/district-rates-2026-2027.pdf +metadata: + label: Northern Ireland non-domestic district rate + reference: + - title: Rates (Northern Ireland) Order 1977 Article 6 + href: https://www.legislation.gov.uk/nisi/1977/2157/article/6 diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/index.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/index.yaml new file mode 100644 index 0000000000..ab6e2f2181 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/index.yaml @@ -0,0 +1,3 @@ +description: Non-domestic rates in Northern Ireland. +metadata: + label: Northern Ireland non-domestic rates diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/modelled.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/modelled.yaml new file mode 100644 index 0000000000..131d68d033 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/modelled.yaml @@ -0,0 +1,11 @@ +description: Whether Northern Ireland non-domestic rates are modelled for the year. Rate poundages are held from 2023-24, so earlier years give no Northern Ireland bill. +values: + 0000-01-01: false + 2023-04-01: true +metadata: + unit: bool + period: year + label: Northern Ireland non-domestic rates modelled + reference: + - title: Rates (Northern Ireland) Order 1977 Article 6 + href: https://www.legislation.gov.uk/nisi/1977/2157/article/6 diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/regional_rate.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/regional_rate.yaml new file mode 100644 index 0000000000..51b69034b4 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/regional_rate.yaml @@ -0,0 +1,35 @@ +description: Non-domestic regional rate in Northern Ireland, in pounds per pound of net annual value, for the rate year beginning 1 April. Years before 2023-24 are not modelled, and the 2026-27 value carries forward until a later rate is added. +values: + 2023-04-01: + value: 0.2790 + metadata: + reference: + - title: The Regional Rates (Northern Ireland) Regulations 2023 (SI 2023/198) reg 2(2) + href: https://www.legislation.gov.uk/uksi/2023/198/made + 2024-04-01: + value: 0.2902 + metadata: + reference: + - title: The Rates (Regional Rates) Order (Northern Ireland) 2024 (SR 2024/28) art 3(1) + href: https://www.legislation.gov.uk/nisr/2024/28/made + 2025-04-01: + value: 0.2989 + metadata: + reference: + - title: The Rates (Regional Rates) Order (Northern Ireland) 2025 (SR 2025/27) art 3 + href: https://www.legislation.gov.uk/nisr/2025/27/made + 2026-04-01: + value: 0.3079 + metadata: + reference: + - title: The Rates (Regional Rates) Order (Northern Ireland) 2026 (SR 2026/19) art 3(1) + href: https://www.legislation.gov.uk/nisr/2026/19/made +metadata: + unit: currency-GBP + period: year + label: Northern Ireland non-domestic regional rate + reference: + - title: Rates (Northern Ireland) Order 1977 Article 6 + href: https://www.legislation.gov.uk/nisi/1977/2157/article/6 + - title: Department of Finance, rate poundages + href: https://www.finance-ni.gov.uk/articles/rate-poundages diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/small_business/in_effect.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/small_business/in_effect.yaml new file mode 100644 index 0000000000..16fdf70ea7 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/small_business/in_effect.yaml @@ -0,0 +1,11 @@ +description: Whether Northern Ireland small business rate relief is in effect. SR 2026/45 extends it to rate years ending before 1 April 2027, and no later extension has been made. +values: + 2023-04-01: true + 2027-04-01: false +metadata: + unit: bool + period: year + label: Northern Ireland small business rate relief in effect + reference: + - title: The Rates (Small Business Hereditament Relief) (Amendment) Regulations (Northern Ireland) 2026 (SR 2026/45) + href: https://www.legislation.gov.uk/nisr/2026/45/made diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/small_business/index.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/small_business/index.yaml new file mode 100644 index 0000000000..20697f2250 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/small_business/index.yaml @@ -0,0 +1,3 @@ +description: Northern Ireland small business rate relief. +metadata: + label: Northern Ireland small business rate relief diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/small_business/max_properties.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/small_business/max_properties.yaml new file mode 100644 index 0000000000..2f574c17f2 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/small_business/max_properties.yaml @@ -0,0 +1,10 @@ +description: Northern Ireland small business rate relief is not given where the occupier has more than this many hereditaments. +values: + 2023-04-01: 3 +metadata: + unit: /1 + period: year + label: Northern Ireland small business rate relief maximum hereditaments + reference: + - title: SR 2010/4 reg 3 + href: https://www.legislation.gov.uk/nisr/2010/4 diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/small_business/relief_rate.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/small_business/relief_rate.yaml new file mode 100644 index 0000000000..be8b9f903e --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/small_business/relief_rate.yaml @@ -0,0 +1,28 @@ +description: Northern Ireland small business rate relief as a share of the bill, by the net annual value of a wholly occupied hereditament. Each band includes its upper limit. +metadata: + type: single_amount + threshold_unit: currency-GBP + amount_unit: /1 + label: Northern Ireland small business rate relief rate + reference: + - title: The Rates (Small Business Hereditament Relief) Regulations (Northern Ireland) 2010 (SR 2010/4) reg 3 + href: https://www.legislation.gov.uk/nisr/2010/4 + - title: SR 2010/4 reg 3 as at 1 April 2023 + href: https://www.legislation.gov.uk/nisr/2010/4/2023-04-01 +brackets: + - threshold: + 2023-04-01: -.inf + amount: + 2023-04-01: 0.5 + - threshold: + 2023-04-01: 2_000 + amount: + 2023-04-01: 0.25 + - threshold: + 2023-04-01: 5_000 + amount: + 2023-04-01: 0.2 + - threshold: + 2023-04-01: 15_000 + amount: + 2023-04-01: 0 diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/unoccupied/exempt_nav_threshold.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/unoccupied/exempt_nav_threshold.yaml new file mode 100644 index 0000000000..88aae780f0 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/unoccupied/exempt_nav_threshold.yaml @@ -0,0 +1,10 @@ +description: Unoccupied non-domestic property in Northern Ireland with net annual value below this amount is not charged. +values: + 2023-04-01: 2_000 +metadata: + unit: currency-GBP + period: year + label: Northern Ireland unoccupied property exemption threshold + reference: + - title: The Rates (Unoccupied Hereditaments) Regulations (Northern Ireland) 2011 (SR 2011/36) + href: https://www.legislation.gov.uk/nisr/2011/36 diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/unoccupied/free_months.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/unoccupied/free_months.yaml new file mode 100644 index 0000000000..76e4e21861 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/unoccupied/free_months.yaml @@ -0,0 +1,10 @@ +description: Unoccupied non-domestic property in Northern Ireland is not charged for this many months after it becomes unoccupied. +values: + 2023-04-01: 3 +metadata: + unit: month + period: year + label: Northern Ireland unoccupied property free months + reference: + - title: The Rates (Unoccupied Hereditaments) Regulations (Northern Ireland) 2011 (SR 2011/36) + href: https://www.legislation.gov.uk/nisr/2011/36 diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/unoccupied/index.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/unoccupied/index.yaml new file mode 100644 index 0000000000..ef4fcb0d4e --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/unoccupied/index.yaml @@ -0,0 +1,3 @@ +description: Rating of unoccupied non-domestic property in Northern Ireland. +metadata: + label: Northern Ireland unoccupied property diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/unoccupied/rate.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/unoccupied/rate.yaml new file mode 100644 index 0000000000..82d7994298 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/northern_ireland/unoccupied/rate.yaml @@ -0,0 +1,10 @@ +description: Share of the occupied bill charged on unoccupied non-domestic property in Northern Ireland. +values: + 2023-04-01: 0.5 +metadata: + unit: /1 + period: year + label: Northern Ireland unoccupied property rate share + reference: + - title: Rates (Northern Ireland) Order 1977 Schedule 8A paragraph 2 + href: https://www.legislation.gov.uk/nisi/1977/2157/schedule/8A diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/charity/rate.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/charity/rate.yaml new file mode 100644 index 0000000000..837863ff73 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/charity/rate.yaml @@ -0,0 +1,27 @@ +description: Mandatory charitable rate relief in England, Wales and Scotland, as a share of the rates bill, for property occupied by a charity and used wholly or mainly for charitable purposes. +# The ratepayer pays one fifth of the bill in England, Wales and Scotland. +# Private and independent schools are excluded (England Sch 4ZA para 2(3), +# Wales para 2A, Scotland 1962 Act s.4(9)); not modelled. +values: + # From 1 April 1990 the charge was A x B / (C x 5), one fifth of the full + # bill (LGFA 1988 s.43(5)-(6) as enacted). Schedule 4ZA para 2 restates the + # same one-fifth formula from 1 April 2024 (Non-Domestic Rating Act 2023). + 1990-04-01: + value: 0.8 + metadata: + reference: + - title: Local Government Finance Act 1988 s.43(5) and (6), as enacted (chargeable amount A x B / (C x 5) for a charity) + href: https://www.legislation.gov.uk/ukpga/1988/41/section/43/enacted +metadata: + label: Mandatory charitable rate relief + unit: /1 + period: year + reference: + - title: Local Government Finance Act 1988 s.43(5) and (6), as enacted + href: https://www.legislation.gov.uk/ukpga/1988/41/section/43/enacted + - title: Local Government Finance Act 1988 Schedule 4ZA para 2(1) and (2)(a) (A x M / (C x 5), from 1 April 2024) + href: https://www.legislation.gov.uk/ukpga/1988/41/schedule/4ZA + - title: Local Government (Financial Provisions etc.) (Scotland) Act 1962 s.4(2) (rate not to exceed one fifth for a charity) + href: https://www.legislation.gov.uk/ukpga/1962/9/section/4 + - title: GOV.UK, Charitable rate relief (80%) + href: https://www.gov.uk/apply-for-business-rate-relief/charitable-rate-relief diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/empty_property/exempt_months.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/empty_property/exempt_months.yaml new file mode 100644 index 0000000000..84da997e5f --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/empty_property/exempt_months.yaml @@ -0,0 +1,12 @@ +description: Unoccupied non-domestic property in England pays no rates for this many months of continuous vacancy. +values: + 2008-04-01: 3 +metadata: + label: Empty property rates exemption period + unit: month + period: year + reference: + - title: The Non-Domestic Rating (Unoccupied Property) (England) Regulations 2008 reg 4(a) + href: https://www.legislation.gov.uk/uksi/2008/386/regulation/4 + - title: The Non-Domestic Rating (Unoccupied Property) (England) Regulations 2008 reg 1 (in force 1 April 2008) + href: https://www.legislation.gov.uk/uksi/2008/386/regulation/1/made diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/empty_property/index.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/empty_property/index.yaml new file mode 100644 index 0000000000..1644d890a1 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/empty_property/index.yaml @@ -0,0 +1,3 @@ +description: Empty (unoccupied) property rates exemption in England. +metadata: + label: Empty property relief diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/empty_property/industrial_exempt_months.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/empty_property/industrial_exempt_months.yaml new file mode 100644 index 0000000000..6b696396ce --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/empty_property/industrial_exempt_months.yaml @@ -0,0 +1,12 @@ +description: Unoccupied qualifying industrial property in England pays no rates for this many months of continuous vacancy. +values: + 2008-04-01: 6 +metadata: + label: Empty industrial property rates exemption period + unit: month + period: year + reference: + - title: The Non-Domestic Rating (Unoccupied Property) (England) Regulations 2008 reg 4(b) + href: https://www.legislation.gov.uk/uksi/2008/386/regulation/4 + - title: The Non-Domestic Rating (Unoccupied Property) (England) Regulations 2008 reg 1 (in force 1 April 2008) + href: https://www.legislation.gov.uk/uksi/2008/386/regulation/1/made diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/empty_property/small_property_threshold.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/empty_property/small_property_threshold.yaml new file mode 100644 index 0000000000..3bb4c5fc72 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/empty_property/small_property_threshold.yaml @@ -0,0 +1,18 @@ +description: Unoccupied non-domestic property in England with rateable value below this amount pays no rates for as long as it stays empty. +values: + 2008-04-01: 2_200 + 2009-04-01: 15_000 + 2010-04-01: 18_000 + 2011-04-01: 2_600 + 2017-04-01: 2_900 +metadata: + label: Empty property small rateable value exemption threshold + unit: currency-GBP + period: year + reference: + - title: The Non-Domestic Rating (Unoccupied Property) (England) Regulations 2008 reg 4(g) ("whose rateable value is less than £2,200") + href: https://www.legislation.gov.uk/uksi/2008/386/regulation/4 + - title: The Non-Domestic Rating (Unoccupied Property) (England) (Amendment) Regulations 2017 (SI 2017/102), art 4(2) (£2,200 in 2008-09, £15,000 in 2009-10, £18,000 in 2010-11, £2,600 from 2011-12, £2,900 from 2017-18) + href: https://www.legislation.gov.uk/uksi/2017/102/article/4 + - title: GOV.UK, Empty property relief ("buildings with a rateable value under £2,900 - until they're reoccupied") + href: https://www.gov.uk/apply-for-business-rate-relief/empty-property-relief diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/index.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/index.yaml new file mode 100644 index 0000000000..2389c49a59 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/index.yaml @@ -0,0 +1,3 @@ +description: Business rates reliefs in England. +metadata: + label: Business rates reliefs diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/pubs_and_live_music_venues/index.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/pubs_and_live_music_venues/index.yaml new file mode 100644 index 0000000000..f6d4ae3396 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/pubs_and_live_music_venues/index.yaml @@ -0,0 +1,3 @@ +description: Business rates relief for pubs and live music venues in England, from 1 April 2026. +metadata: + label: Pubs and live music venues relief diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/pubs_and_live_music_venues/large_venue_rate.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/pubs_and_live_music_venues/large_venue_rate.yaml new file mode 100644 index 0000000000..7232050b0b --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/pubs_and_live_music_venues/large_venue_rate.yaml @@ -0,0 +1,17 @@ +description: Business rates relief for live music venues (not pubs) in England with rateable value at or above the large venue threshold, as a share of the rates bill left after other reliefs. +# BRIL 8/2026 Annex para 6(b) keeps 15% for live music venues with rateable +# value of £1m or more in 2027-28 and 2028-29. Pubs get the main rate (35%) +# whatever their rateable value. In 2026-27 the rate equals the main rate. +values: + 2023-04-01: 0 + 2026-04-01: 0.15 + 2029-04-01: 0 +metadata: + label: Pubs and live music venues relief rate for large live music venues + unit: /1 + period: year + reference: + - title: GOV.UK, Pubs and live music venues relief (15% for 2026 to 2027) + href: https://www.gov.uk/apply-for-business-rate-relief/pubs-and-live-music-venues-relief + - title: Business Rates Information Letter 8/2026, Technical Annex para 6(b) + href: https://www.gov.uk/government/publications/82026-details-of-the-budget-package-and-the-multipliers-for-20272028/82026-details-of-the-budget-package-and-the-multipliers-for-20272028 diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/pubs_and_live_music_venues/large_venue_threshold.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/pubs_and_live_music_venues/large_venue_threshold.yaml new file mode 100644 index 0000000000..476f7e816c --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/pubs_and_live_music_venues/large_venue_threshold.yaml @@ -0,0 +1,10 @@ +description: Live music venues (not pubs) with rateable value at or above this amount get the large venue rate of relief in England. +values: + 2027-04-01: 1_000_000 +metadata: + label: Pubs and live music venues relief large venue threshold + unit: currency-GBP + period: year + reference: + - title: Business Rates Information Letter 8/2026, Technical Annex para 6(b) + href: https://www.gov.uk/government/publications/82026-details-of-the-budget-package-and-the-multipliers-for-20272028/82026-details-of-the-budget-package-and-the-multipliers-for-20272028 diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/pubs_and_live_music_venues/rate.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/pubs_and_live_music_venues/rate.yaml new file mode 100644 index 0000000000..eb2d27116d --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/pubs_and_live_music_venues/rate.yaml @@ -0,0 +1,29 @@ +description: Business rates relief for occupied pubs and live music venues in England, as a share of the rates bill left after other reliefs. +# 15% for 2026-27; Budget 2026 raises it to 35% for 2027-28 and 2028-29 +# (BRIL 8/2026 Annex para 6(a)). Nothing yet sets the relief from 2029-30, so +# it is 0 from 2029-04-01. Social clubs are covered from 2027-28 but are not +# separately flagged here. +values: + 2023-04-01: 0 + 2026-04-01: + value: 0.15 + metadata: + reference: + - title: GOV.UK, Pubs and live music venues relief (15% for 2026 to 2027) + href: https://www.gov.uk/apply-for-business-rate-relief/pubs-and-live-music-venues-relief + 2027-04-01: + value: 0.35 + metadata: + reference: + - title: Business Rates Information Letter 8/2026, Technical Annex para 6(a) + href: https://www.gov.uk/government/publications/82026-details-of-the-budget-package-and-the-multipliers-for-20272028/82026-details-of-the-budget-package-and-the-multipliers-for-20272028 + 2029-04-01: 0 +metadata: + label: Pubs and live music venues relief rate + unit: /1 + period: year + reference: + - title: GOV.UK, Pubs and live music venues relief (15% for 2026 to 2027) + href: https://www.gov.uk/apply-for-business-rate-relief/pubs-and-live-music-venues-relief + - title: Business Rates Information Letter 8/2026, Technical Annex para 6(a) + href: https://www.gov.uk/government/publications/82026-details-of-the-budget-package-and-the-multipliers-for-20272028/82026-details-of-the-budget-package-and-the-multipliers-for-20272028 diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/retail_hospitality_leisure/cap.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/retail_hospitality_leisure/cap.yaml new file mode 100644 index 0000000000..398559721b --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/retail_hospitality_leisure/cap.yaml @@ -0,0 +1,14 @@ +description: Cash cap on retail, hospitality and leisure (RHL) relief per business across all its properties in England. +values: + 2023-04-01: 110_000 +metadata: + label: Retail, hospitality and leisure relief cash cap + unit: currency-GBP + period: year + reference: + - title: Business Rates Relief, 2023/24 Retail, Hospitality and Leisure Scheme, paras 5, 14 and 19 + href: https://www.gov.uk/government/publications/business-rates-relief-202324-retail-hospitality-and-leisure-scheme-local-authority-guidance/business-rates-relief-202324-retail-hospitality-and-leisure-scheme + - title: Business Rates Relief, 2024/25 Retail, Hospitality and Leisure Scheme, paras 5 and 18 + href: https://www.gov.uk/guidance/business-rates-relief-202425-retail-hospitality-and-leisure-scheme + - title: Business Rates Relief, 2025/26 Retail, Hospitality and Leisure Scheme, para 18 + href: https://www.gov.uk/guidance/business-rates-relief-202526-retail-hospitality-and-leisure-scheme diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/retail_hospitality_leisure/index.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/retail_hospitality_leisure/index.yaml new file mode 100644 index 0000000000..52fa213979 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/retail_hospitality_leisure/index.yaml @@ -0,0 +1,3 @@ +description: Retail, hospitality and leisure (RHL) business rates relief in England, a discretionary relief under Local Government Finance Act 1988 s47 funded by section 31 grants. It ended on 31 March 2026. +metadata: + label: Retail, hospitality and leisure relief diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/retail_hospitality_leisure/rate.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/retail_hospitality_leisure/rate.yaml new file mode 100644 index 0000000000..0cbd633f5d --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/retail_hospitality_leisure/rate.yaml @@ -0,0 +1,38 @@ +description: Retail, hospitality and leisure (RHL) relief in England, as a share of the rates bill left after mandatory reliefs. +# Earlier schemes (before 2023-24) are not encoded; the model backdates the +# 2023-24 value to those years. The relief ended on 31 March 2026, +# when the RHL multipliers replaced it. +values: + 2023-04-01: + value: 0.75 + metadata: + reference: + - title: Business Rates Relief, 2023/24 Retail, Hospitality and Leisure Scheme, paras 5 and 14(a) + href: https://www.gov.uk/government/publications/business-rates-relief-202324-retail-hospitality-and-leisure-scheme-local-authority-guidance/business-rates-relief-202324-retail-hospitality-and-leisure-scheme + 2024-04-01: + value: 0.75 + metadata: + reference: + - title: Business Rates Relief, 2024/25 Retail, Hospitality and Leisure Scheme, paras 5 and 14(a) + href: https://www.gov.uk/guidance/business-rates-relief-202425-retail-hospitality-and-leisure-scheme + 2025-04-01: + value: 0.4 + metadata: + reference: + - title: Business Rates Relief, 2025/26 Retail, Hospitality and Leisure Scheme, para 14(a) + href: https://www.gov.uk/guidance/business-rates-relief-202526-retail-hospitality-and-leisure-scheme + 2026-04-01: + value: 0 + metadata: + reference: + - title: GOV.UK, Retail, hospitality and leisure relief (no new claims; from 1 April 2026 bills use the RHL multipliers) + href: https://www.gov.uk/apply-for-business-rate-relief/retail-discount +metadata: + label: Retail, hospitality and leisure relief rate + unit: /1 + period: year + reference: + - title: Business Rates Relief, 2025/26 Retail, Hospitality and Leisure Scheme, para 14(a) + href: https://www.gov.uk/guidance/business-rates-relief-202526-retail-hospitality-and-leisure-scheme + - title: GOV.UK, Retail, hospitality and leisure relief + href: https://www.gov.uk/apply-for-business-rate-relief/retail-discount diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/small_business/full_relief_threshold.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/small_business/full_relief_threshold.yaml new file mode 100644 index 0000000000..bd84a78491 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/small_business/full_relief_threshold.yaml @@ -0,0 +1,14 @@ +description: Properties with rateable value at or below this amount get 100% small business rate relief in England, other than qualifying retail, hospitality and leisure (RHL) properties. +values: + 2017-04-01: 12_000 +metadata: + label: Small business rate relief full relief threshold + unit: currency-GBP + period: year + reference: + - title: Local Government Finance Act 1988 Schedule 4ZA para 4 (small business rate relief, conditions prescribed by the Secretary of State) + href: https://www.legislation.gov.uk/ukpga/1988/41/schedule/4ZA + - title: The Non-Domestic Rating (Small Business Rate Relief) (England) Regulations 2023 reg 3 (full relief at £12,000 or less, tapered relief above £12,000 and up to £15,000, from 1 April 2024; replaces SI 2017/102 art 3) + href: https://www.legislation.gov.uk/uksi/2023/1250/regulation/3 + - title: GOV.UK, Small business rate relief (100% at £12,000 or less, tapering to 0% at £15,000; 50% at £13,500) + href: https://www.gov.uk/apply-for-business-rate-relief/small-business-rate-relief diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/small_business/index.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/small_business/index.yaml new file mode 100644 index 0000000000..4f72ac606a --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/small_business/index.yaml @@ -0,0 +1,3 @@ +description: Small business rate relief (SBRR) in England. +metadata: + label: Small business rate relief diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/small_business/rhl_full_relief_threshold.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/small_business/rhl_full_relief_threshold.yaml new file mode 100644 index 0000000000..1a31d37c53 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/small_business/rhl_full_relief_threshold.yaml @@ -0,0 +1,23 @@ +description: Qualifying retail, hospitality and leisure (RHL) properties with rateable value at or below this amount get 100% small business rate relief in England. +# Budget 2026 raises the RHL threshold to £18,000 from 1 April 2027 "until +# 31/3/29" (BRIL 8/2026 Annex para 5(b)); the 2029-04-01 value restores the +# general threshold, as nothing yet extends it. Vape shops lose SBRR and adult +# gaming centres keep the £12,000/£15,000 thresholds (para 5(a), (c)); not +# modelled. +values: + 2017-04-01: 12_000 + 2027-04-01: 18_000 + 2029-04-01: 12_000 +metadata: + label: Small business rate relief RHL full relief threshold + unit: currency-GBP + period: year + reference: + - title: Local Government Finance Act 1988 Schedule 4ZA para 4 (small business rate relief, conditions prescribed by the Secretary of State) + href: https://www.legislation.gov.uk/ukpga/1988/41/schedule/4ZA + - title: The Non-Domestic Rating (Small Business Rate Relief) (England) Regulations 2023 reg 3 (full relief at £12,000 or less, tapered relief above £12,000 and up to £15,000, from 1 April 2024; replaces SI 2017/102 art 3) + href: https://www.legislation.gov.uk/uksi/2023/1250/regulation/3 + - title: GOV.UK, Small business rate relief (100% at £12,000 or less, tapering to 0% at £15,000; 50% at £13,500) + href: https://www.gov.uk/apply-for-business-rate-relief/small-business-rate-relief + - title: Business Rates Information Letter 8/2026, Technical Annex para 5(b) (RHL thresholds £12,000 to £18,000 and £15,000 to £21,000 until 31/3/29) + href: https://www.gov.uk/government/publications/82026-details-of-the-budget-package-and-the-multipliers-for-20272028/82026-details-of-the-budget-package-and-the-multipliers-for-20272028 diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/small_business/rhl_taper_end_threshold.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/small_business/rhl_taper_end_threshold.yaml new file mode 100644 index 0000000000..93ab4c32be --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/small_business/rhl_taper_end_threshold.yaml @@ -0,0 +1,20 @@ +description: For qualifying retail, hospitality and leisure (RHL) properties, small business rate relief tapers (the bill is the gross bill divided by a factor E = 3,000 / (rateable value less the full relief threshold), to three decimal places, SI 2023/1250 reg 3) from 100% at the RHL full relief threshold to 0% at this rateable value in England. +# Raised to £21,000 from 1 April 2027 "until 31/3/29" (BRIL 8/2026 Annex +# para 5(b)); the 2029-04-01 value restores the general threshold. +values: + 2017-04-01: 15_000 + 2027-04-01: 21_000 + 2029-04-01: 15_000 +metadata: + label: Small business rate relief RHL taper end threshold + unit: currency-GBP + period: year + reference: + - title: Local Government Finance Act 1988 Schedule 4ZA para 4 (small business rate relief, conditions prescribed by the Secretary of State) + href: https://www.legislation.gov.uk/ukpga/1988/41/schedule/4ZA + - title: The Non-Domestic Rating (Small Business Rate Relief) (England) Regulations 2023 reg 3 (full relief at £12,000 or less, tapered relief above £12,000 and up to £15,000, from 1 April 2024; replaces SI 2017/102 art 3) + href: https://www.legislation.gov.uk/uksi/2023/1250/regulation/3 + - title: GOV.UK, Small business rate relief (100% at £12,000 or less, tapering to 0% at £15,000; 50% at £13,500) + href: https://www.gov.uk/apply-for-business-rate-relief/small-business-rate-relief + - title: Business Rates Information Letter 8/2026, Technical Annex para 5(b) (RHL thresholds £12,000 to £18,000 and £15,000 to £21,000 until 31/3/29) + href: https://www.gov.uk/government/publications/82026-details-of-the-budget-package-and-the-multipliers-for-20272028/82026-details-of-the-budget-package-and-the-multipliers-for-20272028 diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/small_business/taper_end_threshold.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/small_business/taper_end_threshold.yaml new file mode 100644 index 0000000000..866d4c012c --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/reliefs/small_business/taper_end_threshold.yaml @@ -0,0 +1,14 @@ +description: Small business rate relief tapers (the bill is the gross bill divided by a factor E = 3,000 / (rateable value less the full relief threshold), to three decimal places, SI 2023/1250 reg 3) from 100% at the full relief threshold to 0% at this rateable value in England, other than for qualifying retail, hospitality and leisure (RHL) properties. +values: + 2017-04-01: 15_000 +metadata: + label: Small business rate relief taper end threshold + unit: currency-GBP + period: year + reference: + - title: Local Government Finance Act 1988 Schedule 4ZA para 4 (small business rate relief, conditions prescribed by the Secretary of State) + href: https://www.legislation.gov.uk/ukpga/1988/41/schedule/4ZA + - title: The Non-Domestic Rating (Small Business Rate Relief) (England) Regulations 2023 reg 3 (full relief at £12,000 or less, tapered relief above £12,000 and up to £15,000, from 1 April 2024; replaces SI 2017/102 art 3) + href: https://www.legislation.gov.uk/uksi/2023/1250/regulation/3 + - title: GOV.UK, Small business rate relief (100% at £12,000 or less, tapering to 0% at £15,000; 50% at £13,500) + href: https://www.gov.uk/apply-for-business-rate-relief/small-business-rate-relief diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/index.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/index.yaml new file mode 100644 index 0000000000..856f684ba4 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/index.yaml @@ -0,0 +1,3 @@ +description: Non-domestic rates in Scotland. +metadata: + label: Scotland non-domestic rates diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/poundage/basic.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/poundage/basic.yaml new file mode 100644 index 0000000000..a0d6410b63 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/poundage/basic.yaml @@ -0,0 +1,19 @@ +description: Basic property rate (non-domestic rate poundage) in Scotland, paid on every property. +values: + 2023-04-01: 0.498 + 2024-04-01: 0.498 + 2025-04-01: 0.498 + 2026-04-01: 0.481 +metadata: + label: Scotland basic property rate + unit: /1 + period: year + reference: + - title: The Non-Domestic Rate (Scotland) Order 2023 (SSI 2023/29) art 2 (49.8p, 2023-24) + href: https://www.legislation.gov.uk/ssi/2023/29/made + - title: The Non-Domestic Rate (Scotland) Order 2024 (SSI 2024/3) art 2 (49.8p, 2024-25) + href: https://www.legislation.gov.uk/ssi/2024/3/made + - title: The Non-Domestic Rate (Scotland) Order 2025 (SSI 2025/37) art 2 (49.8p, 2025-26) + href: https://www.legislation.gov.uk/ssi/2025/37/made + - title: The Non-Domestic Rate (Scotland) Order 2026 (SSI 2026/39) art 2 (48.1p, 2026-27) + href: https://www.legislation.gov.uk/ssi/2026/39/made diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/poundage/higher_supplement.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/poundage/higher_supplement.yaml new file mode 100644 index 0000000000..fd3bc36cc4 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/poundage/higher_supplement.yaml @@ -0,0 +1,19 @@ +description: Additional factor added to the basic property rate in Scotland for properties with rateable value above the higher threshold (the higher property rate). +values: + 2023-04-01: 0.026 + 2024-04-01: 0.061 + 2025-04-01: 0.07 + 2026-04-01: 0.067 +metadata: + label: Scotland higher property supplement + unit: /1 + period: year + reference: + - title: Levying regulations SSI 2023/30 reg 6(4) (0.026) + href: https://www.legislation.gov.uk/ssi/2023/30/made + - title: Levying regulations SSI 2024/4 reg 6(4) (0.061) + href: https://www.legislation.gov.uk/ssi/2024/4/made + - title: Levying regulations SSI 2025/38 reg 6 (0.07) + href: https://www.legislation.gov.uk/ssi/2025/38/made + - title: Levying regulations SSI 2026/68 reg 6(3) (0.067) + href: https://www.legislation.gov.uk/ssi/2026/68/made diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/poundage/higher_threshold.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/poundage/higher_threshold.yaml new file mode 100644 index 0000000000..7b6c4dbdae --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/poundage/higher_threshold.yaml @@ -0,0 +1,12 @@ +description: Properties in Scotland with rateable value above this amount pay the higher property rate. +values: + 2023-04-01: 100_000 +metadata: + label: Scotland higher threshold + unit: currency-GBP + period: year + reference: + - title: SSI 2023/30 reg 6(1) (rateable value exceeding £100,000) + href: https://www.legislation.gov.uk/ssi/2023/30/made + - title: SSI 2026/68 reg 6(1) (rateable value exceeding £100,000) + href: https://www.legislation.gov.uk/ssi/2026/68/made diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/poundage/index.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/poundage/index.yaml new file mode 100644 index 0000000000..997b45cb52 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/poundage/index.yaml @@ -0,0 +1,3 @@ +description: Non-domestic rate poundage in Scotland (basic property rate plus property supplements). +metadata: + label: Scotland non-domestic rate poundage diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/poundage/intermediate_supplement.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/poundage/intermediate_supplement.yaml new file mode 100644 index 0000000000..b783d1d05c --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/poundage/intermediate_supplement.yaml @@ -0,0 +1,19 @@ +description: Additional factor added to the basic property rate in Scotland for properties with rateable value above the intermediate threshold, up to the higher threshold (the intermediate property rate). +values: + 2023-04-01: 0.013 + 2024-04-01: 0.047 + 2025-04-01: 0.056 + 2026-04-01: 0.054 +metadata: + label: Scotland intermediate property supplement + unit: /1 + period: year + reference: + - title: Levying regulations SSI 2023/30 reg 5(4) (0.013) + href: https://www.legislation.gov.uk/ssi/2023/30/made + - title: Levying regulations SSI 2024/4 reg 5(4) (0.047) + href: https://www.legislation.gov.uk/ssi/2024/4/made + - title: Levying regulations SSI 2025/38 reg 5 (0.056) + href: https://www.legislation.gov.uk/ssi/2025/38/made + - title: Levying regulations SSI 2026/68 reg 5(3) (0.054) + href: https://www.legislation.gov.uk/ssi/2026/68/made diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/poundage/intermediate_threshold.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/poundage/intermediate_threshold.yaml new file mode 100644 index 0000000000..be7ab5fcba --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/poundage/intermediate_threshold.yaml @@ -0,0 +1,12 @@ +description: Properties in Scotland with rateable value above this amount pay the intermediate property rate. +values: + 2023-04-01: 51_000 +metadata: + label: Scotland intermediate threshold + unit: currency-GBP + period: year + reference: + - title: SSI 2023/30 reg 5(1) (rateable value exceeding £51,000, but not exceeding £100,000) + href: https://www.legislation.gov.uk/ssi/2023/30/made + - title: SSI 2026/68 reg 5(1) (rateable value exceeding £51,000, but not exceeding £100,000) + href: https://www.legislation.gov.uk/ssi/2026/68/made diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/small_business_bonus/full_relief_threshold.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/small_business_bonus/full_relief_threshold.yaml new file mode 100644 index 0000000000..95526d1436 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/small_business_bonus/full_relief_threshold.yaml @@ -0,0 +1,14 @@ +description: Single-entry properties in Scotland with rateable value at or below this amount get 100% Small Business Bonus Scheme relief. +values: + 2023-04-01: 12_000 +metadata: + label: Scotland SBBS full relief threshold + unit: currency-GBP + period: year + reference: + - title: SSI 2023/30 reg 3(3) table (£12,000 or less, 100%) + href: https://www.legislation.gov.uk/ssi/2023/30/made + - title: SSI 2026/68 reg 3(3) table (£12,000 or less, 100%) + href: https://www.legislation.gov.uk/ssi/2026/68/made + - title: Scottish Government, Local government finance circular 7/2026, Table 3 + href: https://www.gov.scot/publications/local-government-finance-circular-7-2026-non-domestic-rates-relief-guidance/pages/non-domestic-rates-relief-information-for-scottish-local-authorities/ diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/small_business_bonus/index.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/small_business_bonus/index.yaml new file mode 100644 index 0000000000..46c83c27ee --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/small_business_bonus/index.yaml @@ -0,0 +1,3 @@ +description: Small Business Bonus Scheme (SBBS) relief in Scotland, single-entry rules from 1 April 2023. +metadata: + label: Scotland Small Business Bonus Scheme diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/small_business_bonus/middle_relief_rate.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/small_business_bonus/middle_relief_rate.yaml new file mode 100644 index 0000000000..c63a3c6312 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/small_business_bonus/middle_relief_rate.yaml @@ -0,0 +1,12 @@ +description: Small Business Bonus Scheme relief rate in Scotland at the middle threshold, from which relief tapers to 0% at the taper end. +values: + 2023-04-01: 0.25 +metadata: + label: Scotland SBBS middle relief rate + unit: /1 + period: year + reference: + - title: Scottish Government, Local government finance circular 5/2023, Table 5 (relief 100 - 75 x ... between £12,001 and £15,000; 25 x (20000 - RV) / 5000 between £15,001 and £20,000) + href: https://www.gov.scot/publications/local-government-finance-circular-5-2023-non-domestic-rates-relief-guidance/pages/small-business-bonus-scheme/ + - title: Scottish Government, Local government finance circular 7/2026, Table 3 + href: https://www.gov.scot/publications/local-government-finance-circular-7-2026-non-domestic-rates-relief-guidance/pages/non-domestic-rates-relief-information-for-scottish-local-authorities/ diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/small_business_bonus/middle_threshold.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/small_business_bonus/middle_threshold.yaml new file mode 100644 index 0000000000..e2c0ca25e2 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/small_business_bonus/middle_threshold.yaml @@ -0,0 +1,14 @@ +description: Small Business Bonus Scheme relief in Scotland tapers from 100% down to the middle relief rate at this rateable value. +values: + 2023-04-01: 15_000 +metadata: + label: Scotland SBBS middle threshold + unit: currency-GBP + period: year + reference: + - title: Scottish Government, Local government finance circular 5/2023, Small Business Bonus Scheme, Table 5 (£12,001 to £15,000, relief = 100 - 75 x (1 - (15000 - RV) / 3000)) + href: https://www.gov.scot/publications/local-government-finance-circular-5-2023-non-domestic-rates-relief-guidance/pages/small-business-bonus-scheme/ + - title: Scottish Government, Local government finance circular 7/2026, Table 3 (same bands and formulas) + href: https://www.gov.scot/publications/local-government-finance-circular-7-2026-non-domestic-rates-relief-guidance/pages/non-domestic-rates-relief-information-for-scottish-local-authorities/ + - title: SSI 2023/30 reg 3(3) + href: https://www.legislation.gov.uk/ssi/2023/30/made diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/small_business_bonus/taper_end_threshold.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/small_business_bonus/taper_end_threshold.yaml new file mode 100644 index 0000000000..f30ee6c702 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/scotland/small_business_bonus/taper_end_threshold.yaml @@ -0,0 +1,14 @@ +description: Small Business Bonus Scheme relief in Scotland tapers to 0% at this rateable value; single-entry properties must be below it. +values: + 2023-04-01: 20_000 +metadata: + label: Scotland SBBS taper end threshold + unit: currency-GBP + period: year + reference: + - title: SSI 2023/30 reg 3(1)(b) (rateable value of less than £20,000) + href: https://www.legislation.gov.uk/ssi/2023/30/made + - title: SSI 2026/68 reg 3(1) (rateable value of less than £20,000) + href: https://www.legislation.gov.uk/ssi/2026/68/made + - title: Scottish Government, Local government finance circular 7/2026, Table 3 (relief = 25 x ((20000 - RV) / 5000)) + href: https://www.gov.scot/publications/local-government-finance-circular-7-2026-non-domestic-rates-relief-guidance/pages/non-domestic-rates-relief-information-for-scottish-local-authorities/ diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/wales/index.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/wales/index.yaml new file mode 100644 index 0000000000..41ed96d89f --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/wales/index.yaml @@ -0,0 +1,3 @@ +description: Non-domestic rates in Wales. +metadata: + label: Wales non-domestic rates diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/wales/multipliers/higher.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/wales/multipliers/higher.yaml new file mode 100644 index 0000000000..7afc08f183 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/wales/multipliers/higher.yaml @@ -0,0 +1,21 @@ +description: Higher non-domestic rating multiplier in Wales, for properties with rateable value above the higher multiplier threshold. +# Before 2026-27 this equals the single Welsh multiplier, and the threshold +# is infinite, so it has no effect. From 1 April 2027 WSI 2026/133 raises +# it to 1.042 times the standard multiplier; 2027-28 values are not set yet +# and the 2026-27 value carries forward. +values: + 2023-04-01: 0.535 + 2024-04-01: 0.562 + 2025-04-01: 0.568 + 2026-04-01: 0.515 +metadata: + label: Wales higher non-domestic rating multiplier + unit: /1 + period: year + reference: + - title: Welsh Government written statement, Non-domestic rates support 2026-27 (higher multiplier 0.515) + href: https://gov.wales/written-statement-non-domestic-rates-support-2026-27 + - title: Business Wales, Non-domestic rates multipliers 2026-27 (higher multiplier 0.515 above £100,000) + href: https://businesswales.gov.wales/non-domestic-rates-multipliers + - title: The Non-Domestic Rating (Value of Differential Multipliers) (Wales) Regulations 2026 (WSI 2026/39), reg 2 (higher multiplier 1.026 times the standard) + href: https://www.legislation.gov.uk/wsi/2026/39/made diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/wales/multipliers/higher_threshold.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/wales/multipliers/higher_threshold.yaml new file mode 100644 index 0000000000..048008fe2e --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/wales/multipliers/higher_threshold.yaml @@ -0,0 +1,15 @@ +description: Properties in Wales with rateable value above this amount pay the higher non-domestic rating multiplier. +# Infinite before 2026-27, so a reform to the single pre-2026 multiplier +# (the standard parameter) reaches every Welsh property. +values: + 2023-04-01: .inf + 2026-04-01: 100_000 +metadata: + label: Wales higher multiplier threshold + unit: currency-GBP + period: year + reference: + - title: Business Wales, Non-domestic rates multipliers 2026-27 ("a higher multiplier of 0.515, applicable to properties with a rateable value above £100,000") + href: https://businesswales.gov.wales/non-domestic-rates-multipliers + - title: The Non-Domestic Rating (Description of Differential Multipliers) (Wales) Regulations 2025 (WSI 2025/1163), reg 4 ("a rateable value of more than £100,000", excluding 19 public-service list descriptions) + href: https://www.legislation.gov.uk/wsi/2025/1163/made diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/wales/multipliers/index.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/wales/multipliers/index.yaml new file mode 100644 index 0000000000..1ac8158704 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/wales/multipliers/index.yaml @@ -0,0 +1,3 @@ +description: Non-domestic rating multipliers in Wales. +metadata: + label: Wales non-domestic rating multipliers diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/wales/multipliers/retail.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/wales/multipliers/retail.yaml new file mode 100644 index 0000000000..b236d8b501 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/wales/multipliers/retail.yaml @@ -0,0 +1,21 @@ +description: Retail non-domestic rating multiplier in Wales, for shops, kiosks, pharmacies and post offices with rateable value below the retail multiplier threshold. +# Before 2026-27 this equals the single Welsh multiplier, so it has no effect. +# From 2026-27 it is 0.697 times the standard multiplier (0.697 x 0.502 = +# 0.349894), calculated to three decimal places only (LGFA 1988 Sch 7 +# para A19(2)) and published as 0.350. +values: + 2023-04-01: 0.535 + 2024-04-01: 0.562 + 2025-04-01: 0.568 + 2026-04-01: 0.350 +metadata: + label: Wales retail non-domestic rating multiplier + unit: /1 + period: year + reference: + - title: The Non-Domestic Rating (Value of Differential Multipliers) (Wales) Regulations 2026 (WSI 2026/39), reg 2(1)(a) (retail multiplier 0.697 times the standard) + href: https://www.legislation.gov.uk/wsi/2026/39/made + - title: Local Government Finance Act 1988, Schedule 7, para A19(2) (differential multipliers calculated to three decimal places only) + href: https://www.legislation.gov.uk/ukpga/1988/41/schedule/7 + - title: Business Wales, Non-domestic rates multipliers 2026-27 (retail multiplier 0.350) + href: https://businesswales.gov.wales/non-domestic-rates-multipliers diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/wales/multipliers/retail_threshold.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/wales/multipliers/retail_threshold.yaml new file mode 100644 index 0000000000..7833f68fea --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/wales/multipliers/retail_threshold.yaml @@ -0,0 +1,17 @@ +description: Retail properties in Wales with rateable value below this amount pay the retail non-domestic rating multiplier. +# Zero before 2026-27 (no property is below it), so a reform to the single +# pre-2026 multiplier (the standard parameter) reaches every Welsh property. +# From 1 April 2027 WSI 2026/133 renames this the lower multiplier and +# widens it to about 37 descriptions; that change is not modelled. +values: + 2023-04-01: 0 + 2026-04-01: 51_000 +metadata: + label: Wales retail multiplier threshold + unit: currency-GBP + period: year + reference: + - title: The Non-Domestic Rating (Description of Differential Multipliers) (Wales) Regulations 2025 (WSI 2025/1163), reg 3 ("a rateable value of less than £51,000") + href: https://www.legislation.gov.uk/wsi/2025/1163/made + - title: Business Wales, Non-domestic rates multipliers 2026-27 + href: https://businesswales.gov.wales/non-domestic-rates-multipliers diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/wales/multipliers/standard.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/wales/multipliers/standard.yaml new file mode 100644 index 0000000000..f7e56fea8a --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/wales/multipliers/standard.yaml @@ -0,0 +1,26 @@ +description: Non-domestic rating multiplier for Wales; from 2026-27 the standard multiplier, paid by properties that pay neither the retail nor the higher multiplier. +# Before 2026-27 one multiplier applied to every property in Wales. +values: + 2023-04-01: 0.535 + 2024-04-01: 0.562 + 2025-04-01: 0.568 + 2026-04-01: 0.502 +metadata: + label: Wales standard non-domestic rating multiplier + unit: /1 + period: year + reference: + - title: Welsh Government, Non-domestic rates collected by local councils, April 2023 to March 2024 ("For the financial year 2023-24 the multiplier was 0.535") + href: https://gov.wales/non-domestic-rates-actuals-april-2023-march-2024-html + - title: Welsh Government, Non-domestic rates collected by local councils, April 2024 to March 2025 ("the multiplier was 0.562") + href: https://gov.wales/non-domestic-rates-actuals-april-2024-march-2025-html + - title: The Non-Domestic Rating (Multiplier) (Wales) Regulations 2024 (SI 2024/180) + href: https://www.legislation.gov.uk/wsi/2024/180/made + - title: Welsh Government written statement, Non-domestic rates support 2025-26 (provisional multiplier 0.568, increase capped at 1%; confirmed by SI 2025/182, which raises the 2024-25 multiplier of 0.562 by 1%) + href: https://www.gov.wales/written-statement-non-domestic-rates-support-2025-26 + - title: The Non-Domestic Rating (Multiplier) (Wales) Regulations 2025 (SI 2025/182), item B 133.3, a 1% increase + href: https://www.legislation.gov.uk/wsi/2025/182/made + - title: Welsh Government written statement, Non-domestic rates support 2026-27 (standard multiplier 0.502) + href: https://gov.wales/written-statement-non-domestic-rates-support-2026-27 + - title: Business Wales, Non-domestic rates multipliers 2026-27 + href: https://businesswales.gov.wales/non-domestic-rates-multipliers diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/wales/small_business/full_relief_threshold.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/wales/small_business/full_relief_threshold.yaml new file mode 100644 index 0000000000..9637ff1cce --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/wales/small_business/full_relief_threshold.yaml @@ -0,0 +1,14 @@ +description: Properties in Wales with rateable value at or below this amount get 100% small business rates relief. +values: + 2023-04-01: 6_000 +metadata: + label: Wales SBRR full relief threshold + unit: currency-GBP + period: year + reference: + - title: Welsh Government, Non-domestic rates collected by local councils, April 2024 to March 2025 (100% relief up to £6,000, tapering from £6,001 to £12,000) + href: https://gov.wales/non-domestic-rates-actuals-april-2024-march-2025-html + - title: Business Wales, Non-domestic rates small business rates relief (2026-27 liability) + href: https://businesswales.gov.wales/non-domestic-rates-small-business-rates-relief + - title: The Non-Domestic Rating (Small Business Relief) (Wales) Order 2017 (SI 2017/1229) + href: https://www.legislation.gov.uk/wsi/2017/1229/made diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/wales/small_business/index.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/wales/small_business/index.yaml new file mode 100644 index 0000000000..c4c8909d89 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/wales/small_business/index.yaml @@ -0,0 +1,3 @@ +description: Small business rates relief (SBRR) in Wales. +metadata: + label: Wales small business rates relief diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/wales/small_business/max_properties.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/wales/small_business/max_properties.yaml new file mode 100644 index 0000000000..ef01d6450a --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/wales/small_business/max_properties.yaml @@ -0,0 +1,12 @@ +description: A business in Wales gets small business rates relief on at most this many properties in each local authority. +# The firm model has no local authority, so this is applied to the firm's +# total number of properties. +values: + 2023-04-01: 2 +metadata: + label: Wales SBRR maximum properties + unit: int + period: year + reference: + - title: Business Wales, Non-domestic rates small business rates relief ("limited to two properties per business in each local authority") + href: https://businesswales.gov.wales/non-domestic-rates-small-business-rates-relief diff --git a/policyengine_uk/parameters/gov/hmrc/business_rates/wales/small_business/taper_end_threshold.yaml b/policyengine_uk/parameters/gov/hmrc/business_rates/wales/small_business/taper_end_threshold.yaml new file mode 100644 index 0000000000..bf250e21a6 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/business_rates/wales/small_business/taper_end_threshold.yaml @@ -0,0 +1,14 @@ +description: Small business rates relief in Wales tapers from 100% to 0% at this rateable value. +values: + 2023-04-01: 12_000 +metadata: + label: Wales SBRR taper end threshold + unit: currency-GBP + period: year + reference: + - title: Welsh Government, Non-domestic rates collected by local councils, April 2024 to March 2025 (tapered 100% to 0% between £6,001 and £12,000) + href: https://gov.wales/non-domestic-rates-actuals-april-2024-march-2025-html + - title: Business Wales, Non-domestic rates small business rates relief (2026-27 liability) + href: https://businesswales.gov.wales/non-domestic-rates-small-business-rates-relief + - title: The Non-Domestic Rating (Small Business Relief) (Wales) Order 2017 (SI 2017/1229) + href: https://www.legislation.gov.uk/wsi/2017/1229/made diff --git a/policyengine_uk/parameters/gov/hmrc/corporation_tax/capital_allowances/annual_investment_allowance/limit.yaml b/policyengine_uk/parameters/gov/hmrc/corporation_tax/capital_allowances/annual_investment_allowance/limit.yaml new file mode 100644 index 0000000000..4baf5c30e6 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/corporation_tax/capital_allowances/annual_investment_allowance/limit.yaml @@ -0,0 +1,38 @@ +description: Maximum annual investment allowance a business can claim for a year on plant and machinery expenditure under section 51A of the Capital Allowances Act 2001, shared between related businesses and group companies. +values: + 2014-04-01: + value: 500_000 + metadata: + reference: + - title: Finance Act 2014 s 10(1) and (3) (£500,000 from 1 April 2014 for corporation tax to 31 December 2015) + href: https://www.legislation.gov.uk/ukpga/2014/26/section/10 + 2016-01-01: + value: 200_000 + metadata: + reference: + - title: Finance (No. 2) Act 2015 s 8(1) (£200,000 for expenditure incurred on or after 1 January 2016) + href: https://www.legislation.gov.uk/ukpga/2015/33/section/8 + 2019-01-01: + value: 1_000_000 + metadata: + reference: + - title: Finance Act 2019 s 32(1) (£1,000,000 for 1 January 2019 to 31 March 2023, as extended by Finance Act 2022 s 12(1)) + href: https://www.legislation.gov.uk/ukpga/2019/1/section/32 + 2023-04-01: + value: 1_000_000 + metadata: + reference: + - title: Capital Allowances Act 2001 s 51A(5), as substituted by Finance (No. 2) Act 2023 s 8(2)(a) (permanent £1,000,000) + href: https://www.legislation.gov.uk/ukpga/2001/2/section/51A +metadata: + unit: currency-GBP + period: year + label: Annual investment allowance limit + # The limit changed on 1 January in 2016 and 2019. Day-weighting over the + # fiscal year approximates the time-apportioned limit CAA 2001 and the + # amending Acts give a chargeable period that straddles the change (for + # example Finance Act 2019 Sch 13), for a firm with an April to March year. + fiscal_year_blend: true + reference: + - title: Capital Allowances Act 2001 s 51A(5) + href: https://www.legislation.gov.uk/ukpga/2001/2/section/51A diff --git a/policyengine_uk/parameters/gov/hmrc/corporation_tax/capital_allowances/first_year_allowances/full_expensing_rate.yaml b/policyengine_uk/parameters/gov/hmrc/corporation_tax/capital_allowances/first_year_allowances/full_expensing_rate.yaml new file mode 100644 index 0000000000..7fd2a59642 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/corporation_tax/capital_allowances/first_year_allowances/full_expensing_rate.yaml @@ -0,0 +1,27 @@ +description: First-year allowance rate for companies on new and unused main-rate plant and machinery, as a share of the expenditure. It is the super-deduction of 130% for expenditure from 1 April 2021 to 31 March 2023 and full expensing of 100% from 1 April 2023. +values: + 2012-04-01: + value: 0 + metadata: + reference: + - title: Finance Act 2021 s 9 (no general first-year allowance for main-rate plant before the super-deduction) + href: https://www.legislation.gov.uk/ukpga/2021/26/section/9 + 2021-04-01: + value: 1.3 + metadata: + reference: + - title: Finance Act 2021 s 9(2) (super-deduction of 130% on expenditure incurred from 1 April 2021 to 31 March 2023 by a company) + href: https://www.legislation.gov.uk/ukpga/2021/26/section/9 + 2023-04-01: + value: 1 + metadata: + reference: + - title: Capital Allowances Act 2001 s 45S and s 52(3) Table (100% for expenditure qualifying under section 45S that is not special rate expenditure) + href: https://www.legislation.gov.uk/ukpga/2001/2/section/52 +metadata: + unit: /1 + period: year + label: Full expensing rate + reference: + - title: Capital Allowances Act 2001 s 45S (company, unused and not second-hand, incurred on or after 1 April 2023) + href: https://www.legislation.gov.uk/ukpga/2001/2/section/45S diff --git a/policyengine_uk/parameters/gov/hmrc/corporation_tax/capital_allowances/first_year_allowances/main_rate.yaml b/policyengine_uk/parameters/gov/hmrc/corporation_tax/capital_allowances/first_year_allowances/main_rate.yaml new file mode 100644 index 0000000000..56e954734e --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/corporation_tax/capital_allowances/first_year_allowances/main_rate.yaml @@ -0,0 +1,41 @@ +description: First-year allowance rate under section 45U of the Capital Allowances Act 2001 on new and unused main-rate plant and machinery that full expensing does not cover, as a share of the expenditure. Companies and unincorporated businesses can claim it, including for plant bought for leasing; cars and second-hand assets are excluded. +values: + 2012-04-01: + value: 0 + metadata: + reference: + - title: Capital Allowances Act 2001 s 45U(a) (expenditure incurred on or after 1 January 2026 only) + href: https://www.legislation.gov.uk/ukpga/2001/2/section/45U + 2026-01-01: + value: 0.4 + metadata: + reference: + - title: Capital Allowances Act 2001 s 52(3) Table (40% for expenditure qualifying under section 45U), inserted by Finance Act 2026 s 29(5) + href: https://www.legislation.gov.uk/ukpga/2001/2/section/52 + - title: Capital Allowances Act 2001 s 45U, inserted by Finance Act 2026 s 29(3) + href: https://www.legislation.gov.uk/ukpga/2001/2/section/45U + # Announced at Budget 2026 (policy paper of 29 October 2026) for Finance + # Bill 2026-27 (Bill 173). Not enacted: as at 22 November 2026 the Bill has + # had its Commons first reading (3 November 2026), with second reading set + # for 23 November 2026. Clause number not verified. + 2027-01-01: + value: 0.5 + metadata: + reference: + - title: HMRC policy paper, Capital allowances - reduce the main rate writing down allowance and increase the main rate first year allowance (Budget 2026; section 52(3) to be amended from 40% to 50% for expenditure from 1 January 2027) + href: https://www.gov.uk/government/publications/reduce-the-main-rate-writing-down-allowance-and-increase-the-main-rate-first-year-allowance/capital-allowances-reduce-the-main-rate-writing-down-allowance-and-increase-the-main-rate-first-year-allowance +metadata: + unit: /1 + period: year + label: Main-rate first-year allowance rate + # The rate applies to expenditure incurred on or after 1 January, but the + # model gives each April to March year the rate in force on 30 April, its + # usual fiscal-year sample: 0 in 2025, 40% in 2026 and 50% from 2027. The + # first quarter of each calendar year at the new rate is not modelled. + # Day-weighting is avoided because spend under the first-year allowance + # leaves the pool for the year, so a blended rate would misstate the pool. + reference: + - title: Capital Allowances Act 2001 s 45U + href: https://www.legislation.gov.uk/ukpga/2001/2/section/45U + - title: HMRC policy paper, Capital allowances - new first year allowance and reducing main rate writing down allowances (Budget 2025) + href: https://www.gov.uk/government/publications/new-first-year-allowance-and-main-rate-of-writing-down-allowances/capital-allowances-new-first-year-allowance-and-reducing-main-rate-writing-down-allowances diff --git a/policyengine_uk/parameters/gov/hmrc/corporation_tax/capital_allowances/first_year_allowances/special_rate.yaml b/policyengine_uk/parameters/gov/hmrc/corporation_tax/capital_allowances/first_year_allowances/special_rate.yaml new file mode 100644 index 0000000000..064986ed6f --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/corporation_tax/capital_allowances/first_year_allowances/special_rate.yaml @@ -0,0 +1,27 @@ +description: First-year allowance rate for companies on new and unused special-rate plant and machinery, as a share of the expenditure. It is the 50% SR allowance from 1 April 2021 and the 50% section 45S allowance from 1 April 2023. +values: + 2012-04-01: + value: 0 + metadata: + reference: + - title: Finance Act 2021 s 9 (no general first-year allowance for special-rate plant before the SR allowance) + href: https://www.legislation.gov.uk/ukpga/2021/26/section/9 + 2021-04-01: + value: 0.5 + metadata: + reference: + - title: Finance Act 2021 s 9(3) (SR allowance of 50% on expenditure incurred from 1 April 2021 to 31 March 2023 by a company) + href: https://www.legislation.gov.uk/ukpga/2021/26/section/9 + 2023-04-01: + value: 0.5 + metadata: + reference: + - title: Capital Allowances Act 2001 s 52(3) Table (50% for expenditure qualifying under section 45S which is special rate expenditure) + href: https://www.legislation.gov.uk/ukpga/2001/2/section/52 +metadata: + unit: /1 + period: year + label: Special-rate first-year allowance rate + reference: + - title: Capital Allowances Act 2001 s 45S + href: https://www.legislation.gov.uk/ukpga/2001/2/section/45S diff --git a/policyengine_uk/parameters/gov/hmrc/corporation_tax/capital_allowances/structures_and_buildings_allowance/rate.yaml b/policyengine_uk/parameters/gov/hmrc/corporation_tax/capital_allowances/structures_and_buildings_allowance/rate.yaml new file mode 100644 index 0000000000..6f0c4d343f --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/corporation_tax/capital_allowances/structures_and_buildings_allowance/rate.yaml @@ -0,0 +1,31 @@ +description: Structures and buildings allowance claimed each year on the qualifying cost of a non-residential structure or building, on a straight-line basis, under section 270AA(5) of the Capital Allowances Act 2001. +values: + 2012-04-01: + value: 0 + metadata: + reference: + - title: Capital Allowances Act 2001 s 270AA(1) (no allowance unless construction begins and expenditure is incurred on or after 29 October 2018) + href: https://www.legislation.gov.uk/ukpga/2001/2/section/270AA + 2018-10-29: + value: 0.02 + metadata: + reference: + - title: Capital Allowances Act 2001 s 270AA(1)(a) and (b) (construction begins and expenditure incurred on or after 29 October 2018) + href: https://www.legislation.gov.uk/ukpga/2001/2/section/270AA + - title: Finance Act 2020 s 29(2)(c) (2% replaced by 3%) + href: https://www.legislation.gov.uk/ukpga/2020/14/section/29 + 2020-04-01: + value: 0.03 + metadata: + reference: + - title: Finance Act 2020 s 29(2)(c) and (6)(b) (2% to 3% from 1 April 2020 for corporation tax) + href: https://www.legislation.gov.uk/ukpga/2020/14/section/29 + - title: Capital Allowances Act 2001 s 270AA(5)(b) + href: https://www.legislation.gov.uk/ukpga/2001/2/section/270AA +metadata: + unit: /1 + period: year + label: Structures and buildings allowance rate + reference: + - title: Capital Allowances Act 2001 s 270AA + href: https://www.legislation.gov.uk/ukpga/2001/2/section/270AA diff --git a/policyengine_uk/parameters/gov/hmrc/corporation_tax/capital_allowances/writing_down_allowance/main_rate.yaml b/policyengine_uk/parameters/gov/hmrc/corporation_tax/capital_allowances/writing_down_allowance/main_rate.yaml new file mode 100644 index 0000000000..4dcc37a4c1 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/corporation_tax/capital_allowances/writing_down_allowance/main_rate.yaml @@ -0,0 +1,36 @@ +description: Writing-down allowance rate on the main pool of plant and machinery under section 56(1) of the Capital Allowances Act 2001, applied each year to the reducing balance. +values: + 2012-04-01: + value: 0.18 + metadata: + reference: + - title: Finance Act 2011 s 10(2) and (13)(a) (20% to 18% for chargeable periods beginning on or after 1 April 2012 for corporation tax) + href: https://www.legislation.gov.uk/ukpga/2011/11/section/10 + 2026-04-01: + value: 0.14 + metadata: + reference: + - title: Capital Allowances Act 2001 s 56(1), as amended by Finance Act 2026 s 28(1) and (2)(a) (18% to 14% for chargeable periods beginning on or after 1 April 2026 for corporation tax) + href: https://www.legislation.gov.uk/ukpga/2001/2/section/56 + - title: HMRC policy paper, Capital allowances - new first year allowance and reducing main rate writing down allowances + href: https://www.gov.uk/government/publications/new-first-year-allowance-and-main-rate-of-writing-down-allowances/capital-allowances-new-first-year-allowance-and-reducing-main-rate-writing-down-allowances + # Announced at Budget 2026 (policy paper of 29 October 2026) for Finance + # Bill 2026-27 (Bill 173). Not enacted: as at 22 November 2026 the Bill has + # had its Commons first reading (3 November 2026), with second reading set + # for 23 November 2026. Clause number not verified. + 2027-04-01: + value: 0.12 + metadata: + reference: + - title: HMRC policy paper, Capital allowances - reduce the main rate writing down allowance and increase the main rate first year allowance (Budget 2026; 14% to 12% for chargeable periods beginning on or after 1 April 2027 for corporation tax) + href: https://www.gov.uk/government/publications/reduce-the-main-rate-writing-down-allowance-and-increase-the-main-rate-first-year-allowance/capital-allowances-reduce-the-main-rate-writing-down-allowance-and-increase-the-main-rate-first-year-allowance +metadata: + unit: /1 + period: year + label: Main pool writing-down allowance rate + # Changes take effect on 1 April for corporation tax, so every model year + # (an April to March chargeable period) takes one rate. Unincorporated + # businesses change on 6 April; the model gives them the company date. + reference: + - title: Capital Allowances Act 2001 s 56(1) + href: https://www.legislation.gov.uk/ukpga/2001/2/section/56 diff --git a/policyengine_uk/parameters/gov/hmrc/corporation_tax/capital_allowances/writing_down_allowance/small_pool_limit.yaml b/policyengine_uk/parameters/gov/hmrc/corporation_tax/capital_allowances/writing_down_allowance/small_pool_limit.yaml new file mode 100644 index 0000000000..1653211c65 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/corporation_tax/capital_allowances/writing_down_allowance/small_pool_limit.yaml @@ -0,0 +1,17 @@ +description: Pool balance at or below which a business may write off the whole main pool or special rate pool in one year instead of claiming the percentage writing-down allowance, under section 56A of the Capital Allowances Act 2001. +values: + 2008-04-01: + value: 1_000 + metadata: + reference: + - title: Finance Act 2008 s 81(3) and (5)(a) (section 56A inserted for chargeable periods beginning on or after 1 April 2008 for corporation tax) + href: https://www.legislation.gov.uk/ukpga/2008/9/section/81/enacted + - title: Capital Allowances Act 2001 s 56A(3) + href: https://www.legislation.gov.uk/ukpga/2001/2/section/56A +metadata: + unit: currency-GBP + period: year + label: Small pool write-off limit + reference: + - title: Capital Allowances Act 2001 s 56A + href: https://www.legislation.gov.uk/ukpga/2001/2/section/56A diff --git a/policyengine_uk/parameters/gov/hmrc/corporation_tax/capital_allowances/writing_down_allowance/special_rate.yaml b/policyengine_uk/parameters/gov/hmrc/corporation_tax/capital_allowances/writing_down_allowance/special_rate.yaml new file mode 100644 index 0000000000..77871ede10 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/corporation_tax/capital_allowances/writing_down_allowance/special_rate.yaml @@ -0,0 +1,25 @@ +description: Writing-down allowance rate on the special rate pool of plant and machinery, such as integral features and long-life assets, under section 104D(1) of the Capital Allowances Act 2001. +values: + 2012-04-01: + value: 0.08 + metadata: + reference: + - title: Finance Act 2011 s 10(3)(a) and (13)(a) (10% to 8% for chargeable periods beginning on or after 1 April 2012 for corporation tax) + href: https://www.legislation.gov.uk/ukpga/2011/11/section/10/enacted + - title: Finance Act 2019 s 31(2) and (8)(a) (8% replaced by 6% for chargeable periods beginning on or after 1 April 2019 for corporation tax) + href: https://www.legislation.gov.uk/ukpga/2019/1/section/31 + 2019-04-01: + value: 0.06 + metadata: + reference: + - title: Finance Act 2019 s 31(2) and (8)(a) (8% to 6% for chargeable periods beginning on or after 1 April 2019 for corporation tax) + href: https://www.legislation.gov.uk/ukpga/2019/1/section/31 + - title: Capital Allowances Act 2001 s 104D(1) + href: https://www.legislation.gov.uk/ukpga/2001/2/section/104D +metadata: + unit: /1 + period: year + label: Special rate pool writing-down allowance rate + reference: + - title: Capital Allowances Act 2001 s 104D(1) + href: https://www.legislation.gov.uk/ukpga/2001/2/section/104D diff --git a/policyengine_uk/parameters/gov/hmrc/corporation_tax/losses/deductions_allowance.yaml b/policyengine_uk/parameters/gov/hmrc/corporation_tax/losses/deductions_allowance.yaml new file mode 100644 index 0000000000..2b6988fa0b --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/corporation_tax/losses/deductions_allowance.yaml @@ -0,0 +1,12 @@ +description: Corporation tax deductions allowance for a company or group, the amount of profits against which carried-forward losses can be set without the 50% restriction. +values: + 2017-04-01: 5_000_000 +metadata: + unit: currency-GBP + period: year + label: Corporation tax losses deductions allowance + reference: + - title: Corporation Tax Act 2010 s. 269ZR(2) and s. 269ZW + href: https://www.legislation.gov.uk/ukpga/2010/4/section/269ZR + - title: Finance (No. 2) Act 2017 Sch. 4 para. 190 (accounting periods from 1 April 2017) + href: https://www.legislation.gov.uk/ukpga/2017/32/schedule/4/paragraph/190 diff --git a/policyengine_uk/parameters/gov/hmrc/corporation_tax/losses/group_relief_for_carried_forward_losses_applies.yaml b/policyengine_uk/parameters/gov/hmrc/corporation_tax/losses/group_relief_for_carried_forward_losses_applies.yaml new file mode 100644 index 0000000000..366253ae17 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/corporation_tax/losses/group_relief_for_carried_forward_losses_applies.yaml @@ -0,0 +1,13 @@ +description: Whether a company can claim group relief for carried-forward losses surrendered by other group companies. It can for accounting periods from 1 April 2017. +values: + 0000-01-01: false + 2017-04-01: true +metadata: + unit: bool + period: year + label: Group relief for carried-forward losses applies + reference: + - title: Corporation Tax Act 2010 Part 5A + href: https://www.legislation.gov.uk/ukpga/2010/4/part/5A + - title: Finance (No. 2) Act 2017 Sch. 4 para. 190 (accounting periods from 1 April 2017) + href: https://www.legislation.gov.uk/ukpga/2017/32/schedule/4/paragraph/190 diff --git a/policyengine_uk/parameters/gov/hmrc/corporation_tax/losses/restriction_rate.yaml b/policyengine_uk/parameters/gov/hmrc/corporation_tax/losses/restriction_rate.yaml new file mode 100644 index 0000000000..4649abc109 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/corporation_tax/losses/restriction_rate.yaml @@ -0,0 +1,23 @@ +description: Share of a company's relevant profits above the deductions allowance against which corporation tax losses carried forward can be relieved. Before 1 April 2017 carried-forward trade losses were relieved in full against later profits of the trade, represented here as a share of 1. +values: + 2015-04-01: + value: 1 + metadata: + reference: + - title: Corporation Tax Act 2010 s. 45(4) (as enacted) + href: https://www.legislation.gov.uk/ukpga/2010/4/section/45/enacted + 2017-04-01: + value: 0.5 + metadata: + reference: + - title: Corporation Tax Act 2010 s. 269ZD(4) and s. 269ZFA + href: https://www.legislation.gov.uk/ukpga/2010/4/section/269ZD + - title: Finance (No. 2) Act 2017 Sch. 4 para. 190 (accounting periods from 1 April 2017) + href: https://www.legislation.gov.uk/ukpga/2017/32/schedule/4/paragraph/190 +metadata: + unit: /1 + period: year + label: Corporation tax carried-forward losses restriction rate + reference: + - title: Corporation Tax Act 2010 s. 269ZD(4) + href: https://www.legislation.gov.uk/ukpga/2010/4/section/269ZD diff --git a/policyengine_uk/parameters/gov/hmrc/corporation_tax/main_rate.yaml b/policyengine_uk/parameters/gov/hmrc/corporation_tax/main_rate.yaml new file mode 100644 index 0000000000..a2664b79ee --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/corporation_tax/main_rate.yaml @@ -0,0 +1,33 @@ +description: Main rate of corporation tax charged on a company's taxable total profits. From the financial year 2023 it applies in full only where augmented profits exceed the upper limit; before then it was the single rate on all non-ring-fence profits. Values are dated from the 1 April start of each financial year and cover the financial year 2015 onwards. +values: + 2015-04-01: + value: 0.2 + metadata: + reference: + - title: Finance Act 2013 s. 6(1) (main rate for financial year 2015) + href: https://www.legislation.gov.uk/ukpga/2013/29/section/6/enacted + - title: Finance Act 2015 s. 6(2) (main rate for financial year 2016) + href: https://www.legislation.gov.uk/ukpga/2015/11/section/6/enacted + 2017-04-01: + value: 0.19 + metadata: + reference: + - title: Finance (No. 2) Act 2015 s. 7(1) (financial years 2017 to 2019) + href: https://www.legislation.gov.uk/ukpga/2015/33/section/7/enacted + - title: Finance Act 2020 ss. 5 and 6 (financial years 2020 and 2021) + href: https://www.legislation.gov.uk/ukpga/2020/14/section/5 + - title: Finance Act 2021 s. 6(2)(a) (financial year 2022) + href: https://www.legislation.gov.uk/ukpga/2021/26/section/6 + 2023-04-01: + value: 0.25 + metadata: + reference: + - title: Finance Act 2021 s. 6(2)(b) (financial year 2023) + href: https://www.legislation.gov.uk/ukpga/2021/26/section/6 +metadata: + unit: /1 + period: year + label: Corporation tax main rate + reference: + - title: Corporation Tax Act 2010 s. 3 (charge to corporation tax) + href: https://www.legislation.gov.uk/ukpga/2010/4/section/3 diff --git a/policyengine_uk/parameters/gov/hmrc/corporation_tax/marginal_relief/fraction.yaml b/policyengine_uk/parameters/gov/hmrc/corporation_tax/marginal_relief/fraction.yaml new file mode 100644 index 0000000000..c7e69ea07c --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/corporation_tax/marginal_relief/fraction.yaml @@ -0,0 +1,12 @@ +description: Standard marginal relief fraction for corporation tax, which scales the relief given to companies with augmented profits between the lower and upper limits. +values: + 2023-04-01: 0.015 +metadata: + unit: /1 + period: year + label: Corporation tax standard marginal relief fraction + reference: + - title: Finance Act 2021 s. 7(2)(b) (3/200ths) + href: https://www.legislation.gov.uk/ukpga/2021/26/section/7 + - title: Corporation Tax Act 2010 s. 18B + href: https://www.legislation.gov.uk/ukpga/2010/4/section/18B diff --git a/policyengine_uk/parameters/gov/hmrc/corporation_tax/marginal_relief/lower_limit.yaml b/policyengine_uk/parameters/gov/hmrc/corporation_tax/marginal_relief/lower_limit.yaml new file mode 100644 index 0000000000..735030b37c --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/corporation_tax/marginal_relief/lower_limit.yaml @@ -0,0 +1,10 @@ +description: Lower limit of augmented profits for corporation tax, at or below which the small profits rate applies. It is divided by one plus the number of associated companies. +values: + 2023-04-01: 50_000 +metadata: + unit: currency-GBP + period: year + label: Corporation tax lower limit + reference: + - title: Corporation Tax Act 2010 s. 18D(2)(a) and (3)(a) + href: https://www.legislation.gov.uk/ukpga/2010/4/section/18D diff --git a/policyengine_uk/parameters/gov/hmrc/corporation_tax/marginal_relief/upper_limit.yaml b/policyengine_uk/parameters/gov/hmrc/corporation_tax/marginal_relief/upper_limit.yaml new file mode 100644 index 0000000000..194e1a40ec --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/corporation_tax/marginal_relief/upper_limit.yaml @@ -0,0 +1,10 @@ +description: Upper limit of augmented profits for corporation tax, above which the main rate applies without marginal relief. It is divided by one plus the number of associated companies. +values: + 2023-04-01: 250_000 +metadata: + unit: currency-GBP + period: year + label: Corporation tax upper limit + reference: + - title: Corporation Tax Act 2010 s. 18D(2)(b) and (3)(b) + href: https://www.legislation.gov.uk/ukpga/2010/4/section/18D diff --git a/policyengine_uk/parameters/gov/hmrc/corporation_tax/patent_box/index.yaml b/policyengine_uk/parameters/gov/hmrc/corporation_tax/patent_box/index.yaml new file mode 100644 index 0000000000..587d0c73b7 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/corporation_tax/patent_box/index.yaml @@ -0,0 +1,3 @@ +description: Corporation tax Patent Box. +metadata: + label: Patent Box diff --git a/policyengine_uk/parameters/gov/hmrc/corporation_tax/patent_box/relevant_ip_profits_share.yaml b/policyengine_uk/parameters/gov/hmrc/corporation_tax/patent_box/relevant_ip_profits_share.yaml new file mode 100644 index 0000000000..473a59dc57 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/corporation_tax/patent_box/relevant_ip_profits_share.yaml @@ -0,0 +1,15 @@ +description: Share of relevant IP profits brought into the Patent Box deduction, phased in from 60% in the financial year 2013 to 100% from 1 April 2017. Before 1 April 2013 there was no Patent Box. +values: + 0000-01-01: 0 + 2013-04-01: 0.6 + 2014-04-01: 0.7 + 2015-04-01: 0.8 + 2016-04-01: 0.9 + 2017-04-01: 1 +metadata: + unit: /1 + period: year + label: Patent Box relevant IP profits share + reference: + - title: Finance Act 2012 Schedule 2 paragraph 8 + href: https://www.legislation.gov.uk/ukpga/2012/14/schedule/2/paragraph/8 diff --git a/policyengine_uk/parameters/gov/hmrc/corporation_tax/patent_box/special_ip_rate.yaml b/policyengine_uk/parameters/gov/hmrc/corporation_tax/patent_box/special_ip_rate.yaml new file mode 100644 index 0000000000..d14e45b121 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/corporation_tax/patent_box/special_ip_rate.yaml @@ -0,0 +1,10 @@ +description: The special IP rate of corporation tax that the Patent Box deduction gives on a company's relevant IP profits. +values: + 2013-04-01: 0.1 +metadata: + unit: /1 + period: year + label: Patent Box special IP rate + reference: + - title: Corporation Tax Act 2010 s.357A(4) + href: https://www.legislation.gov.uk/ukpga/2010/4/section/357A diff --git a/policyengine_uk/parameters/gov/hmrc/corporation_tax/rd_relief/expenditure_credit/rate.yaml b/policyengine_uk/parameters/gov/hmrc/corporation_tax/rd_relief/expenditure_credit/rate.yaml new file mode 100644 index 0000000000..1ae1d872ee --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/corporation_tax/rd_relief/expenditure_credit/rate.yaml @@ -0,0 +1,41 @@ +description: Research and development expenditure credit as a share of qualifying expenditure. It is the large-company credit under section 104M of the Corporation Tax Act 2009 before April 2024 and the merged scheme credit under section 1042G from then. The credit is a taxable receipt of the trade. +values: + 2015-04-01: + value: 0.11 + metadata: + reference: + - title: Finance Act 2015 s 27(2) and (5) (10% to 11% for expenditure incurred on or after 1 April 2015) + href: https://www.legislation.gov.uk/ukpga/2015/11/section/27 + 2018-01-01: + value: 0.12 + metadata: + reference: + - title: Finance Act 2018 s 19 (11% to 12% for expenditure incurred on or after 1 January 2018) + href: https://www.legislation.gov.uk/ukpga/2018/3/section/19 + 2020-04-01: + value: 0.13 + metadata: + reference: + - title: Finance Act 2020 s 28 (12% to 13% for expenditure incurred on or after 1 April 2020) + href: https://www.legislation.gov.uk/ukpga/2020/14/section/28 + 2023-04-01: + value: 0.2 + metadata: + reference: + - title: Corporation Tax Act 2009 s 104M(3), as amended by Finance Act 2023 s 4(2) (20% for expenditure incurred on or after 1 April 2023) + href: https://www.legislation.gov.uk/ukpga/2009/4/section/104M/2023-04-01 + 2024-04-01: + value: 0.2 + metadata: + reference: + - title: Corporation Tax Act 2009 s 1042G(1)(b) (merged scheme, 20% in any case other than a ring fence trade) + href: https://www.legislation.gov.uk/ukpga/2009/4/section/1042G +metadata: + unit: /1 + period: year + label: R&D expenditure credit rate + # Each April to March year takes the rate in force on 30 April, so the 12% + # rate from 1 January 2018 first applies in 2018. + reference: + - title: Corporation Tax Act 2009 s 1042G + href: https://www.legislation.gov.uk/ukpga/2009/4/section/1042G diff --git a/policyengine_uk/parameters/gov/hmrc/corporation_tax/rd_relief/merged_scheme_in_effect.yaml b/policyengine_uk/parameters/gov/hmrc/corporation_tax/rd_relief/merged_scheme_in_effect.yaml new file mode 100644 index 0000000000..0b3925dd46 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/corporation_tax/rd_relief/merged_scheme_in_effect.yaml @@ -0,0 +1,21 @@ +description: Whether the merged research and development scheme applies. From accounting periods beginning on 1 April 2024 a company claims the merged R&D expenditure credit unless it is a loss-making R&D intensive SME, which claims enhanced R&D intensive support instead; before then every SME claimed under the SME scheme and large companies claimed the R&D expenditure credit. +values: + 2012-04-01: + value: false + metadata: + reference: + - title: Corporation Tax Act 2009 Part 13 Chapter 2 (SME scheme for all SMEs before 1 April 2024) + href: https://www.legislation.gov.uk/ukpga/2009/4/part/13/chapter/2/2023-04-01 + 2024-04-01: + value: true + metadata: + reference: + - title: Finance Act 2024 Sch 1 paras 5 and 16 (Chapter 1A of Part 13 of the Corporation Tax Act 2009 inserted for accounting periods beginning on or after 1 April 2024) + href: https://www.legislation.gov.uk/ukpga/2009/4/part/13/chapter/1A +metadata: + unit: bool + period: year + label: R&D merged scheme in effect + reference: + - title: Corporation Tax Act 2009 Part 13 Chapter 1A + href: https://www.legislation.gov.uk/ukpga/2009/4/section/1042G diff --git a/policyengine_uk/parameters/gov/hmrc/corporation_tax/rd_relief/paye_nic_cap/amount.yaml b/policyengine_uk/parameters/gov/hmrc/corporation_tax/rd_relief/paye_nic_cap/amount.yaml new file mode 100644 index 0000000000..6b5777a52a --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/corporation_tax/rd_relief/paye_nic_cap/amount.yaml @@ -0,0 +1,27 @@ +description: Fixed amount of the cap by reference to a company's PAYE and NIC liabilities on the payable SME R&D tax credit (from accounting periods beginning on or after 1 April 2021) and on the payable merged R&D expenditure credit (from 1 April 2024). +values: + 2021-04-01: + value: 20_000 + metadata: + reference: + - title: Corporation Tax Act 2009 s 1058(1A)(a) as at 1 April 2022 (inserted by Finance Act 2021 Sch 3 para 2(3)) + href: https://www.legislation.gov.uk/ukpga/2009/4/section/1058/2022-04-01 + - title: Finance Act 2021 Sch 3 para 4 (accounting periods beginning on or after 1 April 2021) + href: https://www.legislation.gov.uk/ukpga/2021/26/schedule/3/paragraph/4 + 2024-04-01: + value: 20_000 + metadata: + reference: + - title: Corporation Tax Act 2009 s 1112B(2)(a) + href: https://www.legislation.gov.uk/ukpga/2009/4/section/1112B +metadata: + unit: currency-GBP + period: year + label: R&D expenditure credit PAYE and NIC cap fixed amount + reference: + - title: Corporation Tax Act 2009 s 1112B + href: https://www.legislation.gov.uk/ukpga/2009/4/section/1112B + - title: Corporation Tax Act 2009 s 1042I step 3 + href: https://www.legislation.gov.uk/ukpga/2009/4/section/1042I + - title: Corporation Tax Act 2009 s 1058(1)(aa) + href: https://www.legislation.gov.uk/ukpga/2009/4/section/1058 diff --git a/policyengine_uk/parameters/gov/hmrc/corporation_tax/rd_relief/paye_nic_cap/multiplier.yaml b/policyengine_uk/parameters/gov/hmrc/corporation_tax/rd_relief/paye_nic_cap/multiplier.yaml new file mode 100644 index 0000000000..84af70ffc8 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/corporation_tax/rd_relief/paye_nic_cap/multiplier.yaml @@ -0,0 +1,25 @@ +description: Multiple of a company's relevant PAYE and NIC liabilities added to the fixed amount in the cap on the payable SME R&D tax credit (from accounting periods beginning on or after 1 April 2021) and on the payable merged R&D expenditure credit (from 1 April 2024). +values: + 2021-04-01: + value: 3 + metadata: + reference: + - title: Corporation Tax Act 2009 s 1058(1A)(b) as at 1 April 2022 (inserted by Finance Act 2021 Sch 3 para 2(3)) + href: https://www.legislation.gov.uk/ukpga/2009/4/section/1058/2022-04-01 + - title: Finance Act 2021 Sch 3 para 4 (accounting periods beginning on or after 1 April 2021) + href: https://www.legislation.gov.uk/ukpga/2021/26/schedule/3/paragraph/4 + 2024-04-01: + value: 3 + metadata: + reference: + - title: Corporation Tax Act 2009 s 1112B(2)(b) + href: https://www.legislation.gov.uk/ukpga/2009/4/section/1112B +metadata: + unit: /1 + period: year + label: R&D expenditure credit PAYE and NIC cap multiplier + reference: + - title: Corporation Tax Act 2009 s 1112B + href: https://www.legislation.gov.uk/ukpga/2009/4/section/1112B + - title: Corporation Tax Act 2009 s 1058(1)(aa) + href: https://www.legislation.gov.uk/ukpga/2009/4/section/1058 diff --git a/policyengine_uk/parameters/gov/hmrc/corporation_tax/rd_relief/sme/additional_deduction_rate.yaml b/policyengine_uk/parameters/gov/hmrc/corporation_tax/rd_relief/sme/additional_deduction_rate.yaml new file mode 100644 index 0000000000..1f40b2476a --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/corporation_tax/rd_relief/sme/additional_deduction_rate.yaml @@ -0,0 +1,21 @@ +description: Additional deduction a small or medium-sized enterprise takes in computing trading profits, as a share of its qualifying research and development expenditure, under section 1044(8) of the Corporation Tax Act 2009. From April 2024 only loss-making R&D intensive SMEs claim it, as enhanced R&D intensive support. +values: + 2015-04-01: + value: 1.3 + metadata: + reference: + - title: Finance Act 2015 s 27(3)(a) and (5) (125% to 130% for expenditure incurred on or after 1 April 2015) + href: https://www.legislation.gov.uk/ukpga/2015/11/section/27 + 2023-04-01: + value: 0.86 + metadata: + reference: + - title: Corporation Tax Act 2009 s 1044(8), as amended by Finance Act 2023 s 4(3)(a) (86% for expenditure incurred on or after 1 April 2023) + href: https://www.legislation.gov.uk/ukpga/2009/4/section/1044/2023-04-01 +metadata: + unit: /1 + period: year + label: R&D SME additional deduction rate + reference: + - title: Corporation Tax Act 2009 s 1044(8) + href: https://www.legislation.gov.uk/ukpga/2009/4/section/1044 diff --git a/policyengine_uk/parameters/gov/hmrc/corporation_tax/rd_relief/sme/intensity_threshold.yaml b/policyengine_uk/parameters/gov/hmrc/corporation_tax/rd_relief/sme/intensity_threshold.yaml new file mode 100644 index 0000000000..d3808e69b5 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/corporation_tax/rd_relief/sme/intensity_threshold.yaml @@ -0,0 +1,27 @@ +description: Minimum share of a company's relevant expenditure spent on research and development for it to be R&D intensive, under section 1045ZA of the Corporation Tax Act 2009. An infinite value means no intensive regime applied. +values: + 2015-04-01: + value: .inf + metadata: + reference: + - title: Corporation Tax Act 2009 s 1058(1)(a) as at 1 April 2020 (one payable credit rate for every loss-making SME) + href: https://www.legislation.gov.uk/ukpga/2009/4/section/1058/2020-04-01 + 2023-04-01: + value: 0.4 + metadata: + reference: + - title: Finance Act 2024 Sch 1 para 21(4), as substituted by Finance Act 2025 s 30 (section 1045ZA read with 40% in place of 30% for periods beginning before 1 April 2024) + href: https://www.legislation.gov.uk/ukpga/2024/3/schedule/1/paragraph/21 + 2024-04-01: + value: 0.3 + metadata: + reference: + - title: Corporation Tax Act 2009 s 1045ZA(2) (relevant R&D expenditure at least 30% of relevant expenditure) + href: https://www.legislation.gov.uk/ukpga/2009/4/section/1045ZA +metadata: + unit: /1 + period: year + label: R&D intensity threshold + reference: + - title: Corporation Tax Act 2009 s 1045ZA + href: https://www.legislation.gov.uk/ukpga/2009/4/section/1045ZA diff --git a/policyengine_uk/parameters/gov/hmrc/corporation_tax/rd_relief/sme/intensive_payable_credit_rate.yaml b/policyengine_uk/parameters/gov/hmrc/corporation_tax/rd_relief/sme/intensive_payable_credit_rate.yaml new file mode 100644 index 0000000000..222d349175 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/corporation_tax/rd_relief/sme/intensive_payable_credit_rate.yaml @@ -0,0 +1,27 @@ +description: Payable research and development tax credit for a loss-making R&D intensive small or medium-sized enterprise, as a share of its surrenderable loss. From April 2024 it is the enhanced R&D intensive support credit under section 1058(1)(a) of the Corporation Tax Act 2009. Before April 2023 there was no separate intensive rate, so the general SME rate is repeated. +values: + 2015-04-01: + value: 0.145 + metadata: + reference: + - title: Corporation Tax Act 2009 s 1058(1)(a) as at 1 April 2020 (14.5% for every loss-making SME) + href: https://www.legislation.gov.uk/ukpga/2009/4/section/1058/2020-04-01 + 2023-04-01: + value: 0.145 + metadata: + reference: + - title: Finance Act 2024 Sch 1 para 21(1) and (2) (14.5% for an R&D intensive SME, as if the cut to 10% had not been made, for periods ending on or after 1 April 2023) + href: https://www.legislation.gov.uk/ukpga/2024/3/schedule/1/paragraph/21 + 2024-04-01: + value: 0.145 + metadata: + reference: + - title: Corporation Tax Act 2009 s 1058(1)(a) (14.5% of the Chapter 2 surrenderable loss) + href: https://www.legislation.gov.uk/ukpga/2009/4/section/1058 +metadata: + unit: /1 + period: year + label: R&D intensive SME payable credit rate + reference: + - title: Corporation Tax Act 2009 s 1058(1)(a) + href: https://www.legislation.gov.uk/ukpga/2009/4/section/1058 diff --git a/policyengine_uk/parameters/gov/hmrc/corporation_tax/rd_relief/sme/payable_credit_paye_nic_cap_applies.yaml b/policyengine_uk/parameters/gov/hmrc/corporation_tax/rd_relief/sme/payable_credit_paye_nic_cap_applies.yaml new file mode 100644 index 0000000000..20223facc4 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/corporation_tax/rd_relief/sme/payable_credit_paye_nic_cap_applies.yaml @@ -0,0 +1,25 @@ +description: Whether the payable SME R&D tax credit is capped by reference to the company's PAYE and NIC liabilities, under section 1058(1)(aa) of the Corporation Tax Act 2009. The cap was removed for accounting periods ending on or after 1 April 2012 and reintroduced, as £20,000 plus three times those liabilities, for accounting periods beginning on or after 1 April 2021. +values: + 2012-04-01: + value: false + metadata: + reference: + - title: Finance Act 2012 Sch 3 para 15(2) (cap in section 1058(1)(b) omitted) + href: https://www.legislation.gov.uk/ukpga/2012/14/schedule/3/paragraph/15 + - title: Finance Act 2012 Sch 3 para 39 (accounting periods ending on or after 1 April 2012) + href: https://www.legislation.gov.uk/ukpga/2012/14/schedule/3/paragraph/39 + 2021-04-01: + value: true + metadata: + reference: + - title: Corporation Tax Act 2009 s 1058(1)(aa) and (1A) as at 1 April 2022 (inserted by Finance Act 2021 Sch 3 para 2) + href: https://www.legislation.gov.uk/ukpga/2009/4/section/1058/2022-04-01 + - title: Finance Act 2021 Sch 3 para 4 (accounting periods beginning on or after 1 April 2021) + href: https://www.legislation.gov.uk/ukpga/2021/26/schedule/3/paragraph/4 +metadata: + unit: bool + period: year + label: R&D SME payable credit PAYE and NIC cap applies + reference: + - title: Corporation Tax Act 2009 s 1058 + href: https://www.legislation.gov.uk/ukpga/2009/4/section/1058 diff --git a/policyengine_uk/parameters/gov/hmrc/corporation_tax/rd_relief/sme/payable_credit_rate.yaml b/policyengine_uk/parameters/gov/hmrc/corporation_tax/rd_relief/sme/payable_credit_rate.yaml new file mode 100644 index 0000000000..77072724c4 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/corporation_tax/rd_relief/sme/payable_credit_rate.yaml @@ -0,0 +1,23 @@ +description: Payable research and development tax credit for a loss-making small or medium-sized enterprise that is not R&D intensive, as a share of its surrenderable loss, under section 1058(1)(a) of the Corporation Tax Act 2009. From April 2024 such a company claims the merged scheme credit instead, so the rate no longer applies. +values: + 2014-04-01: + value: 0.145 + metadata: + reference: + - title: Finance Act 2014 s 31(1) (11% to 14.5% for expenditure incurred on or after 1 April 2014) + href: https://www.legislation.gov.uk/ukpga/2014/26/section/31 + - title: Corporation Tax Act 2009 s 1058(1)(a) as at 1 April 2020 (14.5%, substituted by Finance Act 2014 s 31(1)) + href: https://www.legislation.gov.uk/ukpga/2009/4/section/1058/2020-04-01 + 2023-04-01: + value: 0.1 + metadata: + reference: + - title: Corporation Tax Act 2009 s 1058(1)(a), as amended by Finance Act 2023 s 4(3)(d) (10% for expenditure incurred on or after 1 April 2023) + href: https://www.legislation.gov.uk/ukpga/2009/4/section/1058/2023-04-01 +metadata: + unit: /1 + period: year + label: R&D SME payable credit rate + reference: + - title: Corporation Tax Act 2009 s 1058(1)(a) + href: https://www.legislation.gov.uk/ukpga/2009/4/section/1058 diff --git a/policyengine_uk/parameters/gov/hmrc/corporation_tax/small_profits_rate.yaml b/policyengine_uk/parameters/gov/hmrc/corporation_tax/small_profits_rate.yaml new file mode 100644 index 0000000000..e56911074f --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/corporation_tax/small_profits_rate.yaml @@ -0,0 +1,12 @@ +description: Corporation tax small profits rate, charged on a company's taxable total profits where its augmented profits do not exceed the lower limit. It is read only while the small profits rate applies. +values: + 2023-04-01: 0.19 +metadata: + unit: /1 + period: year + label: Corporation tax small profits rate + reference: + - title: Finance Act 2021 s. 7(2)(a) + href: https://www.legislation.gov.uk/ukpga/2021/26/section/7 + - title: Corporation Tax Act 2010 s. 18A + href: https://www.legislation.gov.uk/ukpga/2010/4/section/18A diff --git a/policyengine_uk/parameters/gov/hmrc/corporation_tax/small_profits_rate_applies.yaml b/policyengine_uk/parameters/gov/hmrc/corporation_tax/small_profits_rate_applies.yaml new file mode 100644 index 0000000000..8d55362074 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/corporation_tax/small_profits_rate_applies.yaml @@ -0,0 +1,23 @@ +description: Whether the corporation tax small profits rate and marginal relief apply. They were abolished from 1 April 2015, when a single main rate took over, and reintroduced from 1 April 2023. +values: + 2015-04-01: + value: false + metadata: + reference: + - title: Finance Act 2014 s. 7 and Sch. 1 (abolition of the small profits rate for non-ring-fence profits) + href: https://www.legislation.gov.uk/ukpga/2014/26/section/7/enacted + - title: Finance Act 2014 Sch. 1 para. 22(1) (effect for the financial year 2015 and subsequent financial years) + href: https://www.legislation.gov.uk/ukpga/2014/26/schedule/1/enacted + 2023-04-01: + value: true + metadata: + reference: + - title: Finance Act 2021 s. 7 and Sch. 1 (small profits rate and marginal relief from financial year 2023) + href: https://www.legislation.gov.uk/ukpga/2021/26/section/7 +metadata: + unit: bool + period: year + label: Corporation tax small profits rate applies + reference: + - title: Corporation Tax Act 2010 ss. 18A to 18N + href: https://www.legislation.gov.uk/ukpga/2010/4/part/3 diff --git a/policyengine_uk/parameters/gov/hmrc/digital_services_tax/allowance.yaml b/policyengine_uk/parameters/gov/hmrc/digital_services_tax/allowance.yaml new file mode 100644 index 0000000000..89d2d9461c --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/digital_services_tax/allowance.yaml @@ -0,0 +1,10 @@ +description: Amount of a group's UK digital services revenues deducted before digital services tax is charged. +values: + 2020-04-01: 25_000_000 +metadata: + unit: currency-GBP + period: year + label: Digital services tax allowance + reference: + - title: Finance Act 2020 s.47(3) + href: https://www.legislation.gov.uk/ukpga/2020/14/section/47 diff --git a/policyengine_uk/parameters/gov/hmrc/digital_services_tax/index.yaml b/policyengine_uk/parameters/gov/hmrc/digital_services_tax/index.yaml new file mode 100644 index 0000000000..6c5ddc9c8d --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/digital_services_tax/index.yaml @@ -0,0 +1,3 @@ +description: Digital services tax. +metadata: + label: Digital services tax diff --git a/policyengine_uk/parameters/gov/hmrc/digital_services_tax/rate.yaml b/policyengine_uk/parameters/gov/hmrc/digital_services_tax/rate.yaml new file mode 100644 index 0000000000..9787febe28 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/digital_services_tax/rate.yaml @@ -0,0 +1,13 @@ +description: Digital services tax charged on a group's UK digital services revenues above the allowance, from 1 April 2020. +values: + 0000-01-01: 0 + 2020-04-01: 0.02 +metadata: + unit: /1 + period: year + label: Digital services tax rate + reference: + - title: Finance Act 2020 s.47 + href: https://www.legislation.gov.uk/ukpga/2020/14/section/47 + - title: Finance Act 2020 s.61 (first accounting period begins 1 April 2020) + href: https://www.legislation.gov.uk/ukpga/2020/14/section/61 diff --git a/policyengine_uk/parameters/gov/hmrc/digital_services_tax/threshold/index.yaml b/policyengine_uk/parameters/gov/hmrc/digital_services_tax/threshold/index.yaml new file mode 100644 index 0000000000..03a5030208 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/digital_services_tax/threshold/index.yaml @@ -0,0 +1,3 @@ +description: Digital services tax revenue thresholds. +metadata: + label: Digital services tax thresholds diff --git a/policyengine_uk/parameters/gov/hmrc/digital_services_tax/threshold/uk_revenues.yaml b/policyengine_uk/parameters/gov/hmrc/digital_services_tax/threshold/uk_revenues.yaml new file mode 100644 index 0000000000..20d70f5545 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/digital_services_tax/threshold/uk_revenues.yaml @@ -0,0 +1,10 @@ +description: A group is liable to digital services tax only where its UK digital services revenues exceed this amount. +values: + 2020-04-01: 25_000_000 +metadata: + unit: currency-GBP + period: year + label: Digital services tax UK revenue threshold + reference: + - title: Finance Act 2020 s.46 + href: https://www.legislation.gov.uk/ukpga/2020/14/section/46 diff --git a/policyengine_uk/parameters/gov/hmrc/digital_services_tax/threshold/worldwide_revenues.yaml b/policyengine_uk/parameters/gov/hmrc/digital_services_tax/threshold/worldwide_revenues.yaml new file mode 100644 index 0000000000..87a92b0678 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/digital_services_tax/threshold/worldwide_revenues.yaml @@ -0,0 +1,10 @@ +description: A group is liable to digital services tax only where its worldwide digital services revenues exceed this amount. +values: + 2020-04-01: 500_000_000 +metadata: + unit: currency-GBP + period: year + label: Digital services tax worldwide revenue threshold + reference: + - title: Finance Act 2020 s.46 + href: https://www.legislation.gov.uk/ukpga/2020/14/section/46 diff --git a/policyengine_uk/parameters/gov/hmrc/energy_profits_levy/index.yaml b/policyengine_uk/parameters/gov/hmrc/energy_profits_levy/index.yaml new file mode 100644 index 0000000000..fae5ff5bd0 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/energy_profits_levy/index.yaml @@ -0,0 +1,3 @@ +description: Energy profits levy. +metadata: + label: Energy profits levy diff --git a/policyengine_uk/parameters/gov/hmrc/energy_profits_levy/rate.yaml b/policyengine_uk/parameters/gov/hmrc/energy_profits_levy/rate.yaml new file mode 100644 index 0000000000..a5360cfe20 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/energy_profits_levy/rate.yaml @@ -0,0 +1,37 @@ +description: Energy profits levy rate charged on a company's levy profits, 0 before 26 May 2022. Dates are the legal start dates; each year label is the day-weighted average over 6 April to 5 April, which approximates the apportionment of an accounting period that straddles a change. +# The zero starts at 2015-04-01, not 0000-01-01: fiscal_year_blend needs +# parseable dates, as for the bank surcharge rate. +values: + 2015-04-01: 0 + 2022-05-26: + value: 0.25 + metadata: + reference: + - title: Energy (Oil and Gas) Profits Levy Act 2022 s.1, as enacted + href: https://www.legislation.gov.uk/ukpga/2022/40/enacted + 2023-01-01: + value: 0.35 + metadata: + reference: + - title: Finance Act 2023 s.1 + href: https://www.legislation.gov.uk/ukpga/2023/1/section/1 + 2024-11-01: + value: 0.38 + metadata: + reference: + - title: Finance Act 2025 s.15 + href: https://www.legislation.gov.uk/ukpga/2025/8/section/15 + 2030-04-01: + value: 0 + metadata: + reference: + - title: Finance Act 2025 s.17 (levy ends 31 March 2030) + href: https://www.legislation.gov.uk/ukpga/2025/8/section/17 +metadata: + unit: /1 + period: year + label: Energy profits levy rate + fiscal_year_blend: true + reference: + - title: Energy (Oil and Gas) Profits Levy Act 2022 + href: https://www.legislation.gov.uk/ukpga/2022/40 diff --git a/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1/off_payroll/applies_to_non_public_clients.yaml b/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1/off_payroll/applies_to_non_public_clients.yaml new file mode 100644 index 0000000000..971eec85ee --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1/off_payroll/applies_to_non_public_clients.yaml @@ -0,0 +1,13 @@ +description: Whether the off-payroll working rules apply to medium and large clients outside the public sector. They do from 6 April 2021. +values: + 0000-01-01: false + 2021-04-06: true +metadata: + unit: bool + period: year + label: Off-payroll working rules apply to non-public clients + reference: + - title: The Social Security Contributions (Intermediaries) (Amendment) Regulations 2020 (SI 2020/1220) reg 1 + href: https://www.legislation.gov.uk/uksi/2020/1220/regulation/1 + - title: The Social Security Contributions (Intermediaries) Regulations 2000 (SI 2000/727) reg 14(8A) + href: https://www.legislation.gov.uk/uksi/2000/727/regulation/14 diff --git a/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1/off_payroll/in_effect.yaml b/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1/off_payroll/in_effect.yaml new file mode 100644 index 0000000000..5d51afb8b6 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1/off_payroll/in_effect.yaml @@ -0,0 +1,13 @@ +description: Whether the off-payroll working rules make a public authority client the fee-payer liable to secondary Class 1 contributions on deemed direct payments. They apply from 6 April 2017. +values: + 0000-01-01: false + 2017-04-06: true +metadata: + unit: bool + period: year + label: Off-payroll working rules in effect + reference: + - title: The Social Security (Miscellaneous Amendments No. 2) Regulations 2017 (SI 2017/373) reg 1 + href: https://www.legislation.gov.uk/uksi/2017/373/regulation/1 + - title: The Social Security Contributions (Intermediaries) Regulations 2000 (SI 2000/727) reg 14 + href: https://www.legislation.gov.uk/uksi/2000/727/regulation/14 diff --git a/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1/off_payroll/index.yaml b/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1/off_payroll/index.yaml new file mode 100644 index 0000000000..d09e6faae5 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1/off_payroll/index.yaml @@ -0,0 +1,3 @@ +description: Employer National Insurance under the off-payroll working rules. +metadata: + label: Off-payroll working rules diff --git a/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1a/termination_awards/in_effect.yaml b/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1a/termination_awards/in_effect.yaml new file mode 100644 index 0000000000..ad55f07363 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1a/termination_awards/in_effect.yaml @@ -0,0 +1,13 @@ +description: Whether Class 1A contributions are charged on termination awards above the threshold. They are from 6 April 2020. +values: + 0000-01-01: false + 2020-04-06: true +metadata: + unit: bool + period: year + label: Class 1A on termination awards in effect + reference: + - title: The National Insurance Contributions (Termination Awards and Sporting Testimonials) Act 2019 (Commencement) Regulations 2020 (SI 2020/285) reg 2 + href: https://www.legislation.gov.uk/uksi/2020/285 + - title: Social Security Contributions and Benefits Act 1992 s.10(1A)-(1C) + href: https://www.legislation.gov.uk/ukpga/1992/4/section/10 diff --git a/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1a/termination_awards/index.yaml b/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1a/termination_awards/index.yaml new file mode 100644 index 0000000000..b93c51d397 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1a/termination_awards/index.yaml @@ -0,0 +1,3 @@ +description: Class 1A National Insurance on termination awards. +metadata: + label: Class 1A on termination awards diff --git a/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1a/termination_awards/threshold.yaml b/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1a/termination_awards/threshold.yaml new file mode 100644 index 0000000000..bdb8fa9c7d --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1a/termination_awards/threshold.yaml @@ -0,0 +1,12 @@ +description: Class 1A contributions are charged on each employee's termination awards above this amount, the ITEPA 2003 s.403 threshold. +values: + 2020-04-06: 30_000 +metadata: + unit: currency-GBP + period: year + label: Class 1A termination award threshold + reference: + - title: Income Tax (Earnings and Pensions) Act 2003 s.403(1) and (4) + href: https://www.legislation.gov.uk/ukpga/2003/1/section/403 + - title: Social Security Contributions and Benefits Act 1992 s.10(1A) + href: https://www.legislation.gov.uk/ukpga/1992/4/section/10 diff --git a/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1b/index.yaml b/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1b/index.yaml new file mode 100644 index 0000000000..e2641447c0 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1b/index.yaml @@ -0,0 +1,3 @@ +description: Class 1B National Insurance on PAYE settlement agreements. +metadata: + label: Class 1B diff --git a/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1b/percentage_2022_23/in_effect.yaml b/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1b/percentage_2022_23/in_effect.yaml new file mode 100644 index 0000000000..c98ce4d3fc --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1b/percentage_2022_23/in_effect.yaml @@ -0,0 +1,12 @@ +description: Whether the Class 1B percentage is the fixed rate the Health and Social Care Levy (Repeal) Act 2022 sets for 2022-23, rather than the secondary Class 1 percentage it equals in other tax years. +values: + 0000-01-01: false + 2022-04-06: true + 2023-04-06: false +metadata: + unit: bool + period: year + label: Fixed Class 1B percentage for 2022-23 + reference: + - title: Health and Social Care Levy (Repeal) Act 2022 Schedule paragraph 3 + href: https://www.legislation.gov.uk/ukpga/2022/43/schedule/paragraph/3/enacted diff --git a/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1b/percentage_2022_23/index.yaml b/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1b/percentage_2022_23/index.yaml new file mode 100644 index 0000000000..6d8e18ae76 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1b/percentage_2022_23/index.yaml @@ -0,0 +1,3 @@ +description: Class 1B percentage fixed for 2022-23. +metadata: + label: Class 1B percentage for 2022-23 diff --git a/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1b/percentage_2022_23/rate.yaml b/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1b/percentage_2022_23/rate.yaml new file mode 100644 index 0000000000..d706ef0356 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/national_insurance/class_1b/percentage_2022_23/rate.yaml @@ -0,0 +1,10 @@ +description: Class 1B percentage for 2022-23. +values: + 2022-04-06: 0.1453 +metadata: + unit: /1 + period: year + label: Class 1B percentage for 2022-23 + reference: + - title: Health and Social Care Levy (Repeal) Act 2022 Schedule paragraph 3(1) + href: https://www.legislation.gov.uk/ukpga/2022/43/schedule/paragraph/3/enacted diff --git a/policyengine_uk/parameters/gov/hmrc/national_insurance/employment_allowance/README.md b/policyengine_uk/parameters/gov/hmrc/national_insurance/employment_allowance/README.md new file mode 100644 index 0000000000..523c18ff11 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/national_insurance/employment_allowance/README.md @@ -0,0 +1 @@ +# Employment Allowance diff --git a/policyengine_uk/parameters/gov/hmrc/national_insurance/employment_allowance/amount.yaml b/policyengine_uk/parameters/gov/hmrc/national_insurance/employment_allowance/amount.yaml new file mode 100644 index 0000000000..6076d81794 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/national_insurance/employment_allowance/amount.yaml @@ -0,0 +1,43 @@ +description: Maximum Employment Allowance an employer can set against its secondary Class 1 National Insurance contributions in a tax year. +# The allowance cannot exceed the employer's non-excluded secondary Class 1 +# liabilities for the year (s.1(2)(b)). It started in 2014-15, so the model +# states a zero before then. +values: + 0000-01-01: 0 + 2014-04-06: + value: 2_000 + metadata: + reference: + - title: National Insurance Contributions Act 2014 s.1(2)(a), as enacted + href: https://www.legislation.gov.uk/ukpga/2014/7/section/1/enacted + 2016-04-06: + value: 3_000 + metadata: + reference: + - title: National Insurance Contributions Act 2014 s.1(2)(a), as substituted by SI 2016/63 reg 2 + href: https://www.legislation.gov.uk/ukpga/2014/7/section/1/2016-04-06 + 2020-04-06: + value: 4_000 + metadata: + reference: + - title: National Insurance Contributions Act 2014 s.1(2)(a), as substituted by SI 2020/273 reg 2 + href: https://www.legislation.gov.uk/ukpga/2014/7/section/1/2020-04-06 + 2022-04-06: + value: 5_000 + metadata: + reference: + - title: National Insurance Contributions Act 2014 s.1(2)(a), as substituted by SI 2022/364 reg 2 + href: https://www.legislation.gov.uk/ukpga/2014/7/section/1/2022-04-06 + 2025-04-06: + value: 10_500 + metadata: + reference: + - title: National Insurance Contributions Act 2014 s.1(2)(a), as substituted by the National Insurance Contributions (Secondary Class 1 Contributions) Act 2025 s.3(2) + href: https://www.legislation.gov.uk/ukpga/2014/7/section/1 +metadata: + unit: currency-GBP + period: year + label: Employment Allowance maximum amount + reference: + - title: National Insurance Contributions Act 2014 s.1 + href: https://www.legislation.gov.uk/ukpga/2014/7/section/1 diff --git a/policyengine_uk/parameters/gov/hmrc/national_insurance/employment_allowance/excludes_single_director_companies.yaml b/policyengine_uk/parameters/gov/hmrc/national_insurance/employment_allowance/excludes_single_director_companies.yaml new file mode 100644 index 0000000000..b22c4c6000 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/national_insurance/employment_allowance/excludes_single_director_companies.yaml @@ -0,0 +1,16 @@ +description: Whether a company whose only employee paid earnings liable to secondary Class 1 contributions is a director is excluded from the Employment Allowance. +values: + 0000-01-01: false + 2016-04-06: + value: true + metadata: + reference: + - title: National Insurance Contributions Act 2014 s.2(4A), inserted by SI 2016/344 reg 2 + href: https://www.legislation.gov.uk/ukpga/2014/7/section/2/2016-04-06 +metadata: + unit: bool + period: year + label: Employment Allowance single-director company exclusion + reference: + - title: National Insurance Contributions Act 2014 s.2(4A) + href: https://www.legislation.gov.uk/ukpga/2014/7/section/2 diff --git a/policyengine_uk/parameters/gov/hmrc/national_insurance/employment_allowance/prior_year_liabilities_limit.yaml b/policyengine_uk/parameters/gov/hmrc/national_insurance/employment_allowance/prior_year_liabilities_limit.yaml new file mode 100644 index 0000000000..18c7b87d9d --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/national_insurance/employment_allowance/prior_year_liabilities_limit.yaml @@ -0,0 +1,27 @@ +description: Secondary Class 1 liabilities in the previous tax year at or above which an employer cannot qualify for the Employment Allowance. +# s.2(4B) excluded an employer whose qualifying secondary Class 1 liabilities +# for the previous tax year, together with those of connected companies or +# charities, were £100,000 or more. It applied from 6 April 2020 (SI 2020/218) +# and was omitted from 6 April 2025 by the National Insurance Contributions +# (Secondary Class 1 Contributions) Act 2025 s.3. Infinity means no limit. +values: + 0000-01-01: .inf + 2020-04-06: + value: 100_000 + metadata: + reference: + - title: National Insurance Contributions Act 2014 s.2(4B), inserted by SI 2020/218 reg 3 + href: https://www.legislation.gov.uk/ukpga/2014/7/section/2/2020-04-06 + 2025-04-06: + value: .inf + metadata: + reference: + - title: National Insurance Contributions Act 2014 s.2(4B)-(4G), omitted from 6 April 2025 by the National Insurance Contributions (Secondary Class 1 Contributions) Act 2025 s.3(3)(a) and (4) + href: https://www.legislation.gov.uk/ukpga/2014/7/section/2 +metadata: + unit: currency-GBP + period: year + label: Employment Allowance prior-year liabilities limit + reference: + - title: National Insurance Contributions Act 2014 s.2(4B) + href: https://www.legislation.gov.uk/ukpga/2014/7/section/2/2020-04-06 diff --git a/policyengine_uk/parameters/gov/hmrc/plastic_packaging_tax/index.yaml b/policyengine_uk/parameters/gov/hmrc/plastic_packaging_tax/index.yaml new file mode 100644 index 0000000000..d38fc1022f --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/plastic_packaging_tax/index.yaml @@ -0,0 +1,3 @@ +description: Plastic packaging tax. +metadata: + label: Plastic packaging tax diff --git a/policyengine_uk/parameters/gov/hmrc/plastic_packaging_tax/rate.yaml b/policyengine_uk/parameters/gov/hmrc/plastic_packaging_tax/rate.yaml new file mode 100644 index 0000000000..60f3ccc51c --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/plastic_packaging_tax/rate.yaml @@ -0,0 +1,28 @@ +description: Plastic packaging tax charged per tonne of chargeable plastic packaging components. +# The tax is charged from 1 April 2022, so the model states a zero before then. +values: + 0000-01-01: 0 + 2022-04-01: + value: 200 + metadata: + reference: + - title: Finance Act 2021 s.45, as enacted + href: https://www.legislation.gov.uk/ukpga/2021/26/section/45/enacted + 2023-04-01: 210.82 + 2024-04-01: 217.85 + 2025-04-01: 223.69 + 2026-04-01: + value: 228.82 + metadata: + reference: + - title: Finance Act 2026 s.104 + href: https://www.legislation.gov.uk/ukpga/2026/11/section/104 +metadata: + unit: currency-GBP + period: year + label: Plastic packaging tax rate per tonne + reference: + - title: Finance Act 2021 s.45, as amended + href: https://www.legislation.gov.uk/ukpga/2021/26/section/45 + - title: Plastic Packaging Tax policy paper (GOV.UK), rates from April 2022 to April 2026 + href: https://www.gov.uk/government/publications/introduction-of-plastic-packaging-tax/plastic-packaging-tax diff --git a/policyengine_uk/parameters/gov/hmrc/plastic_packaging_tax/registration_threshold.yaml b/policyengine_uk/parameters/gov/hmrc/plastic_packaging_tax/registration_threshold.yaml new file mode 100644 index 0000000000..bdc7e887fc --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/plastic_packaging_tax/registration_threshold.yaml @@ -0,0 +1,15 @@ +description: A person whose finished plastic packaging components reach this many tonnes in 12 months is liable to register for plastic packaging tax, and only registered or liable persons are charged. +# The tax is not charged before 2022-04-01 (its rate is 0), so the threshold +# states a zero before then. +values: + 0000-01-01: 0 + 2022-04-01: 10 +metadata: + unit: /1 + period: year + label: Plastic packaging tax registration threshold (tonnes) + reference: + - title: Finance Act 2021 s.55 + href: https://www.legislation.gov.uk/ukpga/2021/26/section/55 + - title: Finance Act 2021 s.43(2A) + href: https://www.legislation.gov.uk/ukpga/2021/26/section/43 diff --git a/policyengine_uk/parameters/gov/hmrc/residential_property_developer_tax/allowance.yaml b/policyengine_uk/parameters/gov/hmrc/residential_property_developer_tax/allowance.yaml new file mode 100644 index 0000000000..8b5b1b4693 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/residential_property_developer_tax/allowance.yaml @@ -0,0 +1,10 @@ +description: Annual residential property developer tax allowance, shared within a group, deducted from RPD profits before the tax is charged. +values: + 2022-04-01: 25_000_000 +metadata: + unit: currency-GBP + period: year + label: Residential property developer tax allowance + reference: + - title: Finance Act 2022 s.33 and s.43 + href: https://www.legislation.gov.uk/ukpga/2022/3/section/43 diff --git a/policyengine_uk/parameters/gov/hmrc/residential_property_developer_tax/index.yaml b/policyengine_uk/parameters/gov/hmrc/residential_property_developer_tax/index.yaml new file mode 100644 index 0000000000..32c7d0a208 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/residential_property_developer_tax/index.yaml @@ -0,0 +1,3 @@ +description: Residential property developer tax. +metadata: + label: Residential property developer tax diff --git a/policyengine_uk/parameters/gov/hmrc/residential_property_developer_tax/rate.yaml b/policyengine_uk/parameters/gov/hmrc/residential_property_developer_tax/rate.yaml new file mode 100644 index 0000000000..c653f345ea --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/residential_property_developer_tax/rate.yaml @@ -0,0 +1,13 @@ +description: Residential property developer tax charged on a company's RPD profits above its allowance, for accounting periods from 1 April 2022. +values: + 0000-01-01: 0 + 2022-04-01: 0.04 +metadata: + unit: /1 + period: year + label: Residential property developer tax rate + reference: + - title: Finance Act 2022 s.33(1) + href: https://www.legislation.gov.uk/ukpga/2022/3/section/33 + - title: Finance Act 2022 s.51(1) (accounting periods beginning on or after 1 April 2022) + href: https://www.legislation.gov.uk/ukpga/2022/3/section/51 diff --git a/policyengine_uk/parameters/gov/hmrc/soft_drinks_industry_levy/index.yaml b/policyengine_uk/parameters/gov/hmrc/soft_drinks_industry_levy/index.yaml new file mode 100644 index 0000000000..2ba5182e40 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/soft_drinks_industry_levy/index.yaml @@ -0,0 +1,3 @@ +description: Soft drinks industry levy. +metadata: + label: Soft drinks industry levy diff --git a/policyengine_uk/parameters/gov/hmrc/soft_drinks_industry_levy/rate/higher.yaml b/policyengine_uk/parameters/gov/hmrc/soft_drinks_industry_levy/rate/higher.yaml new file mode 100644 index 0000000000..c43f3971d7 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/soft_drinks_industry_levy/rate/higher.yaml @@ -0,0 +1,31 @@ +description: Soft drinks industry levy charged per litre of chargeable soft drink with 8 grams or more of sugar per 100 millilitres. +# The levy is charged from 6 April 2018, so the model states a zero before then. +values: + 0000-01-01: 0 + 2018-04-06: + value: 0.24 + metadata: + reference: + - title: Finance Act 2017 s.30 (£2.40 per 10 litres), as enacted + href: https://www.legislation.gov.uk/ukpga/2017/10/section/30/enacted + 2025-04-01: + value: 0.259 + metadata: + reference: + - title: Finance Act 2025 s.79 (£2.59 per 10 litres) + href: https://www.legislation.gov.uk/ukpga/2025/8/section/79 + 2026-04-01: + value: 0.278 + metadata: + reference: + - title: Finance Act 2026 s.108 + href: https://www.legislation.gov.uk/ukpga/2026/11/section/108 +metadata: + unit: currency-GBP + period: year + label: Soft drinks industry levy higher rate per litre + reference: + - title: Finance Act 2017 Part 2 + href: https://www.legislation.gov.uk/ukpga/2017/10/part/2 + - title: Check if your drink is liable for the Soft Drinks Industry Levy (GOV.UK) + href: https://www.gov.uk/guidance/check-if-your-drink-is-liable-for-the-soft-drinks-industry-levy diff --git a/policyengine_uk/parameters/gov/hmrc/soft_drinks_industry_levy/rate/index.yaml b/policyengine_uk/parameters/gov/hmrc/soft_drinks_industry_levy/rate/index.yaml new file mode 100644 index 0000000000..73e835ff6c --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/soft_drinks_industry_levy/rate/index.yaml @@ -0,0 +1,3 @@ +description: Soft drinks industry levy rates per litre. +metadata: + label: Soft drinks industry levy rates diff --git a/policyengine_uk/parameters/gov/hmrc/soft_drinks_industry_levy/rate/lower.yaml b/policyengine_uk/parameters/gov/hmrc/soft_drinks_industry_levy/rate/lower.yaml new file mode 100644 index 0000000000..0f2128f879 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/soft_drinks_industry_levy/rate/lower.yaml @@ -0,0 +1,31 @@ +description: Soft drinks industry levy charged per litre of chargeable soft drink with at least 5 but less than 8 grams of sugar per 100 millilitres. +# The levy is charged from 6 April 2018, so the model states a zero before then. +values: + 0000-01-01: 0 + 2018-04-06: + value: 0.18 + metadata: + reference: + - title: Finance Act 2017 s.30 (£1.80 per 10 litres), as enacted + href: https://www.legislation.gov.uk/ukpga/2017/10/section/30/enacted + 2025-04-01: + value: 0.194 + metadata: + reference: + - title: Finance Act 2025 s.79 (£1.94 per 10 litres) + href: https://www.legislation.gov.uk/ukpga/2025/8/section/79 + 2026-04-01: + value: 0.208 + metadata: + reference: + - title: Finance Act 2026 s.108 + href: https://www.legislation.gov.uk/ukpga/2026/11/section/108 +metadata: + unit: currency-GBP + period: year + label: Soft drinks industry levy lower rate per litre + reference: + - title: Finance Act 2017 Part 2 + href: https://www.legislation.gov.uk/ukpga/2017/10/part/2 + - title: Check if your drink is liable for the Soft Drinks Industry Levy (GOV.UK) + href: https://www.gov.uk/guidance/check-if-your-drink-is-liable-for-the-soft-drinks-industry-levy diff --git a/policyengine_uk/parameters/gov/hmrc/soft_drinks_industry_levy/small_producer_threshold.yaml b/policyengine_uk/parameters/gov/hmrc/soft_drinks_industry_levy/small_producer_threshold.yaml new file mode 100644 index 0000000000..a09dfea91d --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/soft_drinks_industry_levy/small_producer_threshold.yaml @@ -0,0 +1,15 @@ +description: A producer whose chargeable soft drinks, with those of connected persons, do not exceed this many litres in a year is a small producer and pays no soft drinks industry levy. +# The levy is not charged before 2018-04-06 (its rate is 0), so the threshold +# states a zero before then. +values: + 0000-01-01: 0 + 2018-04-06: 1_000_000 +metadata: + unit: /1 + period: year + label: Soft drinks industry levy small producer threshold (litres) + reference: + - title: Finance Act 2017 s.37 + href: https://www.legislation.gov.uk/ukpga/2017/10/section/37 + - title: Finance Act 2017 s.38 + href: https://www.legislation.gov.uk/ukpga/2017/10/section/38 diff --git a/policyengine_uk/parameters/gov/hmrc/vat/flat_rate/default_sector_rate.yaml b/policyengine_uk/parameters/gov/hmrc/vat/flat_rate/default_sector_rate.yaml new file mode 100644 index 0000000000..0977a9d1eb --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/vat/flat_rate/default_sector_rate.yaml @@ -0,0 +1,21 @@ +description: Flat rate percentage for the "any other activity not listed elsewhere" business category of the VAT flat rate scheme, used when a firm's sector rate is not supplied. +values: + # Regulation 55K's table was substituted from 4 January 2011 (SI 2010/2940 + # reg 4), with the 20% standard rate; later 2020-21 amendments changed only + # temporary hospitality rows. Earlier values for this row are not encoded, + # so the model applies 12% before 2011. + 2011-01-04: + value: 0.12 + metadata: + reference: + - title: The Value Added Tax (Amendment) (No. 3) Regulations 2010 (SI 2010/2940) reg 4 (regulation 55K table substituted from 4 January 2011) + href: https://www.legislation.gov.uk/uksi/1995/2518/regulation/55K +metadata: + unit: /1 + period: year + label: VAT flat rate default sector percentage + reference: + - title: VAT Flat Rate Scheme, flat rate percentages by business type + href: https://www.gov.uk/vat-flat-rate-scheme/how-much-you-pay + - title: Value Added Tax Regulations 1995, regulation 55K (table of categories) + href: https://www.legislation.gov.uk/uksi/1995/2518/regulation/55K diff --git a/policyengine_uk/parameters/gov/hmrc/vat/flat_rate/join_threshold.yaml b/policyengine_uk/parameters/gov/hmrc/vat/flat_rate/join_threshold.yaml new file mode 100644 index 0000000000..c756028f0e --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/vat/flat_rate/join_threshold.yaml @@ -0,0 +1,17 @@ +description: A business may join the VAT flat rate scheme if it expects the value of its taxable supplies (excluding VAT) in the next year to be no more than this amount. +values: + 2003-04-10: + value: 150_000 + metadata: + reference: + - title: The Value Added Tax (Amendment) (No. 2) Regulations 2003 (SI 2003/1069) reg 7(1)(a) (£100,000 to £150,000 in regulation 55L(1)(a)(i), from 10 April 2003) + href: https://www.legislation.gov.uk/uksi/2003/1069/regulation/7/made +metadata: + unit: currency-GBP + period: year + label: VAT flat rate scheme joining threshold + reference: + - title: Value Added Tax Regulations 1995, regulation 55L(1)(a)(i) + href: https://www.legislation.gov.uk/uksi/1995/2518/regulation/55L + - title: VAT Notice 733, section 2.5 + href: https://www.gov.uk/guidance/flat-rate-scheme-for-small-businesses-vat-notice-733--2 diff --git a/policyengine_uk/parameters/gov/hmrc/vat/flat_rate/leave_threshold.yaml b/policyengine_uk/parameters/gov/hmrc/vat/flat_rate/leave_threshold.yaml new file mode 100644 index 0000000000..cd715bfe1b --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/vat/flat_rate/leave_threshold.yaml @@ -0,0 +1,17 @@ +description: A business must leave the VAT flat rate scheme when its VAT-inclusive total turnover in the year exceeds this amount. Encoded for reference; the model applies only the joining test. +values: + 2011-01-04: + value: 230_000 + metadata: + reference: + - title: Value Added Tax Regulations 1995 reg 55M(1)(a), as amended by the Value Added Tax (Amendment) (No. 3) Regulations 2010 (SI 2010/2940) reg 5(a) from 4 January 2011 + href: https://www.legislation.gov.uk/uksi/1995/2518/regulation/55M +metadata: + unit: currency-GBP + period: year + label: VAT flat rate scheme leaving threshold + reference: + - title: Value Added Tax Regulations 1995, regulation 55M(1)(a) + href: https://www.legislation.gov.uk/uksi/1995/2518/regulation/55M + - title: VAT Notice 733, section 3.5 + href: https://www.gov.uk/guidance/flat-rate-scheme-for-small-businesses-vat-notice-733--2 diff --git a/policyengine_uk/parameters/gov/hmrc/vat/flat_rate/limited_cost_trader_rate.yaml b/policyengine_uk/parameters/gov/hmrc/vat/flat_rate/limited_cost_trader_rate.yaml new file mode 100644 index 0000000000..497ec7178f --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/vat/flat_rate/limited_cost_trader_rate.yaml @@ -0,0 +1,12 @@ +description: Flat rate percentage applied to VAT-inclusive turnover for limited cost traders in the VAT flat rate scheme, whatever their sector. +values: + 2017-04-01: 0.165 +metadata: + unit: /1 + period: year + label: VAT flat rate for limited cost traders + reference: + - title: The Value Added Tax (Amendment) Regulations 2017 (SI 2017/295), regulation 7 inserting regulation 55KA + href: https://www.legislation.gov.uk/uksi/2017/295/made + - title: VAT Notice 733, section 4.4 + href: https://www.gov.uk/guidance/flat-rate-scheme-for-small-businesses-vat-notice-733--2 diff --git a/policyengine_uk/parameters/gov/hmrc/vat/partial_exemption/de_minimis/index.yaml b/policyengine_uk/parameters/gov/hmrc/vat/partial_exemption/de_minimis/index.yaml new file mode 100644 index 0000000000..d564158353 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/vat/partial_exemption/de_minimis/index.yaml @@ -0,0 +1,3 @@ +description: VAT partial exemption de minimis tests. +metadata: + label: VAT partial exemption de minimis diff --git a/policyengine_uk/parameters/gov/hmrc/vat/partial_exemption/de_minimis/input_tax_share.yaml b/policyengine_uk/parameters/gov/hmrc/vat/partial_exemption/de_minimis/input_tax_share.yaml new file mode 100644 index 0000000000..21bc2ffbd5 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/vat/partial_exemption/de_minimis/input_tax_share.yaml @@ -0,0 +1,9 @@ +description: Under the VAT partial exemption de minimis test, exempt input tax must be no more than this share of all input tax, as well as within the monthly limit. +values: + 1995-10-20: 0.5 +metadata: + label: VAT partial exemption de minimis input tax share + unit: /1 + reference: + - title: The Value Added Tax Regulations 1995 (SI 1995/2518), reg 106(1)(b) + href: https://www.legislation.gov.uk/uksi/1995/2518/regulation/106 diff --git a/policyengine_uk/parameters/gov/hmrc/vat/partial_exemption/de_minimis/monthly_limit.yaml b/policyengine_uk/parameters/gov/hmrc/vat/partial_exemption/de_minimis/monthly_limit.yaml new file mode 100644 index 0000000000..5b8a6b0d5d --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/vat/partial_exemption/de_minimis/monthly_limit.yaml @@ -0,0 +1,12 @@ +description: Under the VAT partial exemption de minimis test, exempt input tax is treated as attributable to taxable supplies where it averages no more than this amount a month and is no more than the share of all input tax set by the input tax share parameter. +values: + 1995-10-20: 625 +metadata: + label: VAT partial exemption de minimis monthly limit + unit: currency-GBP + period: month + reference: + - title: The Value Added Tax Regulations 1995 (SI 1995/2518), reg 106(1), as made + href: https://www.legislation.gov.uk/uksi/1995/2518/regulation/106/made + - title: The Value Added Tax Regulations 1995 (SI 1995/2518), reg 106(1), as amended + href: https://www.legislation.gov.uk/uksi/1995/2518/regulation/106 diff --git a/policyengine_uk/parameters/gov/hmrc/vat/partial_exemption/de_minimis/simplified/exempt_supplies_share.yaml b/policyengine_uk/parameters/gov/hmrc/vat/partial_exemption/de_minimis/simplified/exempt_supplies_share.yaml new file mode 100644 index 0000000000..33258e6244 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/vat/partial_exemption/de_minimis/simplified/exempt_supplies_share.yaml @@ -0,0 +1,9 @@ +description: Under the VAT partial exemption simplified de minimis test, the value of exempt supplies must be no more than this share of the value of all supplies. +values: + 2010-04-01: 0.5 +metadata: + label: VAT partial exemption simplified de minimis exempt supplies share + unit: /1 + reference: + - title: The Value Added Tax Regulations 1995 (SI 1995/2518), reg 105A + href: https://www.legislation.gov.uk/uksi/1995/2518/regulation/105A diff --git a/policyengine_uk/parameters/gov/hmrc/vat/partial_exemption/de_minimis/simplified/in_effect.yaml b/policyengine_uk/parameters/gov/hmrc/vat/partial_exemption/de_minimis/simplified/in_effect.yaml new file mode 100644 index 0000000000..3b5bdc5b48 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/vat/partial_exemption/de_minimis/simplified/in_effect.yaml @@ -0,0 +1,10 @@ +description: Whether the VAT partial exemption simplified de minimis test applies. It was added from 1 April 2010. +values: + 0000-01-01: false + 2010-04-01: true +metadata: + label: VAT partial exemption simplified de minimis test in effect + unit: bool + reference: + - title: The Value Added Tax (Amendment) Regulations 2010 (SI 2010/559) + href: https://www.legislation.gov.uk/uksi/2010/559/made diff --git a/policyengine_uk/parameters/gov/hmrc/vat/partial_exemption/de_minimis/simplified/index.yaml b/policyengine_uk/parameters/gov/hmrc/vat/partial_exemption/de_minimis/simplified/index.yaml new file mode 100644 index 0000000000..c0e7f99874 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/vat/partial_exemption/de_minimis/simplified/index.yaml @@ -0,0 +1,3 @@ +description: VAT partial exemption simplified de minimis test. +metadata: + label: VAT partial exemption simplified de minimis test diff --git a/policyengine_uk/parameters/gov/hmrc/vat/partial_exemption/de_minimis/simplified/monthly_limit.yaml b/policyengine_uk/parameters/gov/hmrc/vat/partial_exemption/de_minimis/simplified/monthly_limit.yaml new file mode 100644 index 0000000000..6f055d3c86 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/vat/partial_exemption/de_minimis/simplified/monthly_limit.yaml @@ -0,0 +1,12 @@ +description: Under the VAT partial exemption simplified de minimis test, all input tax is recoverable where total input tax less input tax used exclusively for taxable supplies averages no more than this amount a month, and exempt supplies are within the exempt supplies share. +values: + 2010-04-01: 625 +metadata: + label: VAT partial exemption simplified de minimis monthly limit + unit: currency-GBP + period: month + reference: + - title: The Value Added Tax Regulations 1995 (SI 1995/2518), reg 105A + href: https://www.legislation.gov.uk/uksi/1995/2518/regulation/105A + - title: The Value Added Tax (Amendment) Regulations 2010 (SI 2010/559) + href: https://www.legislation.gov.uk/uksi/2010/559/made diff --git a/policyengine_uk/parameters/gov/hmrc/vat/partial_exemption/index.yaml b/policyengine_uk/parameters/gov/hmrc/vat/partial_exemption/index.yaml new file mode 100644 index 0000000000..e8a6d665f1 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/vat/partial_exemption/index.yaml @@ -0,0 +1,3 @@ +description: VAT partial exemption standard method. +metadata: + label: VAT partial exemption diff --git a/policyengine_uk/parameters/gov/hmrc/vat/partial_exemption/rounding_threshold.yaml b/policyengine_uk/parameters/gov/hmrc/vat/partial_exemption/rounding_threshold.yaml new file mode 100644 index 0000000000..cd36d98ed0 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/vat/partial_exemption/rounding_threshold.yaml @@ -0,0 +1,12 @@ +description: Under the VAT partial exemption standard method, the recoverable percentage is rounded up to the next whole number where residual input tax averages no more than this amount a month, and to two decimal places otherwise. +values: + 2005-04-01: 400_000 +metadata: + label: VAT partial exemption whole-number rounding threshold (monthly) + unit: currency-GBP + period: month + reference: + - title: The Value Added Tax (Amendment) Regulations 2005 (SI 2005/762), which added reg 101(5) + href: https://www.legislation.gov.uk/uksi/2005/762/made + - title: The Value Added Tax Regulations 1995 (SI 1995/2518), reg 101(4)-(5), as amended + href: https://www.legislation.gov.uk/uksi/1995/2518/regulation/101 diff --git a/policyengine_uk/parameters/gov/hmrc/vat/registration/deregistration_threshold.yaml b/policyengine_uk/parameters/gov/hmrc/vat/registration/deregistration_threshold.yaml new file mode 100644 index 0000000000..b217762cc0 --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/vat/registration/deregistration_threshold.yaml @@ -0,0 +1,20 @@ +description: A VAT-registered business may cancel its registration when the value of its taxable supplies (excluding VAT) in the next 12 months is expected to be no more than this threshold. +values: + 2010-04-01: 68_000 + 2011-04-01: 71_000 + 2012-04-01: 75_000 + 2013-04-01: 77_000 + 2014-04-01: 79_000 + 2015-04-01: 80_000 + 2016-04-01: 81_000 + 2017-04-01: 83_000 + 2024-04-01: 88_000 +metadata: + unit: currency-GBP + period: year + label: VAT deregistration threshold + reference: + - title: Value Added Tax Act 1994, Schedule 1, paragraph 4 + href: https://www.legislation.gov.uk/ukpga/1994/23/schedule/1/paragraph/4 + - title: VAT Notice 700/1 supplement, section 5.2 (deregistration limits) + href: https://www.gov.uk/government/publications/vat-notice-7001-should-i-be-registered-for-vat/vat-notice-7001-supplement--2 diff --git a/policyengine_uk/parameters/gov/hmrc/vat/registration/threshold.yaml b/policyengine_uk/parameters/gov/hmrc/vat/registration/threshold.yaml new file mode 100644 index 0000000000..e3b9a23e0d --- /dev/null +++ b/policyengine_uk/parameters/gov/hmrc/vat/registration/threshold.yaml @@ -0,0 +1,22 @@ +description: A business must register for VAT when the value of its taxable supplies (standard-, reduced- and zero-rated, excluding VAT) over the previous 12 months exceeds this threshold. +values: + 2010-04-01: 70_000 + 2011-04-01: 73_000 + 2012-04-01: 77_000 + 2013-04-01: 79_000 + 2014-04-01: 81_000 + 2015-04-01: 82_000 + 2016-04-01: 83_000 + 2017-04-01: 85_000 + 2024-04-01: 90_000 +metadata: + unit: currency-GBP + period: year + label: VAT registration threshold + reference: + - title: Value Added Tax Act 1994, Schedule 1, paragraph 1(1) + href: https://www.legislation.gov.uk/ukpga/1994/23/schedule/1/paragraph/1 + - title: The Value Added Tax (Increase of Registration Limits) Order 2024 (SI 2024/307) + href: https://www.legislation.gov.uk/uksi/2024/307/made + - title: VAT Notice 700/1 supplement, section 2.2 (registration thresholds) + href: https://www.gov.uk/government/publications/vat-notice-7001-should-i-be-registered-for-vat/vat-notice-7001-supplement--2 diff --git a/policyengine_uk/programs.yaml b/policyengine_uk/programs.yaml index c80b24cbd1..ddbb82841c 100644 --- a/policyengine_uk/programs.yaml +++ b/policyengine_uk/programs.yaml @@ -266,6 +266,178 @@ programs: verified_end_year: 2030 notes: Receipts allocated to households by shareholding. Local and central rating lists; outturn from 2020-21 (Northern Ireland's first year) to 2025-26 (Wales 2024-25), then OBR March 2026 receipts forecasts to 2030-31. + # --- Firm-side programs (firm entity; not in the budget totals) --- + - id: corporation_tax + name: Corporation tax + full_name: Corporation Tax + category: Taxes + agency: HMRC + status: partial + coverage: UK + variable: corporation_tax + parameter_prefix: gov.hmrc.corporation_tax + verified_start_year: 2026 + notes: Firm-level liability of companies. Main and small profits rates with marginal relief and the associated-companies divisor, loss relief with the deductions allowance, capital allowances (full expensing, first-year allowances, AIA, writing-down allowances, SBA) and merged-scheme R&D relief, group relief for a claimed amount (Parts 5 and 5A) and the Patent Box deduction on supplied relevant IP profits. No quarterly instalments. Not in household_tax or gov_tax. + + - id: bank_surcharge + name: Bank surcharge + full_name: Bank Corporation Tax Surcharge + category: Taxes + agency: HMRC + status: partial + coverage: UK + variable: bank_surcharge + parameter_prefix: gov.hmrc.bank_surcharge + verified_start_year: 2026 + notes: Firm-level surcharge on banking companies' profits above the surcharge allowance. The 6% rate announced for 1 January 2027 to 31 March 2028 is not yet enacted. Not in household_tax or gov_tax. + + - id: apprenticeship_levy + name: Apprenticeship levy + full_name: Apprenticeship Levy + category: Taxes + agency: HMRC + status: partial + coverage: UK + variable: apprenticeship_levy + parameter_prefix: gov.hmrc.apprenticeship_levy + verified_start_year: 2017 + notes: Firm-level levy on the paybill less the levy allowance, with the allowance shared across connected employers. Not in household_tax or gov_tax. + + - id: firm_employer_ni + name: Employer National Insurance (firms) + full_name: Class 1 secondary National Insurance contributions of employers + category: Taxes + agency: HMRC + status: partial + coverage: UK + variable: firm_employer_ni + parameter_prefix: gov.hmrc.national_insurance.class_1 + verified_start_year: 2024 + notes: Firm-level employer National Insurance after the Employment Allowance, plus off-payroll Class 1 (firm_off_payroll_employer_ni), Class 1A on termination awards and Class 1B as separate variables. Earnings above the secondary threshold are approximated from paybill and employees unless given as an input. The household-side measure is ni_employer under the national_insurance entry. Not in household_tax or gov_tax. + + - id: employment_allowance + name: Employment Allowance + full_name: Employment Allowance against employer National Insurance + category: Taxes + agency: HMRC + status: partial + coverage: UK + variable: employment_allowance + parameter_prefix: gov.hmrc.national_insurance.employment_allowance + verified_start_year: 2024 + notes: Firm-level allowance, capped at the employer's Class 1 secondary liability. Covers the single-director and public-body exclusions and the prior-year liabilities limit for 2020-21 to 2024-25. Not in household_tax or gov_tax. + + - id: firm_business_rates + name: Business rates (firms) + full_name: Non-domestic rates payable by firms in England, Wales, Scotland and Northern Ireland + category: Taxes + agency: Local + status: partial + coverage: England + variable: firm_business_rates + parameter_prefix: gov.hmrc.business_rates + verified_start_year: 2023 + verified_end_year: 2027 + notes: Firm-level statutory liability on one aggregate property per firm. England with small business, charitable, retail hospitality and leisure, pubs and live music, and empty property reliefs; Wales (standard, retail and higher multipliers, SBRR and charitable relief) and Scotland (poundage, Small Business Bonus Scheme and charitable relief) from 2023-24; Northern Ireland (regional and district rates, small business rate relief, charity exemption, unoccupied property) from 2023-24 where a district is supplied, with 2027-28 Northern Ireland poundages carried forward, not verified. No transitional relief. The business_rates entry is the separate household allocation of UK receipts. Not in household_tax or gov_tax. + + - id: firm_vat + name: VAT (firms) + full_name: Value Added Tax payable by registered businesses + category: Taxes + agency: HMRC + status: partial + coverage: UK + variable: firm_vat + parameter_prefix: gov.hmrc.vat + verified_start_year: 2025 + notes: Firm-level output VAT less recoverable input VAT, with partial exemption (direct attribution and, if flagged, the de minimis tests), the registration threshold and the flat rate scheme including the limited cost trader rate. Registration is tested on annual turnover; no cash or annual accounting. The household-side measure is the vat entry. Not in household_tax or gov_tax. + + - id: soft_drinks_industry_levy + name: Soft drinks industry levy + full_name: Soft Drinks Industry Levy + category: Taxes + agency: HMRC + status: partial + coverage: UK + variable: soft_drinks_industry_levy + parameter_prefix: gov.hmrc.soft_drinks_industry_levy + verified_start_year: 2018 + verified_end_year: 2026 + notes: Firm-level levy per litre of chargeable soft drinks at the higher and lower sugar bands, with the 1 million litre small producer exemption. Litres are firm inputs. Rates after 2026-27 carry forward. Not in household_tax or gov_tax. + + - id: plastic_packaging_tax + name: Plastic packaging tax + full_name: Plastic Packaging Tax + category: Taxes + agency: HMRC + status: partial + coverage: UK + variable: plastic_packaging_tax + parameter_prefix: gov.hmrc.plastic_packaging_tax + verified_start_year: 2022 + verified_end_year: 2026 + notes: Firm-level tax per tonne of plastic packaging with less than 30% recycled plastic, for firms at or above the 10 tonne registration threshold over the year. Tonnes are firm inputs. Rates after 2026-27 carry forward. Not in household_tax or gov_tax. + + - id: residential_property_developer_tax + name: Residential property developer tax + full_name: Residential Property Developer Tax + category: Taxes + agency: HMRC + status: partial + coverage: UK + variable: residential_property_developer_tax + parameter_prefix: gov.hmrc.residential_property_developer_tax + verified_start_year: 2022 + notes: Firm-level 4% charge on supplied RPD profits above the group-shared £25 million allowance, companies only. Not deductible for corporation tax. Not in household_tax or gov_tax. + + - id: digital_services_tax + name: Digital services tax + full_name: Digital Services Tax + category: Taxes + agency: HMRC + status: partial + coverage: UK + variable: digital_services_tax + parameter_prefix: gov.hmrc.digital_services_tax + verified_start_year: 2020 + notes: Firm-level 2% of group UK digital services revenues above £25 million, where worldwide revenues exceed £500 million and UK revenues exceed £25 million, shared by UK revenues. Revenues are inputs; the alternative charge is not modelled. Not in household_tax or gov_tax. + + - id: energy_profits_levy + name: Energy profits levy + full_name: Energy (Oil and Gas) Profits Levy + category: Taxes + agency: HMRC + status: partial + coverage: UK + variable: energy_profits_levy + parameter_prefix: gov.hmrc.energy_profits_levy + verified_start_year: 2022 + notes: Firm-level levy on supplied levy profits (after the investment and decarbonisation allowances), day-weighted 25%, 35% and 38% rates to 31 March 2030. The price floor is not modelled. Not in household_tax or gov_tax. + + - id: firm_minimum_wage_cost + name: Minimum wage floor (firms) + full_name: Firm cost of meeting the National Minimum Wage + category: Other + agency: HMRC + status: partial + coverage: UK + variable: firm_minimum_wage_cost + parameter_prefix: gov.hmrc.minimum_wage + verified_start_year: 2026 + notes: Extra pay needed to bring a firm's low-paid block up to the adult rate, at the block's average hourly wage. It raises the paybill read by the apprenticeship levy and the default employer NIC and auto-enrolment approximations. A firm cost, not a tax; not in household_tax or gov_tax. Younger-worker and apprentice rates not modelled. + + - id: auto_enrolment_employer_contribution + name: Auto-enrolment employer contribution + full_name: Automatic enrolment employer minimum pension contribution + category: Other + agency: DWP + status: partial + coverage: UK + variable: firm_auto_enrolment_employer_contribution + parameter_prefix: gov.dwp.auto_enrolment + verified_start_year: 2025 + notes: Firm-level employer minimum contribution on qualifying earnings, approximated from paybill and employees. + - id: minimum_wage name: National Minimum Wage full_name: National Minimum Wage / National Living Wage diff --git a/policyengine_uk/simulation.py b/policyengine_uk/simulation.py index 94ab790818..c8f52b24b4 100644 --- a/policyengine_uk/simulation.py +++ b/policyengine_uk/simulation.py @@ -13,11 +13,12 @@ # PolicyEngine core imports from policyengine_core.data import Dataset from policyengine_core.enums import Enum as CoreEnum -from policyengine_core.periods import Period, period as period_ +from policyengine_core.periods import ETERNITY, Period, period as period_ from policyengine_core.parameters import Parameter from policyengine_core.reforms import Reform from policyengine_core.simulations import Simulation as CoreSimulation from policyengine_core.simulations.simulation import ( + _branch_clone, _uprating_index_value, ) from policyengine_core.tools.hugging_face import download_huggingface_dataset @@ -34,7 +35,11 @@ UKMultiYearDataset, UKSingleYearDataset, ) -from policyengine_uk.utils.entity_ids import ENTITY_ID_VARIABLES, check_entity_ids +from policyengine_uk.utils.entity_ids import ( + ENTITY_ID_VARIABLES, + FIRM_ID_VARIABLE, + check_entity_ids, +) from policyengine_uk.utils.scenario import ConstructionReformState, Scenario from policyengine_uk.data.economic_assumptions import ( BEREAVEMENT_SPLIT_INPUTS, @@ -235,6 +240,88 @@ def _current_law_uprating_fingerprint(capital_gains_projection) -> str: return _current_law_uprating_fingerprints[key] +def _root_population_keys(simulation) -> list: + """Keys of ``simulation``'s root populations (the firm's): those that are + neither its system's person population nor one of its group populations. + + policyengine-core knows only people and groups of people, so its + ``clone`` and ``_bind_to_tax_benefit_system`` leave these out; the UK + ``Simulation`` handles them itself.""" + system = simulation.tax_benefit_system + populations = getattr(simulation, "populations", None) or {} + if system is None: + return [] + own = {system.person_entity.key, *system.group_entity_keys} + return [key for key in populations if key not in own] + + +def _root_entity(system, key): + """The entity of ``system`` with ``key``. A cloned system copies its + ``entities`` apart from its person and group entities, so look it up + there.""" + for entity in system.entities: + if entity.key == key: + return entity + return None + + +def _with_firm_ids(table): + """``table``, a firm table, with a ``firm_id`` column: a table without + one numbers its firms 0, 1, ... in the order it gives them, as + ``UKSingleYearDataset.from_simulation`` does. None stays None.""" + if table is None or FIRM_ID_VARIABLE in table.columns: + return table + return table.assign(**{FIRM_ID_VARIABLE: np.arange(len(table))}) + + +def _firm_table_in_population_order(table, firm_ids): + """``table``, a year's firm table, with its rows in the order of the firm + population's ``firm_ids`` (the first year's order), or None if there is + no table. A table without ``firm_id`` numbers its firms 0, 1, ... . + + Each year's table must give exactly the first year's firms, each once: + the population is built from the first year, so a later year's extra or + missing firms would otherwise be dropped or left without inputs.""" + if table is None: + return None + table = _with_firm_ids(table) + ids = table[FIRM_ID_VARIABLE].to_numpy() + firm_ids = np.asarray(firm_ids) + if np.array_equal(ids, firm_ids): + return table + position = pd.Series(np.arange(len(ids)), index=ids) + if ( + len(ids) != len(firm_ids) + or position.index.has_duplicates + or set(ids.tolist()) != set(firm_ids.tolist()) + ): + raise ValueError( + "Each year's firm table must give the same firms, each once, as " + f"the first year's: the first year gives {len(firm_ids)} firm(s), " + f"this table {len(ids)} row(s) with different firm ids." + ) + return table.iloc[position.loc[firm_ids].to_numpy()] + + +def _core_dataset_firm_ids(data, system): + """The firm ids of a core dataset's ``data`` (``{variable: {period: + values}}``): its ``firm_id`` values for their first period, or, without + them, 0, 1, ... for as many firms as its firm variables' first values + give. None if it has no firm variables.""" + if FIRM_ID_VARIABLE in data: + values = data[FIRM_ID_VARIABLE] + return np.asarray(values[next(iter(values))]) + for variable, values in data.items(): + if variable not in system.variables or not values: + continue + if system.variables[variable].entity.key != "firm": + continue + first = np.asarray(values[next(iter(values))]) + if first.ndim > 0: + return np.arange(len(first)) + return None + + def get_default_dataset_url() -> str: dataset_url = os.environ.get(DEFAULT_DATASET_ENV_VAR) if dataset_url: @@ -698,8 +785,156 @@ def set_input(self, variable_name: str, period: Period, value) -> None: if variable_name in CGT_DATASET_INPUTS: self._capture_cgt_supplied_inputs(variable_name, replace_period=period) + def _bind_to_tax_benefit_system(self) -> None: + """Bind every population to this simulation's system, as core does, + including the root (firm) populations core does not know. + + Core binds the person and group populations, and raises for any + other. Take the root populations out while it runs, then bind each + to the system's entity of its key and each of its holders to the + system's variable, dropping holders (and their input records) for + variables the system does not have in that entity, as core does for + the others.""" + roots = _root_population_keys(self) + if not roots: + super()._bind_to_tax_benefit_system() + return + populations = self.populations + taken = {key: populations.pop(key) for key in roots} + try: + super()._bind_to_tax_benefit_system() + finally: + populations.update(taken) + system = self.tax_benefit_system + variables = system.variables + dropped = set() + for key, population in taken.items(): + entity = _root_entity(system, key) + if entity is not None: + population.entity = entity + for name, holder in list(population._holders.items()): + variable = variables.get(name) + if ( + variable is None + or variable.entity.key != key + or (variable.definition_period == ETERNITY) + != holder._memory_storage.is_eternal + ): + del population._holders[name] + dropped.add(name) + else: + holder.variable = variable + if not dropped: + return + user_input_keys = getattr(self, "_user_input_keys", None) + if user_input_keys is not None and any( + key[0] in dropped for key in user_input_keys + ): + self._user_input_keys = { + key for key in user_input_keys if key[0] not in dropped + } + input_variables = getattr(self, "input_variables", None) + if input_variables is not None and any( + name in dropped for name in input_variables + ): + self.input_variables = [ + name for name in input_variables if name not in dropped + ] + + @contextmanager + def _exporting_people_only(self): + """While core exports one row (or list entry) per person, leave out + the variables of root (firm) populations: firms are not people, and + their values do not map to them.""" + roots = set(_root_population_keys(self)) + variables = self.tax_benefit_system.variables + exportable = self._get_exportable_input_periods + + def periods(variable_name, include_computed_variables): + if variables[variable_name].entity.key in roots: + return [] + return exportable(variable_name, include_computed_variables) + + # Restore whatever was there before (an instance override from an + # enclosing call, or none), so nested exports leave it as found. + missing = object() + previous = self.__dict__.get("_get_exportable_input_periods", missing) + self._get_exportable_input_periods = periods + try: + yield + finally: + if previous is missing: + del self._get_exportable_input_periods + else: + self._get_exportable_input_periods = previous + + def _to_person_dataframe(self, get_periods, include_computed_variables=False): + roots = set(_root_population_keys(self)) + variables = self.tax_benefit_system.variables + + def periods(variable_name): + if variables[variable_name].entity.key in roots: + return [] + return get_periods(variable_name) + + return super()._to_person_dataframe( + periods, include_computed_variables=include_computed_variables + ) + + def to_input_dict(self, include_computed_variables: bool = False) -> dict: + """Export the inputs as core does, one entry per person, leaving out + firm variables (firms are not people).""" + with self._exporting_people_only(): + return super().to_input_dict( + include_computed_variables=include_computed_variables + ) + + def map_result(self, values, source_entity: str, target_entity: str, how=None): + """Map values between entities, as core does. A root (firm) + population has no members, so its values map only to itself: core + would route a firm-to-person mapping back through itself without + end.""" + if source_entity != target_entity: + roots = set(_root_population_keys(self)) + if source_entity in roots or target_entity in roots: + raise ValueError( + f"Cannot map values from {source_entity} to {target_entity}: " + "firms have no members, so firm values do not map to " + "people or households, or the reverse." + ) + return super().map_result(values, source_entity, target_entity, how=how) + def clone(self, *args, **kwargs) -> "Simulation": + # Core's clone shares cached arrays when ``get_branch`` (or a + # subsample's baseline copy) announced it, and marks the request + # used; read it first, so the firm population shares them too. + request = _branch_clone.get() + share_arrays = ( + request is not None and request.pending and request.simulation is self + ) clone = super().clone(*args, **kwargs) + # Core copies only the person and group populations, and the copy of + # this simulation's attributes left the firm shortcut pointing at + # this simulation's population. Give the clone its own copy, bound + # to the clone's system. + for key in _root_population_keys(self): + # The patched core clone (policyengine_uk.tax_benefit_system) + # has already given the clone its own copy, bound to it. + existing = clone.populations.get(key) + if ( + existing is not None + and existing is not self.populations[key] + and getattr(existing, "simulation", None) is clone + ): + setattr(clone, key, existing) + continue + sharing = {"share_arrays": True} if share_arrays else {} + population = self.populations[key].clone(clone, **sharing) + entity = _root_entity(clone.tax_benefit_system, key) + if entity is not None: + population.entity = entity + clone.populations[key] = population + setattr(clone, key, population) clone._construction_reform_state = copy.deepcopy( getattr(self, "_construction_reform_state", None) ) @@ -1210,7 +1445,12 @@ def build_from_situation(self, situation: Dict) -> None: """Build simulation from a situation dictionary. Args: - situation: Dictionary describing household composition and characteristics + situation: Dictionary describing household composition and + characteristics. An optional ``firms`` entry, mapping each + firm's name to its inputs (``{variable: {period: value}}`` or + ``{variable: value}`` for the default period), gives the + simulation firms; without it the simulation has none. A + situation of firms alone has no people. """ self._start_new_population(built_from_dataset=False) self.build_from_populations(self.tax_benefit_system.instantiate_entities()) @@ -1218,16 +1458,68 @@ def build_from_situation(self, situation: Dict) -> None: SimulationBuilder, ) # Import here to avoid circular dependency + # A copy: the caller's situation also builds a reform's baseline. + situation = dict(situation) + firms = situation.pop("firms", None) + variables = self.tax_benefit_system.variables + root_inputs = sorted( + name + for name in situation + if name in variables + and variables[name].entity.key in _root_population_keys(self) + ) + if root_inputs: + raise ValueError( + "A situation gives firms through its 'firms' entry, " + "{name: {variable: value}}, not as variables of its own: " + f"{', '.join(root_inputs)}." + ) builder = SimulationBuilder() builder.default_period = self.default_input_period - builder.build_from_dict(self.tax_benefit_system, situation, self) + if firms is not None and not situation: + # Firms alone: no people, benefit units or households. + builder.build_default_simulation(self.tax_benefit_system, 0, self) + self.input_variables = [] + else: + builder.build_from_dict(self.tax_benefit_system, situation, self) self.has_axes = builder.has_axes + # Core's builder knows only people and their groups, and its + # variable-only route gives every population, the firm's included, + # one record per person. A situation's firms come from its ``firms`` + # entry alone. + self._build_firms_from_situation(firms or {}) self._capture_cgt_supplied_inputs() self.dataset = UKSingleYearDataset.from_simulation( self, fiscal_year=self.default_input_period ) + def _build_firms_from_situation(self, firms: Dict) -> None: + """Give the firm population the firms of a situation's ``firms`` + entry, and their inputs.""" + from policyengine_core.simulations.simulation_builder import ( + SimulationBuilder, + ) + + population = self.populations["firm"] + population.count = 0 + population.ids = [] + for holder in population._holders.values(): + holder.delete_arrays() + population._holders = {} + if not firms: + return + builder = SimulationBuilder() + builder.default_period = self.default_input_period + builder.add_person_entity(population.entity, firms) + builder.finalize_variables_init(population) + known = set(self.input_variables or ()) + self.input_variables = list(self.input_variables or ()) + [ + name + for name, holder in population._holders.items() + if name not in known and holder.get_known_periods() + ] + def build_from_dataset_source( self, dataset_source: Union[str, os.PathLike] ) -> None: @@ -1477,7 +1769,9 @@ def get_first_array(variable_name: str) -> np.ndarray: "benunit_id", "household_id", ], - ) + ), + # Firms, if the dataset has any, in the order it gives them. + firm_id=_core_dataset_firm_ids(data, self.tax_benefit_system), ) self._isa_income_contracts = resolve_contracts( @@ -1559,12 +1853,28 @@ def build_from_multi_year_dataset(self, dataset: UKMultiYearDataset) -> None: _pre_encode_enum_columns(dataset, self.tax_benefit_system) # Use first year to establish entity structure first_year = dataset[dataset.years[0]] + first_firm_table = _with_firm_ids(first_year.firm) + if first_firm_table is None: + later = [ + year for year in dataset.years[1:] if dataset[year].firm is not None + ] + if later: + raise ValueError( + f"The dataset gives a firm table for {later[0]} but not for " + f"its first year, {dataset.years[0]}: the first year's " + "firm table sets the simulation's firms." + ) self.build_from_ids( first_year.person.person_id, first_year.person.person_benunit_id, first_year.person.person_household_id, first_year.benunit.benunit_id, first_year.household.household_id, + firm_id=( + None + if first_firm_table is None + else first_firm_table[FIRM_ID_VARIABLE].to_numpy() + ), ) self._isa_income_contracts = { year: copy.deepcopy(dataset[year].isa_income_contract) @@ -1583,6 +1893,14 @@ def build_from_multi_year_dataset(self, dataset: UKMultiYearDataset) -> None: if variable not in self.tax_benefit_system.variables: continue self.set_input(variable, year, table[variable]) + firm_table = _firm_table_in_population_order( + dataset[year].firm, self.populations["firm"].ids + ) + if firm_table is not None: + for variable in firm_table.columns: + if variable not in self.tax_benefit_system.variables: + continue + self.set_input(variable, year, firm_table[variable].to_numpy()) # Retain the dataset actually loaded, including the copied base amounts # and price declaration when economic assumptions were disabled. @@ -1628,6 +1946,7 @@ def build_from_ids( person_household_id: np.ndarray, benunit_id: np.ndarray, household_id: np.ndarray, + firm_id: Optional[np.ndarray] = None, ) -> None: """Build simulation entities from ID arrays. @@ -1637,6 +1956,8 @@ def build_from_ids( person_household_id: Array mapping persons to households benunit_id: Array of benefit unit IDs household_id: Array of household IDs + firm_id: Optional array of firm IDs. Firms have no members and + keep the order given. Without it the simulation has no firms. Warns: EntityIdWarning: If an ID is not a whole number, or is outside the @@ -1663,6 +1984,10 @@ def build_from_ids( ), ): check_entity_ids(self.tax_benefit_system.variables[variable_name], ids) + if firm_id is not None: + check_entity_ids( + self.tax_benefit_system.variables[FIRM_ID_VARIABLE], firm_id + ) builder = SimulationBuilder() builder.populations = self.tax_benefit_system.instantiate_entities() @@ -1671,6 +1996,8 @@ def build_from_ids( builder.declare_person_entity("person", person_id) builder.declare_entity("benunit", np.unique(benunit_id)) builder.declare_entity("household", np.unique(household_id)) + if firm_id is not None: + builder.declare_entity("firm", np.asarray(firm_id)) # Link persons to benefit units and households builder.join_with_persons( @@ -1746,6 +2073,11 @@ def subsample( Returns: This simulation, subsampled. """ + if self.populations["firm"].count > 0: + raise NotImplementedError( + "Cannot subsample a simulation with firms: the subsample draws " + "households, and firms are not members of households." + ) return subsample_simulation( self, n=n, @@ -1783,7 +2115,8 @@ def move_values(self, variable_donor: str, variable_target: str) -> None: holder.delete_arrays(known_period) def calculate_all(self, year: int) -> None: - person, benunit, household = ( + person, benunit, household, firm = ( + pd.DataFrame(), pd.DataFrame(), pd.DataFrame(), pd.DataFrame(), @@ -1798,15 +2131,20 @@ def calculate_all(self, year: int) -> None: benunit[variable.name] = result elif entity == "household": household[variable.name] = result + elif entity == "firm": + firm[variable.name] = result person = MicroDataFrame(person, weights="person_weight") benunit = MicroDataFrame(benunit, weights="benunit_weight") household = MicroDataFrame(household, weights="household_weight") + has_firms = self.populations["firm"].count > 0 + firm = MicroDataFrame(firm, weights="firm_weight") if has_firms else None return UKSingleYearDataset( person=person, benunit=benunit, household=household, + firm=firm, fiscal_year=year, savings_income_projection=getattr(self, "_savings_income_projection", None), ) diff --git a/policyengine_uk/tax_benefit_system.py b/policyengine_uk/tax_benefit_system.py index 2233830e36..4f9aa80892 100644 --- a/policyengine_uk/tax_benefit_system.py +++ b/policyengine_uk/tax_benefit_system.py @@ -14,11 +14,14 @@ from policyengine_core.parameters.operations.uprate_parameters import ( uprate_parameters, ) +from policyengine_core.populations import Population +from policyengine_core.simulations import Simulation as CoreSimulation +from policyengine_core.simulations.simulation import _branch_clone from policyengine_core.taxbenefitsystems import TaxBenefitSystem from policyengine_core.variables import Variable # PolicyEngine UK imports -from policyengine_uk.entities import BenUnit, Household, Person +from policyengine_uk.entities import BenUnit, Firm, Household, Person from policyengine_uk.data.capital_gains_projection import ( CapitalGainsProjection, add_capital_gains_projection, @@ -277,11 +280,119 @@ def process_parameter_tree( return parameters, projected +def _root_entities(system: TaxBenefitSystem) -> list: + """The entities of ``system`` whose populations stand on their own, with + no members: those that are neither its person entity nor a group entity + (the firm; see ``policyengine_uk.entities``).""" + own = {system.person_entity.key, *system.group_entity_keys} + return [entity for entity in system.entities if entity.key not in own] + + +class RootPopulation(Population): + """The population of a root entity (the firm's): records of their own, + with no members. + + Core treats any non-group population as people, so ``firm.household`` + would otherwise project household values onto the people, not the firms, + and return an array of the wrong length. A root population refuses those + shortcuts. Its clones (for branches, copies and reforms) are root + populations too.""" + + def __getattr__(self, attribute: str): + simulation = self.__dict__.get("simulation") + populations = getattr(simulation, "populations", None) or {} + if attribute in populations: + entity = self.__dict__.get("entity") + key = entity.key if entity is not None else "root" + raise AttributeError( + f"A {key} has no members, so {key} formulas cannot read " + f"{attribute} values through {key}.{attribute}." + ) + return super().__getattr__(attribute) + + def clone(self, simulation, share_arrays: bool = False) -> "RootPopulation": + sharing = {"share_arrays": True} if share_arrays else {} + result = super().clone(simulation, **sharing) + result.__class__ = RootPopulation + return result + + +def _instantiate_entities_with_root_populations(self) -> dict: + """Core's populations (people and their groups) and an empty population + of each root entity. A root population has no records until a + situation, dataset or ``Simulation.build_from_ids`` gives it some. + + This replaces ``TaxBenefitSystem.instantiate_entities`` rather than + overriding it in ``CountryTaxBenefitSystem``: a core ``Reform`` (as the + YAML test runner builds for a test's reforms and parameter changes) is a + ``TaxBenefitSystem`` built from this system's entities, not a + ``CountryTaxBenefitSystem``, and its simulations need the firm + population too. For a system with no root entities it returns what core + returns.""" + populations = _core_instantiate_entities(self) + for entity in _root_entities(self): + populations.setdefault(entity.key, RootPopulation(entity)) + return populations + + +_core_instantiate_entities = getattr( + TaxBenefitSystem.instantiate_entities, + "_core_instantiate_entities", + TaxBenefitSystem.instantiate_entities, +) +_instantiate_entities_with_root_populations._core_instantiate_entities = ( + _core_instantiate_entities +) +TaxBenefitSystem.instantiate_entities = _instantiate_entities_with_root_populations + + +def _clone_with_root_populations(self, *args, **kwargs): + """Core's ``Simulation.clone``, keeping the root (firm) populations. + + Core copies only the person and group populations. A core simulation + over this system (as the YAML test runner builds, and as formulas that + branch or clone it, such as the marginal tax rates, work on) would lose + the firm population, and clearing or reading any firm variable on the + copy would raise. The UK ``Simulation`` overrides ``clone`` and binds + its own copy over the one made here. For a simulation with no root + populations it returns what core returns.""" + roots = [ + key + for key in getattr(self, "populations", {}) + if isinstance(self.populations[key], RootPopulation) + ] + request = _branch_clone.get() + share_arrays = ( + request is not None and request.pending and request.simulation is self + ) + new = _core_simulation_clone(self, *args, **kwargs) + sharing = {"share_arrays": True} if share_arrays else {} + for key in roots: + if key in new.populations: + continue + population = self.populations[key].clone(new, **sharing) + entity = next( + (e for e in new.tax_benefit_system.entities if e.key == key), None + ) + if entity is not None: + population.entity = entity + new.populations[key] = population + setattr(new, key, population) + return new + + +_core_simulation_clone = getattr( + CoreSimulation.clone, "_core_simulation_clone", CoreSimulation.clone +) +_clone_with_root_populations._core_simulation_clone = _core_simulation_clone +CoreSimulation.clone = _clone_with_root_populations + + class CountryTaxBenefitSystem(TaxBenefitSystem): """UK-specific tax and benefit system implementation. This class defines the UK tax-benefit system with all relevant - variables, parameters, and entities (Person, BenUnit, Household). + variables, parameters, and entities (Person, BenUnit, Household, Firm). """ basic_inputs: List[str] = [ @@ -564,7 +675,10 @@ def _apply_legacy_overrides(self) -> None: def __init__(self, capital_gains_projection: CapitalGainsProjection | None = None): """Initialize the UK tax-benefit system with entities and parameters.""" - super().__init__(entities=[Person, BenUnit, Household]) + # Person first: core takes the first ``is_person`` entity as the + # person entity. Firm is a root entity (see ``entities.py``) and must + # come after it, so it is neither the person entity nor a group one. + super().__init__(entities=[Person, BenUnit, Household, Firm]) self.capital_gains_projection = capital_gains_projection # Load all variables from the variables directory diff --git a/policyengine_uk/tests/policy/baseline/firm/firm_inputs.yaml b/policyengine_uk/tests/policy/baseline/firm/firm_inputs.yaml new file mode 100644 index 0000000000..3fb1fe8bc9 --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/firm/firm_inputs.yaml @@ -0,0 +1,28 @@ +# Firm YAML tests give firm variables directly, with no `firms:` block: core's +# YAML builder ignores a `firms:` block and leaves the simulation with no +# firms. With variable-only input every population, the firm's included, has +# one record per array element. +- name: Case 1, one firm's inputs are read back. + period: 2025 + input: + firm_paybill: 500_000 + firm_employees: 20 + firm_is_bank: true + output: + firm_paybill: 500_000 + firm_employees: 20 + firm_is_bank: true + firm_weight: 1 + firm_legal_form: COMPANY + +- name: Case 2, several firms given as arrays, one value per firm. + period: 2025 + input: + firm_paybill: [100_000, 2_000_000, 0] + firm_legal_form: [COMPANY, SOLE_TRADER, PARTNERSHIP] + firm_in_freeport: [false, true, false] + output: + firm_paybill: [100_000, 2_000_000, 0] + firm_legal_form: [COMPANY, SOLE_TRADER, PARTNERSHIP] + firm_in_freeport: [false, true, false] + firm_n_associated_companies: [0, 0, 0] diff --git a/policyengine_uk/tests/policy/baseline/gov/dwp/auto_enrolment/firm_auto_enrolment_employer_contribution.yaml b/policyengine_uk/tests/policy/baseline/gov/dwp/auto_enrolment/firm_auto_enrolment_employer_contribution.yaml new file mode 100644 index 0000000000..27bc504341 --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/dwp/auto_enrolment/firm_auto_enrolment_employer_contribution.yaml @@ -0,0 +1,101 @@ +# 2025-26 band 6,240 to 50,270 (width 44,030); employer minimum 3%. +- name: Case 1, average-pay qualifying earnings and the 3% employer minimum. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_paybill: [300_000, 40_000, 0, 1_000_000] + firm_employees: [10, 10, 0, 10] + output: + # Average pay 30,000: (30,000 - 6,240) x 10 = 237,600. + # Average 4,000 is below the lower limit: 0. No employees: 0. + # Average 100,000 is capped at the band width: 44,030 x 10 = 440,300. + firm_auto_enrolment_qualifying_earnings: [237_600, 0, 0, 440_300] + # 3% of each. + firm_auto_enrolment_employer_contribution: [7_128, 0, 0, 13_209] + +- name: Case 2, 2019-20 band of 6,136 to 50,000. + period: 2019 + absolute_error_margin: 0.01 + input: + firm_paybill: [300_000] + firm_employees: [10] + output: + # (30,000 - 6,136) x 10 = 238,640; x 3% = 7,159.2. + firm_auto_enrolment_qualifying_earnings: [238_640] + firm_auto_enrolment_employer_contribution: [7_159.2] + +- name: Case 3, supplied qualifying earnings override the default. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_paybill: [300_000] + firm_employees: [10] + firm_auto_enrolment_qualifying_earnings: [100_000] + output: + firm_auto_enrolment_employer_contribution: [3_000] + +- name: Case 4, transitional employer minimums of 1% and 2%. + period: 2017 + absolute_error_margin: 0.01 + input: + firm_auto_enrolment_qualifying_earnings: [100_000] + output: + # 2017-18 is in the first transitional period: 1%. + firm_auto_enrolment_employer_contribution: [1_000] + +- name: Case 5, second transitional period. + period: 2018 + absolute_error_margin: 0.01 + input: + firm_auto_enrolment_qualifying_earnings: [100_000] + output: + # 2018-19: 2%. + firm_auto_enrolment_employer_contribution: [2_000] + +# 2025-26: trigger 10,000; band 6,240 to 50,270 (width 44,030); 3%. +- name: Case 6, staff below the earnings trigger and above the upper limit leave the average. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_paybill: [300_000, 300_000, 100_000, 300_000] + firm_employees: [10, 10, 10, 3] + firm_employees_below_auto_enrolment_earnings_trigger: [2, 0, 4, 0] + firm_paybill_below_auto_enrolment_earnings_trigger: [16_000, 0, 20_000, 0] + firm_employees_above_auto_enrolment_upper_limit: [1, 0, 0, 3] + firm_paybill_above_auto_enrolment_upper_limit: [100_000, 0, 0, 300_000] + output: + # Firm 1: 2 staff paid 8,000 are not enrolled; 1 paid 100,000 gives the + # band width 44,030. The other 7 share 300,000 - 16,000 - 100,000 = + # 184,000: 184,000 - 7 x 6,240 = 140,320. Total 140,320 + 44,030 = 184,350. + # Firm 2: no split supplied, the plain average: (30,000 - 6,240) x 10 = 237,600. + # Firm 3: 4 staff paid 5,000 are not enrolled. The other 6 share 80,000: + # 80,000 - 6 x 6,240 = 42,560 (the plain average gives 37,600). + # Firm 4: all 3 above the upper limit: 3 x 44,030 = 132,090. + firm_auto_enrolment_qualifying_earnings: [184_350, 237_600, 42_560, 132_090] + # 3% of each. + firm_auto_enrolment_employer_contribution: [5_530.5, 7_128, 1_276.8, 3_962.7] + +# 2025-26: band 6,240 to 50,270 (width 44,030). +- name: Case 7, inconsistent pay-distribution inputs are clipped. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_paybill: [300_000, 300_000, 300_000, 300_000] + firm_employees: [10, 10, 10, 10] + firm_employees_below_auto_enrolment_earnings_trigger: [12, -2, 0, 2] + firm_paybill_below_auto_enrolment_earnings_trigger: [400_000, -16_000, 0, 16_000] + firm_employees_above_auto_enrolment_upper_limit: [5, -1, 2, 10] + firm_paybill_above_auto_enrolment_upper_limit: [50_000, -100_000, 60_000, 290_000] + output: + # Firm 1: below-trigger headcount 12 capped at 10 and paybill 400,000 at + # 300,000; above-upper headcount capped at 10 - 10 = 0 and paybill at + # 300,000 - 300,000 = 0. Nobody is left: 0. + # Firm 2: negative inputs floored at 0, the plain average: + # (30,000 - 6,240) x 10 = 237,600. + # Firm 3: 2 above the upper limit with 60,000 < 2 x 50,270 = 100,540 is + # inconsistent, so they rejoin the rest: (30,000 - 6,240) x 10 = 237,600. + # Firm 4: 2 below the trigger with 16,000. Above-upper headcount capped at + # 10 - 2 = 8 and paybill at 300,000 - 16,000 = 284,000 < 8 x 50,270 = + # 402,160, so the 8 rejoin the rest: 8 share 284,000, average 35,500; + # (35,500 - 6,240) x 8 = 234,080. + firm_auto_enrolment_qualifying_earnings: [0, 237_600, 237_600, 234_080] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/apprenticeship_levy/apprenticeship_levy.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/apprenticeship_levy/apprenticeship_levy.yaml new file mode 100644 index 0000000000..4fa38b0b3b --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/apprenticeship_levy/apprenticeship_levy.yaml @@ -0,0 +1,53 @@ +- name: Case 1, apprenticeship levy around the £3m break-even pay bill. + period: 2025 + input: + firm_paybill: [3_000_000, 2_000_000, 5_000_000, 5_000_000] + firm_apprenticeship_levy_allowance_share: [1, 1, 1, 0.5] + output: + # 0.5% x 3m = 15,000 - 15,000 = 0; 10,000 - 15,000 floored at 0; + # 25,000 - 15,000 = 10,000; 25,000 - 7,500 (half share) = 17,500. + apprenticeship_levy: [0, 0, 10_000, 17_500] + +- name: Case 2, no levy before 2017-18. + period: 2016 + input: + firm_paybill: [5_000_000] + output: + apprenticeship_levy: [0] + +- name: Case 3, levy in its first year. + period: 2017 + input: + firm_paybill: [4_000_000] + output: + # 20,000 - 15,000. + apprenticeship_levy: [5_000] + +# FA 2016 s.99: levy = 0.5% x pay bill - levy allowance (15,000), and nil where +# that is negative. The charge starts at a pay bill of 15,000 / 0.005 = +# 3,000,000. Margin 0.001 so that a 0.005 levy is distinguishable from 0. +- name: Case 4, pay bill at and £1 above the break-even point and the allowance. + period: 2025 + absolute_error_margin: 0.001 + input: + firm_paybill: [3_000_000, 3_000_001, 15_000, 15_001] + output: + # 0.005 x 3,000,000 = 15,000 - 15,000 = 0. + # 0.005 x 3,000,001 = 15,000.005 - 15,000 = 0.005. + # Pay bill equal to the allowance: 0.005 x 15,000 = 75 - 15,000 < 0 -> 0. + # 0.005 x 15,001 = 75.005 - 15,000 < 0 -> 0. + apprenticeship_levy: [0, 0.005, 0, 0] + +- name: Case 5, connected companies share one allowance (s.101). + period: 2025 + absolute_error_margin: 0.001 + input: + firm_paybill: [1_500_000, 1_500_001, 1_000_000, 3_000_000, 1_000_000] + firm_apprenticeship_levy_allowance_share: [0.5, 0.5, 0.25, 0.75, 0] + output: + # Half share 7,500: 0.005 x 1,500,000 = 7,500 - 7,500 = 0; + # 0.005 x 1,500,001 = 7,500.005 - 7,500 = 0.005. + # Unit split 25/75: 5,000 - 3,750 = 1,250 and 15,000 - 11,250 = 3,750; + # total 5,000 = 0.005 x 4,000,000 - 15,000, as for one employer. + # Member allocated no allowance: 0.005 x 1,000,000 = 5,000. + apprenticeship_levy: [0, 0.005, 1_250, 3_750, 5_000] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/apprenticeship_levy/apprenticeship_levy_devolved.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/apprenticeship_levy/apprenticeship_levy_devolved.yaml new file mode 100644 index 0000000000..00c636c9e6 --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/apprenticeship_levy/apprenticeship_levy_devolved.yaml @@ -0,0 +1,22 @@ +# The apprenticeship levy (FA 2016 Part 6) is UK-wide: it applies the same way +# whatever the firm's region. 2025-26: 0.5% of the pay bill less a 15,000 +# allowance, floored at zero. +- name: Case 1, the levy is the same in each nation. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_paybill: [5_000_000, 5_000_000, 5_000_000, 5_000_000] + firm_region: [LONDON, SCOTLAND, WALES, NORTHERN_IRELAND] + output: + # 0.005 x 5,000,000 = 25,000 - 15,000 = 10,000 for every firm. + apprenticeship_levy: [10_000, 10_000, 10_000, 10_000] + +- name: Case 2, a devolved firm below the break-even pay bill pays nothing. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_paybill: [2_000_000, 2_000_000, 2_000_000] + firm_region: [SCOTLAND, WALES, NORTHERN_IRELAND] + output: + # 0.005 x 2,000,000 = 10,000 - 15,000 < 0 -> 0. + apprenticeship_levy: [0, 0, 0] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/bank_surcharge/bank_surcharge.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/bank_surcharge/bank_surcharge.yaml new file mode 100644 index 0000000000..8afe4441a4 --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/bank_surcharge/bank_surcharge.yaml @@ -0,0 +1,110 @@ +# The rate is day-weighted over each 6 April to 5 April year, so the 6% rate +# from 1 January 2027 enters the 2026 label for 95 of 365 days, and the +# return to 3% on 1 April 2028 enters the 2027 label for 5 of 366 days. +- name: Case 1, bank surcharge in 2026-27. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, COMPANY, COMPANY] + firm_is_bank: [true, true, false] + firm_taxable_trading_profit: [150_000_000, 80_000_000, 150_000_000] + firm_capital_allowances: [0, 0, 0] + firm_rd_additional_deduction: [0, 0, 0] + firm_rd_expenditure_credit: [0, 0, 0] + output: + # Rate: 6 April 2026 to 31 December 2026 is 270 days at 3%; 1 January + # 2027 to 5 April 2027 is 95 days at 6%. (270 x 0.03 + 95 x 0.06) / 365 + # = 13.8 / 365 = 0.0378082. Times (150m - 100m) = 1,890,410.96. Below the + # allowance and non-banks pay none. + bank_surcharge: [1_890_410.96, 0, 0] + corporation_tax: [37_500_000, 20_000_000, 37_500_000] + +- name: Case 2, mostly the 6% temporary rate in 2027-28. + period: 2027 + absolute_error_margin: 0.01 + input: + firm_legal_form: COMPANY + firm_is_bank: true + firm_taxable_trading_profit: 150_000_000 + firm_capital_allowances: 0 + firm_rd_additional_deduction: 0 + firm_rd_expenditure_credit: 0 + output: + # Rate: 6 April 2027 to 31 March 2028 is 361 days at 6%; 1 April 2028 + # to 5 April 2028 is 5 days at 3%. (361 x 0.06 + 5 x 0.03) / 366 + # = 21.81 / 366 = 0.0595902. Times 50m = 2,979,508.20. + bank_surcharge: 2_979_508.20 + +- name: Case 3, back to 3% in 2028-29. + period: 2028 + absolute_error_margin: 0.01 + input: + firm_legal_form: COMPANY + firm_is_bank: true + firm_taxable_trading_profit: 150_000_000 + firm_capital_allowances: 0 + firm_rd_additional_deduction: 0 + firm_rd_expenditure_credit: 0 + output: + bank_surcharge: 1_500_000 + +- name: Case 4, 8% above 25m in 2022-23. + period: 2022 + # Values are float32: near 10m one step is 1, so allow it. + absolute_error_margin: 1 + input: + firm_legal_form: COMPANY + firm_is_bank: true + firm_taxable_trading_profit: 150_000_000 + firm_capital_allowances: 0 + firm_rd_additional_deduction: 0 + firm_rd_expenditure_credit: 0 + output: + # Rate: 6 April 2022 to 31 March 2023 is 360 days at 8%; 1 April 2023 + # to 5 April 2023 is 5 days at 3%. (360 x 0.08 + 5 x 0.03) / 365 + # = 28.95 / 365 = 0.0793151. The allowance is not blended and reads + # 25m. Times (150m - 25m) = 9,914,383.56. + bank_surcharge: 9_914_383.56 + +- name: Case 5, partnerships pay no bank surcharge. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_legal_form: PARTNERSHIP + firm_is_bank: true + firm_taxable_trading_profit: 150_000_000 + firm_capital_allowances: 0 + firm_rd_additional_deduction: 0 + firm_rd_expenditure_credit: 0 + output: + bank_surcharge: 0 + +- name: Case 6, the R&D expenditure credit is left out of surcharge profits. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_legal_form: COMPANY + firm_is_bank: true + firm_taxable_trading_profit: 200_000_000 + firm_qualifying_rd_expenditure: 50_000_000 + firm_total_relevant_expenditure: 1_000_000_000 + output: + # RDEC 20% x 50m = 10m, a taxable receipt: taxable total profits 210m. + # Surcharge profits deduct it (s. 269DA(2)): 210m - 10m = 200m. + # 3% x (200m - 100m) = 3.0m. + firm_rd_expenditure_credit: 10_000_000 + firm_taxable_profit: 210_000_000 + bank_surcharge: 3_000_000 + +- name: Case 7, a bank in a group with half the surcharge allowance. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, COMPANY] + firm_is_bank: [true, true] + firm_taxable_trading_profit: [150_000_000, 150_000_000] + firm_bank_surcharge_allowance_share: [0.5, 1] + output: + # Group share: allowance 0.5 x 100m = 50m; 3% x (150m - 50m) = 3.0m. + # Whole allowance: 3% x (150m - 100m) = 1.5m. + bank_surcharge: [3_000_000, 1_500_000] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/business_rates/firm/firm_business_rates.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/business_rates/firm/firm_business_rates.yaml new file mode 100644 index 0000000000..2b4810fe74 --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/business_rates/firm/firm_business_rates.yaml @@ -0,0 +1,239 @@ +# Margins of 0.1 allow for float32 storage of six-figure amounts. +- name: 2026-27 small business rate relief, taper and multiplier switch + period: 2026 + absolute_error_margin: 0.1 + input: + firm_rateable_value: [10_000, 13_500, 14_000, 15_000, 50_999, 51_000, 500_000] + output: + # Gross = RV x multiplier (43.2p below £51,000, 48.0p to £499,999, 50.8p above). + # 10,000 x 0.432 = 4,320, SBRR 100% -> 0. + # 13,500 x 0.432 = 5,832, SBRR (15,000 - 13,500) / 3,000 = 50% -> 2,916. + # 14,000 x 0.432 = 6,048, SBRR 1/3 -> 4,032. + # 15,000 x 0.432 = 6,480, SBRR 0%. + # 50,999 x 0.432 = 22,031.568. + # 51,000 x 0.480 = 24,480. + # 500,000 x 0.508 = 254,000. + firm_gross_business_rates: [4_320, 5_832, 6_048, 6_480, 22_031.568, 24_480, 254_000] + firm_small_business_rate_relief: [4_320, 2_916, 2_016, 0, 0, 0, 0] + firm_business_rates: [0, 2_916, 4_032, 6_480, 22_031.568, 24_480, 254_000] + +- name: 2026-27 RHL against non-RHL property + period: 2026 + absolute_error_margin: 0.1 + input: + firm_rateable_value: [100_000, 100_000, 13_500] + firm_is_rhl_property: [false, true, true] + output: + # 100,000 x 0.480 = 48,000; 100,000 x 0.430 = 43,000. + # 13,500 x 0.382 = 5,157, SBRR 50% (RHL thresholds still £12k/£15k) -> 2,578.5. + firm_business_rates: [48_000, 43_000, 2_578.5] + +- name: 2027-28 RHL small business rate relief thresholds of £18,000 and £21,000 + period: 2027 + absolute_error_margin: 0.1 + input: + firm_rateable_value: [18_000, 19_500, 21_000, 19_500] + firm_is_rhl_property: [true, true, true, false] + output: + # RHL: 18,000 x 0.395 = 7,110, 100% relief -> 0. + # 19,500 x 0.395 = 7,702.5, relief (21,000 - 19,500) / 3,000 = 50% -> 3,851.25. + # 21,000 x 0.395 = 8,295, relief 0%. + # Non-RHL keeps £12k/£15k: 19,500 x 0.447 = 8,716.5, no relief. + firm_business_rates: [0, 3_851.25, 8_295, 8_716.5] + +- name: Small business rate relief only with one property + period: 2026 + absolute_error_margin: 0.1 + input: + firm_rateable_value: [10_000, 10_000] + firm_n_properties: [1, 2] + output: + # 10,000 x 0.432 = 4,320. + firm_business_rates: [0, 4_320] + +- name: 2025-26 RHL relief at 40%, cap of £110,000, after SBRR + period: 2025 + absolute_error_margin: 0.1 + input: + firm_rateable_value: [100_000, 1_000_000, 13_500, 100_000] + firm_is_rhl_property: [true, true, true, false] + output: + # 100,000 x 0.555 = 55,500, RHL relief 40% = 22,200 -> 33,300. + # 1,000,000 x 0.555 = 555,000, 40% = 222,000 capped at 110,000 -> 445,000. + # 13,500 x 0.499 = 6,736.5, SBRR 50% = 3,368.25, RHL 40% of the remaining + # 3,368.25 = 1,347.30 -> 2,020.95. + # Non-RHL: 55,500. + firm_retail_hospitality_leisure_rate_relief: [22_200, 110_000, 1_347.3, 0] + firm_business_rates: [33_300, 445_000, 2_020.95, 55_500] + +- name: 2024-25 RHL relief at 75% + period: 2024 + absolute_error_margin: 0.1 + input: + firm_rateable_value: [100_000] + firm_is_rhl_property: [true] + output: + # 100,000 x 0.546 = 54,600, relief 75% = 40,950 -> 13,650. + firm_business_rates: [13_650] + +- name: RHL relief ended on 31 March 2026 + period: 2026 + absolute_error_margin: 0.1 + input: + firm_rateable_value: [100_000] + firm_is_rhl_property: [true] + output: + firm_retail_hospitality_leisure_rate_relief: [0] + +- name: Mandatory charitable relief of 80%, instead of SBRR, before RHL relief + period: 2026 + absolute_error_margin: 0.1 + input: + firm_rateable_value: [100_000, 10_000] + firm_is_charity: [true, true] + output: + # 100,000 x 0.480 = 48,000, relief 38,400 -> 9,600. + # 10,000 x 0.432 = 4,320, charity relief 3,456 and no SBRR -> 864. + firm_charitable_rate_relief: [38_400, 3_456] + firm_small_business_rate_relief: [0, 0] + firm_business_rates: [9_600, 864] + +- name: Charity with RHL relief in 2025-26 (guidance Example 3 order) + period: 2025 + absolute_error_margin: 0.1 + input: + firm_rateable_value: [100_000] + firm_is_charity: [true] + firm_is_rhl_property: [true] + output: + # 55,500 - 80% (44,400) = 11,100; RHL relief 40% = 4,440 -> 6,660. + firm_business_rates: [6_660] + +- name: Empty property, 3 months exempt (6 for industrial), then full rates + period: 2026 + absolute_error_margin: 0.1 + input: + firm_rateable_value: [100_000, 100_000, 100_000, 100_000, 10_000] + firm_property_occupied: [false, false, false, false, false] + firm_is_industrial_property: [false, true, false, false, false] + firm_months_empty: [0, 0, 3, 2, 0] + output: + # Gross 100,000 x 0.480 = 48,000. + # 3 of 12 months exempt: 12,000 -> 36,000. + # Industrial, 6 of 12 months exempt: 24,000 -> 24,000. + # Already empty 3 months: no exemption left -> 48,000. + # Already empty 2 months: 1 month left, 4,000 -> 44,000. + # 10,000 x 0.432 = 4,320, no SBRR when empty, 3 months exempt 1,080 -> 3,240. + firm_empty_property_rates_exemption: [12_000, 24_000, 0, 4_000, 1_080] + firm_business_rates: [36_000, 24_000, 48_000, 44_000, 3_240] + +- name: Pubs and live music venues relief, 15% in 2026-27 + period: 2026 + absolute_error_margin: 0.1 + input: + firm_rateable_value: [40_000] + firm_is_rhl_property: [true] + firm_is_pub_or_live_music_venue: [true] + output: + # 40,000 x 0.382 = 15,280, relief 15% = 2,292 -> 12,988. + firm_business_rates: [12_988] + +- name: Pubs and live music venues relief, 35% in 2027-28 and 15% for a live music venue at £1m or more + period: 2027 + absolute_error_margin: 0.1 + input: + firm_rateable_value: [40_000, 1_000_000] + firm_is_rhl_property: [true, true] + firm_is_pub_or_live_music_venue: [true, true] + firm_is_live_music_venue: [false, true] + output: + # 40,000 x 0.395 = 15,800, pub relief 35% = 5,530 -> 10,270. + # 1,000,000 x 0.525 = 525,000, live music venue at £1m or more: 15% = 78,750 -> 446,250. + firm_pubs_and_live_music_venues_rate_relief: [5_530, 78_750] + firm_business_rates: [10_270, 446_250] + +- name: No pubs relief after 31 March 2029 + period: 2029 + absolute_error_margin: 0.1 + input: + firm_rateable_value: [40_000] + firm_is_rhl_property: [true] + firm_is_pub_or_live_music_venue: [true] + output: + # 40,000 x 0.395 = 15,800 (2027-28 multiplier carried forward). + firm_business_rates: [15_800] + +- name: Property outside England is not modelled + period: 2026 + input: + firm_rateable_value: [100_000] + firm_in_england: [false] + output: + firm_gross_business_rates: [0] + firm_business_rates: [0] + +- name: 2023-24 multiplier switch at £51,000, and no English rates in Northern Ireland + period: 2023 + absolute_error_margin: 0.01 + input: + firm_region: [NORTHERN_IRELAND, LONDON, LONDON] + firm_rateable_value: [100_000, 50_999, 51_000] + output: + # Northern Ireland is outside England: 0. + # 50,999 x 0.499 = 25,448.501 (above 15,000, so no SBRR). + # 51,000 x 0.512 = 26,112. + firm_business_rates: [0, 25_448.501, 26_112] + +- name: RHL multipliers apply to occupied property only (2026-27) + period: 2026 + absolute_error_margin: 0.01 + input: + firm_rateable_value: [100_000, 100_000] + firm_is_rhl_property: [true, true] + firm_property_occupied: [true, false] + firm_months_empty: [0, 12] + output: + # Occupied RHL: 100,000 x 0.430 = 43,000. Unoccupied after the 3-month + # exemption: the national standard multiplier, 100,000 x 0.480 = 48,000. + firm_business_rates_multiplier: [0.430, 0.480] + firm_business_rates: [43_000, 48_000] + +- name: Before 2024-25 empty and charity property pay the standard multiplier + period: 2023 + absolute_error_margin: 0.01 + input: + firm_rateable_value: [40_000, 40_000, 40_000] + firm_is_charity: [false, true, false] + firm_property_occupied: [true, true, false] + firm_months_empty: [0, 0, 12] + output: + # Occupied, not a charity: small multiplier 0.499. + # Charity: standard 0.512; 40,000 x 0.512 = 20,480, one fifth = 4,096. + # Empty after the exemption: 40,000 x 0.512 = 20,480. + firm_business_rates_multiplier: [0.499, 0.512, 0.512] + firm_business_rates: [19_960, 4_096, 20_480] + +- name: From 2024-25 empty and charity property below £51,000 pay the small multiplier + period: 2024 + absolute_error_margin: 0.01 + input: + firm_rateable_value: [40_000, 40_000] + firm_is_charity: [true, false] + firm_property_occupied: [true, false] + firm_months_empty: [0, 12] + output: + # 40,000 x 0.499 = 19,960; charity pays one fifth, 3,992; empty pays all. + firm_business_rates_multiplier: [0.499, 0.499] + firm_business_rates: [3_992, 19_960] + +- name: Empty property below £2,900 is exempt while empty + period: 2025 + absolute_error_margin: 0.01 + input: + firm_rateable_value: [2_000, 2_899, 2_900] + firm_property_occupied: [false, false, false] + firm_months_empty: [12, 12, 12] + output: + # Below £2,900: exempt all year. At £2,900 (not "less than"): + # 2,900 x 0.499 = 1,447.10 with no exemption left after 12 months empty. + firm_business_rates: [0, 0, 1_447.1] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/business_rates/firm/firm_business_rates_multiplier.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/business_rates/firm/firm_business_rates_multiplier.yaml new file mode 100644 index 0000000000..4062cd0458 --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/business_rates/firm/firm_business_rates_multiplier.yaml @@ -0,0 +1,51 @@ +# Small business threshold: RV below £51,000. High-value: RV £500,000 or more. +- name: 2023-24 multipliers, small 49.9p below £51,000 and standard 51.2p from it + period: 2023 + absolute_error_margin: 0.0001 + input: + firm_rateable_value: [50_999, 51_000, 500_000] + output: + firm_business_rates_multiplier: [0.499, 0.512, 0.512] + +- name: 2024-25 multipliers, small 49.9p and standard 54.6p + period: 2024 + absolute_error_margin: 0.0001 + input: + firm_rateable_value: [50_999, 51_000, 500_000] + output: + firm_business_rates_multiplier: [0.499, 0.546, 0.546] + +- name: 2025-26 multipliers, small 49.9p and standard 55.5p, RHL pays the same + period: 2025 + absolute_error_margin: 0.0001 + input: + firm_rateable_value: [50_999, 51_000, 50_999, 51_000] + firm_is_rhl_property: [false, false, true, true] + output: + firm_business_rates_multiplier: [0.499, 0.555, 0.499, 0.555] + +- name: 2026-27 non-RHL multipliers switch at £51,000 and £500,000 + period: 2026 + absolute_error_margin: 0.0001 + input: + firm_rateable_value: [50_999, 51_000, 499_999, 500_000] + output: + firm_business_rates_multiplier: [0.432, 0.480, 0.480, 0.508] + +- name: 2026-27 RHL multipliers, with high-value 50.8p for all properties + period: 2026 + absolute_error_margin: 0.0001 + input: + firm_rateable_value: [50_999, 51_000, 499_999, 500_000] + firm_is_rhl_property: [true, true, true, true] + output: + firm_business_rates_multiplier: [0.382, 0.430, 0.430, 0.508] + +- name: 2027-28 multipliers from BRIL 8/2026 + period: 2027 + absolute_error_margin: 0.0001 + input: + firm_rateable_value: [50_999, 51_000, 500_000, 50_999, 51_000, 500_000] + firm_is_rhl_property: [false, false, false, true, true, true] + output: + firm_business_rates_multiplier: [0.447, 0.497, 0.525, 0.395, 0.445, 0.525] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/business_rates/firm/firm_business_rates_northern_ireland.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/business_rates/firm/firm_business_rates_northern_ireland.yaml new file mode 100644 index 0000000000..5f131f18c8 --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/business_rates/firm/firm_business_rates_northern_ireland.yaml @@ -0,0 +1,169 @@ +# Northern Ireland non-domestic rates: net annual value x (regional rate + +# district rate) (Rates (NI) Order 1977 Art 6). Belfast 2026-27: 0.3079 + +# 0.342388 = 0.650288. +- name: Without a district a Northern Ireland firm's rates stay at 0. + period: 2026 + absolute_error_margin: 0.1 + input: + firm_region: [NORTHERN_IRELAND] + firm_rateable_value: [30_000] + output: + firm_business_rates: [0] + +- name: Belfast 2026-27, above the small business bands. + period: 2026 + absolute_error_margin: 0.1 + input: + firm_region: [NORTHERN_IRELAND] + firm_northern_ireland_district: [BELFAST] + firm_rateable_value: [30_000] + output: + firm_business_rates_multiplier: [0.650288] + firm_business_rates: [19_508.64] + firm_only_tax: [19_508.64] + +- name: A district outside Northern Ireland is ignored. + period: 2026 + absolute_error_margin: 0.1 + input: + firm_region: [WALES] + firm_northern_ireland_district: [BELFAST] + firm_rateable_value: [30_000] + output: + # The Welsh standard multiplier, 0.502. + firm_business_rates: [15_060] + +- name: Derry City and Strabane 2023-24 (0.2790 + 0.354362). + period: 2023 + absolute_error_margin: 0.1 + input: + firm_region: [NORTHERN_IRELAND] + firm_northern_ireland_district: [DERRY_CITY_AND_STRABANE] + firm_rateable_value: [100_000] + output: + firm_business_rates: [63_336.2] + +- name: Derry City and Strabane 2024-25 (0.2902 + 0.377408). + period: 2024 + absolute_error_margin: 0.1 + input: + firm_region: [NORTHERN_IRELAND] + firm_northern_ireland_district: [DERRY_CITY_AND_STRABANE] + firm_rateable_value: [100_000] + output: + firm_business_rates: [66_760.8] + +- name: Derry City and Strabane 2025-26 (0.2989 + 0.395993). + period: 2025 + absolute_error_margin: 0.1 + input: + firm_region: [NORTHERN_IRELAND] + firm_northern_ireland_district: [DERRY_CITY_AND_STRABANE] + firm_rateable_value: [100_000] + output: + firm_business_rates: [69_489.3] + +- name: Derry City and Strabane 2026-27 (0.3079 + 0.413735). + period: 2026 + absolute_error_margin: 0.1 + input: + firm_region: [NORTHERN_IRELAND] + firm_northern_ireland_district: [DERRY_CITY_AND_STRABANE] + firm_rateable_value: [100_000] + output: + firm_business_rates: [72_163.5] + +- name: Before 2023-24 Northern Ireland rates are not modelled. + period: 2022 + absolute_error_margin: 0.1 + input: + firm_region: [NORTHERN_IRELAND] + firm_northern_ireland_district: [BELFAST] + firm_rateable_value: [30_000] + output: + firm_business_rates: [0] + +- name: Small business rate relief band edges, Belfast 2026-27. + period: 2026 + absolute_error_margin: 0.1 + input: + firm_region: [NORTHERN_IRELAND, NORTHERN_IRELAND, NORTHERN_IRELAND, NORTHERN_IRELAND, NORTHERN_IRELAND, NORTHERN_IRELAND] + firm_northern_ireland_district: [BELFAST, BELFAST, BELFAST, BELFAST, BELFAST, BELFAST] + firm_rateable_value: [2_000, 2_001, 5_000, 5_001, 15_000, 15_001] + output: + # 50% up to 2,000; 25% up to 5,000; 20% up to 15,000; none above. + firm_business_rates: [650.288, 975.92, 2_438.58, 2_601.67, 7_803.456, 9_754.97] + +- name: Small business rate relief in Fermanagh and Omagh 2026-27. + period: 2026 + absolute_error_margin: 0.1 + input: + firm_region: [NORTHERN_IRELAND] + firm_northern_ireland_district: [FERMANAGH_AND_OMAGH] + firm_rateable_value: [10_000] + output: + # 10,000 x (0.3079 + 0.270502) = 5,784.02, less 20%. + firm_business_rates: [4_627.216] + +- name: Small business rate relief, Belfast 2023-24 (0.2790 + 0.293221). + period: 2023 + absolute_error_margin: 0.1 + input: + firm_region: [NORTHERN_IRELAND] + firm_northern_ireland_district: [BELFAST] + firm_rateable_value: [4_000] + output: + # 4,000 x 0.572221 = 2,288.884, less 25%. + firm_business_rates: [1_716.663] + +- name: No small business rate relief above three properties or for industrial property. + period: 2026 + absolute_error_margin: 0.1 + input: + firm_region: [NORTHERN_IRELAND, NORTHERN_IRELAND, NORTHERN_IRELAND] + firm_northern_ireland_district: [BELFAST, BELFAST, BELFAST] + firm_rateable_value: [4_000, 4_000, 4_000] + firm_n_properties: [3, 4, 1] + firm_is_industrial_property: [false, false, true] + output: + # 4,000 x 0.650288 = 2,601.152; less 25% = 1,950.864. + firm_business_rates: [1_950.864, 2_601.152, 2_601.152] + +- name: Charity property in Northern Ireland is exempt. + period: 2026 + absolute_error_margin: 0.1 + input: + firm_region: [NORTHERN_IRELAND] + firm_northern_ireland_district: [BELFAST] + firm_rateable_value: [30_000] + firm_is_charity: [true] + output: + firm_business_rates: [0] + firm_charitable_rate_relief: [0] + +- name: Unoccupied property pays half after three months empty, Belfast 2026-27. + period: 2026 + absolute_error_margin: 0.1 + input: + firm_region: [NORTHERN_IRELAND, NORTHERN_IRELAND, NORTHERN_IRELAND, NORTHERN_IRELAND, NORTHERN_IRELAND] + firm_northern_ireland_district: [BELFAST, BELFAST, BELFAST, BELFAST, BELFAST] + firm_rateable_value: [30_000, 30_000, 1_999, 2_000, 30_000] + firm_property_occupied: [false, false, false, false, false] + firm_months_empty: [3, 0, 3, 3, 3] + firm_is_industrial_property: [false, false, false, false, true] + output: + # 19,508.64 x 50% = 9,754.32; empty from the start of the year, 9 of + # 12 months: 7,315.74; below 2,000 is exempt; 2,000 x 0.650288 x 50% = + # 650.288; industrial is exempt. + firm_business_rates: [9_754.32, 7_315.74, 0, 650.288, 0] + +- name: Small business rate relief lapses from 2027-28 under the law as it stands. + period: 2027 + absolute_error_margin: 0.1 + input: + firm_region: [NORTHERN_IRELAND] + firm_northern_ireland_district: [BELFAST] + firm_rateable_value: [2_000] + output: + # 2026-27 poundages carry forward: 2,000 x 0.650288. + firm_business_rates: [1_300.576] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/business_rates/firm/firm_business_rates_scotland.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/business_rates/firm/firm_business_rates_scotland.yaml new file mode 100644 index 0000000000..d39a187567 --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/business_rates/firm/firm_business_rates_scotland.yaml @@ -0,0 +1,128 @@ +# Scotland non-domestic rates. Basic property rate 0.498 (2023-24 to 2025-26), +# 0.481 (2026-27). Supplements above £51,000 up to £100,000 / above £100,000: +# 0.013 / 0.026 (2023-24), 0.047 / 0.061 (2024-25), 0.056 / 0.07 (2025-26), +# 0.054 / 0.067 (2026-27). SBBS single entry: 100% at RV £12,000 or less, +# 100 - 75 x (1 - (15,000 - RV) / 3,000) % to £15,000, +# 25 x (20,000 - RV) / 5,000 % to £20,000. Margin 0.01 for float32 storage. +- name: Scotland poundage bands, 2026-27 + period: 2026 + absolute_error_margin: 0.1 + input: + firm_region: [SCOTLAND, SCOTLAND, SCOTLAND, SCOTLAND, SCOTLAND] + firm_rateable_value: [51_000, 51_001, 100_000, 100_001, 1_000_000] + output: + # 51,000 x 0.481 = 24,531 (basic property rate). + # 51,001 x (0.481 + 0.054) = 51,001 x 0.535 = 27,285.535. + # 100,000 x 0.535 = 53,500. + # 100,001 x (0.481 + 0.067) = 100,001 x 0.548 = 54,800.548. + # 1,000,000 x 0.548 = 548,000. + firm_business_rates_multiplier: [0.481, 0.535, 0.535, 0.548, 0.548] + firm_business_rates: [24_531, 27_285.535, 53_500, 54_800.548, 548_000] + +- name: Scotland higher property rate, 2023-24 + period: 2023 + absolute_error_margin: 0.1 + input: + firm_region: [SCOTLAND, SCOTLAND] + firm_rateable_value: [80_000, 1_000_000] + output: + # 80,000 x (0.498 + 0.013) = 80,000 x 0.511 = 40,880. + # 1,000,000 x (0.498 + 0.026) = 524,000. + firm_business_rates: [40_880, 524_000] + +- name: Scotland higher property rate, 2024-25 + period: 2024 + absolute_error_margin: 0.1 + input: + firm_region: SCOTLAND + firm_rateable_value: 1_000_000 + output: + # 1,000,000 x (0.498 + 0.061) = 559,000. + firm_business_rates: 559_000 + +- name: Scotland higher property rate, 2025-26 + period: 2025 + absolute_error_margin: 0.1 + input: + firm_region: SCOTLAND + firm_rateable_value: 1_000_000 + output: + # 1,000,000 x (0.498 + 0.07) = 568,000. + firm_business_rates: 568_000 + +- name: Scotland SBBS at its boundaries, 2026-27 + period: 2026 + absolute_error_margin: 0.01 + input: + firm_region: [SCOTLAND, SCOTLAND, SCOTLAND, SCOTLAND, SCOTLAND, SCOTLAND, SCOTLAND, SCOTLAND] + firm_rateable_value: [12_000, 12_001, 13_500, 15_000, 15_001, 17_500, 19_999, 20_000] + output: + # Gross = RV x 0.481. + # 12,000 -> 5,772; 100% -> rates 0. + # 12,001 -> 5,772.481; 100 - 75 x (1 - 2,999 / 3,000) = 99.975% + # -> relief 5,771.037880, rates 1.443120. + # 13,500 -> 6,493.5; 100 - 75 x 0.5 = 62.5% -> relief 4,058.4375. + # 15,000 -> 7,215; 25% -> relief 1,803.75. + # 15,001 -> 7,215.481; 25 x 4,999 / 5,000 = 24.995% + # -> relief 1,803.509476. + # 17,500 -> 8,417.5; 12.5% -> relief 1,052.1875. + # 19,999 -> 9,619.519; 0.005% -> relief 0.480976. + # 20,000 -> 9,620; 0%. + firm_gross_business_rates: [5_772, 5_772.481, 6_493.5, 7_215, 7_215.481, 8_417.5, 9_619.519, 9_620] + firm_business_rates_reliefs: [5_772, 5_771.037880, 4_058.4375, 1_803.75, 1_803.509476, 1_052.1875, 0.480976, 0] + firm_business_rates: [0, 1.443120, 2_435.0625, 5_411.25, 5_411.971524, 7_365.3125, 9_619.038024, 9_620] + +- name: Scotland SBBS needs one occupied property + period: 2025 + absolute_error_margin: 0.01 + input: + firm_region: [SCOTLAND, SCOTLAND, SCOTLAND] + firm_rateable_value: [10_000, 10_000, 10_000] + firm_n_properties: [1, 2, 1] + firm_property_occupied: [true, true, false] + output: + # 10,000 x 0.498 = 4,980. One occupied property: 100% relief. + # Two properties (multi-entry SBBS not modelled) or unoccupied: none. + firm_business_rates_reliefs: [4_980, 0, 0] + firm_business_rates: [0, 4_980, 4_980] + +# Mandatory charitable relief in Scotland: the rate may not exceed one fifth +# (Local Government (Financial Provisions etc.) (Scotland) Act 1962 s.4(2)). +# SBBS is reduced by any s.4(2) reduction, but only down to nil (levying +# regulations reg 3(4), 2023 to 2026), so a charity gets the larger of the +# two reliefs. +- name: Scotland large charity gets 80% charitable relief + period: 2026 + absolute_error_margin: 0.1 + input: + firm_region: SCOTLAND + firm_rateable_value: 1_000_000 + firm_is_charity: true + output: + # 1,000,000 x (0.481 + 0.067) = 548,000; relief 548,000 x 0.8 = 438,400; + # rates 109,600. + firm_charitable_rate_relief: 438_400 + firm_business_rates_reliefs: 438_400 + firm_business_rates: 109_600 + +- name: Scotland small charity gets the larger of SBBS and charitable relief + period: 2026 + absolute_error_margin: 0.01 + input: + firm_region: [SCOTLAND, SCOTLAND, SCOTLAND, SCOTLAND] + firm_rateable_value: [10_000, 12_001, 13_500, 10_000] + firm_n_properties: [1, 1, 1, 2] + firm_is_charity: [true, true, true, true] + output: + # Gross = RV x 0.481. + # 10,000 -> 4,810. SBBS 100% (4,810) exceeds charity 3,848, so relief + # 4,810 and rates 0. + # 12,001 -> 5,772.481. SBBS 99.975% = 5,771.037880 exceeds charity + # 4,617.9848; rates 1.443120. + # 13,500 -> 6,493.5. SBBS 62.5% = 4,058.4375 is below charity + # 6,493.5 x 0.8 = 5,194.8; relief 5,194.8, rates 1,298.7. + # 10,000 on two properties: multi-entry SBBS is not modelled, so charity + # relief only, 3,848; rates 962. + firm_charitable_rate_relief: [3_848, 4_617.9848, 5_194.8, 3_848] + firm_business_rates_reliefs: [4_810, 5_771.037880, 5_194.8, 3_848] + firm_business_rates: [0, 1.443120, 1_298.7, 962] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/business_rates/firm/firm_business_rates_wales.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/business_rates/firm/firm_business_rates_wales.yaml new file mode 100644 index 0000000000..882b953f2a --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/business_rates/firm/firm_business_rates_wales.yaml @@ -0,0 +1,227 @@ +# Wales non-domestic rates. Multipliers: 0.535 (2023-24), 0.562 (2024-25), +# 0.568 (2025-26); 2026-27 standard 0.502, higher 0.515 above £100,000, +# retail 0.350 below £51,000. +# SBRR: 100% at RV £6,000 or less, tapering linearly to 0% at £12,000, on at +# most two properties. Margin 0.01 for float32 storage. +- name: Wales standard property, single multiplier 2023-24 to 2025-26 + period: 2025 + absolute_error_margin: 0.01 + input: + firm_region: [WALES, WALES, WALES] + firm_rateable_value: [30_000, 30_000, 30_000] + output: + # 30,000 x 0.568 = 17,040; above £12,000 so no SBRR. + firm_business_rates_multiplier: [0.568, 0.568, 0.568] + firm_business_rates: [17_040, 17_040, 17_040] + +- name: Wales multiplier in 2023-24 + period: 2023 + absolute_error_margin: 0.01 + input: + firm_region: WALES + firm_rateable_value: 30_000 + output: + # 30,000 x 0.535 = 16,050. + firm_business_rates: 16_050 + +- name: Wales multiplier in 2024-25 + period: 2024 + absolute_error_margin: 0.01 + input: + firm_region: WALES + firm_rateable_value: 30_000 + output: + # 30,000 x 0.562 = 16,860. + firm_business_rates: 16_860 + +- name: Wales SBRR at its boundaries, 2025-26 + period: 2025 + absolute_error_margin: 0.01 + input: + firm_region: [WALES, WALES, WALES, WALES, WALES, WALES] + firm_rateable_value: [6_000, 6_001, 9_000, 11_999, 12_000, 12_001] + output: + # 6,000 x 0.568 = 3,408; share clip((12,000 - 6,000) / 6,000) = 1 -> 0. + # 6,001 x 0.568 = 3,408.568; share 5,999 / 6,000 + # -> relief 3,407.999905, rates 0.568095. + # 9,000 x 0.568 = 5,112; share 0.5 -> relief 2,556. + # 11,999 x 0.568 = 6,815.432; share 1 / 6,000 -> relief 1.135905, + # rates 6,814.296095. + # 12,000 x 0.568 = 6,816 and 12,001 x 0.568 = 6,816.568; no relief. + firm_gross_business_rates: [3_408, 3_408.568, 5_112, 6_815.432, 6_816, 6_816.568] + firm_business_rates_reliefs: [3_408, 3_407.999905, 2_556, 1.135905, 0, 0] + firm_business_rates: [0, 0.568095, 2_556, 6_814.296095, 6_816, 6_816.568] + +- name: Wales SBRR property limit and occupation + period: 2025 + absolute_error_margin: 0.01 + input: + firm_region: [WALES, WALES, WALES] + firm_rateable_value: [9_000, 9_000, 9_000] + firm_n_properties: [2, 3, 1] + firm_property_occupied: [true, true, false] + output: + # Gross 9,000 x 0.568 = 5,112. Two properties: relief 50% = 2,556. + # Three properties: no SBRR. Unoccupied: no SBRR. + firm_business_rates_reliefs: [2_556, 0, 0] + +- name: Wales 2026-27 standard and higher multipliers + period: 2026 + absolute_error_margin: 0.1 + input: + firm_region: [WALES, WALES, WALES] + firm_rateable_value: [100_000, 100_001, 500_000] + output: + # 100,000 x 0.502 = 50,200 (not above £100,000). + # 100,001 x 0.515 = 51,500.515. + # 500,000 x 0.515 = 257,500. + firm_business_rates_multiplier: [0.502, 0.515, 0.515] + firm_business_rates: [50_200, 51_500.515, 257_500] + +- name: Wales firm gets no English SBRR or RHL multiplier + period: 2026 + absolute_error_margin: 0.01 + input: + firm_region: WALES + firm_rateable_value: 13_500 + firm_is_rhl_property: true + output: + # 13,500 x 0.502 = 6,777; above £12,000 so no Welsh SBRR, and the + # English SBRR and RHL relief do not apply. The English RHL flag does + # not give the Welsh retail multiplier. + firm_business_rates: 6_777 + +# Welsh retail multiplier from 2026-27 (WSI 2025/1163 reg 3; WSI 2026/39): +# 0.350 for shops, kiosks, pharmacies and post offices below £51,000. +- name: Wales 2026-27 retail multiplier at its £51,000 boundary + period: 2026 + absolute_error_margin: 0.01 + input: + firm_region: [WALES, WALES, WALES] + firm_rateable_value: [50_999, 51_000, 50_999] + firm_is_wales_retail_property: [true, true, false] + output: + # Shop below £51,000: 50,999 x 0.350 = 17,849.65. + # Shop at £51,000 (not "less than"): 51,000 x 0.502 = 25,602. + # Not a shop: 50,999 x 0.502 = 25,601.498. + firm_business_rates_multiplier: [0.350, 0.502, 0.502] + firm_business_rates: [17_849.65, 25_602, 25_601.498] + +- name: Wales 2026-27 small shop gets SBRR on the retail-multiplier bill + period: 2026 + absolute_error_margin: 0.01 + input: + firm_region: WALES + firm_rateable_value: 9_000 + firm_is_wales_retail_property: true + output: + # Gross 9,000 x 0.350 = 3,150. SBRR tapers 100% to 0% from £6,000 to + # £12,000: 50% = 1,575; rates 1,575. + firm_business_rates_reliefs: 1_575 + firm_business_rates: 1_575 + +- name: Wales retail flag has no effect before 2026-27 or outside Wales + period: 2025 + absolute_error_margin: 0.01 + input: + firm_region: [WALES, LONDON] + firm_rateable_value: [30_000, 30_000] + firm_is_wales_retail_property: [true, true] + output: + # Wales 2025-26 single multiplier 0.568; England 2025-26 small business + # multiplier 0.499. + firm_business_rates_multiplier: [0.568, 0.499] + +# Higher multiplier exclusions (WSI 2025/1163 reg 4): 19 public-service +# descriptions stay on the standard multiplier above £100,000. +- name: Wales 2026-27 excluded description stays on the standard multiplier + period: 2026 + absolute_error_margin: 0.01 + input: + firm_region: [WALES, WALES] + firm_rateable_value: [200_000, 200_000] + firm_is_wales_higher_multiplier_excluded: [true, false] + output: + # Hospital: 200,000 x 0.502 = 100,400; other: 200,000 x 0.515 = 103,000. + firm_business_rates_multiplier: [0.502, 0.515] + firm_business_rates: [100_400, 103_000] + +- name: Northern Ireland without a district is not modelled + period: 2026 + input: + firm_region: NORTHERN_IRELAND + firm_rateable_value: 30_000 + output: + firm_business_rates: 0 + +# Mandatory charitable relief in Wales: the ratepayer pays one fifth +# (LGFA 1988 Sch 4ZA para 2; s.43(5)-(6) before April 2024). Where charity +# relief and SBRR both apply, the charity calculation is used (Sch 4ZA +# para 9; s.43(8B) before April 2024), even where SBRR would give more. +- name: Wales large charity gets 80% charitable relief + period: 2025 + absolute_error_margin: 0.1 + input: + firm_region: WALES + firm_rateable_value: 100_000 + firm_is_charity: true + output: + # 100,000 x 0.568 = 56,800; relief 56,800 x 0.8 = 45,440; + # rates 56,800 - 45,440 = 11,360. + firm_charitable_rate_relief: 45_440 + firm_business_rates_reliefs: 45_440 + firm_business_rates: 11_360 + +- name: Wales small charity gets charitable relief instead of SBRR + period: 2025 + absolute_error_margin: 0.01 + input: + firm_region: [WALES, WALES, WALES] + firm_rateable_value: [6_000, 9_000, 6_000] + firm_is_charity: [true, true, true] + firm_property_occupied: [true, true, false] + output: + # 6,000 x 0.568 = 3,408. SBRR alone would be 100% (3,408), but the + # charity calculation is used: relief 3,408 x 0.8 = 2,726.4, rates 681.6. + # 9,000 x 0.568 = 5,112. SBRR alone would be 50% (2,556); charity relief + # 5,112 x 0.8 = 4,089.6, rates 1,022.4. + # Unoccupied: no charitable relief or SBRR; empty property relief in + # Wales is not modelled, so rates 3,408. + firm_charitable_rate_relief: [2_726.4, 4_089.6, 0] + firm_business_rates_reliefs: [2_726.4, 4_089.6, 0] + firm_business_rates: [681.6, 1_022.4, 3_408] + +- name: Wales small charity in 2023-24, under s.43(5) and (8B) + period: 2023 + absolute_error_margin: 0.01 + input: + firm_region: WALES + firm_rateable_value: 6_000 + firm_is_charity: true + output: + # 6,000 x 0.535 = 3,210; charity relief 3,210 x 0.8 = 2,568 (not the + # 100% SBRR); rates 642. + firm_business_rates_reliefs: 2_568 + firm_business_rates: 642 + +- name: Wales flagged shop above £100,000 pays the higher multiplier + period: 2026 + absolute_error_margin: 0.01 + input: + firm_region: [WALES] + firm_rateable_value: [200_000] + firm_is_wales_retail_property: [true] + output: + # A flagged shop above £100,000 pays the higher multiplier: 0.515. + firm_business_rates_multiplier: [0.515] + +- name: Wales excluded flag has no effect in 2025-26 + period: 2025 + absolute_error_margin: 0.01 + input: + firm_region: [WALES, WALES] + firm_rateable_value: [200_000, 200_000] + firm_is_wales_higher_multiplier_excluded: [true, false] + output: + # One multiplier, 0.568, for both. + firm_business_rates_multiplier: [0.568, 0.568] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/business_rates/firm/firm_pubs_and_live_music_venues_rate_relief.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/business_rates/firm/firm_pubs_and_live_music_venues_rate_relief.yaml new file mode 100644 index 0000000000..6c9d9140ad --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/business_rates/firm/firm_pubs_and_live_music_venues_rate_relief.yaml @@ -0,0 +1,47 @@ +# Pubs and live music venues relief (BRIL 8/2026 Technical Annex para 6): +# 35% in 2027-28 and 2028-29, but live music venues (not pubs) with rateable +# value of £1m or more keep 15%. 2027-28 high-value multiplier 52.5p from +# £500,000 (BRIL 8/2026). RHL relief has ended by 2027-28, so the pubs +# relief applies to the full gross bill. Margin 0.1 for float32 storage of +# bills over £500,000. +- name: 2027-28 pub and live music venue at £1.2m + period: 2027 + absolute_error_margin: 0.1 + input: + firm_rateable_value: [1_200_000, 1_200_000] + firm_is_rhl_property: [true, true] + firm_is_pub_or_live_music_venue: [true, true] + firm_is_live_music_venue: [false, true] + output: + # Both: 1,200,000 x 0.525 = 630,000. + # Pub: 35% whatever the rateable value = 220,500 -> rates 409,500. + # Live music venue at £1m or more: 15% = 94,500 -> rates 535,500. + firm_gross_business_rates: [630_000, 630_000] + firm_pubs_and_live_music_venues_rate_relief: [220_500, 94_500] + firm_business_rates: [409_500, 535_500] + +- name: 2027-28 pub and live music venue at £999,999 + period: 2027 + absolute_error_margin: 0.1 + input: + firm_rateable_value: [999_999, 999_999] + firm_is_rhl_property: [true, true] + firm_is_pub_or_live_music_venue: [true, true] + firm_is_live_music_venue: [false, true] + output: + # Both: 999,999 x 0.525 = 524,999.475, below £1m so both get 35% + # = 183,749.81625 -> rates 341,249.65875. + firm_gross_business_rates: [524_999.475, 524_999.475] + firm_pubs_and_live_music_venues_rate_relief: [183_749.81625, 183_749.81625] + firm_business_rates: [341_249.65875, 341_249.65875] + +- name: Live music venue flag alone does not make a firm eligible + period: 2027 + absolute_error_margin: 0.1 + input: + firm_rateable_value: [40_000] + firm_is_rhl_property: [true] + firm_is_live_music_venue: [true] + output: + # firm_is_pub_or_live_music_venue is the eligibility flag; it is false. + firm_pubs_and_live_music_venues_rate_relief: [0] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/business_rates/firm/firm_sbrr_boundaries.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/business_rates/firm/firm_sbrr_boundaries.yaml new file mode 100644 index 0000000000..88afcdf79a --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/business_rates/firm/firm_sbrr_boundaries.yaml @@ -0,0 +1,55 @@ +# Small business rate relief boundaries (Sch 4ZA para 4(1) LGFA 1988 and +# SI 2023/1250 reg 3): 100% at RV £12,000 or less; above that the bill is +# gross / E, with E = 3,000 / (RV - 12,000) rounded to three decimal places, +# so relief = gross - gross / E, and none above £15,000. 2026-27 small +# business multiplier 43.2p (BRIL 5/2025 para 2). Margin 0.01 for float32 +# storage. +- name: SBRR at exactly £12,000, just above, at £13,500 and at £15,000 + period: 2026 + absolute_error_margin: 0.01 + input: + firm_rateable_value: [12_000, 12_001, 13_500, 15_000] + output: + # 12,000 x 0.432 = 5,184; at or below £12,000 -> relief 5,184, rates 0. + # 12,001 x 0.432 = 5,184.432; E = 3,000 / 1 = 3,000.000 + # -> rates 5,184.432 / 3,000 = 1.728144, relief 5,182.703856. + # 13,500 x 0.432 = 5,832; E = 3,000 / 1,500 = 2.000 -> relief 2,916. + # 15,000 x 0.432 = 6,480; E = 3,000 / 3,000 = 1.000 -> relief 0, + # rates 6,480. + firm_gross_business_rates: [5_184, 5_184.432, 5_832, 6_480] + firm_small_business_rate_relief: [5_184, 5_182.704, 2_916, 0] + firm_business_rates: [0, 1.728, 2_916, 6_480] + +- name: SBRR £1 either side of the full-relief limit and the taper end + period: 2026 + absolute_error_margin: 0.01 + input: + firm_rateable_value: [11_999, 14_999, 15_001] + output: + # 11,999 x 0.432 = 5,183.568; share 1 -> relief 5,183.568, rates 0. + # 14,999 x 0.432 = 6,479.568; E = 3,000 / 2,999 = 1.000333 -> 1.000 + # -> rates 6,479.568 / 1 = 6,479.568, relief 0 (the rounding of E + # removes the 2.16 a linear taper would give). + # 15,001 x 0.432 = 6,480.432; above £15,000 -> no relief, rates 6,480.432. + firm_gross_business_rates: [5_183.568, 6_479.568, 6_480.432] + firm_small_business_rate_relief: [5_183.568, 0, 0] + firm_business_rates: [0, 6_479.568, 6_480.432] + +- name: 2027-28 RHL SBRR either side of £18,000 and £21,000 + period: 2027 + absolute_error_margin: 0.01 + input: + firm_rateable_value: [17_999, 18_000, 18_001, 20_999, 21_000, 21_001] + firm_is_rhl_property: [true, true, true, true, true, true] + output: + # RHL small business multiplier 0.395 in 2027-28, thresholds 18,000 and + # 21,000. + # 17,999 x 0.395 = 7,109.605; 18,000 x 0.395 = 7,110; both full relief. + # E assumed = 3,000 / (RV - 18,000), rounded to three decimal places. + # 18,001 x 0.395 = 7,110.395; E = 3,000.000 + # -> rates 7,110.395 / 3,000 = 2.370132, relief 7,108.024868. + # 20,999 x 0.395 = 8,294.605; E = 3,000 / 2,999 = 1.000333 -> 1.000 + # -> relief 0, rates 8,294.605. + # 21,000 x 0.395 = 8,295 and 21,001 x 0.395 = 8,295.395; no relief. + firm_small_business_rate_relief: [7_109.605, 7_110, 7_108.024868, 0, 0, 0] + firm_business_rates: [0, 0, 2.370132, 8_294.605, 8_295, 8_295.395] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/business_rates/firm/firm_small_business_rate_relief.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/business_rates/firm/firm_small_business_rate_relief.yaml new file mode 100644 index 0000000000..655f524888 --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/business_rates/firm/firm_small_business_rate_relief.yaml @@ -0,0 +1,26 @@ +# Small business rate relief taper with E rounded to three decimal places. +# Sch 4ZA para 4(1) LGFA 1988: chargeable amount = gross / E, where +# (SI 2023/1250 reg 3) E = 3,000 / (RV - 12,000) for RV over £12,000 and up to +# £15,000, "calculated to three decimal places only". Relief = gross - gross / E. +# 2026-27 small business multiplier 43.2p. Margin 0.01 for float32 storage. +- name: SBRR taper with E rounded, 2026-27 + period: 2026 + absolute_error_margin: 0.01 + input: + firm_rateable_value: [14_999, 13_500, 12_001, 13_501, 14_900] + output: + # 14,999 x 0.432 = 6,479.568; E = 3,000 / 2,999 = 1.000333 -> 1.000; + # relief = 6,479.568 - 6,479.568 / 1 = 0 (a linear taper gave 2.16). + # 13,500 x 0.432 = 5,832; E = 3,000 / 1,500 = 2.000; + # relief = 5,832 - 2,916 = 2,916. + # 12,001 x 0.432 = 5,184.432; E = 3,000 / 1 = 3,000.000; + # relief = 5,184.432 - 1.728144 = 5,182.703856. + # 13,501 x 0.432 = 5,832.432; E = 3,000 / 1,501 = 1.998668 -> 1.999; + # relief = 5,832.432 - 2,917.674837 = 2,914.757163 + # (a linear taper gave 2,914.27). + # 14,900 x 0.432 = 6,436.8; E = 3,000 / 2,900 = 1.034483 -> 1.034; + # relief = 6,436.8 - 6,225.145068 = 211.654932 + # (a linear taper gave 214.56). + firm_gross_business_rates: [6_479.568, 5_832, 5_184.432, 5_832.432, 6_436.8] + firm_small_business_rate_relief: [0, 2_916, 5_182.703856, 2_914.757163, 211.654932] + firm_business_rates: [6_479.568, 2_916, 1.728144, 2_917.674837, 6_225.145068] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/corporation_tax/capital_allowances/firm_capital_allowances.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/corporation_tax/capital_allowances/firm_capital_allowances.yaml new file mode 100644 index 0000000000..1668dbca4e --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/corporation_tax/capital_allowances/firm_capital_allowances.yaml @@ -0,0 +1,493 @@ +- name: Case 1, full expensing for a company and AIA for a sole trader on new main-rate plant. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, SOLE_TRADER] + firm_capex_main_pool_new: [500_000, 500_000] + output: + # Company: 100% full expensing on 500,000. Sole trader: no full + # expensing, so the AIA (limit 1,000,000) covers all 500,000. + firm_full_expensing_allowance: [500_000, 0] + firm_annual_investment_allowance: [0, 500_000] + firm_main_rate_first_year_allowance: [0, 0] + firm_capital_allowances: [500_000, 500_000] + +- name: Case 2, AIA at exactly 1 million and above on second-hand plant. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_legal_form: [SOLE_TRADER, SOLE_TRADER] + firm_capex_main_pool_used: [1_000_000, 1_200_000] + output: + # 1,000,000: AIA 1,000,000, nothing pooled. + # 1,200,000: AIA 1,000,000; 200,000 pooled; WDA 14% x 200,000 = 28,000. + firm_annual_investment_allowance: [1_000_000, 1_000_000] + firm_main_pool_writing_down_allowance: [0, 28_000] + firm_capital_allowances: [1_000_000, 1_028_000] + firm_main_pool_carried_forward: [0, 172_000] + +- name: Case 3, new versus second-hand plant for a sole trader above the AIA limit. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_legal_form: [SOLE_TRADER, SOLE_TRADER] + firm_capex_main_pool_new: [1_500_000, 0] + firm_capex_main_pool_used: [0, 1_500_000] + output: + # New: AIA 1,000,000; 40% FYA on 500,000 = 200,000; the other 300,000 + # joins the pool next year, so no WDA this year. Total 1,200,000. + # Used: no FYA. AIA 1,000,000; 500,000 pooled; WDA 14% = 70,000. + firm_main_rate_first_year_allowance: [200_000, 0] + firm_main_pool_writing_down_allowance: [0, 70_000] + firm_capital_allowances: [1_200_000, 1_070_000] + firm_main_pool_carried_forward: [300_000, 430_000] + +- name: Case 4, main-rate FYA for a sole trader in 2025, before it starts. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_legal_form: [SOLE_TRADER] + firm_capex_main_pool_new: [1_500_000] + output: + # The 30 April 2025 rate is 0, so 500,000 above the AIA is pooled: + # WDA 18% x 500,000 = 90,000. Total 1,090,000. + firm_main_rate_first_year_allowance: [0] + firm_main_pool_writing_down_allowance: [90_000] + firm_capital_allowances: [1_090_000] + +- name: Case 5, main-rate FYA at 50% in 2027. + period: 2027 + absolute_error_margin: 0.01 + input: + firm_legal_form: [SOLE_TRADER, PARTNERSHIP] + firm_capex_main_pool_new: [1_500_000, 1_500_000] + output: + # AIA 1,000,000 plus 50% x 500,000 = 250,000. + firm_main_rate_first_year_allowance: [250_000, 250_000] + firm_capital_allowances: [1_250_000, 1_250_000] + firm_main_pool_carried_forward: [250_000, 250_000] + +- name: Case 6, main pool WDA rate in 2025. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_main_pool_brought_forward: [100_000] + firm_special_rate_pool_brought_forward: [100_000] + output: + # Main 18% x 100,000; special 6% x 100,000. + firm_main_pool_writing_down_allowance: [18_000] + firm_special_rate_pool_writing_down_allowance: [6_000] + firm_capital_allowances: [24_000] + +- name: Case 7, main pool WDA rate in 2026. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_main_pool_brought_forward: [100_000] + firm_special_rate_pool_brought_forward: [100_000] + output: + # Main 14% x 100,000; special 6% x 100,000. + firm_main_pool_writing_down_allowance: [14_000] + firm_special_rate_pool_writing_down_allowance: [6_000] + firm_capital_allowances: [20_000] + +- name: Case 8, main pool WDA rate in 2027. + period: 2027 + absolute_error_margin: 0.01 + input: + firm_main_pool_brought_forward: [100_000] + output: + # 12% x 100,000. + firm_main_pool_writing_down_allowance: [12_000] + firm_main_pool_carried_forward: [88_000] + +- name: Case 9, small pool write-off at and above 1,000. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_main_pool_brought_forward: [1_000, 1_001] + firm_special_rate_pool_brought_forward: [1_000, 1_001] + output: + # At 1,000 the pool is written off. At 1,001: 14% = 140.14 and 6% = 60.06. + firm_main_pool_writing_down_allowance: [1_000, 140.14] + firm_special_rate_pool_writing_down_allowance: [1_000, 60.06] + +- name: Case 10, balancing charge when disposals exceed the main pool. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_main_pool_brought_forward: [10_000] + firm_disposal_proceeds_main_pool: [25_000] + output: + # 10,000 - 25,000 = -15,000: no WDA, balancing charge 15,000. + firm_main_pool_writing_down_allowance: [0] + firm_main_pool_balancing_charge: [15_000] + firm_capital_allowances: [-15_000] + firm_main_pool_carried_forward: [0] + +- name: Case 11, AIA before the 50% FYA on a company's new special-rate plant. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, COMPANY] + firm_capex_special_rate_new: [400_000, 1_400_000] + output: + # 400,000: AIA covers it all, worth more than the 50% FYA. + # 1,400,000: AIA 1,000,000; 50% FYA on 400,000 = 200,000; the other + # 200,000 joins the special rate pool next year. + firm_annual_investment_allowance: [400_000, 1_000_000] + firm_special_rate_first_year_allowance: [0, 200_000] + firm_special_rate_pool_writing_down_allowance: [0, 0] + firm_capital_allowances: [400_000, 1_200_000] + firm_special_rate_pool_carried_forward: [0, 200_000] + +- name: Case 12, special-rate plant for a sole trader goes to the pool after AIA. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_legal_form: [SOLE_TRADER] + firm_capex_special_rate_new: [1_400_000] + output: + # AIA 1,000,000; no FYA for a sole trader; 400,000 pooled; WDA 6% = 24,000. + firm_special_rate_first_year_allowance: [0] + firm_special_rate_pool_writing_down_allowance: [24_000] + firm_capital_allowances: [1_024_000] + +- name: Case 13, AIA order across a company's mixed spend. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY] + firm_capex_main_pool_used: [800_000] + firm_capex_special_rate_used: [300_000] + firm_capex_special_rate_new: [500_000] + output: + # AIA: special used 300,000, then main used 700,000 (limit reached). + # Main pool: 100,000 x 14% = 14,000. Special new: 50% FYA = 250,000. + # Total 1,000,000 + 14,000 + 250,000 = 1,264,000. + firm_aia_special_rate_used: [300_000] + firm_aia_main_pool_used: [700_000] + firm_aia_special_rate_new: [0] + firm_main_pool_writing_down_allowance: [14_000] + firm_special_rate_first_year_allowance: [250_000] + firm_capital_allowances: [1_264_000] + +- name: Case 14, shared AIA limit. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_legal_form: [SOLE_TRADER] + firm_aia_share: [0.5] + firm_capex_main_pool_used: [800_000] + output: + # Limit 0.5 x 1,000,000 = 500,000; 300,000 pooled; WDA 14% = 42,000. + firm_annual_investment_allowance: [500_000] + firm_capital_allowances: [542_000] + +- name: Case 15, structures and buildings allowance in 2026 and 2019. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_capex_structures: [1_000_000] + firm_sba_qualifying_cost_brought_forward: [500_000] + output: + # 3% x 1,500,000 = 45,000. + firm_structures_and_buildings_allowance: [45_000] + firm_capital_allowances: [45_000] + +- name: Case 16, structures and buildings allowance at 2% in 2019. + period: 2019 + absolute_error_margin: 0.01 + input: + firm_capex_structures: [1_000_000] + output: + firm_structures_and_buildings_allowance: [20_000] + +- name: Case 17, super-deduction in 2022. + period: 2022 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, SOLE_TRADER] + firm_capex_main_pool_new: [100_000, 100_000] + output: + # Company: 130% x 100,000. Sole trader: AIA 100,000. + firm_full_expensing_allowance: [130_000, 0] + firm_capital_allowances: [130_000, 100_000] + firm_main_pool_carried_forward: [0, 0] + +- name: Case 18, company new main-rate plant in 2020 before full expensing. + period: 2020 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY] + firm_capex_main_pool_new: [1_500_000] + output: + # AIA 1,000,000; 500,000 pooled at 18% = 90,000. + firm_full_expensing_allowance: [0] + firm_capital_allowances: [1_090_000] + +- name: Case 19, AIA goes to new special-rate plant before used main-rate plant without the special-rate FYA. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_legal_form: [SOLE_TRADER, COMPANY] + firm_capex_main_pool_used: [600_000, 600_000] + firm_capex_special_rate_new: [600_000, 600_000] + output: + # Sole trader: AIA 600,000 on special new (else 6% WDA), then 400,000 on + # main used; 200,000 main pooled, WDA 14% = 28,000. Total 1,028,000. + # Company: AIA 600,000 on main used, then 400,000 on special new; 50% FYA + # on 200,000 = 100,000. Total 1,100,000. + firm_aia_special_rate_new: [600_000, 400_000] + firm_aia_main_pool_used: [400_000, 600_000] + firm_special_rate_first_year_allowance: [0, 100_000] + firm_main_pool_writing_down_allowance: [28_000, 0] + firm_capital_allowances: [1_028_000, 1_100_000] + +- name: Case 20, AIA limit of 200,000 in 2017. + period: 2017 + absolute_error_margin: 0.01 + input: + firm_legal_form: [SOLE_TRADER] + firm_capex_main_pool_used: [300_000] + output: + # AIA 200,000; 100,000 pooled at 18% = 18,000. + firm_annual_investment_allowance: [200_000] + firm_capital_allowances: [218_000] + +- name: Case 21, AIA limit share in 2025. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_aia_share: [1, 0.25] + output: + # 1 x 1,000,000 = 1,000,000; 0.25 x 1,000,000 = 250,000. + firm_annual_investment_allowance_limit: [1_000_000, 250_000] + +- name: Case 22, disposal of fully expensed plant gives a balancing charge outside the pool. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY] + firm_main_pool_brought_forward: [1_000_000] + firm_disposal_proceeds_main_pool: [200_000] + firm_disposal_proceeds_full_expensing: [200_000] + output: + # Charge 1 x 200,000; pool receipts 200,000 - 200,000 = 0. + firm_full_expensing_balancing_charge: [200_000] + # 1,000,000 - 0 = 1,000,000. + firm_main_pool_balance: [1_000_000] + # 18% x 1,000,000 = 180,000. + firm_main_pool_writing_down_allowance: [180_000] + # Pool balance 1,000,000 is positive: no pool charge. + firm_main_pool_balancing_charge: [0] + # 180,000 - 200,000 = -20,000. + firm_capital_allowances: [-20_000] + # 1,000,000 - 180,000 = 820,000. + firm_main_pool_carried_forward: [820_000] + +- name: Case 23, no fully expensed disposals leaves the pool rules unchanged. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, COMPANY] + firm_main_pool_brought_forward: [1_000_000, 1_000_000] + firm_disposal_proceeds_main_pool: [200_000, 0] + firm_disposal_proceeds_full_expensing: [0, 0] + output: + # No fully expensed disposals: no charge. + firm_full_expensing_balancing_charge: [0, 0] + # 18% x (1,000,000 - 200,000) = 144,000; 18% x 1,000,000 = 180,000. + firm_main_pool_writing_down_allowance: [144_000, 180_000] + # Allowances equal the WDA. + firm_capital_allowances: [144_000, 180_000] + +- name: Case 24, disposals only partly of fully expensed plant. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY] + firm_main_pool_brought_forward: [1_000_000] + firm_disposal_proceeds_main_pool: [300_000] + firm_disposal_proceeds_full_expensing: [200_000] + output: + # Charge 1 x 200,000. + firm_full_expensing_balancing_charge: [200_000] + # 1,000,000 - (300,000 - 200,000) = 900,000. + firm_main_pool_balance: [900_000] + # 18% x 900,000 = 162,000. + firm_main_pool_writing_down_allowance: [162_000] + # 162,000 - 200,000 = -38,000. + firm_capital_allowances: [-38_000] + +- name: Case 25, full expensing charge alongside a main pool balancing charge. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY] + firm_main_pool_brought_forward: [10_000] + firm_disposal_proceeds_main_pool: [225_000] + firm_disposal_proceeds_full_expensing: [200_000] + output: + # Charge 1 x 200,000. + firm_full_expensing_balancing_charge: [200_000] + # 10,000 - (225,000 - 200,000) = -15,000. + firm_main_pool_balance: [-15_000] + # Pool charge max(15,000, 0) = 15,000. + firm_main_pool_balancing_charge: [15_000] + # Negative pool: WDA 0. + firm_main_pool_writing_down_allowance: [0] + # 0 - 15,000 - 200,000 = -215,000. + firm_capital_allowances: [-215_000] + # max(-15,000, 0) - 0 = 0. + firm_main_pool_carried_forward: [0] + +- name: Case 26, fully expensed proceeds capped at main pool proceeds and nil for a sole trader. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, SOLE_TRADER] + firm_main_pool_brought_forward: [1_000_000, 1_000_000] + firm_disposal_proceeds_main_pool: [0, 200_000] + firm_disposal_proceeds_full_expensing: [200_000, 200_000] + output: + # Company min(200,000, 0) = 0; a sole trader cannot claim full expensing, so 0. + firm_full_expensing_balancing_charge: [0, 0] + # Company 1,000,000 - 0 = 1,000,000; sole trader 1,000,000 - 200,000 = 800,000. + firm_main_pool_balance: [1_000_000, 800_000] + # 18% x 1,000,000 = 180,000; 18% x 800,000 = 144,000. + firm_capital_allowances: [180_000, 144_000] + +- name: Case 27, new main-rate plant for leasing gets the AIA and the 40% FYA, not full expensing. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, SOLE_TRADER] + firm_capex_main_pool_new_for_leasing: [2_000_000, 2_000_000] + output: + # Leasing is excluded from full expensing (s.46 general exclusion 6). + firm_full_expensing_allowance: [0, 0] + # AIA min(2,000,000, 1,000,000) = 1,000,000. + firm_annual_investment_allowance: [1_000_000, 1_000_000] + # 40% x (2,000,000 - 1,000,000) = 400,000. + firm_main_rate_first_year_allowance: [400_000, 400_000] + # FYA spend joins the pool next year, so no WDA. + firm_main_pool_writing_down_allowance: [0, 0] + # 1,000,000 + 400,000 = 1,400,000. + firm_capital_allowances: [1_400_000, 1_400_000] + # 2,000,000 - 1,000,000 - 400,000 = 600,000. + firm_main_pool_carried_forward: [600_000, 600_000] + +- name: Case 28, plant for leasing below the AIA limit. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY] + firm_capex_main_pool_new_for_leasing: [300_000] + output: + # Leasing is excluded from full expensing: 0. + firm_full_expensing_allowance: [0] + # AIA min(300,000, 1,000,000) = 300,000. + firm_annual_investment_allowance: [300_000] + # 40% x (300,000 - 300,000) = 0. + firm_main_rate_first_year_allowance: [0] + # 300,000 + 0 = 300,000. + firm_capital_allowances: [300_000] + # 300,000 - 300,000 - 0 = 0. + firm_main_pool_carried_forward: [0] + +- name: Case 29, company with both ordinary new plant and plant for leasing. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY] + firm_capex_main_pool_new: [500_000] + firm_capex_main_pool_new_for_leasing: [1_500_000] + output: + # Full expensing 100% x 500,000 on the ordinary plant only. + firm_full_expensing_allowance: [500_000] + # AIA min(1,500,000, 1,000,000) = 1,000,000 on the leasing plant. + firm_annual_investment_allowance: [1_000_000] + # 40% x (1,500,000 - 1,000,000) = 200,000. + firm_main_rate_first_year_allowance: [200_000] + # 500,000 + 1,000,000 + 200,000 = 1,700,000. + firm_capital_allowances: [1_700_000] + # 500,000 - 200,000 = 300,000. + firm_main_pool_carried_forward: [300_000] + +- name: Case 30, plant for leasing in 2025 before the main-rate FYA. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY] + firm_capex_main_pool_new_for_leasing: [1_500_000] + output: + # Leasing is excluded from full expensing: 0. + firm_full_expensing_allowance: [0] + # AIA min(1,500,000, 1,000,000) = 1,000,000. + firm_annual_investment_allowance: [1_000_000] + # The 30 April 2025 main-rate FYA rate is 0: 0 x 500,000 = 0. + firm_main_rate_first_year_allowance: [0] + # 18% x (1,500,000 - 1,000,000) = 90,000. + firm_main_pool_writing_down_allowance: [90_000] + # 1,000,000 + 90,000 = 1,090,000. + firm_capital_allowances: [1_090_000] + # 500,000 - 90,000 = 410,000. + firm_main_pool_carried_forward: [410_000] + +- name: Case 31, AIA goes to plant for leasing before special-rate plant with the 50% FYA in 2025. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY] + firm_capex_special_rate_new: [1_000_000] + firm_capex_main_pool_new_for_leasing: [1_000_000] + output: + # Main-rate FYA 0 is below 50%, so leasing first: min(1,000,000, 1,000,000). + firm_aia_main_pool_new: [1_000_000] + # 1,000,000 - 1,000,000 = 0 left for special-rate plant. + firm_aia_special_rate_new: [0] + # 50% x 1,000,000 = 500,000. + firm_special_rate_first_year_allowance: [500_000] + # 1,000,000 + 500,000 = 1,500,000. + firm_capital_allowances: [1_500_000] + # 1,000,000 - 500,000 = 500,000 joins the special rate pool next year. + firm_special_rate_pool_carried_forward: [500_000] + +- name: Case 32, AIA goes to plant for leasing before special-rate plant with the 50% FYA in 2026. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY] + firm_capex_special_rate_new: [1_000_000] + firm_capex_main_pool_new_for_leasing: [1_000_000] + output: + # Main-rate FYA 40% is below 50%, so leasing first: min(1,000,000, 1,000,000). + firm_aia_main_pool_new: [1_000_000] + # 1,000,000 - 1,000,000 = 0 left for special-rate plant. + firm_aia_special_rate_new: [0] + # 40% x (1,000,000 - 1,000,000) = 0. + firm_main_rate_first_year_allowance: [0] + # 50% x 1,000,000 = 500,000. + firm_special_rate_first_year_allowance: [500_000] + # 1,000,000 + 500,000 = 1,500,000. + firm_capital_allowances: [1_500_000] + +- name: Case 33, tied FYA rates in 2027 keep special-rate plant first for the AIA. + period: 2027 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY] + firm_capex_special_rate_new: [1_000_000] + firm_capex_main_pool_new_for_leasing: [1_000_000] + output: + # Both FYAs are 50%, so special-rate first: min(1,000,000, 1,000,000). + firm_aia_special_rate_new: [1_000_000] + # 1,000,000 - 1,000,000 = 0 left for leasing plant. + firm_aia_main_pool_new: [0] + # 50% x (1,000,000 - 0) = 500,000. + firm_main_rate_first_year_allowance: [500_000] + # 50% x (1,000,000 - 1,000,000) = 0. + firm_special_rate_first_year_allowance: [0] + # 1,000,000 + 500,000 = 1,500,000. + firm_capital_allowances: [1_500_000] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/corporation_tax/corporation_tax.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/corporation_tax/corporation_tax.yaml new file mode 100644 index 0000000000..4140153682 --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/corporation_tax/corporation_tax.yaml @@ -0,0 +1,363 @@ +# Agent C's capital allowance and R&D variables are set as inputs so these +# cases test corporation tax alone. +- name: Case 1, small profits rate, marginal relief and main rate boundaries in 2026-27. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, COMPANY, COMPANY, COMPANY, COMPANY] + firm_n_associated_companies: [0, 0, 0, 0, 0] + firm_taxable_trading_profit: [50_000, 50_001, 100_000, 250_000, 250_001] + firm_capital_allowances: [0, 0, 0, 0, 0] + firm_rd_additional_deduction: [0, 0, 0, 0, 0] + firm_rd_expenditure_credit: [0, 0, 0, 0, 0] + output: + # 50,000 is at the lower limit: 19% x 50,000 = 9,500. + # 50,001: 25% x 50,001 = 12,500.25; relief 3/200 x (250,000 - 50,001) + # = 2,999.985; tax 9,500.265. + # 100,000: 25,000 - 3/200 x 150,000 = 25,000 - 2,250 = 22,750. + # 250,000 is at the upper limit: relief 3/200 x 0 = 0; tax 62,500. + # 250,001: 25% x 250,001 = 62,500.25. + firm_marginal_relief: [0, 2_999.985, 2_250, 0, 0] + corporation_tax_before_credits: [9_500, 9_500.265, 22_750, 62_500, 62_500.25] + corporation_tax: [9_500, 9_500.265, 22_750, 62_500, 62_500.25] + +- name: Case 2, limits divided by associated companies. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, COMPANY, COMPANY, COMPANY] + firm_n_associated_companies: [1, 3, 3, 3] + firm_taxable_trading_profit: [100_000, 100_000, 12_500, 40_000] + firm_capital_allowances: [0, 0, 0, 0] + firm_rd_additional_deduction: [0, 0, 0, 0] + firm_rd_expenditure_credit: [0, 0, 0, 0] + output: + # One associate: limits 25,000 and 125,000. + # 100,000: 25,000 - 3/200 x (125,000 - 100,000) = 25,000 - 375 = 24,625. + # Three associates: limits 12,500 and 62,500. + # 100,000 is above the upper limit: 25% x 100,000 = 25,000. + # 12,500 is at the lower limit: 19% x 12,500 = 2,375. + # 40,000: 10,000 - 3/200 x 22,500 = 10,000 - 337.5 = 9,662.5. + firm_corporation_tax_lower_limit: [25_000, 12_500, 12_500, 12_500] + firm_corporation_tax_upper_limit: [125_000, 62_500, 62_500, 62_500] + firm_marginal_relief: [375, 0, 0, 337.5] + corporation_tax: [24_625, 25_000, 2_375, 9_662.5] + +- name: Case 3, exempt distributions raise augmented profits. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, COMPANY] + firm_n_associated_companies: [0, 0] + firm_taxable_trading_profit: [40_000, 40_000] + firm_exempt_distributions: [5_000, 20_000] + firm_capital_allowances: [0, 0] + firm_rd_additional_deduction: [0, 0] + firm_rd_expenditure_credit: [0, 0] + output: + # Augmented 45,000 is below the lower limit: 19% x 40,000 = 7,600. + # Augmented 60,000: 25% x 40,000 = 10,000; relief + # 3/200 x (250,000 - 60,000) x 40,000 / 60,000 = 1,900; tax 8,100. + firm_augmented_profits: [45_000, 60_000] + firm_taxable_profit: [40_000, 40_000] + firm_marginal_relief: [0, 1_900] + corporation_tax: [7_600, 8_100] + +- name: Case 4, profits combine capital allowances, R&D relief and non-trading profits. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_legal_form: COMPANY + firm_n_associated_companies: 0 + firm_taxable_trading_profit: 500_000 + firm_capital_allowances: 100_000 + firm_rd_additional_deduction: 50_000 + firm_rd_expenditure_credit: 20_000 + firm_non_trading_profits: 30_000 + output: + # 500,000 - 100,000 - 50,000 + 20,000 + 30,000 = 400,000. + # Tax before credits 25% x 400,000 = 100,000; less RDEC 20,000 = 80,000. + firm_profits_before_losses: 400_000 + corporation_tax_before_credits: 100_000 + corporation_tax: 80_000 + firm_rdec_excess_payable: 0 + +- name: Case 5, R&D expenditure credit above the tax is payable. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_legal_form: COMPANY + firm_n_associated_companies: 0 + firm_taxable_trading_profit: 0 + firm_capital_allowances: 0 + firm_rd_additional_deduction: 0 + firm_rd_expenditure_credit: 20_000 + output: + # The taxable credit gives profits of 20,000: 19% x 20,000 = 3,800. + # The credit discharges the 3,800 and 20,000 - 3,800 = 16,200 is payable. + corporation_tax_before_credits: 3_800 + corporation_tax: 0 + firm_rdec_excess_payable: 16_200 + +- name: Case 6, non-companies pay no corporation tax. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_legal_form: [SOLE_TRADER, PARTNERSHIP, OTHER] + firm_taxable_trading_profit: [100_000, 100_000, 100_000] + firm_exempt_distributions: [10_000, 10_000, 10_000] + firm_capital_allowances: [0, 0, 0] + firm_rd_additional_deduction: [0, 0, 0] + firm_rd_expenditure_credit: [0, 0, 0] + output: + firm_taxable_profit: [0, 0, 0] + firm_augmented_profits: [0, 0, 0] + corporation_tax: [0, 0, 0] + +- name: Case 7, single main rate before the small profits rate returned. + period: 2022 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, COMPANY] + firm_n_associated_companies: [0, 0] + firm_taxable_trading_profit: [40_000, 100_000] + firm_capital_allowances: [0, 0] + firm_rd_additional_deduction: [0, 0] + firm_rd_expenditure_credit: [0, 0] + output: + # 19% on all profits in 2022-23: 7,600 and 19,000; no marginal relief. + firm_marginal_relief: [0, 0] + corporation_tax: [7_600, 19_000] + +- name: Case 8, 20% main rate in 2016-17. + period: 2016 + absolute_error_margin: 0.01 + input: + firm_legal_form: COMPANY + firm_taxable_trading_profit: 100_000 + firm_capital_allowances: 0 + firm_rd_additional_deduction: 0 + firm_rd_expenditure_credit: 0 + output: + corporation_tax: 20_000 + +# Boundaries in CTA 2010: the small profits rate applies where augmented +# profits do not exceed the lower limit (s.18A), marginal relief where they +# exceed the lower limit and do not exceed the upper limit (s.18B). Lower +# limit 50,000, upper limit 250,000, fraction 3/200 = 0.015, rates 19% and 25%, +# limits divided by 1 + associated companies (s.18D). +- name: Case 9, profits just below each limit with no associated companies. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, COMPANY] + firm_n_associated_companies: [0, 0] + firm_taxable_trading_profit: [49_999, 249_999] + firm_capital_allowances: [0, 0] + firm_rd_additional_deduction: [0, 0] + firm_rd_expenditure_credit: [0, 0] + output: + # 49,999 is below the lower limit: 19% x 49,999 = 9,499.81. + # 249,999 is upper limit - 1: 25% x 249,999 = 62,499.75; relief + # 0.015 x (250,000 - 249,999) = 0.015; tax 62,499.735. + firm_marginal_relief: [0, 0.015] + corporation_tax: [9_499.81, 62_499.735] + +- name: Case 10, every limit boundary with one associated company. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, COMPANY, COMPANY, COMPANY, COMPANY] + firm_n_associated_companies: [1, 1, 1, 1, 1] + firm_taxable_trading_profit: [25_000, 25_001, 124_999, 125_000, 125_001] + firm_capital_allowances: [0, 0, 0, 0, 0] + firm_rd_additional_deduction: [0, 0, 0, 0, 0] + firm_rd_expenditure_credit: [0, 0, 0, 0, 0] + output: + # Limits 50,000 / 2 = 25,000 and 250,000 / 2 = 125,000. + # 25,000 at the lower limit: 19% x 25,000 = 4,750. + # 25,001: 25% x 25,001 = 6,250.25; relief 0.015 x (125,000 - 25,001) + # = 1,499.985; tax 4,750.265. + # 124,999: 31,249.75 - 0.015 x 1 = 31,249.735. + # 125,000 at the upper limit: relief 0; tax 31,250. + # 125,001 above the upper limit: 25% x 125,001 = 31,250.25. + firm_corporation_tax_lower_limit: [25_000, 25_000, 25_000, 25_000, 25_000] + firm_corporation_tax_upper_limit: [125_000, 125_000, 125_000, 125_000, 125_000] + firm_marginal_relief: [0, 1_499.985, 0.015, 0, 0] + corporation_tax: [4_750, 4_750.265, 31_249.735, 31_250, 31_250.25] + +- name: Case 11, every limit boundary with four associated companies. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, COMPANY, COMPANY, COMPANY, COMPANY] + firm_n_associated_companies: [4, 4, 4, 4, 4] + firm_taxable_trading_profit: [10_000, 10_001, 49_999, 50_000, 50_001] + firm_capital_allowances: [0, 0, 0, 0, 0] + firm_rd_additional_deduction: [0, 0, 0, 0, 0] + firm_rd_expenditure_credit: [0, 0, 0, 0, 0] + output: + # Limits 50,000 / 5 = 10,000 and 250,000 / 5 = 50,000. + # 10,000 at the lower limit: 19% x 10,000 = 1,900. + # 10,001: 25% x 10,001 = 2,500.25; relief 0.015 x (50,000 - 10,001) + # = 599.985; tax 1,900.265. + # 49,999: 12,499.75 - 0.015 = 12,499.735. + # 50,000 at the upper limit: tax 12,500. Unscaled limits would give + # 19% x 50,000 = 9,500 here. + # 50,001 above the upper limit: 25% x 50,001 = 12,500.25. + firm_corporation_tax_lower_limit: [10_000, 10_000, 10_000, 10_000, 10_000] + firm_corporation_tax_upper_limit: [50_000, 50_000, 50_000, 50_000, 50_000] + firm_marginal_relief: [0, 599.985, 0.015, 0, 0] + corporation_tax: [1_900, 1_900.265, 12_499.735, 12_500, 12_500.25] + +- name: Case 12, small profits rate, marginal relief and main rate in 2023-24. + period: 2023 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, COMPANY, COMPANY, COMPANY, COMPANY] + firm_n_associated_companies: [0, 0, 0, 0, 0] + firm_taxable_trading_profit: [50_000, 50_001, 150_000, 250_000, 300_000] + firm_capital_allowances: [0, 0, 0, 0, 0] + firm_rd_additional_deduction: [0, 0, 0, 0, 0] + firm_rd_expenditure_credit: [0, 0, 0, 0, 0] + output: + # From 1 April 2023: main rate 25%, small profits rate 19%, limits + # 50,000 and 250,000, marginal relief fraction 3/200. + # 50,000 is at the lower limit: 19% x 50,000 = 9,500. + # 50,001: 25% x 50,001 = 12,500.25; relief 0.015 x (250,000 - 50,001) + # = 2,999.985; tax 9,500.265. + # 150,000: 37,500 - 0.015 x 100,000 = 37,500 - 1,500 = 36,000. + # 250,000 at the upper limit: relief 0; tax 62,500. + # 300,000 above the upper limit: 25% x 300,000 = 75,000. + firm_marginal_relief: [0, 2_999.985, 1_500, 0, 0] + corporation_tax: [9_500, 9_500.265, 36_000, 62_500, 75_000] + +- name: Case 13, small profits rate, marginal relief and main rate in 2024-25. + period: 2024 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, COMPANY, COMPANY, COMPANY, COMPANY] + firm_n_associated_companies: [0, 0, 0, 0, 0] + firm_taxable_trading_profit: [50_000, 50_001, 150_000, 250_000, 300_000] + firm_capital_allowances: [0, 0, 0, 0, 0] + firm_rd_additional_deduction: [0, 0, 0, 0, 0] + firm_rd_expenditure_credit: [0, 0, 0, 0, 0] + output: + # 2024-25: the same rates, limits and fraction as 2023-24. + # 50,000 is at the lower limit: 19% x 50,000 = 9,500. + # 50,001: 25% x 50,001 = 12,500.25; relief 0.015 x (250,000 - 50,001) + # = 2,999.985; tax 9,500.265. + # 150,000: 37,500 - 0.015 x 100,000 = 37,500 - 1,500 = 36,000. + # 250,000 at the upper limit: relief 0; tax 62,500. + # 300,000 above the upper limit: 25% x 300,000 = 75,000. + firm_marginal_relief: [0, 2_999.985, 1_500, 0, 0] + corporation_tax: [9_500, 9_500.265, 36_000, 62_500, 75_000] + +- name: Case 14, small profits rate, marginal relief and main rate in 2025-26. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, COMPANY, COMPANY, COMPANY, COMPANY] + firm_n_associated_companies: [0, 0, 0, 0, 0] + firm_taxable_trading_profit: [50_000, 50_001, 150_000, 250_000, 300_000] + firm_capital_allowances: [0, 0, 0, 0, 0] + firm_rd_additional_deduction: [0, 0, 0, 0, 0] + firm_rd_expenditure_credit: [0, 0, 0, 0, 0] + output: + # 2025-26: the same rates, limits and fraction as 2023-24. + # 50,000 is at the lower limit: 19% x 50,000 = 9,500. + # 50,001: 25% x 50,001 = 12,500.25; relief 0.015 x (250,000 - 50,001) + # = 2,999.985; tax 9,500.265. + # 150,000: 37,500 - 0.015 x 100,000 = 37,500 - 1,500 = 36,000. + # 250,000 at the upper limit: relief 0; tax 62,500. + # 300,000 above the upper limit: 25% x 300,000 = 75,000. + firm_marginal_relief: [0, 2_999.985, 1_500, 0, 0] + corporation_tax: [9_500, 9_500.265, 36_000, 62_500, 75_000] + +- name: Case 15, full expensing balancing charge raises taxable profit. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_legal_form: COMPANY + firm_n_associated_companies: 0 + firm_taxable_trading_profit: 500_000 + firm_main_pool_brought_forward: 1_000_000 + firm_disposal_proceeds_main_pool: 200_000 + firm_disposal_proceeds_full_expensing: 200_000 + firm_rd_additional_deduction: 0 + firm_rd_expenditure_credit: 0 + output: + # WDA 18% x 1,000,000 = 180,000, less the 200,000 charge = -20,000. + firm_capital_allowances: -20_000 + # 500,000 - (-20,000) = 520,000. + firm_profits_before_losses: 520_000 + # Above the upper limit: 25% x 520,000 = 130,000. + corporation_tax: 130_000 + +# Close investment-holding and non-UK-resident companies get no small profits +# rate or marginal relief (CTA 2010 ss.18A(1), 18B(1) and 18N). +- name: Case 20, excluded company pays the main rate below the lower limit in 2025. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, COMPANY] + firm_n_associated_companies: [0, 0] + firm_taxable_trading_profit: [40_000, 40_000] + firm_small_profits_rate_excluded: [false, true] + firm_capital_allowances: [0, 0] + firm_rd_additional_deduction: [0, 0] + firm_rd_expenditure_credit: [0, 0] + output: + # 19% x 40,000 = 7,600; excluded: 25% x 40,000 = 10,000. + corporation_tax: [7_600, 10_000] + +- name: Case 21, excluded company gets no marginal relief in 2025. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, COMPANY] + firm_n_associated_companies: [0, 0] + firm_taxable_trading_profit: [100_000, 100_000] + firm_small_profits_rate_excluded: [false, true] + firm_capital_allowances: [0, 0] + firm_rd_additional_deduction: [0, 0] + firm_rd_expenditure_credit: [0, 0] + output: + # 3/200 x (250,000 - 100,000) = 2,250; excluded: none. + firm_marginal_relief: [2_250, 0] + # 25% x 100,000 - 2,250 = 22,750; excluded: 25% x 100,000 = 25,000. + corporation_tax: [22_750, 25_000] + +- name: Case 22, exclusion has no effect under the single 19% rate in 2022. + period: 2022 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, COMPANY] + firm_n_associated_companies: [0, 0] + firm_taxable_trading_profit: [40_000, 40_000] + firm_small_profits_rate_excluded: [false, true] + firm_capital_allowances: [0, 0] + firm_rd_additional_deduction: [0, 0] + firm_rd_expenditure_credit: [0, 0] + output: + # 19% x 40,000 = 7,600 either way. + corporation_tax: [7_600, 7_600] + +- name: Case 23, RDEC notional tax rate for an excluded company in 2025 (s.1042K(5)). + period: 2025 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, COMPANY] + firm_n_associated_companies: [0, 0] + firm_small_profits_rate_excluded: [true, true] + firm_qualifying_rd_expenditure: [1_000_000, 100_000] + firm_total_relevant_expenditure: [10_000_000, 10_000_000] + firm_taxable_trading_profit: [-1_000_000, 10_000] + output: + # 20,000 + 10,000 = 30,000 taxed at the 25% main rate = 7,500; the loss-maker pays none. + corporation_tax_before_credits: [0, 7_500] + # No profits ignoring the credit: 200,000 x 81% = 162,000; main rate: min(20,000 - 7,500, 20,000 x 75%) = 12,500. + # For a company with profits, step 1 is always below the step 2 cap, so + # the main-rate notional tax cannot change the second result; the case + # pins the value rather than isolating the s.1042K(5)(a) branch. + firm_rdec_excess_payable: [162_000, 12_500] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/corporation_tax/firm_group_relief.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/corporation_tax/firm_group_relief.yaml new file mode 100644 index 0000000000..bd17e5d8ec --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/corporation_tax/firm_group_relief.yaml @@ -0,0 +1,108 @@ +# Group relief (CTA 2010 Parts 5 and 5A). 2025-26: main rate 25%, small +# profits rate 19%, limits 50,000 and 250,000, marginal relief fraction 3/200. +- name: Part 5 group relief is capped at total profits, with marginal relief edges. + period: 2025 + absolute_error_margin: 0.5 + input: + firm_taxable_trading_profit: [300_000, 300_000, 300_000, 300_000, -100_000] + firm_group_relief_claimed: [400_000, 100_000, 250_000, 249_999, 50_000] + output: + firm_group_relief: [300_000, 100_000, 250_000, 249_999, 0] + firm_taxable_profit: [0, 200_000, 50_000, 50_001, 0] + # 200,000 x 25% - 3/200 x 50,000 = 49,250; 50,000 x 19%; 50,001 at the + # main rate less marginal relief 3/200 x 199,999 = 9,500.265. + corporation_tax: [0, 49_250, 9_500, 9_500.27, 0] + +- name: Part 5 group relief comes before carried-forward losses and their restriction. + period: 2025 + absolute_error_margin: 1 + input: + firm_taxable_trading_profit: [12_000_000] + firm_group_relief_claimed: [2_000_000] + firm_losses_brought_forward: [20_000_000] + output: + # Profits after group relief 10,000,000: 5,000,000 + 50% x 5,000,000. + firm_losses_used: [7_500_000] + firm_taxable_profit: [2_500_000] + corporation_tax: [625_000] + +- name: Part 5A relief uses the room left after the firm's own losses. + period: 2025 + absolute_error_margin: 1 + input: + firm_taxable_trading_profit: [12_000_000, 12_000_000] + firm_losses_brought_forward: [3_000_000, 10_000_000] + firm_group_relief_for_carried_forward_losses_claimed: [6_000_000, 6_000_000] + output: + # Relevant maximum 5,000,000 + 50% x 7,000,000 = 8,500,000. First firm: + # own losses 3,000,000 all used, room 5,500,000. Second: 8,500,000 of + # 10,000,000 own losses used, so no Part 5A relief. + firm_losses_used: [3_000_000, 8_500_000] + firm_group_relief_for_carried_forward_losses: [5_500_000, 0] + firm_taxable_profit: [3_500_000, 3_500_000] + corporation_tax: [875_000, 875_000] + +- name: Part 5A relief starts in April 2017. + period: 2016 + absolute_error_margin: 1 + input: + firm_taxable_trading_profit: [12_000_000] + firm_group_relief_for_carried_forward_losses_claimed: [6_000_000] + output: + # 20% main rate, no Part 5A relief. + firm_group_relief_for_carried_forward_losses: [0] + corporation_tax: [2_400_000] + +- name: Part 5A relief in 2017-18, at 19%. + period: 2017 + absolute_error_margin: 1 + input: + firm_taxable_trading_profit: [12_000_000] + firm_group_relief_for_carried_forward_losses_claimed: [6_000_000] + output: + # 5,000,000 + 50% x 7,000,000 = 8,500,000 is above the claim. + firm_group_relief_for_carried_forward_losses: [6_000_000] + corporation_tax: [1_140_000] + +- name: Group relief across the April 2023 rate change, 2022-23. + period: 2022 + absolute_error_margin: 0.5 + input: + firm_taxable_trading_profit: [300_000] + firm_group_relief_claimed: [200_000] + output: + corporation_tax: [19_000] + +- name: Group relief across the April 2023 rate change, 2023-24. + period: 2023 + absolute_error_margin: 0.5 + input: + firm_taxable_trading_profit: [300_000] + firm_group_relief_claimed: [200_000] + output: + # 100,000 x 25% - 3/200 x 150,000. + corporation_tax: [22_750] + +- name: A sole trader gets no group relief. + period: 2025 + absolute_error_margin: 0.5 + input: + firm_legal_form: [SOLE_TRADER] + firm_taxable_trading_profit: [300_000] + firm_group_relief_claimed: [100_000] + output: + firm_group_relief: [0] + corporation_tax: [0] + +- name: Bank surcharge adds back group relief from non-banking companies. + period: 2025 + absolute_error_margin: 1 + input: + firm_is_bank: [true, true] + firm_taxable_trading_profit: [300_000_000, 300_000_000] + firm_group_relief_claimed: [50_000_000, 50_000_000] + firm_non_banking_group_relief_claimed: [50_000_000, 0] + output: + corporation_tax: [62_500_000, 62_500_000] + # 3% above 100,000,000: (300m - 100m) x 3% and (250m - 100m) x 3%. + bank_surcharge: [6_000_000, 4_500_000] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/corporation_tax/firm_losses_used.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/corporation_tax/firm_losses_used.yaml new file mode 100644 index 0000000000..128df06c82 --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/corporation_tax/firm_losses_used.yaml @@ -0,0 +1,60 @@ +- name: Case 1, carried-forward losses and the deductions allowance. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, COMPANY, COMPANY, COMPANY, COMPANY] + firm_n_associated_companies: [0, 0, 0, 0, 0] + firm_taxable_trading_profit: [3_000_000, 8_000_000, 8_000_000, 8_000_000, -100_000] + firm_losses_brought_forward: [10_000_000, 10_000_000, 2_000_000, 10_000_000, 1_000_000] + firm_deductions_allowance_share: [1, 1, 1, 0.5, 1] + firm_capital_allowances: [0, 0, 0, 0, 0] + firm_rd_additional_deduction: [0, 0, 0, 0, 0] + firm_rd_expenditure_credit: [0, 0, 0, 0, 0] + output: + # 3m profit, within the 5m allowance: all 3m relieved, taxable 0. + # 8m profit, cap binds: 5m + 50% x (8m - 5m) = 6.5m used, taxable 1.5m. + # 8m profit, 2m losses: cap 6.5m does not bind, taxable 6m. + # Half the allowance: 2.5m + 50% x (8m - 2.5m) = 5.25m used, taxable 2.75m. + # A loss-making year uses no losses brought forward. + firm_losses_used: [3_000_000, 6_500_000, 2_000_000, 5_250_000, 0] + firm_taxable_profit: [0, 1_500_000, 6_000_000, 2_750_000, 0] + # 25% of taxable profit (all above the upper limit, or nil). + corporation_tax: [0, 375_000, 1_500_000, 687_500, 0] + +- name: Case 2, no restriction on carried-forward losses before April 2017. + period: 2016 + absolute_error_margin: 0.01 + input: + firm_legal_form: COMPANY + firm_taxable_trading_profit: 8_000_000 + firm_losses_brought_forward: 10_000_000 + firm_capital_allowances: 0 + firm_rd_additional_deduction: 0 + firm_rd_expenditure_credit: 0 + output: + # Full relief: min(10m, 8m) = 8m used, taxable 0. + firm_losses_used: 8_000_000 + firm_taxable_profit: 0 + +- name: Case 3, profits just above the 5m deductions allowance in 2025-26. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, COMPANY, COMPANY] + firm_n_associated_companies: [0, 0, 0] + firm_taxable_trading_profit: [5_000_000, 5_000_001, 5_000_002] + firm_losses_brought_forward: [6_000_000, 6_000_000, 5_000_000] + firm_capital_allowances: [0, 0, 0] + firm_rd_additional_deduction: [0, 0, 0] + firm_rd_expenditure_credit: [0, 0, 0] + output: + # 5,000,000 at the allowance: all 5,000,000 relieved, taxable 0. + # 5,000,001: cap 5,000,000 + 50% x 1 = 5,000,000.5 binds, taxable 0.5. + # 5,000,002 with 5,000,000 of losses: cap 5,000,001 does not bind, so + # 5,000,000 used, taxable 2. + # Float32 holds 5,000,000.5 exactly (spacing 0.5 between 4,194,304 and + # 8,388,608), so the 0.01 margin is enough. + firm_losses_used: [5_000_000, 5_000_000.5, 5_000_000] + firm_taxable_profit: [0, 0.5, 2] + # 19% (under the lower limit): 0; 19% x 0.5 = 0.095; 19% x 2 = 0.38. + corporation_tax: [0, 0.095, 0.38] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/corporation_tax/firm_patent_box.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/corporation_tax/firm_patent_box.yaml new file mode 100644 index 0000000000..ea473f4b62 --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/corporation_tax/firm_patent_box.yaml @@ -0,0 +1,111 @@ +# Patent Box (CTA 2010 s.357A): deduction RP x (AR - 10%) / AR, where AR is +# the main rate before April 2023 and, from then, the small profits rate if +# the company is charged at it (F(No.2)A 2023 s.11; HMRC CIRD201020). +- name: Main rate company, 2025-26. + period: 2025 + absolute_error_margin: 0.5 + input: + firm_taxable_trading_profit: [1_000_000, 60_000, 100_000] + firm_relevant_ip_profits: [400_000, 30_000, 250_000] + output: + # 400,000 x 15/25 = 240,000; CT on 760,000 at 25% = 190,000. + # 30,000 x 15/25 = 18,000 on profit 60,000 (AR 25%); 42,000 is under + # the lower limit, so 19% = 7,980. 250,000 is capped at the 100,000 + # trading profit: 60,000; 40,000 at 19% = 7,600. + firm_patent_box_deduction: [240_000, 18_000, 60_000] + corporation_tax: [190_000, 7_980, 7_600] + +- name: Small profits rate company, and the AR boundary at 50,000, 2025-26. + period: 2025 + absolute_error_margin: 0.5 + input: + firm_taxable_trading_profit: [40_000, 50_000, 50_001] + firm_relevant_ip_profits: [20_000, 10_000, 10_000] + output: + firm_patent_box_applicable_rate: [0.19, 0.19, 0.25] + # 20,000 x 9/19 = 9,473.68, CT 19% x 30,526.32 = 5,800. + # 10,000 x 9/19 = 4,736.84, CT 19% x 45,263.16 = 8,600. + # 10,000 x 15/25 = 6,000, profit 44,001 under the lower limit: 8,360.19. + firm_patent_box_deduction: [9_473.68, 4_736.84, 6_000] + corporation_tax: [5_800, 8_600, 8_360.19] + +- name: Phase-in of relevant IP profits, 2015-16 (80%, main rate 20%). + period: 2015 + absolute_error_margin: 0.5 + input: + firm_taxable_trading_profit: [1_000_000] + firm_relevant_ip_profits: [400_000] + output: + # 0.8 x 400,000 x 10/20 = 160,000; 20% x 840,000. + corporation_tax: [168_000] + +- name: Phase-in, 2016-17 (90%, main rate 20%). + period: 2016 + absolute_error_margin: 0.5 + input: + firm_taxable_trading_profit: [1_000_000] + firm_relevant_ip_profits: [400_000] + output: + # 0.9 x 400,000 x 10/20 = 180,000; 20% x 820,000. + corporation_tax: [164_000] + +- name: Full relevant IP profits from April 2017 (main rate 19%). + period: 2017 + absolute_error_margin: 0.5 + input: + firm_taxable_trading_profit: [1_000_000] + firm_relevant_ip_profits: [400_000] + output: + # 400,000 x 9/19 = 189,473.68; 19% x 810,526.32 = 154,000. + corporation_tax: [154_000] + +- name: 2022-23 at the 19% main rate. + period: 2022 + absolute_error_margin: 0.5 + input: + firm_taxable_trading_profit: [1_000_000] + firm_relevant_ip_profits: [400_000] + output: + corporation_tax: [154_000] + +- name: 2023-24 at the 25% main rate. + period: 2023 + absolute_error_margin: 0.5 + input: + firm_taxable_trading_profit: [1_000_000] + firm_relevant_ip_profits: [400_000] + output: + corporation_tax: [190_000] + +- name: No Patent Box before April 2013. + period: 2012 + absolute_error_margin: 0.5 + input: + firm_taxable_trading_profit: [1_000_000] + firm_relevant_ip_profits: [400_000] + output: + firm_patent_box_deduction: [0] + +- name: No Patent Box for a sole trader or on a trading loss. + period: 2025 + absolute_error_margin: 0.5 + input: + firm_legal_form: [SOLE_TRADER, COMPANY] + firm_taxable_trading_profit: [1_000_000, -50_000] + firm_relevant_ip_profits: [400_000, 400_000] + output: + firm_patent_box_deduction: [0, 0] + +- name: The applicable rate ignores carried-forward losses, a documented simplification. + period: 2025 + absolute_error_margin: 0.5 + input: + firm_taxable_trading_profit: [200_000] + firm_relevant_ip_profits: [100_000] + firm_losses_brought_forward: [180_000] + output: + # Pre-deduction profit 200,000 is above the 50,000 lower limit, so AR is + # 25%: 100,000 x 15/25 = 60,000. Losses then cover the 140,000 left. + firm_patent_box_applicable_rate: [0.25] + firm_patent_box_deduction: [60_000] + firm_taxable_profit: [0] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/corporation_tax/rd_relief/rd_relief.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/corporation_tax/rd_relief/rd_relief.yaml new file mode 100644 index 0000000000..962b0de2b6 --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/corporation_tax/rd_relief/rd_relief.yaml @@ -0,0 +1,475 @@ +- name: Case 1, merged scheme credit for a large company and none for a sole trader. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, SOLE_TRADER] + firm_qualifying_rd_expenditure: [1_000_000, 1_000_000] + firm_total_relevant_expenditure: [5_000_000, 5_000_000] + firm_taxable_trading_profit: [2_000_000, 2_000_000] + output: + # 20% x 1,000,000. + firm_rd_expenditure_credit: [200_000, 0] + firm_rd_additional_deduction: [0, 0] + +- name: Case 2, ERIS at 29.9% versus 30% intensity for a loss-making SME. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, COMPANY] + firm_is_sme: [true, true] + firm_qualifying_rd_expenditure: [299_000, 300_000] + firm_total_relevant_expenditure: [1_000_000, 1_000_000] + firm_taxable_trading_profit: [-500_000, -500_000] + output: + # 29.9%: not R&D intensive, so the merged credit: 20% x 299,000 = 59,800. + # 30%: ERIS. Deduction 86% x 300,000 = 258,000. Loss 500,000 + 258,000 = + # 758,000, capped at 300,000 + 258,000 = 558,000. Credit 14.5% x 558,000 + # = 80,910. + firm_is_rd_intensive: [false, true] + firm_claims_rd_sme_relief: [false, true] + firm_rd_expenditure_credit: [59_800, 0] + firm_rd_additional_deduction: [0, 258_000] + firm_rd_surrenderable_loss: [0, 558_000] + firm_rd_payable_credit: [0, 80_910] + +- name: Case 3, ERIS needs a trading loss before the additional deduction. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, COMPANY, COMPANY] + firm_is_sme: [true, true, true] + firm_qualifying_rd_expenditure: [300_000, 300_000, 300_000] + firm_total_relevant_expenditure: [1_000_000, 1_000_000, 1_000_000] + firm_taxable_trading_profit: [-100_000, 100_000, 0] + output: + # Loss of 100,000: deduction 258,000; loss 358,000 below the 558,000 cap; + # credit 14.5% x 358,000 = 51,910. + # Profit of 100,000 or exactly 0: no loss, so the merged credit of + # 20% x 300,000 = 60,000. + firm_rd_additional_deduction: [258_000, 0, 0] + firm_rd_surrenderable_loss: [358_000, 0, 0] + firm_rd_payable_credit: [51_910, 0, 0] + firm_rd_expenditure_credit: [0, 60_000, 60_000] + +- name: Case 4, capital allowances can create the ERIS trading loss. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY] + firm_is_sme: [true] + firm_qualifying_rd_expenditure: [300_000] + firm_total_relevant_expenditure: [1_000_000] + firm_taxable_trading_profit: [100_000] + firm_capex_main_pool_new: [150_000] + output: + # Profit 100,000 - full expensing 150,000 = -50,000. Deduction 258,000; + # loss 308,000; credit 14.5% x 308,000 = 44,660. + firm_rd_additional_deduction: [258_000] + firm_rd_payable_credit: [44_660] + firm_rd_expenditure_credit: [0] + +- name: Case 5, SME scheme for every SME in 2023 before the merger. + period: 2023 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, COMPANY, COMPANY] + firm_is_sme: [true, true, false] + firm_qualifying_rd_expenditure: [100_000, 100_000, 100_000] + firm_total_relevant_expenditure: [1_000_000, 1_000_000, 1_000_000] + firm_taxable_trading_profit: [200_000, -50_000, 200_000] + output: + # Profitable SME: deduction 86% x 100,000 = 86,000, no credit. + # Loss-making SME (10% intensity, below 40%): loss 50,000 + 86,000 = + # 136,000 below the 186,000 cap; credit 10% x 136,000 = 13,600. + # Large company: 20% x 100,000 = 20,000. + firm_rd_additional_deduction: [86_000, 86_000, 0] + firm_rd_payable_credit: [0, 13_600, 0] + firm_rd_expenditure_credit: [0, 0, 20_000] + +- name: Case 6, SME scheme rates in 2022. + period: 2022 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, COMPANY] + firm_is_sme: [true, false] + firm_qualifying_rd_expenditure: [100_000, 100_000] + firm_total_relevant_expenditure: [1_000_000, 1_000_000] + firm_taxable_trading_profit: [-50_000, 200_000] + output: + # SME: deduction 130% x 100,000 = 130,000; loss 180,000 below the 230,000 + # cap; credit 14.5% x 180,000 = 26,100. Large: 13% x 100,000 = 13,000. + firm_rd_additional_deduction: [130_000, 0] + firm_rd_payable_credit: [26_100, 0] + firm_rd_expenditure_credit: [0, 13_000] + +# R&D expenditure credit payable after corporation tax (CTA 2009 s. 1042I). +# Step 1 sets the credit against the year's tax; step 2 (s. 1042K) caps what +# is left at the credit less notional tax on the credit, at the main rate if +# the company has profits chargeable at the main rate ignoring the credit and +# at the small profits rate otherwise. Before April 2024 the RDEC step 2 +# (s. 104N) always used the main rate. The firms are large companies, so all +# R&D goes to the expenditure credit. +- name: Case 7, loss-making company pays notional tax at the small profits rate. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_legal_form: COMPANY + firm_qualifying_rd_expenditure: 1_000_000 + firm_total_relevant_expenditure: 10_000_000 + firm_taxable_trading_profit: -1_000_000 + output: + # Credit 20% x 1,000,000 = 200,000. Profits -1,000,000 + 200,000 < 0, so + # no tax and step 1 leaves 200,000. No profits ignoring the credit, so + # notional tax at 19% x 200,000 = 38,000. Payable 200,000 - 38,000 + # = 162,000. + firm_rd_expenditure_credit: 200_000 + corporation_tax_before_credits: 0 + corporation_tax: 0 + firm_rdec_excess_payable: 162_000 + +- name: Case 8, main-rate company whose step 1 remainder is under the cap. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_legal_form: COMPANY + firm_n_associated_companies: 0 + firm_qualifying_rd_expenditure: 1_000_000 + firm_total_relevant_expenditure: 10_000_000 + firm_taxable_trading_profit: 300_000 + output: + # Credit 200,000. Taxable 300,000 + 200,000 = 500,000, above the + # 250,000 upper limit: tax 25% x 500,000 = 125,000. Step 1 leaves + # 200,000 - 125,000 = 75,000. Profits ignoring the credit are 300,000, + # above the lower limit, so the cap is 200,000 x (1 - 25%) = 150,000. + # Payable 75,000. + corporation_tax_before_credits: 125_000 + corporation_tax: 0 + firm_rdec_excess_payable: 75_000 + +- name: Case 9, main rate for a marginal relief company ignoring the credit. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, COMPANY] + firm_n_associated_companies: [0, 0] + firm_qualifying_rd_expenditure: [500_000, 500_000] + firm_total_relevant_expenditure: [10_000_000, 10_000_000] + firm_taxable_trading_profit: [1_000, 1_000] + firm_exempt_distributions: [60_000, 0] + output: + # Both: credit 20% x 500,000 = 100,000; taxable 1,000 + 100,000 = 101,000. + # First: augmented 161,000, in the marginal relief band. Tax 25% x + # 101,000 - 3/200 x (250,000 - 161,000) x 101,000 / 161,000 = 25,250 + # - 837.48 = 24,412.52. Step 1 leaves 75,587.48. Ignoring the credit, + # taxable 1,000 and augmented 61,000 exceed the 50,000 lower limit, so + # main rate: cap 100,000 x 75% = 75,000. Payable 75,000. + # Second: augmented 101,000. Tax 25,250 - 3/200 x 149,000 = 23,015. Step + # 1 leaves 76,985. Ignoring the credit augmented profits are 1,000, so + # the small profits rate: cap 100,000 x 81% = 81,000. Payable 76,985. + corporation_tax_before_credits: [24_412.52, 23_015] + firm_rdec_excess_payable: [75_000, 76_985] + +- name: Case 10, notional tax at the single 19% main rate in 2022 (s. 104N). + period: 2022 + absolute_error_margin: 0.01 + input: + firm_legal_form: COMPANY + firm_qualifying_rd_expenditure: 1_000_000 + firm_total_relevant_expenditure: 10_000_000 + firm_taxable_trading_profit: -1_000_000 + output: + # Large-company RDEC 13% x 1,000,000 = 130,000; no tax. Notional tax at + # the 19% main rate: 130,000 x 81% = 105,300. + firm_rd_expenditure_credit: 130_000 + firm_rdec_excess_payable: 105_300 + +- name: Case 11, notional tax at the 25% main rate for a loss-maker in 2023 (s. 104N). + period: 2023 + absolute_error_margin: 0.01 + input: + firm_legal_form: COMPANY + firm_qualifying_rd_expenditure: 1_000_000 + firm_total_relevant_expenditure: 10_000_000 + firm_taxable_trading_profit: -1_000_000 + output: + # RDEC 20% x 1,000,000 = 200,000; no tax. Before the merged scheme step 2 + # uses the main rate even with no profits: 200,000 x 75% = 150,000. + firm_rd_expenditure_credit: 200_000 + firm_rdec_excess_payable: 150_000 + +- name: Case 12, merged scheme PAYE and NIC cap binds (s. 1042I step 3, s. 1112B). + period: 2025 + absolute_error_margin: 0.01 + input: + firm_legal_form: COMPANY + firm_qualifying_rd_expenditure: 1_000_000 + firm_total_relevant_expenditure: 10_000_000 + firm_taxable_trading_profit: -1_000_000 + firm_relevant_paye_nic_liabilities: 40_000 + firm_rdec_paye_nic_cap_supplied: true + output: + # As case 7, 162,000 is left after step 2. Cap 20,000 + 3 x 40,000 + # = 140,000 < 162,000, so payable 140,000. + firm_rdec_excess_payable: 140_000 + +- name: Case 13, merged scheme PAYE and NIC cap does not bind. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_legal_form: COMPANY + firm_qualifying_rd_expenditure: 1_000_000 + firm_total_relevant_expenditure: 10_000_000 + firm_taxable_trading_profit: -1_000_000 + firm_relevant_paye_nic_liabilities: 50_000 + firm_rdec_paye_nic_cap_supplied: true + output: + # Cap 20,000 + 3 x 50,000 = 170,000 > 162,000, so payable 162,000. + firm_rdec_excess_payable: 162_000 + +- name: Case 14, merged scheme cap is the 20,000 fixed amount with no PAYE or NIC. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_legal_form: COMPANY + firm_qualifying_rd_expenditure: 1_000_000 + firm_total_relevant_expenditure: 10_000_000 + firm_taxable_trading_profit: -1_000_000 + firm_relevant_paye_nic_liabilities: 0 + firm_rdec_paye_nic_cap_supplied: true + # The pre-2024 input is ignored under the merged scheme. + firm_rd_staff_paye_nic: 0 + output: + # Cap 20,000 + 3 x 0 = 20,000, so payable 20,000. + firm_rdec_excess_payable: 20_000 + +- name: Case 15, cap at PAYE and NIC on R&D staff before April 2024 binds (s. 104N step 3). + period: 2023 + absolute_error_margin: 0.01 + input: + firm_legal_form: COMPANY + firm_qualifying_rd_expenditure: 1_000_000 + firm_total_relevant_expenditure: 10_000_000 + firm_taxable_trading_profit: -1_000_000 + firm_rd_staff_paye_nic: 100_000 + firm_rdec_paye_nic_cap_supplied: true + output: + # As case 11, 150,000 is left after step 2. Cap is the R&D staff PAYE + # and NIC itself, 100,000 < 150,000, so payable 100,000. + firm_rdec_excess_payable: 100_000 + +- name: Case 16, pre-2024 cap does not bind and the merged input is ignored. + period: 2023 + absolute_error_margin: 0.01 + input: + firm_legal_form: COMPANY + firm_qualifying_rd_expenditure: 1_000_000 + firm_total_relevant_expenditure: 10_000_000 + firm_taxable_trading_profit: -1_000_000 + firm_rd_staff_paye_nic: 200_000 + firm_rdec_paye_nic_cap_supplied: true + firm_relevant_paye_nic_liabilities: 0 + output: + # Cap 200,000 > 150,000, so payable 150,000. No 20,000 fixed amount + # before April 2024, and the merged input plays no part. + firm_rdec_excess_payable: 150_000 + +- name: Case 17, defaults leave the cap unsupplied (firm_rdec_paye_nic_cap_supplied false). + period: 2025 + absolute_error_margin: 0.01 + input: + firm_legal_form: COMPANY + firm_qualifying_rd_expenditure: 1_000_000 + firm_total_relevant_expenditure: 10_000_000 + firm_taxable_trading_profit: -1_000_000 + output: + # firm_rdec_paye_nic_cap_supplied defaults to false, so the cap does not + # bind and payable is 162,000 as in case 7 (cases 10 and 11 cover + # 2022 and 2023). + firm_rdec_excess_payable: 162_000 + +- name: Case 18, R&D intensity at the 30% condition in 2025-26. + period: 2025 + absolute_error_margin: 0.000001 + input: + firm_qualifying_rd_expenditure: [299_999, 300_000, 0] + firm_total_relevant_expenditure: [1_000_000, 1_000_000, 0] + output: + # 299,999 / 1,000,000 = 0.299999, below 30%; 300,000 / 1,000,000 = 0.3 + # meets it. A zero total gives an intensity of 0, not a division error. + firm_rd_intensity: [0.299999, 0.3, 0] + firm_is_rd_intensive: [false, true, false] + +- name: Case 19, R&D intensity at the 40% condition in 2023-24. + period: 2023 + input: + firm_qualifying_rd_expenditure: [399_999, 400_000, 300_000] + firm_total_relevant_expenditure: [1_000_000, 1_000_000, 1_000_000] + output: + # 39.9999% is below 40%; 40% meets it; 30% meets the 2024 condition + # but not the 40% that applied in 2023-24. + firm_is_rd_intensive: [false, true, false] + +# Unrelieved loss (CTA 2009 s.1056(2)(a)): the trading loss is reduced by the +# relief that could be had against total profits of the same period, so only +# what non-trading profits cannot absorb is surrenderable. +- name: Case 20, SME loss fully relieved against non-trading profits in 2022. + period: 2022 + absolute_error_margin: 0.01 + input: + firm_legal_form: COMPANY + firm_is_sme: true + firm_qualifying_rd_expenditure: 100_000 + firm_total_relevant_expenditure: 1_000_000 + firm_taxable_trading_profit: -100_000 + firm_non_trading_profits: 400_000 + output: + # 130% x 100,000 = 130,000. + firm_rd_additional_deduction: 130_000 + # Loss 100,000 + 130,000 = 230,000, less 400,000 of non-trading profits, is nil. + firm_rd_surrenderable_loss: 0 + # 14.5% x 0 = 0. + firm_rd_payable_credit: 0 + # 400,000 - 100,000 - 130,000 = 170,000. + firm_taxable_profit: 170_000 + # 19% x 170,000 = 32,300, with no credit to subtract. + firm_only_tax: 32_300 + +- name: Case 21, SME loss partly relieved against non-trading profits in 2022. + period: 2022 + absolute_error_margin: 0.01 + input: + firm_legal_form: COMPANY + firm_is_sme: true + firm_qualifying_rd_expenditure: 100_000 + firm_total_relevant_expenditure: 1_000_000 + firm_taxable_trading_profit: -100_000 + firm_non_trading_profits: 50_000 + output: + # Loss 230,000 - 50,000 = 180,000, below the 100,000 + 130,000 = 230,000 cap. + firm_rd_surrenderable_loss: 180_000 + # 14.5% x 180,000 = 26,100. + firm_rd_payable_credit: 26_100 + # 50,000 - 100,000 - 130,000 < 0, so nil. + firm_taxable_profit: 0 + +- name: Case 22, ERIS loss fully relieved against non-trading profits in 2025. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_legal_form: COMPANY + firm_is_sme: true + firm_n_associated_companies: 0 + firm_qualifying_rd_expenditure: 100_000 + firm_total_relevant_expenditure: 200_000 + firm_taxable_trading_profit: -100_000 + firm_non_trading_profits: 400_000 + output: + # Intensity 100,000 / 200,000 = 50%, at least 30%, with a trading loss: ERIS. + firm_claims_rd_sme_relief: true + # Loss 100,000 + 86% x 100,000 = 186,000, less 400,000 of non-trading profits, is nil. + firm_rd_surrenderable_loss: 0 + # 14.5% x 0 = 0. + firm_rd_payable_credit: 0 + # 400,000 - 100,000 - 86,000 = 214,000. + firm_taxable_profit: 214_000 + # 25% x 214,000 - 3/200 x (250,000 - 214,000) = 53,500 - 540 = 52,960. + firm_only_tax: 52_960 + +# PAYE and NIC cap on the SME payable credit (CTA 2009 s.1058(1)(aa)): from +# accounting periods beginning on or after 1 April 2021, £20,000 plus three +# times the relevant PAYE and NIC liabilities (s.1058(1A), from April 2024 +# s.1112B). +- name: Case 23, SME payable credit capped at the 20,000 fixed amount in 2022. + period: 2022 + absolute_error_margin: 0.01 + input: + firm_legal_form: COMPANY + firm_is_sme: true + firm_qualifying_rd_expenditure: 1_000_000 + firm_total_relevant_expenditure: 2_000_000 + firm_taxable_trading_profit: -1_000_000 + firm_rdec_paye_nic_cap_supplied: true + firm_relevant_paye_nic_liabilities: 0 + output: + # Loss 1,000,000 + 130% x 1,000,000 = 2,300,000, equal to the cap. + firm_rd_surrenderable_loss: 2_300_000 + # min(14.5% x 2,300,000 = 333,500, 20,000 + 3 x 0 = 20,000) = 20,000. + firm_rd_payable_credit: 20_000 + +- name: Case 24, SME payable credit cap does not bind or is not supplied in 2022. + period: 2022 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, COMPANY] + firm_is_sme: [true, true] + firm_qualifying_rd_expenditure: [1_000_000, 1_000_000] + firm_total_relevant_expenditure: [2_000_000, 2_000_000] + firm_taxable_trading_profit: [-1_000_000, -1_000_000] + firm_rdec_paye_nic_cap_supplied: [true, false] + firm_relevant_paye_nic_liabilities: [200_000, 0] + output: + # Cap 20,000 + 3 x 200,000 = 620,000 > 333,500; without the flag no cap: both 333,500. + firm_rd_payable_credit: [333_500, 333_500] + +- name: Case 25, ERIS payable credit cap binds with PAYE and NIC in 2025. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, COMPANY] + firm_is_sme: [true, true] + firm_qualifying_rd_expenditure: [1_000_000, 1_000_000] + firm_total_relevant_expenditure: [1_000_000, 1_000_000] + firm_taxable_trading_profit: [-1_000_000, -1_000_000] + firm_rdec_paye_nic_cap_supplied: [true, true] + firm_relevant_paye_nic_liabilities: [50_000, 0] + output: + # Loss 1,000,000 + 86% x 1,000,000 = 1,860,000, equal to the cap. + firm_rd_surrenderable_loss: [1_860_000, 1_860_000] + # min(14.5% x 1,860,000 = 269,700, 20,000 + 3 x 50,000 = 170,000); min(269,700, 20,000). + firm_rd_payable_credit: [170_000, 20_000] + +- name: Case 26, no SME payable credit cap before accounting periods from April 2021. + period: 2020 + absolute_error_margin: 0.01 + input: + firm_legal_form: COMPANY + firm_is_sme: true + firm_qualifying_rd_expenditure: 1_000_000 + firm_total_relevant_expenditure: 2_000_000 + firm_taxable_trading_profit: -1_000_000 + firm_rdec_paye_nic_cap_supplied: true + firm_relevant_paye_nic_liabilities: 0 + output: + # No cap in 2020-21: 14.5% x 2,300,000 = 333,500. + firm_rd_payable_credit: 333_500 + +- name: Case 27, SME payable credit cap applies from the 2021-22 accounting period. + period: 2021 + absolute_error_margin: 0.01 + input: + firm_legal_form: COMPANY + firm_is_sme: true + firm_qualifying_rd_expenditure: 1_000_000 + firm_total_relevant_expenditure: 2_000_000 + firm_taxable_trading_profit: -1_000_000 + firm_rdec_paye_nic_cap_supplied: true + firm_relevant_paye_nic_liabilities: 10_000 + output: + # min(14.5% x 2,300,000 = 333,500, 20,000 + 3 x 10,000 = 50,000) = 50,000. + firm_rd_payable_credit: 50_000 + +- name: A trading loss surrendered as group relief cannot also be surrendered for the ERIS credit. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_legal_form: [COMPANY, COMPANY] + firm_is_sme: [true, true] + firm_qualifying_rd_expenditure: [300_000, 300_000] + firm_total_relevant_expenditure: [1_000_000, 1_000_000] + firm_taxable_trading_profit: [-100_000, -100_000] + firm_trading_loss_surrendered: [58_000, 500_000] + output: + # Loss 358,000 (as in Case 3) less 58,000 surrendered = 300,000; credit + # 14.5% x 300,000 = 43,500. Surrendering more than the loss leaves 0. + firm_rd_surrenderable_loss: [300_000, 0] + firm_rd_payable_credit: [43_500, 0] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/digital_services_tax/digital_services_tax.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/digital_services_tax/digital_services_tax.yaml new file mode 100644 index 0000000000..545ec15c31 --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/digital_services_tax/digital_services_tax.yaml @@ -0,0 +1,35 @@ +# Digital services tax (Finance Act 2020 Part 2): 2% of the group's UK digital +# services revenues above 25,000,000, where worldwide revenues exceed +# 500,000,000 and UK revenues exceed 25,000,000. +- name: Thresholds, allowance and group share, 2025-26. + period: 2025 + absolute_error_margin: 0.5 + input: + firm_legal_form: [COMPANY, COMPANY, COMPANY, COMPANY, COMPANY, COMPANY, SOLE_TRADER] + firm_uk_digital_services_revenues: [100_000_000, 100_000_000, 25_000_000, 25_001_000, 40_000_000, 100_000_000, 100_000_000] + firm_group_uk_digital_services_revenues: [0, 0, 0, 0, 100_000_000, 0, 0] + firm_group_digital_services_revenues: [500_000_000, 501_000_000, 600_000_000, 600_000_000, 600_000_000, 0, 600_000_000] + output: + # Worldwide not over 500m: 0. 2% x 75m = 1,500,000. UK not over 25m: 0. + # 2% x 1,000 = 20. 2% x 75m x 40/100 = 600,000. Worldwide defaults to the + # UK total: 0. DST applies to any person: 1,500,000. + digital_services_tax: [0, 1_500_000, 0, 20, 600_000, 0, 1_500_000] + +- name: Before April 2020 there is no DST. + period: 2019 + absolute_error_margin: 0.5 + input: + firm_uk_digital_services_revenues: [100_000_000] + firm_group_digital_services_revenues: [600_000_000] + output: + digital_services_tax: [0] + +- name: 2020-21, the first year, firm-only. + period: 2020 + absolute_error_margin: 0.5 + input: + firm_uk_digital_services_revenues: [100_000_000] + firm_group_digital_services_revenues: [600_000_000] + output: + digital_services_tax: [1_500_000] + firm_only_tax: [1_500_000] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/energy_profits_levy/energy_profits_levy.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/energy_profits_levy/energy_profits_levy.yaml new file mode 100644 index 0000000000..f09967e816 --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/energy_profits_levy/energy_profits_levy.yaml @@ -0,0 +1,62 @@ +# Energy profits levy on 1,000,000 of levy profits. The rate is day-weighted +# over 6 April to 5 April: 25% from 26 May 2022, 35% from 1 January 2023, 38% +# from 1 November 2024, 0 from 1 April 2030. +- name: Before the levy, 2021-22. + period: 2021 + absolute_error_margin: 1 + input: + firm_epl_profits: [1_000_000] + output: + energy_profits_levy: [0] + +- name: 2022-23, part year at 25% and 35%. + period: 2022 + absolute_error_margin: 1 + input: + firm_epl_profits: [1_000_000] + output: + # 50 days at 0, 220 at 25%, 95 at 35%: (220 x 0.25 + 95 x 0.35) / 365. + energy_profits_levy: [241_781] + +- name: 2023-24 at 35%. + period: 2023 + absolute_error_margin: 1 + input: + firm_epl_profits: [1_000_000] + output: + energy_profits_levy: [350_000] + +- name: 2024-25, 35% then 38% from 1 November 2024. + period: 2024 + absolute_error_margin: 1 + input: + firm_epl_profits: [1_000_000] + output: + # (209 x 0.35 + 156 x 0.38) / 365. + energy_profits_levy: [362_822] + +- name: 2025-26 at 38%, companies only, no levy on a loss. + period: 2025 + absolute_error_margin: 1 + input: + firm_legal_form: [COMPANY, COMPANY, SOLE_TRADER] + firm_epl_profits: [1_000_000, -1_000_000, 1_000_000] + output: + energy_profits_levy: [380_000, 0, 0] + firm_only_tax: [380_000, 0, 0] + +- name: 2029-30, the last year, with 5 days of the next label at 0. + period: 2029 + absolute_error_margin: 1 + input: + firm_epl_profits: [1_000_000] + output: + energy_profits_levy: [374_795] + +- name: From 2030-31 the levy has ended. + period: 2030 + absolute_error_margin: 1 + input: + firm_epl_profits: [1_000_000] + output: + energy_profits_levy: [0] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/minimum_wage/firm/firm_minimum_wage_cost.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/minimum_wage/firm/firm_minimum_wage_cost.yaml new file mode 100644 index 0000000000..8b0b02f0d1 --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/minimum_wage/firm/firm_minimum_wage_cost.yaml @@ -0,0 +1,137 @@ +# Adult rate (top band of gov.hmrc.minimum_wage.non_apprentice), read at +# 30 April: 2016-17 £7.20, 2026-27 £12.71. +# 2026-27: apprenticeship levy 0.5% less a £15,000 allowance; secondary +# threshold 96.153846 x 52 = 5,000 (to the penny); secondary rate 15%; +# auto-enrolment qualifying earnings band £6,240 to £50,270. + +- name: Case 1, pay that meets the adult rate, or no low-paid hours, costs nothing. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_paybill: [500_000, 100_000, 200_000, 200_000] + firm_low_paid_hours: [10_000, 1_000, 0, 0] + firm_low_paid_paybill: [130_000, 12_710, 50_000, 0] + output: + # 12.71 x 10,000 = 127,100 - 130,000 floored at 0; + # 12.71 x 1,000 = 12,710, exactly the pay, so 0; + # zero hours: 12.71 x 0 - 50,000 floored at 0, and 12.71 x 0 - 0 = 0. + firm_minimum_wage_cost: [0, 0, 0, 0] + # The paybill is unchanged. + firm_paybill_after_minimum_wage: [500_000, 100_000, 200_000, 200_000] + +- name: Case 2, an underpaid block is topped up to the adult rate. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_paybill: [400_000] + firm_low_paid_hours: [10_000] + firm_low_paid_paybill: [100_000] + output: + # 12.71 x 10,000 = 127,100 - 100,000 = 27,100. + firm_minimum_wage_cost: [27_100] + # 400,000 + 27,100. + firm_paybill_after_minimum_wage: [427_100] + +- name: Case 3, 2016 uses the April 2016 national living wage, not the October 2015 rate. + period: 2016 + absolute_error_margin: 0.01 + input: + firm_paybill: [100_000] + firm_low_paid_hours: [1_000] + firm_low_paid_paybill: [6_000] + output: + # 7.20 x 1,000 = 7,200 - 6,000 = 1,200. On 1 January 2016 the rate was + # 6.70, which would give 700. + firm_minimum_wage_cost: [1_200] + +- name: Case 4, the floor lifts the paybill over the levy allowance. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_paybill: [2_990_000, 2_990_000] + firm_low_paid_hours: [20_000, 0] + firm_low_paid_paybill: [234_200, 0] + output: + # 12.71 x 20,000 = 254,200 - 234,200 = 20,000; the twin has no cost. + firm_minimum_wage_cost: [20_000, 0] + # 2,990,000 + 20,000; 2,990,000 + 0. + firm_paybill_after_minimum_wage: [3_010_000, 2_990_000] + # 0.5% x 3,010,000 = 15,050 - 15,000 = 50; + # 0.5% x 2,990,000 = 14,950 - 15,000 floored at 0. + apprenticeship_levy: [50, 0] + +- name: Case 5, the floor raises the default NIC and auto-enrolment bases. + period: 2026 + absolute_error_margin: 1 + input: + firm_paybill: [300_000, 300_000] + firm_employees: [10, 10] + firm_low_paid_hours: [20_000, 0] + firm_low_paid_paybill: [234_200, 0] + output: + # Cost 20,000 as in case 4, so the paybill is 320,000 against 300,000. + firm_paybill_after_minimum_wage: [320_000, 300_000] + # 320,000 - 10 x 5,000 = 270,000; 300,000 - 50,000 = 250,000. + firm_class_1_earnings_above_secondary_threshold: [270_000, 250_000] + # 15% of each. + firm_employer_ni_before_allowance: [40_500, 37_500] + # Average pay 32,000 - 6,240 = 25,760 x 10 = 257,600; + # 30,000 - 6,240 = 23,760 x 10 = 237,600. + firm_auto_enrolment_qualifying_earnings: [257_600, 237_600] + +- name: Case 6, a supplied base above the threshold is unchanged by the floor. + period: 2026 + absolute_error_margin: 1 + input: + firm_paybill: [300_000] + firm_employees: [10] + firm_low_paid_hours: [20_000] + firm_low_paid_paybill: [234_200] + firm_class_1_earnings_above_secondary_threshold: [100_000] + output: + # 12.71 x 20,000 = 254,200 - 234,200 = 20,000. + firm_minimum_wage_cost: [20_000] + # The supplied 100,000 stands: 15% = 15,000. + firm_employer_ni_before_allowance: [15_000] + +- name: Case 7, with a pay split supplied the extra pay falls in the remaining group. + period: 2026 + absolute_error_margin: 1 + input: + firm_paybill: [300_000] + firm_employees: [10] + firm_low_paid_hours: [20_000] + firm_low_paid_paybill: [234_200] + # Two staff at or below the threshold, paid 6,000 in all. + firm_employees_below_secondary_threshold: [2] + firm_paybill_below_secondary_threshold: [6_000] + output: + # 12.71 x 20,000 = 254,200 - 234,200 = 20,000. + firm_minimum_wage_cost: [20_000] + # (320,000 - 6,000) - 8 x 5,000 = 274,000; 15% = 41,100. + firm_class_1_earnings_above_secondary_threshold: [274_000] + firm_employer_ni_before_allowance: [41_100] + +- name: Case 8, no rate before October 2010 and negative inputs count as 0. + period: 2010 + absolute_error_margin: 0.01 + input: + firm_paybill: [3_100_000] + firm_low_paid_hours: [10_000] + firm_low_paid_paybill: [50_000] + output: + # The non-apprentice rates start on 1 October 2010; at 30 April 2010 + # the scale is empty, so the cost is 0 and the levy (0 before + # 2017) is unaffected. + firm_minimum_wage_cost: [0] + apprenticeship_levy: [0] + +- name: Case 9, a negative low-paid paybill counts as 0. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_low_paid_hours: [1_000] + firm_low_paid_paybill: [-5_000] + output: + # 12.71 x 1,000 = 12,710 - 0 = 12,710 (not 17,710). + firm_minimum_wage_cost: [12_710] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/national_insurance/employer/firm/firm_class_1a_ni.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/national_insurance/employer/firm/firm_class_1a_ni.yaml new file mode 100644 index 0000000000..b369afa11b --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/national_insurance/employer/firm/firm_class_1a_ni.yaml @@ -0,0 +1,55 @@ +# SSCBA 1992 s.10: Class 1A = Class 1A percentage x cash equivalent of +# benefits in kind. No threshold. Annual rates are read at 30 April. +- name: Case 1, Class 1A at 15% in 2025-26. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_class_1a_benefits: [100_000, 0, 1] + output: + # 0.15 x 100,000 = 15,000; nothing on no benefits; 0.15 x 1 = 0.15 + # (no threshold). + firm_class_1a_ni: [15_000, 0, 0.15] + +- name: Case 2, Class 1A at 13.8% in 2024-25. + period: 2024 + absolute_error_margin: 0.01 + input: + firm_class_1a_benefits: [100_000] + output: + # 0.138 x 100,000 = 13,800. + firm_class_1a_ni: [13_800] + +- name: Case 3, Class 1A fixed at 14.53% for 2022-23. + period: 2022 + absolute_error_margin: 0.01 + input: + firm_class_1a_benefits: [100_000] + output: + # The 30 April 2022 secondary rate is 15.05%, but the Health and Social + # Care Levy (Repeal) Act 2022 fixes Class 1A at 14.53% for the whole + # year: 0.1453 x 100,000 = 14,530. + firm_class_1a_ni: [14_530] + +- name: Case 4, Class 1A at 13.8% in 2023-24 after the fixed rate ends. + period: 2023 + absolute_error_margin: 0.01 + input: + firm_class_1a_benefits: [100_000] + output: + # 0.138 x 100,000 = 13,800. + firm_class_1a_ni: [13_800] + +- name: Case 5, the Employment Allowance is not set against Class 1A. + period: 2025 + absolute_error_margin: 1 + input: + firm_paybill: [300_000] + firm_employees: [10] + firm_class_1a_benefits: [20_000] + output: + # Secondary Class 1: (300,000 - 10 x 5,000) x 0.15 = 37,500; less the + # 10,500 EA = 27,000, as with no benefits. + employment_allowance: [10_500] + firm_employer_ni: [27_000] + # Class 1A in full: 0.15 x 20,000 = 3,000. + firm_class_1a_ni: [3_000] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/national_insurance/employer/firm/firm_class_1b_ni.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/national_insurance/employer/firm/firm_class_1b_ni.yaml new file mode 100644 index 0000000000..6fe2024dcf --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/national_insurance/employer/firm/firm_class_1b_ni.yaml @@ -0,0 +1,61 @@ +# Class 1B on PAYE settlement agreements (SSCBA 1992 s.10A): the secondary +# percentage of chargeable earnings plus the tax paid, 14.53% in 2022-23. +- name: 2025-26 at 15%. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_psa_chargeable_earnings: [60_000, 0, 1, 0, -5_000] + firm_psa_income_tax: [40_000, 40_000, 0, 0, -1] + output: + firm_class_1b_ni: [15_000, 6_000, 0.15, 0, 0] + +- name: 2024-25 at 13.8%. + period: 2024 + absolute_error_margin: 0.01 + input: + firm_psa_chargeable_earnings: [60_000] + firm_psa_income_tax: [40_000] + output: + firm_class_1b_ni: [13_800] + +- name: 2022-23 at the fixed 14.53%. + period: 2022 + absolute_error_margin: 0.01 + input: + firm_psa_chargeable_earnings: [60_000] + firm_psa_income_tax: [40_000] + output: + firm_class_1b_ni: [14_530] + +- name: 2023-24 back at the secondary percentage, 13.8%. + period: 2023 + absolute_error_margin: 0.01 + input: + firm_psa_chargeable_earnings: [60_000] + firm_psa_income_tax: [40_000] + output: + firm_class_1b_ni: [13_800] + +- name: 2021-22 at 13.8%. + period: 2021 + absolute_error_margin: 0.01 + input: + firm_psa_chargeable_earnings: [60_000] + firm_psa_income_tax: [40_000] + output: + firm_class_1b_ni: [13_800] + +- name: The Employment Allowance cannot be set against Class 1B, which is firm-only. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_paybill: [30_000] + firm_employees: [2] + firm_psa_chargeable_earnings: [6_000] + firm_psa_income_tax: [4_000] + output: + employment_allowance: [3_000] + firm_employer_ni: [0] + firm_class_1b_ni: [1_500] + firm_tax: [1_500] + firm_only_tax: [1_500] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/national_insurance/employer/firm/firm_employer_ni.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/national_insurance/employer/firm/firm_employer_ni.yaml new file mode 100644 index 0000000000..5fe8656f43 --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/national_insurance/employer/firm/firm_employer_ni.yaml @@ -0,0 +1,199 @@ +# 2025-26: secondary threshold 96.153846 x 52 = 5,000; rate 15%; EA 10,500. +- name: Case 1, firm employer NICs in 2025-26 with and without the EA binding. + period: 2025 + absolute_error_margin: 1 + input: + firm_paybill: [300_000, 40_000, 2_000_000] + firm_employees: [10, 2, 40] + output: + # 300,000 - 10 x 5,000 = 250,000; 40,000 - 2 x 5,000 = 30,000; + # 2,000,000 - 40 x 5,000 = 1,800,000. + firm_class_1_earnings_above_secondary_threshold: [250_000, 30_000, 1_800_000] + # 15% of each. + firm_employer_ni_before_allowance: [37_500, 4_500, 270_000] + # min(10,500, liability). + employment_allowance: [10_500, 4_500, 10_500] + firm_employer_ni: [27_000, 0, 259_500] + +# 2024-25: secondary threshold 175 x 52 = 9,100; rate 13.8%; EA 5,000. +- name: Case 2, firm employer NICs in 2024-25. + period: 2024 + absolute_error_margin: 1 + input: + firm_paybill: [300_000] + firm_employees: [10] + output: + # 300,000 - 91,000 = 209,000; x 0.138 = 28,842; less 5,000. + firm_class_1_earnings_above_secondary_threshold: [209_000] + firm_employer_ni_before_allowance: [28_842] + employment_allowance: [5_000] + firm_employer_ni: [23_842] + +- name: Case 3, zero-rated earnings for under-21s, apprentices and freeport staff. + period: 2025 + absolute_error_margin: 1 + input: + firm_paybill: [300_000, 300_000] + firm_employees: [10, 10] + firm_zero_rated_class_1_earnings: [50_000, 400_000] + output: + # (250,000 - 50,000) x 15% = 30,000; zero-rated above the base gives 0. + firm_employer_ni_before_allowance: [30_000, 0] + employment_allowance: [10_500, 0] + firm_employer_ni: [19_500, 0] + +- name: Case 4, supplied earnings above the threshold override the average-pay default. + period: 2025 + absolute_error_margin: 1 + input: + firm_paybill: [300_000] + firm_employees: [10] + firm_class_1_earnings_above_secondary_threshold: [100_000] + output: + # 100,000 x 15% = 15,000; less 10,500. + firm_employer_ni_before_allowance: [15_000] + firm_employer_ni: [4_500] + +- name: Case 5, a paybill below the headcount times the threshold gives no NICs. + period: 2025 + absolute_error_margin: 1 + input: + firm_paybill: [40_000, 0] + firm_employees: [10, 0] + output: + # 40,000 - 50,000 < 0. + firm_class_1_earnings_above_secondary_threshold: [0, 0] + firm_employer_ni: [0, 0] + +- name: Case 6, staff supplied as paid below the secondary threshold leave the average. + period: 2025 + absolute_error_margin: 1 + input: + firm_paybill: [300_000, 300_000, 20_000] + firm_employees: [10, 10, 5] + firm_employees_below_secondary_threshold: [3, 0, 5] + firm_paybill_below_secondary_threshold: [12_000, 0, 20_000] + output: + # Firm 1: 3 staff paid 4,000 each (12,000) are below 5,000. + # (300,000 - 12,000) - (10 - 3) x 5,000 = 288,000 - 35,000 = 253,000, + # against 250,000 from the plain average. + # Firm 2: no split supplied, the plain average: 300,000 - 50,000 = 250,000. + # Firm 3: every employee below the threshold: 0 - 0 x 5,000 = 0. + firm_class_1_earnings_above_secondary_threshold: [253_000, 250_000, 0] + # 15% of each: 37,950; 37,500; 0. + firm_employer_ni_before_allowance: [37_950, 37_500, 0] + # Less the 10,500 Employment Allowance (capped at the liability). + firm_employer_ni: [27_450, 27_000, 0] + +- name: Case 7, inconsistent pay-distribution inputs are clipped. + period: 2025 + absolute_error_margin: 1 + input: + firm_paybill: [200_000, 300_000, 300_000, 20_000] + firm_employees: [10, 10, 10, 5] + firm_employees_below_secondary_threshold: [15, -3, 3, 5] + firm_paybill_below_secondary_threshold: [60_000, -12_000, 40_000, 30_000] + output: + # Secondary threshold 5,000. + # Firm 1: headcount 15 capped at 10; paybill 60,000 capped at + # min(200,000, 10 x 5,000) = 50,000. (200,000 - 50,000) - 0 x 5,000 = 150,000. + # Firm 2: negative inputs floored at 0, the plain average: + # 300,000 - 10 x 5,000 = 250,000. + # Firm 3: paybill 40,000 capped at 3 x 5,000 = 15,000. + # (300,000 - 15,000) - 7 x 5,000 = 285,000 - 35,000 = 250,000. + # Firm 4: paybill 30,000 capped at min(20,000, 25,000) = 20,000. + # (20,000 - 20,000) - 0 x 5,000 = 0. + firm_class_1_earnings_above_secondary_threshold: [150_000, 250_000, 250_000, 0] + +# The same firm in every case below: 10 staff, paybill 500,000. +- name: Case 8, Employment Allowance at exactly 100,000 of prior-year liabilities in 2024-25. + period: 2024 + absolute_error_margin: 0.01 + input: + firm_claims_employment_allowance: [true, true, true] + firm_employees: [10, 10, 10] + firm_paybill: [500_000, 500_000, 500_000] + firm_prior_year_secondary_class_1_liabilities: [99_999.99, 100_000, 100_000.01] + output: + # NICA 2014 s.2(4B): no allowance where the prior year's secondary Class 1 + # liabilities were 100,000 or more. Float32 keeps 99,999.99 below and + # 100,000.01 above 100,000 (spacing about 0.008). + employment_allowance_eligible: [true, false, false] + # (500,000 - 10 x 9,100) x 13.8% = 409,000 x 0.138 = 56,442. + firm_employer_ni_before_allowance: [56_442, 56_442, 56_442] + # min(5,000, 56,442) = 5,000 for the eligible firm only. + employment_allowance: [5_000, 0, 0] + # 56,442 - 5,000 = 51,442; 56,442; 56,442. + firm_employer_ni: [51_442, 56_442, 56_442] + +- name: Case 9, no prior-year liability test from 2025-26. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_claims_employment_allowance: [true] + firm_employees: [10] + firm_paybill: [500_000] + firm_prior_year_secondary_class_1_liabilities: [1_000_000] + output: + # The 100,000 test was removed from 6 April 2025, so 1,000,000 of + # prior-year liabilities still gets min(10,500, 67,500) = 10,500. + employment_allowance: [10_500] + # (500,000 - 10 x 5,000) x 15% = 67,500; less 10,500 = 57,000. + firm_employer_ni: [57_000] + +- name: Case 10, the same firm in 2023-24. + period: 2023 + absolute_error_margin: 0.01 + input: + firm_employees: [10] + firm_paybill: [500_000] + output: + # Secondary threshold 175 x 52 = 9,100; rate 13.8%: + # (500,000 - 91,000) x 0.138 = 56,442. + firm_employer_ni_before_allowance: [56_442] + # Less the 5,000 Employment Allowance (firm_claims_employment_allowance + # defaults to true): 51,442. + firm_employer_ni: [51_442] + +- name: Case 11, the same firm in 2026-27. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_employees: [10] + firm_paybill: [500_000] + output: + # Secondary threshold 96.153846 x 52 = 5,000; rate 15%: + # (500,000 - 50,000) x 0.15 = 67,500. + firm_employer_ni_before_allowance: [67_500] + # Less the 10,500 Employment Allowance: 57,000. + firm_employer_ni: [57_000] + +# Precedence of the employer NIC base, 2025-26 (threshold 5,000): a supplied +# base, then the pay split, then the plain average. +- name: Edge cases of the pay split. + period: 2025 + absolute_error_margin: 1 + input: + firm_paybill: [300_000, 300_000, 300_000] + firm_employees: [10, 10, 10] + firm_employees_below_secondary_threshold: [4, 0, 4] + firm_paybill_below_secondary_threshold: [12_000, 12_000, 0] + output: + # The split: 288,000 - 30,000 = 258,000. Pay without a headcount is + # capped at 0 x the threshold, so ignored: 250,000. A headcount without + # pay treats those staff as paid 0: 300,000 - 6 x 5,000 = 270,000. + firm_class_1_earnings_above_secondary_threshold: [258_000, 250_000, 270_000] + +- name: A supplied base is used as given, even with a pay split. + period: 2025 + absolute_error_margin: 1 + input: + firm_paybill: [300_000] + firm_employees: [10] + firm_employees_below_secondary_threshold: [4] + firm_paybill_below_secondary_threshold: [12_000] + firm_class_1_earnings_above_secondary_threshold: [100_000] + output: + # The split alone would give 258,000. + firm_class_1_earnings_above_secondary_threshold: [100_000] + firm_employer_ni_before_allowance: [15_000] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/national_insurance/employer/firm/firm_employer_ni_freeport.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/national_insurance/employer/firm/firm_employer_ni_freeport.yaml new file mode 100644 index 0000000000..5362d166ec --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/national_insurance/employer/firm/firm_employer_ni_freeport.yaml @@ -0,0 +1,25 @@ +# Freeport and investment zone employer NIC relief (NICA 2022 s.1) gives a 0% +# secondary rate on an eligible employee's earnings up to the freeport upper +# secondary threshold. The firm model takes those earnings through +# firm_zero_rated_class_1_earnings; firm_in_freeport alone changes nothing. +# 2025-26: secondary threshold 5,000 a year; rate 15%; EA 10,500. +- name: Case 1, freeport and investment zone relief passes through the zero-rated earnings input. + period: 2025 + absolute_error_margin: 1 + input: + firm_paybill: [1_000_000, 1_000_000, 1_000_000] + firm_employees: [20, 20, 20] + firm_in_freeport: [false, true, true] + # Firm 3: 10 eligible staff each earning at least 25,000, the freeport + # upper secondary threshold, so each has 25,000 - 5,000 = 20,000 zero-rated: + # 10 x 20,000 = 200,000. The model has no freeport threshold parameter, so + # the caller computes this. + firm_zero_rated_class_1_earnings: [0, 0, 200_000] + output: + # 1,000,000 - 20 x 5,000 = 900,000 above the threshold for all three. + firm_class_1_earnings_above_secondary_threshold: [900_000, 900_000, 900_000] + # Firms 1 and 2: 0.15 x 900,000 = 135,000 (the flag alone gives no relief). + # Firm 3: 0.15 x (900,000 - 200,000) = 105,000. + firm_employer_ni_before_allowance: [135_000, 135_000, 105_000] + # Less the 10,500 EA. + firm_employer_ni: [124_500, 124_500, 94_500] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/national_insurance/employer/firm/firm_off_payroll_employer_ni.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/national_insurance/employer/firm/firm_off_payroll_employer_ni.yaml new file mode 100644 index 0000000000..651997abaa --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/national_insurance/employer/firm/firm_off_payroll_employer_ni.yaml @@ -0,0 +1,109 @@ +# Off-payroll working rules (SI 2000/727 regs 14, 17, 18). Secondary threshold +# x 52: 5,000 (2025-26), 9,100 (2022-23 to 2024-25), 8,840 (2021-22), 8,788 +# (2020-21). Rates 15% (2025-26), 13.8% (2023-24, 2024-25 and 2020-21 to +# 2021-22), 15.05% (2022-23 read at 30 April). +- name: Deemed payments above the threshold for each deemed worker, 2025-26. + period: 2025 + absolute_error_margin: 1 + input: + firm_off_payroll_deemed_payments: [100_000, 100_000, 100_000, 0, -50_000] + firm_off_payroll_deemed_workers: [2, 0, 30, 0, -3] + output: + # (100,000 - 10,000) x 15%; no workers so no threshold; 30 x 5,000 + # covers it; nothing; negatives count as 0. + firm_off_payroll_employer_ni: [13_500, 15_000, 0, 0, 0] + +- name: 2024-25 at 13.8% above 9,100 per worker. + period: 2024 + absolute_error_margin: 1 + input: + firm_off_payroll_deemed_payments: [100_000] + firm_off_payroll_deemed_workers: [2] + output: + # (100,000 - 18,200) x 13.8% = 11,288.40. + firm_off_payroll_employer_ni: [11_288.4] + +- name: 2022-23 at 15.05%. + period: 2022 + absolute_error_margin: 1 + input: + firm_off_payroll_deemed_payments: [100_000] + firm_off_payroll_deemed_workers: [2] + output: + # 81,800 x 15.05% = 12,310.90. + firm_off_payroll_employer_ni: [12_310.9] + +- name: Before April 2021 only public authority clients are fee-payers. + period: 2020 + absolute_error_margin: 1 + input: + firm_off_payroll_deemed_payments: [100_000, 100_000] + firm_off_payroll_deemed_workers: [2, 2] + firm_is_public_body: [false, true] + output: + # (100,000 - 17,576) x 13.8% = 11,374.51. + firm_off_payroll_employer_ni: [0, 11_374.51] + firm_off_payroll_levy_earnings: [0, 100_000] + +- name: From April 2021 private clients are fee-payers too. + period: 2021 + absolute_error_margin: 1 + input: + firm_off_payroll_deemed_payments: [100_000] + firm_off_payroll_deemed_workers: [2] + output: + # (100,000 - 17,680) x 13.8% = 11,360.16. + firm_off_payroll_employer_ni: [11_360.16] + +- name: Before April 2017 there are no off-payroll contributions. + period: 2016 + absolute_error_margin: 1 + input: + firm_off_payroll_deemed_payments: [100_000] + firm_is_public_body: [true] + output: + firm_off_payroll_employer_ni: [0] + firm_off_payroll_levy_earnings: [0] + +- name: The Employment Allowance cannot be set against off-payroll contributions. + period: 2025 + absolute_error_margin: 1 + input: + firm_paybill: [30_000] + firm_employees: [2] + firm_off_payroll_deemed_payments: [100_000] + firm_off_payroll_deemed_workers: [2] + output: + # Own payroll: (30,000 - 10,000) x 15% = 3,000, all covered. + employment_allowance: [3_000] + firm_employer_ni: [0] + firm_off_payroll_employer_ni: [13_500] + firm_tax: [13_500] + # Off-payroll NIC is not firm-only; the levy is 0 under the allowance. + firm_only_tax: [0] + +- name: Off-payroll contributions do not count towards the allowance cap, 2024-25. + period: 2024 + absolute_error_margin: 1 + input: + firm_paybill: [800_000] + firm_employees: [10] + firm_off_payroll_deemed_payments: [500_000] + firm_off_payroll_deemed_workers: [5] + output: + # (800,000 - 91,000) x 13.8% = 97,842; (500,000 - 45,500) x 13.8% = 62,721. + firm_employer_ni_before_allowance: [97_842] + employment_allowance: [5_000] + firm_off_payroll_employer_ni: [62_721] + +- name: Deemed payments count in the apprenticeship levy pay bill. + period: 2025 + absolute_error_margin: 1 + input: + firm_paybill: [2_900_000, 2_900_000] + firm_employees: [100, 100] + firm_off_payroll_deemed_payments: [0, 200_000] + output: + # 0.5% x 2,900,000 = 14,500 is under the allowance; 0.5% x 3,100,000 = + # 15,500 less 15,000 = 500. + apprenticeship_levy: [0, 500] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/national_insurance/employer/firm/firm_termination_award_class_1a_ni.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/national_insurance/employer/firm/firm_termination_award_class_1a_ni.yaml new file mode 100644 index 0000000000..983fbdf0d0 --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/national_insurance/employer/firm/firm_termination_award_class_1a_ni.yaml @@ -0,0 +1,65 @@ +# Class 1A on termination awards above 30,000 (SSCBA 1992 s.10(1A); ITEPA +# 2003 s.403), from 6 April 2020, at the secondary Class 1 percentage. +- name: The 30,000 threshold, 2025-26 at 15%. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_termination_awards: [30_000, 30_001, 130_000, 250_000, 100_000, 50_000, -1] + firm_termination_award_recipients: [1, 1, 1, 5, 5, 0, 0] + output: + # 0; 1 x 15%; 100,000 x 15%; (250,000 - 150,000) x 15%; 0; 50,000 + # treated as above the threshold; 0. + firm_termination_award_class_1a_ni: [0, 0.15, 15_000, 15_000, 0, 7_500, 0] + +- name: 2024-25 at 13.8%. + period: 2024 + absolute_error_margin: 0.01 + input: + firm_termination_awards: [130_000] + firm_termination_award_recipients: [1] + output: + firm_termination_award_class_1a_ni: [13_800] + +- name: 2022-23 at 15.05%, not the fixed 14.53% for benefits in kind. + period: 2022 + absolute_error_margin: 0.01 + input: + firm_termination_awards: [130_000] + firm_termination_award_recipients: [1] + firm_class_1a_benefits: [100_000] + output: + firm_termination_award_class_1a_ni: [15_050] + firm_class_1a_ni: [14_530] + +- name: 2020-21, the first year, at 13.8%. + period: 2020 + absolute_error_margin: 0.01 + input: + firm_termination_awards: [130_000] + firm_termination_award_recipients: [1] + output: + firm_termination_award_class_1a_ni: [13_800] + +- name: Before April 2020 there is no Class 1A on termination awards. + period: 2019 + absolute_error_margin: 0.01 + input: + firm_termination_awards: [130_000] + firm_termination_award_recipients: [1] + output: + firm_termination_award_class_1a_ni: [0] + +- name: The Employment Allowance cannot be set against it, and it is firm-only. + period: 2025 + absolute_error_margin: 0.01 + input: + firm_paybill: [30_000] + firm_employees: [2] + firm_termination_awards: [130_000] + firm_termination_award_recipients: [1] + output: + employment_allowance: [3_000] + firm_employer_ni: [0] + apprenticeship_levy: [0] + firm_tax: [15_000] + firm_only_tax: [15_000] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/national_insurance/employment_allowance/employment_allowance.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/national_insurance/employment_allowance/employment_allowance.yaml new file mode 100644 index 0000000000..0a5b22e625 --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/national_insurance/employment_allowance/employment_allowance.yaml @@ -0,0 +1,76 @@ +# Firm: paybill 300,000 and 10 employees. 2025-26 liability 37,500 (see +# firm_employer_ni.yaml); 2024-25 liability 28,842. +- name: Case 1, ineligible firms in 2025-26. + period: 2025 + absolute_error_margin: 1 + input: + firm_paybill: [300_000, 300_000, 300_000, 300_000, 300_000] + firm_employees: [10, 10, 10, 10, 10] + firm_is_single_director_company: [true, false, false, false, false] + firm_is_public_body: [false, true, true, false, false] + firm_is_charity: [false, false, true, false, false] + firm_claims_employment_allowance: [true, true, true, false, true] + # The £100,000 test no longer applies from 2025-26. + firm_prior_year_secondary_class_1_liabilities: [0, 0, 0, 0, 1_000_000] + output: + # Single director; public body; public body that is a charity (eligible); + # non-claiming group member; large prior-year liabilities (eligible). + employment_allowance_eligible: [false, false, true, false, true] + employment_allowance: [0, 0, 10_500, 0, 10_500] + firm_employer_ni: [37_500, 37_500, 27_000, 37_500, 27_000] + +- name: Case 2, the £100,000 prior-year liabilities test in 2024-25. + period: 2024 + absolute_error_margin: 1 + input: + firm_paybill: [300_000, 300_000] + firm_employees: [10, 10] + firm_prior_year_secondary_class_1_liabilities: [99_999, 100_000] + output: + # "£100,000 or more" excludes. + employment_allowance_eligible: [true, false] + employment_allowance: [5_000, 0] + +- name: Case 3, single-director companies could claim before 2016-17. + period: 2015 + absolute_error_margin: 1 + input: + firm_paybill: [300_000] + firm_employees: [10] + firm_is_single_director_company: [true] + output: + # 2015-16 EA 2,000; liability (300,000 - 10 x 8,112) x 13.8% = 30,205.44. + employment_allowance_eligible: [true] + employment_allowance: [2_000] + +- name: Case 4, EA amounts by tax year. + period: 2021 + absolute_error_margin: 1 + input: + firm_paybill: [300_000] + firm_employees: [10] + output: + employment_allowance: [4_000] + +- name: Case 5, the default prior-year liabilities exclude a large employer in 2024-25. + period: 2024 + absolute_error_margin: 1 + input: + firm_paybill: [1_000_000] + firm_employees: [10] + output: + # (1,000,000 - 10 x 9,100) x 13.8% = 125,442, taken as the prior-year + # liabilities; 125,442 >= 100,000 excludes. + firm_prior_year_secondary_class_1_liabilities: [125_442] + employment_allowance_eligible: [false] + employment_allowance: [0] + firm_employer_ni: [125_442] + +- name: Case 6, the £3,000 allowance in 2019-20. + period: 2019 + absolute_error_margin: 1 + input: + firm_paybill: [300_000] + firm_employees: [10] + output: + employment_allowance: [3_000] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/plastic_packaging_tax/plastic_packaging_tax.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/plastic_packaging_tax/plastic_packaging_tax.yaml new file mode 100644 index 0000000000..0f18fe8fbd --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/plastic_packaging_tax/plastic_packaging_tax.yaml @@ -0,0 +1,62 @@ +# Plastic packaging tax (Finance Act 2021 Part 2), 100 chargeable tonnes. +- name: Before the tax, 2021-22. + absolute_error_margin: 0.01 + period: 2021 + input: + firm_plastic_packaging_tonnes_chargeable: [100] + output: + plastic_packaging_tax: [0] + +- name: 2022-23, £200 a tonne. + absolute_error_margin: 0.01 + period: 2022 + input: + firm_plastic_packaging_tonnes_chargeable: [100] + output: + plastic_packaging_tax: [20_000] + +- name: 2023-24, £210.82 a tonne. + absolute_error_margin: 0.01 + period: 2023 + input: + firm_plastic_packaging_tonnes_chargeable: [100] + output: + plastic_packaging_tax: [21_082] + +- name: 2024-25, £217.85 a tonne. + absolute_error_margin: 0.01 + period: 2024 + input: + firm_plastic_packaging_tonnes_chargeable: [100] + output: + plastic_packaging_tax: [21_785] + +- name: 2025-26, £223.69 a tonne. + absolute_error_margin: 0.01 + period: 2025 + input: + firm_plastic_packaging_tonnes_chargeable: [100] + output: + plastic_packaging_tax: [22_369] + +- name: 2026-27, £228.82 a tonne, with a part tonne. + absolute_error_margin: 0.01 + period: 2026 + input: + firm_plastic_packaging_tonnes_chargeable: [100, 10.5] + output: + # 10.5 x 228.82 = 2,402.61. + plastic_packaging_tax: [22_882, 2_402.61] + +- name: The 10 tonne registration test, 2025-26. + absolute_error_margin: 0.01 + period: 2025 + input: + firm_plastic_packaging_tonnes_chargeable: [9.999, 10, 4, 0, 12] + firm_plastic_packaging_tonnes_total: [9.999, 10, 10, 50, 0] + output: + # Under 10 tonnes is not liable to register. At 10 tonnes it is: + # 10 x 223.69 = 2,236.90. 4 chargeable of 10 in total: 894.76. Nothing + # chargeable: 0. A total below the chargeable tonnes counts as the + # chargeable tonnes: 12 x 223.69 = 2,684.28. + plastic_packaging_tax: [0, 2_236.90, 894.76, 0, 2_684.28] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/residential_property_developer_tax/residential_property_developer_tax.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/residential_property_developer_tax/residential_property_developer_tax.yaml new file mode 100644 index 0000000000..32a3c4cc9a --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/residential_property_developer_tax/residential_property_developer_tax.yaml @@ -0,0 +1,44 @@ +# Residential property developer tax (Finance Act 2022 Part 2): 4% above the +# 25,000,000 allowance, shared within a group. +- name: The allowance boundary and group share, 2025-26. + period: 2025 + absolute_error_margin: 0.5 + input: + firm_legal_form: [COMPANY, COMPANY, COMPANY, COMPANY, COMPANY, SOLE_TRADER] + firm_rpd_profits: [25_000_000, 25_001_000, 100_000_000, 30_000_000, -5_000_000, 100_000_000] + firm_rpdt_allowance_share: [1, 1, 1, 0.4, 1, 1] + output: + # 0; 4% x 1,000 = 40; 4% x 75,000,000; 4% x (30,000,000 - 10,000,000); + # a loss pays 0; a sole trader is not a company. + residential_property_developer_tax: [0, 40, 3_000_000, 800_000, 0, 0] + +- name: Before April 2022 there is no RPDT. + period: 2021 + absolute_error_margin: 0.5 + input: + firm_rpd_profits: [100_000_000] + output: + residential_property_developer_tax: [0] + +- name: 2022-23, the first year, and no change to corporation tax. + period: 2022 + absolute_error_margin: 1 + input: + firm_rpd_profits: [100_000_000] + firm_taxable_trading_profit: [100_000_000] + output: + residential_property_developer_tax: [3_000_000] + # 19% main rate in 2022-23; RPDT is not deductible. + corporation_tax: [19_000_000] + firm_tax: [22_000_000] + firm_only_tax: [22_000_000] + +- name: The allowance share is clipped to between 0 and 1. + period: 2025 + absolute_error_margin: 0.5 + input: + firm_rpd_profits: [100_000_000, 100_000_000] + firm_rpdt_allowance_share: [-1, 3] + output: + # Share 0: 4% x 100m; share 1: 4% x 75m. + residential_property_developer_tax: [4_000_000, 3_000_000] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/soft_drinks_industry_levy/soft_drinks_industry_levy.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/soft_drinks_industry_levy/soft_drinks_industry_levy.yaml new file mode 100644 index 0000000000..bdbd91feba --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/soft_drinks_industry_levy/soft_drinks_industry_levy.yaml @@ -0,0 +1,73 @@ +# Soft drinks industry levy (Finance Act 2017 Part 2). 2,000,000 litres at the +# higher rate and 3,000,000 at the lower rate in each year. +- name: Year transitions, before the levy and at each rate change. + absolute_error_margin: 0.5 + period: 2017 + input: + firm_sdil_litres_higher_rate: [2_000_000] + firm_sdil_litres_lower_rate: [3_000_000] + output: + soft_drinks_industry_levy: [0] + +- name: 2018-19 rates, 24p and 18p. + absolute_error_margin: 0.5 + period: 2018 + input: + firm_sdil_litres_higher_rate: [2_000_000] + firm_sdil_litres_lower_rate: [3_000_000] + output: + # 480,000 + 540,000. + soft_drinks_industry_levy: [1_020_000] + +- name: 2024-25 still at the 2018 rates. + absolute_error_margin: 0.5 + period: 2024 + input: + firm_sdil_litres_higher_rate: [2_000_000] + firm_sdil_litres_lower_rate: [3_000_000] + output: + soft_drinks_industry_levy: [1_020_000] + +- name: 2025-26 rates, 25.9p and 19.4p. + absolute_error_margin: 0.5 + period: 2025 + input: + firm_sdil_litres_higher_rate: [2_000_000] + firm_sdil_litres_lower_rate: [3_000_000] + output: + # 518,000 + 582,000. + soft_drinks_industry_levy: [1_100_000] + +- name: 2026-27 rates, 27.8p and 20.8p. + absolute_error_margin: 0.5 + period: 2026 + input: + firm_sdil_litres_higher_rate: [2_000_000] + firm_sdil_litres_lower_rate: [3_000_000] + output: + # 556,000 + 624,000. + soft_drinks_industry_levy: [1_180_000] + +- name: Small producer boundary at 1 million litres, and supplied group production. + absolute_error_margin: 0.5 + period: 2025 + input: + firm_sdil_litres_higher_rate: [1_000_000, 1_000_001, 500_000, 0] + firm_sdil_annual_production_litres: [1_000_000, 1_000_001, 1_500_000, 0] + output: + # Exactly 1 million litres is not more than the limit, so exempt. + # 1,000,001 x 0.259 = 259,000.26. 500,000 x 0.259 = 129,500, since the + # group produces more than 1 million litres. + soft_drinks_industry_levy: [0, 259_000, 129_500, 0] + firm_tax: [0, 259_000, 129_500, 0] + firm_only_tax: [0, 259_000, 129_500, 0] + +- name: A supplied production of 0 is read as not supplied. + absolute_error_margin: 0.5 + period: 2025 + input: + firm_sdil_litres_higher_rate: [2_000_000] + firm_sdil_annual_production_litres: [0] + output: + # Own litres 2,000,000 are used for the small producer test. + soft_drinks_industry_levy: [518_000] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/vat/firm/firm_vat_flat_rate_scheme.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/vat/firm/firm_vat_flat_rate_scheme.yaml new file mode 100644 index 0000000000..37bf4305a5 --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/vat/firm/firm_vat_flat_rate_scheme.yaml @@ -0,0 +1,77 @@ +# Flat rate scheme (VAT Regulations 1995 Part VIIA; Notice 733). +# Liability = flat rate % x VAT-inclusive turnover (all supplies incl. VAT, +# exempt included). No input VAT recovery. Joining limit £150,000 taxable +# turnover ex-VAT. Limited cost trader rate 16.5%; default sector rate 12% +# ("any other activity not listed elsewhere"). + +- name: Limited cost trader pays 16.5%, other firm the 12% default + period: 2025 + absolute_error_margin: 0.01 + input: + firm_standard_rated_supplies: [100_000, 100_000] + firm_input_vat: [3_000, 3_000] + firm_uses_flat_rate_scheme: [true, true] + firm_is_limited_cost_trader: [true, false] + output: + firm_flat_rate_scheme_eligible: [true, true] + # 100,000 * 1.2 = 120,000 + firm_flat_rate_turnover: [120_000, 120_000] + firm_flat_rate_percentage: [0.165, 0.12] + # 120,000 * 0.165 = 19,800; 120,000 * 0.12 = 14,400 + firm_vat_flat_rate_liability: [19_800, 14_400] + # Normal would be 20,000 - 3,000 = 17,000 + firm_vat_normal_liability: [17_000, 17_000] + firm_vat: [19_800, 14_400] + +- name: Flat rate turnover includes zero-rated and exempt supplies + period: 2025 + absolute_error_margin: 0.01 + input: + firm_standard_rated_supplies: 80_000 + firm_zero_rated_supplies: 20_000 + firm_exempt_supplies: 10_000 + firm_uses_flat_rate_scheme: true + output: + # Taxable 80,000 + 20,000 = 100,000 > 90,000, so registered + firm_vat_registered: true + # 80,000 * 1.2 + 20,000 + 10,000 = 126,000 + firm_flat_rate_turnover: 126_000 + # 126,000 * 0.12 = 15,120 + firm_vat: 15_120 + +- name: Firm above the £150,000 joining limit uses normal accounting + period: 2025 + absolute_error_margin: 0.01 + input: + firm_standard_rated_supplies: [150_000, 160_000] + firm_input_vat: [10_000, 10_000] + firm_uses_flat_rate_scheme: [true, true] + output: + firm_flat_rate_scheme_eligible: [true, false] + # A: 150,000 * 1.2 * 0.12 = 21,600 (flat rate) + # B: 160,000 * 0.2 - 10,000 = 22,000 (normal) + firm_vat_liability_if_registered: [21_600, 22_000] + firm_vat: [21_600, 22_000] + +- name: A supplied sector percentage replaces the default + period: 2025 + absolute_error_margin: 0.01 + input: + firm_standard_rated_supplies: 100_000 + firm_uses_flat_rate_scheme: true + firm_flat_rate_sector_percentage: 0.145 + output: + # 120,000 * 0.145 = 17,400 + firm_vat: 17_400 + +- name: An unregistered firm electing the flat rate scheme pays nothing + period: 2025 + absolute_error_margin: 0.01 + input: + firm_standard_rated_supplies: 50_000 + firm_uses_flat_rate_scheme: true + output: + firm_vat_registered: false + # 50,000 * 1.2 * 0.12 = 7,200 if registered + firm_vat_liability_if_registered: 7_200 + firm_vat: 0 diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/vat/firm/firm_vat_normal_accounting.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/vat/firm/firm_vat_normal_accounting.yaml new file mode 100644 index 0000000000..4ca5957961 --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/vat/firm/firm_vat_normal_accounting.yaml @@ -0,0 +1,78 @@ +# Normal accounting: output VAT (standard 20%, reduced 5%) less input VAT +# recoverable under the partial exemption standard method +# (taxable / (taxable + exempt) supplies). + +- name: Reduced-rated supplies carry VAT at 5% + period: 2025 + input: + firm_standard_rated_supplies: 60_000 + firm_reduced_rated_supplies: 40_000 + firm_input_vat: 8_000 + output: + firm_vat_taxable_turnover: 100_000 + firm_vat_registered: true + # 60,000 * 0.2 + 40,000 * 0.05 = 12,000 + 2,000 = 14,000 + firm_output_vat: 14_000 + firm_recoverable_input_vat: 8_000 + # 14,000 - 8,000 = 6,000 + firm_vat: 6_000 + +- name: Partial exemption restricts input VAT recovery + period: 2025 + absolute_error_margin: 0.01 + input: + firm_standard_rated_supplies: 150_000 + firm_exempt_supplies: 50_000 + firm_input_vat: 20_000 + output: + # 150,000 / (150,000 + 50,000) = 0.75 + firm_partial_exemption_recovery_share: 0.75 + # 20,000 * 0.75 = 15,000 + firm_recoverable_input_vat: 15_000 + # Output 150,000 * 0.2 = 30,000; 30,000 - 15,000 = 15,000 + firm_vat: 15_000 + +- name: A supplied recovery share overrides the standard method + period: 2025 + absolute_error_margin: 0.01 + input: + firm_standard_rated_supplies: 150_000 + firm_exempt_supplies: 50_000 + firm_input_vat: 20_000 + firm_partial_exemption_recovery_share: 0.9 + output: + # 20,000 * 0.9 = 18,000; 30,000 - 18,000 = 12,000 + firm_recoverable_input_vat: 18_000 + firm_vat: 12_000 + +# Partial exemption percentage rounding (SI 1995/2518 reg 101(4)-(5)): up to +# the next whole percent where input tax averages no more than £400,000 a +# month, otherwise up to two decimal places. +- name: Partial exemption percentage is rounded up to a whole number + period: 2025 + absolute_error_margin: 0.01 + input: + firm_standard_rated_supplies: [100_000, 1_000_000, 150_000] + firm_exempt_supplies: [200_000, 10_000, 50_000] + firm_input_vat: [30_000, 100_000, 20_000] + output: + # 100,000 / 300,000 = 33.33% -> 34%; 30,000 x 0.34 = 10,200. + # 1,000,000 / 1,010,000 = 99.0099% -> 100%; 100,000 x 1 = 100,000. + # 150,000 / 200,000 = exactly 75%, unchanged; 20,000 x 0.75 = 15,000. + firm_partial_exemption_recovery_share: [0.34, 1, 0.75] + firm_recoverable_input_vat: [10_200, 100_000, 15_000] + +- name: Above £400,000 a month of input tax the percentage is rounded to two decimals + period: 2025 + absolute_error_margin: 1 + input: + firm_standard_rated_supplies: [100_000_000, 100_000_000] + firm_exempt_supplies: [200_000_000, 200_000_000] + firm_input_vat: [4_800_000, 4_800_012] + output: + # 4,800,000 / 12 = 400,000 a month, not more: 33.33% -> 34%; + # 4,800,000 x 0.34 = 1,632,000. + # 4,800,012 / 12 = 400,001 a month: 33.333...% -> 33.34%; + # 4,800,012 x 0.3334 = 1,600,324. + firm_partial_exemption_recovery_share: [0.34, 0.3334] + firm_recoverable_input_vat: [1_632_000, 1_600_324] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/vat/firm/firm_vat_partial_exemption_de_minimis.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/vat/firm/firm_vat_partial_exemption_de_minimis.yaml new file mode 100644 index 0000000000..300774b58f --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/vat/firm/firm_vat_partial_exemption_de_minimis.yaml @@ -0,0 +1,115 @@ +# Partial exemption de minimis (SI 1995/2518 regs 105A, 106) and direct +# attribution (reg 101(2)). 2025-26: standard rate 20%, threshold 90,000. +# The annual de minimis limit is 625 x 12 = 7,500. +- name: De minimis original test at its 7,500 boundary. + period: 2025 + absolute_error_margin: 0.5 + input: + firm_standard_rated_supplies: [150_000, 150_000] + firm_exempt_supplies: [50_000, 50_000] + firm_input_vat: [30_000, 30_004] + firm_applies_partial_exemption_de_minimis: [true, true] + output: + # Share 75%. Exempt input tax 7,500 (passes, and is under half of + # 30,000) and 7,501 (fails). The second recovers 75% x 30,004 = 22,503. + firm_recoverable_input_vat: [30_000, 22_503] + # Output VAT 30,000. + firm_vat: [0, 7_497] + +- name: The same firms without the de minimis flag use the standard method. + period: 2025 + absolute_error_margin: 0.5 + input: + firm_standard_rated_supplies: [150_000, 150_000] + firm_exempt_supplies: [50_000, 50_000] + firm_input_vat: [30_000, 30_004] + output: + firm_recoverable_input_vat: [22_500, 22_503] + +- name: De minimis half-of-input-tax test and the simplified test's exempt supplies share. + period: 2025 + absolute_error_margin: 0.5 + input: + # Input VAT 10,000. Shares 50%, 49.5% rounded up to 50%, and 49%. + firm_standard_rated_supplies: [100_000, 99_000, 98_000] + firm_exempt_supplies: [100_000, 101_000, 102_000] + firm_input_vat: [10_000, 10_000, 10_000] + firm_applies_partial_exemption_de_minimis: [true, true, true] + output: + # Exempt input 5,000, 5,000 and 5,100: within 7,500, and the first two + # are exactly half of input tax, so pass. The third is over half, and + # its exempt supplies are over half of all supplies, so the simplified + # test fails too. + firm_recoverable_input_vat: [10_000, 10_000, 4_900] + # Output VAT 20,000, 19,800 and 19,600. + firm_vat: [10_000, 9_800, 14_700] + +- name: The simplified test passes where the original test fails. + period: 2025 + absolute_error_margin: 0.5 + input: + firm_standard_rated_supplies: [300_000] + firm_exempt_supplies: [200_000] + firm_input_vat: [6_000] + firm_input_vat_attributable_to_exempt_supplies: [6_000] + firm_applies_partial_exemption_de_minimis: [true] + output: + # All 6,000 is exempt input tax, more than half of input tax, so the + # original test fails. Input tax less taxable-attributable tax is 6,000, + # within 7,500, and exempt supplies are 40% of all supplies. + firm_recoverable_input_vat: [6_000] + firm_vat: [54_000] + +- name: The simplified test does not exist before April 2010. + period: 2009 + absolute_error_margin: 0.5 + input: + firm_standard_rated_supplies: [300_000] + firm_exempt_supplies: [200_000] + firm_input_vat: [6_000] + firm_input_vat_attributable_to_exempt_supplies: [6_000] + firm_applies_partial_exemption_de_minimis: [true] + output: + # The original test fails (6,000 is all of input tax), so nothing is + # recovered. + firm_recoverable_input_vat: [0] + +- name: Direct attribution under the standard method, above the de minimis limits. + period: 2025 + absolute_error_margin: 0.5 + input: + firm_standard_rated_supplies: [600_000] + firm_exempt_supplies: [400_000] + firm_input_vat: [100_000] + firm_input_vat_attributable_to_taxable_supplies: [40_000] + firm_input_vat_attributable_to_exempt_supplies: [10_000] + firm_applies_partial_exemption_de_minimis: [true] + output: + # 40,000 + 60% x 50,000 residual = 70,000. Exempt input 30,000 fails. + firm_recoverable_input_vat: [70_000] + firm_vat: [50_000] + +- name: Attributed input VAT above total input VAT is capped, taxable first. + period: 2025 + absolute_error_margin: 0.5 + input: + firm_standard_rated_supplies: [600_000] + firm_exempt_supplies: [400_000] + firm_input_vat: [100_000] + firm_input_vat_attributable_to_taxable_supplies: [80_000] + firm_input_vat_attributable_to_exempt_supplies: [50_000] + output: + # Taxable 80,000, exempt capped at 20,000, residual 0. + firm_recoverable_input_vat: [80_000] + +- name: The de minimis tests are not applied to negative input VAT. + period: 2025 + absolute_error_margin: 0.5 + input: + firm_standard_rated_supplies: [150_000] + firm_exempt_supplies: [50_000] + firm_input_vat: [-4_000] + firm_applies_partial_exemption_de_minimis: [true] + output: + # The standard method as without the flag: 75% x -4,000. + firm_recoverable_input_vat: [-3_000] diff --git a/policyengine_uk/tests/policy/baseline/gov/hmrc/vat/firm/firm_vat_registration.yaml b/policyengine_uk/tests/policy/baseline/gov/hmrc/vat/firm/firm_vat_registration.yaml new file mode 100644 index 0000000000..30a570e576 --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/hmrc/vat/firm/firm_vat_registration.yaml @@ -0,0 +1,126 @@ +# VAT registration (VATA 1994 Sch 1 para 1): registered when taxable supplies +# (standard + reduced + zero rated, ex-VAT) exceed the threshold, or voluntarily. +# Threshold: £85,000 from 1 April 2017, £90,000 from 1 April 2024. A year's +# parameters are read at 30 April of that year (the fiscal year it starts), +# so 2023 resolves to £85,000 and 2024 and 2025 to £90,000. Standard rate 20%. + +- name: 2025 threshold is £90,000 and must be exceeded + period: 2025 + input: + firm_standard_rated_supplies: [89_000, 90_000, 91_000] + firm_input_vat: [0, 0, 0] + output: + firm_vat_taxable_turnover: [89_000, 90_000, 91_000] + firm_vat_registered: [false, false, true] + # 91,000 * 0.2 = 18,200 + firm_vat_liability_if_registered: [17_800, 18_000, 18_200] + firm_vat: [0, 0, 18_200] + +- name: 2023 threshold is £85,000 and must be exceeded + period: 2023 + input: + firm_standard_rated_supplies: [85_000, 86_000] + output: + firm_vat_registered: [false, true] + # 86,000 * 0.2 = 17,200 + firm_vat: [0, 17_200] + +- name: £88,000 turnover is registered in 2023 (threshold £85,000) + period: 2023 + input: + firm_standard_rated_supplies: 88_000 + output: + firm_vat_registered: true + # 88,000 * 0.2 = 17,600 + firm_output_vat: 17_600 + firm_vat: 17_600 + +- name: £88,000 turnover is not registered in 2025 (threshold £90,000) + period: 2025 + input: + firm_standard_rated_supplies: 88_000 + output: + firm_vat_registered: false + firm_output_vat: 17_600 + firm_vat: 0 + +- name: Zero-rated supplies count towards the threshold and give a repayment + period: 2025 + input: + firm_zero_rated_supplies: 100_000 + firm_input_vat: 5_000 + output: + firm_vat_taxable_turnover: 100_000 + firm_vat_registered: true + firm_output_vat: 0 + # 0 - 5,000 = -5,000 (repayment) + firm_vat: -5_000 + +- name: Exempt supplies do not count towards the threshold + period: 2025 + input: + firm_standard_rated_supplies: 50_000 + firm_exempt_supplies: 60_000 + output: + firm_vat_taxable_turnover: 50_000 + firm_vat_registered: false + firm_vat: 0 + +- name: Voluntary registration below the threshold with a repayment + period: 2025 + input: + firm_standard_rated_supplies: [20_000, 20_000] + firm_input_vat: [6_000, 6_000] + firm_vat_voluntarily_registered: [true, false] + output: + firm_vat_registered: [true, false] + # Output 20,000 * 0.2 = 4,000; 4,000 - 6,000 = -2,000 + firm_output_vat: [4_000, 4_000] + firm_vat_normal_liability: [-2_000, -2_000] + firm_vat: [-2_000, 0] + +- name: Voluntarily registered firm with no supplies recovers all input VAT + period: 2025 + input: + firm_input_vat: 1_000 + firm_vat_voluntarily_registered: true + output: + firm_partial_exemption_recovery_share: 1 + firm_vat: -1_000 + +- name: £90,001 is registered in 2025 (£1 above the £90,000 threshold) + period: 2025 + # Margin 0.01 for float32 storage. + absolute_error_margin: 0.01 + input: + firm_standard_rated_supplies: 90_001 + output: + # 90,001 > 90,000 (Sch 1 para 1(1)(a) "has exceeded"). + firm_vat_registered: true + # 90,001 * 0.2 = 18,000.2 + firm_vat: 18_000.2 + +- name: £85,001 is registered in 2023 (threshold £85,000) + period: 2023 + # Margin 0.01 for float32 storage. + absolute_error_margin: 0.01 + input: + firm_standard_rated_supplies: 85_001 + output: + firm_vat_registered: true + # 85,001 * 0.2 = 17,000.2 + firm_vat: 17_000.2 + +- name: 2024 change year uses the £90,000 threshold in force at 30 April + period: 2024 + # Margin 0.01 for float32 storage. + absolute_error_margin: 0.01 + input: + firm_standard_rated_supplies: [85_001, 88_000, 90_000, 90_001] + output: + # SI 2024/307 raised the threshold to £90,000 from 1 April 2024. Read at + # 30 April 2024, so 85,001 and 88,000 (above the old £85,000) and 90,000 + # (not exceeding) are unregistered; 90,001 is registered. + firm_vat_registered: [false, false, false, true] + # 90,001 * 0.2 = 18,000.2 + firm_vat: [0, 0, 0, 18_000.2] diff --git a/policyengine_uk/tests/policy/integration/firm/integration.yaml b/policyengine_uk/tests/policy/integration/firm/integration.yaml new file mode 100644 index 0000000000..a30f0337f4 --- /dev/null +++ b/policyengine_uk/tests/policy/integration/firm/integration.yaml @@ -0,0 +1,149 @@ +# Firm tax as the sum of its programs, for two companies run through every +# firm-side program at once. Variable-only inputs: each array position is one +# firm (YAML firm tests never use a `firms:` block, which the runner ignores). +# +# Period 2026 is the 2026-27 fiscal year. Its values: employer Class 1 rate 15% above a secondary threshold of £96.153846 a week +# (x 52 = 4,999.999992 a year, about 5,000 per employee); Employment +# Allowance 10,500; apprenticeship levy 0.5% less a 15,000 allowance; +# corporation tax 25% main, 19% small profits, marginal relief fraction 3/200 +# between 50,000 and 250,000; full expensing 100%; RDEC 20%; business rates +# multipliers for England of 43.2p (small, rateable value under 51,000), +# 48p (standard) and 50.8p (high value, 500,000 or more); small business rate +# relief tapering from 12,000 to 15,000; VAT 20% standard rate. + +- name: Case 1, mid-size and small company across every firm program. + period: 2026 + absolute_error_margin: 0.01 + input: + firm_employees: [80, 3] + firm_paybill: [4_000_000, 90_000] + firm_taxable_trading_profit: [1_500_000, 120_000] + firm_capex_main_pool_new: [400_000, 0] + firm_qualifying_rd_expenditure: [200_000, 0] + firm_rateable_value: [200_000, 13_500] + firm_standard_rated_supplies: [8_000_000, 300_000] + firm_zero_rated_supplies: [500_000, 0] + firm_exempt_supplies: [0, 100_000] + firm_input_vat: [900_000, 20_000] + output: + # Employer NI. + # Mid-size: (4,000,000 - 80 x 5,000) x 15% = 3,600,000 x 15% = 540,000. + # Small: (90,000 - 3 x 5,000) x 15% = 75,000 x 15% = 11,250. + firm_employer_ni_before_allowance: [540_000, 11_250] + # Employment Allowance: min(10,500, liability) for both. + employment_allowance: [10_500, 10_500] + # 540,000 - 10,500 = 529,500; 11,250 - 10,500 = 750. + firm_employer_ni: [529_500, 750] + # Apprenticeship levy: 0.5% x 4,000,000 - 15,000 = 5,000; + # 0.5% x 90,000 = 450 < 15,000, so 0. + apprenticeship_levy: [5_000, 0] + # Corporation tax. The mid-size company is not an SME, so it claims RDEC: + # 20% x 200,000 = 40,000, which is taxable and then set against the tax. + firm_rd_expenditure_credit: [40_000, 0] + # Full expensing deducts all 400,000 of new main-pool plant. + firm_capital_allowances: [400_000, 0] + # 1,500,000 + 40,000 - 400,000 = 1,140,000; 120,000. + firm_taxable_profit: [1_140_000, 120_000] + # Mid-size: above the upper limit, 25% x 1,140,000 = 285,000. + # Small: 25% x 120,000 = 30,000 less marginal relief + # 3/200 x (250,000 - 120,000) = 1,950, so 28,050. + firm_marginal_relief: [0, 1_950] + corporation_tax_before_credits: [285_000, 28_050] + # 285,000 - 40,000 RDEC = 245,000. + corporation_tax: [245_000, 28_050] + bank_surcharge: [0, 0] + # Business rates. Mid-size: 200,000 x 48p = 96,000, no relief. + # Small: 13,500 x 43.2p = 5,832, less small business rate relief of + # (15,000 - 13,500) / (15,000 - 12,000) = 50%, so 2,916. + firm_gross_business_rates: [96_000, 5_832] + firm_small_business_rate_relief: [0, 2_916] + firm_business_rates: [96_000, 2_916] + # VAT. Mid-size: output 20% x 8,000,000 = 1,600,000 (zero-rated supplies + # bear none) less input VAT 900,000, fully recoverable: 700,000. + # Small: output 20% x 300,000 = 60,000 less 20,000 x 300/(300+100) + # = 15,000 recoverable under partial exemption: 45,000. + firm_output_vat: [1_600_000, 60_000] + firm_recoverable_input_vat: [900_000, 15_000] + firm_vat: [700_000, 45_000] + # Sum of the parts. + # Mid-size: 245,000 + 0 + 5,000 + 529,500 + 96,000 + 700,000 = 1,575,500. + # Small: 28,050 + 0 + 0 + 750 + 2,916 + 45,000 = 76,716. + firm_tax: [1_575_500, 76_716] + # Firm-only rules: corporation tax, bank surcharge, apprenticeship levy and + # business rates (the Employment Allowance moves with employer NI and is + # left out). + # Mid-size: 245,000 + 0 + 5,000 + 96,000 = 346,000. + # Small: 28,050 + 0 + 0 + 2,916 = 30,966. + firm_only_tax: [346_000, 30_966] + +- name: Case 2, bank with losses brought forward and the bank surcharge. + period: 2026 + # Values are float32: at tens of millions one step is 4, so allow it. + absolute_error_margin: 4 + input: + firm_is_bank: [true] + firm_employees: [1_000] + firm_paybill: [100_000_000] + firm_taxable_trading_profit: [160_000_000] + firm_losses_brought_forward: [10_000_000] + firm_rateable_value: [2_000_000] + output: + # Employer NI: (100,000,000 - 1,000 x 5,000) x 15% = 14,250,000, less the + # 10,500 Employment Allowance = 14,239,500. + firm_employer_ni: [14_239_500] + # Apprenticeship levy: 0.5% x 100,000,000 - 15,000 = 485,000. + apprenticeship_levy: [485_000] + # Losses: at most the 5,000,000 deductions allowance plus 50% of profits + # above it, 5,000,000 + 50% x 155,000,000 = 82,500,000; the 10,000,000 + # brought forward is under that, so all of it is used. + firm_losses_used: [10_000_000] + # 160,000,000 - 10,000,000 = 150,000,000 at 25% = 37,500,000. + firm_taxable_profit: [150_000_000] + corporation_tax: [37_500_000] + # Bank surcharge rate for 2026-27, day-weighted from 6 April 2026: 270 + # days at 3% and 95 days at 6% from 1 January 2027, (270 x 3% + 95 x 6%) + # / 365 = 13.8 / 365. Times (150,000,000 - 100,000,000 allowance) + # = 1,890,410.96. + bank_surcharge: [1_890_410.96] + # Business rates: 2,000,000 x 50.8p high-value multiplier = 1,016,000. + firm_business_rates: [1_016_000] + # firm_tax: 37,500,000 + 1,890,410.96 + 485,000 + 14,239,500 + 1,016,000 + # + 0 VAT = 55,130,910.96. + firm_tax: [55_130_910.96] + # firm_only_tax: 37,500,000 + 1,890,410.96 + 485,000 + 1,016,000 + # = 40,891,410.96. + firm_only_tax: [40_891_410.96] + +- name: Case 3, R&D tax credits paid out reduce firm tax. + period: 2026 + absolute_error_margin: 0.01 + input: + # Lab: an R&D-intensive loss-making SME (qualifying R&D 400,000 of + # 1,000,000 relevant expenditure, intensity 40%). Large company: R&D of + # 400,000 and no trading profit, so its RDEC exceeds its tax. + firm_is_sme: [true, false] + firm_qualifying_rd_expenditure: [400_000, 400_000] + firm_total_relevant_expenditure: [1_000_000, 4_000_000] + firm_taxable_trading_profit: [-200_000, 0] + firm_employees: [10, 0] + firm_paybill: [400_000, 0] + output: + # Lab (ERIS): additional deduction 86% x 400,000 = 344,000; loss + # 200,000 + 344,000 = 544,000, under the cap 400,000 + 344,000 = 744,000; + # payable credit 14.5% x 544,000 = 78,880. + firm_rd_additional_deduction: [344_000, 0] + firm_rd_payable_credit: [78_880, 0] + # Large company (RDEC): 20% x 400,000 = 80,000, taxable; 80,000 is in the + # marginal relief band: 25% x 80,000 - 3/200 x (250,000 - 80,000) + # = 17,450 before credits; the credit discharges it and 62,550 is paid. + firm_rd_expenditure_credit: [0, 80_000] + corporation_tax_before_credits: [0, 17_450] + corporation_tax: [0, 0] + firm_rdec_excess_payable: [0, 62_550] + # Lab employer NI: (400,000 - 10 x 5,000) x 15% = 52,500 less the 10,500 + # Employment Allowance = 42,000. + firm_employer_ni: [42_000, 0] + # firm_tax: 42,000 - 78,880 = -36,880; 0 - 62,550 = -62,550. + firm_tax: [-36_880, -62_550] + # firm_only_tax leaves employer NI out: -78,880 and -62,550. + firm_only_tax: [-78_880, -62_550] diff --git a/policyengine_uk/tests/test_firm_additional_rules.py b/policyengine_uk/tests/test_firm_additional_rules.py new file mode 100644 index 0000000000..28128f258d --- /dev/null +++ b/policyengine_uk/tests/test_firm_additional_rules.py @@ -0,0 +1,314 @@ +"""Tests for the firm rules added in the fourth audit: reform-to-incidence +tests, and a check of every firm input's visibility and the new inputs' +defaults (default-inertness itself rests on the full YAML suite). + +Each test reforms one parameter of a new rule and checks that the weighted +change reaches ``firm_tax_change_total`` and that household +``firm_tax_incidence`` sums (weighted) to it, or, for rules whose rates reach +households elsewhere, that it does not. +""" + +import numpy as np +import pandas as pd +import pytest + +from policyengine_uk import Microsimulation +from policyengine_uk.data import UKSingleYearDataset + +YEAR = 2026 +HOUSEHOLD_WEIGHTS = [100.0, 200.0] +FIRM_WEIGHTS = [5.0, 7.0, 11.0] +ALWAYS = "2020-01-01.2035-12-31" + + +def dataset(**firm_columns) -> UKSingleYearDataset: + firm = { + "firm_id": [1, 2, 3], + "firm_weight": FIRM_WEIGHTS, + "firm_taxable_trading_profit": [1_000_000.0, 100_000.0, 40_000.0], + "firm_paybill": [2_000_000.0, 300_000.0, 0.0], + "firm_employees": [40.0, 8.0, 0.0], + } + firm.update(firm_columns) + return UKSingleYearDataset( + person=pd.DataFrame( + { + "person_id": [1, 2], + "person_benunit_id": [1, 2], + "person_household_id": [1, 2], + "age": [30, 50], + "employment_income": [20_000.0, 60_000.0], + } + ), + benunit=pd.DataFrame({"benunit_id": [1, 2]}), + household=pd.DataFrame( + { + "household_id": [1, 2], + "household_weight": HOUSEHOLD_WEIGHTS, + "region": "LONDON", + "rent": 0.0, + "tenure_type": "OWNED_OUTRIGHT", + "council_tax": 0.0, + "corporate_sector_wealth": [100_000.0, 200_000.0], + } + ), + firm=pd.DataFrame(firm), + fiscal_year=YEAR, + ) + + +def change_total_and_incidence(data, reform): + simulation = Microsimulation(dataset=data, reform=reform) + total = np.asarray(simulation.calculate("firm_tax_change_total", YEAR)) + incidence = np.asarray(simulation.calculate("firm_tax_incidence", YEAR)) + return simulation, total, (incidence * HOUSEHOLD_WEIGHTS).sum() + + +def test_soft_drinks_levy_rate_reform_reaches_firm_incidence(): + # 2026-27 higher rate 27.8p. Firm 1 has 2m litres, firm 2 500,000 (a + # small producer), firm 3 none. At 30p: 2,000,000 x 0.022 = 44,000 for + # firm 1 only; 5 x 44,000 = 220,000. + data = dataset(firm_sdil_litres_higher_rate=[2_000_000.0, 500_000.0, 0.0]) + _, total, incidence = change_total_and_incidence( + data, + {"gov.hmrc.soft_drinks_industry_levy.rate.higher": {ALWAYS: 0.30}}, + ) + assert total == pytest.approx([220_000, 220_000], abs=1) + assert incidence == pytest.approx(220_000, abs=1) + + +def test_plastic_packaging_tax_rate_reform_reaches_firm_incidence(): + # 2026-27 rate 228.82. Firm 1 100 tonnes, firm 2 8 tonnes (under the + # registration threshold), firm 3 20 tonnes. At 300: (300 - 228.82) x + # 100 = 7,118 and x 20 = 1,423.6; 5 x 7,118 + 11 x 1,423.6 = 51,249.6. + data = dataset(firm_plastic_packaging_tonnes_chargeable=[100.0, 8.0, 20.0]) + _, total, incidence = change_total_and_incidence( + data, {"gov.hmrc.plastic_packaging_tax.rate": {ALWAYS: 300}} + ) + assert total == pytest.approx([51_249.6, 51_249.6], abs=1) + assert incidence == pytest.approx(51_249.6, abs=1) + + +def test_partial_exemption_de_minimis_limit_reaches_firm_incidence(): + # Firm 2: 150,000 standard-rated and 50,000 exempt supplies, 30,000 of + # input VAT, de minimis applied: exempt input tax 7,500 is within the + # 7,500 limit, so it recovers all 30,000. With the limits at 0 both + # tests fail and it recovers 75%: VAT rises by 7,500; 7 x 7,500 = 52,500. + data = dataset( + firm_standard_rated_supplies=[0.0, 150_000.0, 0.0], + firm_exempt_supplies=[0.0, 50_000.0, 0.0], + firm_input_vat=[0.0, 30_000.0, 0.0], + firm_applies_partial_exemption_de_minimis=[False, True, False], + ) + simulation, total, incidence = change_total_and_incidence( + data, + { + "gov.hmrc.vat.partial_exemption.de_minimis.monthly_limit": {ALWAYS: 0}, + "gov.hmrc.vat.partial_exemption.de_minimis.simplified.monthly_limit": { + ALWAYS: 0 + }, + }, + ) + baseline_vat = np.asarray(simulation.baseline.calculate("firm_vat", YEAR)) + assert baseline_vat[1] == pytest.approx(0, abs=0.01) + assert total == pytest.approx([52_500, 52_500], abs=1) + assert incidence == pytest.approx(52_500, abs=1) + + +def test_secondary_rate_reform_reaches_class_1b_and_termination_class_1a(): + # Firm 1: PSA earnings 60,000 and tax 40,000; termination awards 130,000 + # for one employee. Raising the secondary rate from 15% to 16% adds 1% x + # 100,000 = 1,000 of Class 1B and 1% x 100,000 = 1,000 of termination + # Class 1A, both firm-only: 5 x 2,000 = 10,000. Firm 1's own employer NIC + # also rises, but that reaches households through ni_employer, and the + # change in its Employment Allowance is 0 (it stays at 10,500). + data = dataset( + firm_psa_chargeable_earnings=[60_000.0, 0.0, 0.0], + firm_psa_income_tax=[40_000.0, 0.0, 0.0], + firm_termination_awards=[130_000.0, 0.0, 0.0], + firm_termination_award_recipients=[1, 0, 0], + ) + simulation, total, incidence = change_total_and_incidence( + data, + { + "gov.hmrc.national_insurance.class_1.employer_scale[1].rate": { + ALWAYS: 0.16 + }, + }, + ) + change = np.asarray(simulation.calculate("firm_class_1b_ni", YEAR)) - np.asarray( + simulation.baseline.calculate("firm_class_1b_ni", YEAR) + ) + assert change == pytest.approx([1_000, 0, 0], abs=0.5) + # Firm 2's allowance: (300,000 - 8 x 5,000) x 15% = 39,000 > 10,500, so + # it is unchanged too. + assert total == pytest.approx([10_000, 10_000], abs=5) + assert incidence == pytest.approx(10_000, abs=5) + + +def test_levy_rate_reform_reaches_incidence_through_off_payroll_payments(): + # Firm 2: paybill 300,000 plus 3,000,000 of deemed payments. Levy at 0.5%: + # 16,500 - 15,000 = 1,500; at 1%: 33,000 - 15,000 = 18,000. Firm 1: + # 10,000 under the allowance, then 20,000 - 15,000 = 5,000. + # 5 x 5,000 + 7 x 16,500 = 140,500. + data = dataset(firm_off_payroll_deemed_payments=[0.0, 3_000_000.0, 0.0]) + _, total, incidence = change_total_and_incidence( + data, {"gov.hmrc.apprenticeship_levy.rate": {ALWAYS: 0.01}} + ) + assert total == pytest.approx([140_500, 140_500], abs=1) + assert incidence == pytest.approx(140_500, abs=1) + + +def test_off_payroll_ni_is_not_firm_only(): + # A rise in the secondary rate changes firm 2's off-payroll NIC but not + # firm_only_tax, since the rate reaches households through ni_employer. + data = dataset( + firm_off_payroll_deemed_payments=[0.0, 100_000.0, 0.0], + firm_off_payroll_deemed_workers=[0, 2, 0], + ) + simulation = Microsimulation( + dataset=data, + reform={ + "gov.hmrc.national_insurance.class_1.employer_scale[1].rate": {ALWAYS: 0.16} + }, + ) + off_payroll = np.asarray(simulation.calculate("firm_off_payroll_employer_ni", YEAR)) + assert off_payroll[1] == pytest.approx(0.16 * 90_000, abs=0.5) + only = np.asarray(simulation.calculate("firm_only_tax", YEAR)) - np.asarray( + simulation.baseline.calculate("firm_only_tax", YEAR) + ) + assert only == pytest.approx([0, 0, 0], abs=0.01) + + +def test_group_relief_changes_a_main_rate_reform_total(): + # Firm 1 claims 600,000 of group relief, leaving 400,000 of profit. A + # main rate rise from 25% to 26% then adds 1% x 400,000 = 4,000 for firm + # 1 and 1% x 100,000 = 1,000 for firm 2: 5 x 4,000 + 7 x 1,000 = 27,000. + data = dataset(firm_group_relief_claimed=[600_000.0, 0.0, 0.0]) + _, total, incidence = change_total_and_incidence( + data, {"gov.hmrc.corporation_tax.main_rate": {ALWAYS: 0.26}} + ) + assert total == pytest.approx([27_000, 27_000], abs=1) + assert incidence == pytest.approx(27_000, abs=1) + + +def test_northern_ireland_regional_rate_reform_reaches_firm_incidence(): + # Firm 3 is in Belfast with a net annual value of 30,000; 2026-27 + # regional rate 0.3079. At 0.40: 30,000 x 0.0921 = 2,763; 11 x 2,763 = + # 30,393. Firms 1 and 2 are in London with no rateable value. + data = dataset( + firm_region=["LONDON", "LONDON", "NORTHERN_IRELAND"], + firm_northern_ireland_district=["UNKNOWN", "UNKNOWN", "BELFAST"], + firm_rateable_value=[0.0, 0.0, 30_000.0], + ) + simulation, total, incidence = change_total_and_incidence( + data, + {"gov.hmrc.business_rates.northern_ireland.regional_rate": {ALWAYS: 0.40}}, + ) + baseline = np.asarray(simulation.baseline.calculate("firm_business_rates", YEAR)) + assert baseline == pytest.approx([0, 0, 19_508.64], abs=0.1) + assert total == pytest.approx([30_393, 30_393], abs=1) + assert incidence == pytest.approx(30_393, abs=1) + + +def test_patent_box_special_rate_reform_reaches_firm_incidence(): + # Firm 1: profit 1,000,000 with 400,000 of relevant IP profits, 2026-27. + # Baseline deduction 400,000 x 15/25 = 240,000. With a 15% special rate: + # 400,000 x 10/25 = 160,000, so 80,000 more profit at 25% = 20,000; + # 5 x 20,000 = 100,000. + data = dataset(firm_relevant_ip_profits=[400_000.0, 0.0, 0.0]) + _, total, incidence = change_total_and_incidence( + data, {"gov.hmrc.corporation_tax.patent_box.special_ip_rate": {ALWAYS: 0.15}} + ) + assert total == pytest.approx([100_000, 100_000], abs=1) + assert incidence == pytest.approx(100_000, abs=1) + + +@pytest.mark.parametrize( + "column, values, parameter, value, expected", + [ + # Firm 1: 100m of RPD profits. 5% instead of 4% on 75m: 750,000; x 5. + ( + "firm_rpd_profits", + [100_000_000.0, 0.0, 0.0], + "gov.hmrc.residential_property_developer_tax.rate", + 0.05, + 3_750_000, + ), + # Firm 2: 100m of UK digital services revenues in a group with 600m + # worldwide (supplied below). 3% instead of 2% on 75m: 750,000; x 7. + ( + "firm_uk_digital_services_revenues", + [0.0, 100_000_000.0, 0.0], + "gov.hmrc.digital_services_tax.rate", + 0.03, + 5_250_000, + ), + # Firm 3: 1m of levy profits. 40% instead of 38%: 20,000; x 11. + ( + "firm_epl_profits", + [0.0, 0.0, 1_000_000.0], + "gov.hmrc.energy_profits_levy.rate", + 0.40, + 220_000, + ), + ], + ids=["rpdt", "dst", "epl"], +) +def test_profit_tax_rate_reforms_reach_firm_incidence( + column, values, parameter, value, expected +): + data = dataset( + **{column: values}, + firm_group_digital_services_revenues=[0.0, 600_000_000.0, 0.0], + ) + _, total, incidence = change_total_and_incidence(data, {parameter: {ALWAYS: value}}) + assert total == pytest.approx([expected, expected], abs=1) + assert incidence == pytest.approx(expected, abs=1) + + +def test_every_firm_input_is_hidden_and_has_an_inert_default(): + """Firm inputs stay out of the household builder (core reads firm as a + person entity), and each new rule's inputs default to no effect.""" + from policyengine_uk import CountryTaxBenefitSystem + + variables = CountryTaxBenefitSystem().variables + firm_inputs = [ + variable + for variable in variables.values() + if variable.entity.key == "firm" + and not variable.formulas + and not variable.adds + and not variable.subtracts + ] + assert firm_inputs + assert [v.name for v in firm_inputs if not v.hidden_input] == [] + new_inputs = { + "firm_off_payroll_deemed_payments": 0, + "firm_off_payroll_deemed_workers": 0, + "firm_termination_awards": 0, + "firm_termination_award_recipients": 0, + "firm_psa_chargeable_earnings": 0, + "firm_psa_income_tax": 0, + "firm_group_relief_claimed": 0, + "firm_group_relief_for_carried_forward_losses_claimed": 0, + "firm_non_banking_group_relief_claimed": 0, + "firm_trading_loss_surrendered": 0, + "firm_input_vat_attributable_to_taxable_supplies": 0, + "firm_input_vat_attributable_to_exempt_supplies": 0, + "firm_applies_partial_exemption_de_minimis": False, + "firm_sdil_litres_higher_rate": 0, + "firm_sdil_litres_lower_rate": 0, + "firm_plastic_packaging_tonnes_chargeable": 0, + "firm_relevant_ip_profits": 0, + "firm_rpd_profits": 0, + "firm_rpdt_allowance_share": 1, + "firm_uk_digital_services_revenues": 0, + "firm_group_uk_digital_services_revenues": 0, + "firm_group_digital_services_revenues": 0, + "firm_epl_profits": 0, + } + for name, default in new_inputs.items(): + assert variables[name].default_value == default, name + district = variables["firm_northern_ireland_district"] + assert district.default_value.name == "UNKNOWN" diff --git a/policyengine_uk/tests/test_firm_docs_examples.py b/policyengine_uk/tests/test_firm_docs_examples.py new file mode 100644 index 0000000000..518d7a3eee --- /dev/null +++ b/policyengine_uk/tests/test_firm_docs_examples.py @@ -0,0 +1,213 @@ +"""The worked examples in docs/book/usage/firm-reforms.md. + +Each fixture runs the code from one section of the page, and each test checks +a figure the page states. Keep the two in step: a change here needs the same +change on the page. +""" + +import numpy as np +import pandas as pd +import pytest + +from policyengine_uk import Microsimulation, Simulation +from policyengine_uk.data import UKSingleYearDataset + +YEAR = 2026 + + +def values(simulation, variable): + return np.asarray(simulation.calculate(variable, YEAR)) + + +# Raise the corporation tax main rate + + +@pytest.fixture(scope="module") +def main_rate_sim(): + firms = { + "large_company": {"firm_taxable_trading_profit": {2026: 2_000_000}}, + "mid_company": {"firm_taxable_trading_profit": {2026: 150_000}}, + "small_company": {"firm_taxable_trading_profit": {2026: 40_000}}, + "sole_trader": { + "firm_legal_form": "SOLE_TRADER", + "firm_taxable_trading_profit": {2026: 80_000}, + }, + } + reform = {"gov.hmrc.corporation_tax.main_rate": {"2026-01-01.2100-12-31": 0.27}} + + return Simulation(situation={"firms": firms}, reform=reform) + + +def test_main_rate_baseline(main_rate_sim): + # 25% x 2,000,000; 25% x 150,000 - 3/200 x 100,000; 19% x 40,000; none. + assert values(main_rate_sim.baseline, "corporation_tax") == pytest.approx( + [500_000, 36_000, 7_600, 0], abs=0.01 + ) + + +def test_main_rate_reform(main_rate_sim): + # 27% x 2,000,000; 27% x 150,000 - 1,500; small profits rate; none. + assert values(main_rate_sim, "corporation_tax") == pytest.approx( + [540_000, 39_000, 7_600, 0], abs=0.01 + ) + + +def test_main_rate_leaves_marginal_relief_unchanged(main_rate_sim): + for simulation in (main_rate_sim, main_rate_sim.baseline): + assert values(simulation, "firm_marginal_relief") == pytest.approx( + [0, 1_500, 0, 0], abs=0.01 + ) + + +# Change the main-pool writing-down allowance + + +@pytest.fixture(scope="module") +def wda_sim(): + firms = { + "manufacturer": { + "firm_taxable_trading_profit": {2026: 1_000_000}, + "firm_main_pool_brought_forward": {2026: 500_000}, + }, + "workshop": { + "firm_taxable_trading_profit": {2026: 100_000}, + "firm_main_pool_brought_forward": {2026: 200_000}, + }, + } + reform = { + "gov.hmrc.corporation_tax.capital_allowances.writing_down_allowance.main_rate": { + "2026-01-01.2100-12-31": 0.18 + } + } + + return Simulation(situation={"firms": firms}, reform=reform) + + +WDA_EXPECTED = { + # 14% and 18% of 500,000 and 200,000. + "firm_main_pool_writing_down_allowance": ([70_000, 28_000], [90_000, 36_000]), + "firm_taxable_profit": ([930_000, 72_000], [910_000, 64_000]), + # Manufacturer: 25% of taxable profit. Workshop: 25% x 72,000 - + # 3/200 x 178,000 = 15,330; 25% x 64,000 - 3/200 x 186,000 = 13,210. + "corporation_tax": ([232_500, 15_330], [227_500, 13_210]), + "firm_main_pool_carried_forward": ([430_000, 172_000], [410_000, 164_000]), +} + + +@pytest.mark.parametrize("variable", sorted(WDA_EXPECTED)) +def test_wda(wda_sim, variable): + baseline, reformed = WDA_EXPECTED[variable] + assert values(wda_sim.baseline, variable) == pytest.approx(baseline, abs=0.01) + assert values(wda_sim, variable) == pytest.approx(reformed, abs=0.01) + + +def test_wda_tax_change(wda_sim): + change = values(wda_sim, "corporation_tax") - values( + wda_sim.baseline, "corporation_tax" + ) + # 25% x 20,000 and 26.5% x 8,000. + assert change == pytest.approx([-5_000, -2_120], abs=0.01) + + +# Cut the Employment Allowance and allocate the change to households + + +@pytest.fixture(scope="module") +def allowance_sim(): + dataset = UKSingleYearDataset( + person=pd.DataFrame( + { + "person_id": [1, 2], + "person_benunit_id": [1, 2], + "person_household_id": [1, 2], + "age": [30, 50], + "employment_income": [25_000.0, 75_000.0], + } + ), + benunit=pd.DataFrame({"benunit_id": [1, 2]}), + household=pd.DataFrame( + { + "household_id": [1, 2], + "household_weight": [1_000.0, 1_000.0], + "region": "LONDON", + "rent": 0.0, + "tenure_type": "OWNED_OUTRIGHT", + "council_tax": 0.0, + "corporate_sector_wealth": [0.0, 100_000.0], + "consumption": [20_000.0, 30_000.0], + } + ), + firm=pd.DataFrame( + { + "firm_id": [1, 2, 3], + "firm_weight": [100.0, 300.0, 50.0], + "firm_paybill": [2_000_000.0, 150_000.0, 60_000.0], + "firm_employees": [40.0, 5.0, 2.0], + } + ), + fiscal_year=2026, + ) + reform = { + "gov.hmrc.national_insurance.employment_allowance.amount": { + "2026-01-01.2100-12-31": 5_000 + }, + "gov.contrib.policyengine.firm_incidence.capital": { + "2026-01-01.2100-12-31": 0.5 + }, + "gov.contrib.policyengine.firm_incidence.consumer": { + "2026-01-01.2100-12-31": 0.25 + }, + "gov.contrib.policyengine.firm_incidence.labour": { + "2026-01-01.2100-12-31": 0.25 + }, + } + + return Microsimulation(dataset=dataset, reform=reform) + + +HOUSEHOLD_WEIGHT = 1_000 + + +def test_allowance_employer_ni_before_allowance(allowance_sim): + # 15% x (pay - 5,000 per employee): 1,800,000; 125,000; 50,000. + assert values(allowance_sim, "firm_employer_ni_before_allowance") == pytest.approx( + [270_000, 18_750, 7_500], abs=0.01 + ) + + +def test_allowance_amounts(allowance_sim): + assert values(allowance_sim.baseline, "employment_allowance") == pytest.approx( + [10_500, 10_500, 7_500], abs=0.01 + ) + assert values(allowance_sim, "employment_allowance") == pytest.approx( + [5_000, 5_000, 5_000], abs=0.01 + ) + + +def test_allowance_change_total(allowance_sim): + # 100 x 5,500 + 300 x 5,500 + 50 x 2,500. + assert values(allowance_sim, "firm_tax_change_total") == pytest.approx( + [2_325_000, 2_325_000], abs=0.01 + ) + + +def test_allowance_incidence_keys(allowance_sim): + assert values(allowance_sim, "shareholding") == pytest.approx([0, 0.001]) + assert values(allowance_sim, "consumption_shareholding") == pytest.approx( + [0.0004, 0.0006] + ) + + +def test_allowance_incidence(allowance_sim): + incidence = values(allowance_sim, "firm_tax_incidence") + # 2,325,000 x (0.25 x 0.0004 + 0.25 x 0.00025) and + # 2,325,000 x (0.5 x 0.001 + 0.25 x 0.0006 + 0.25 x 0.00075). + assert incidence == pytest.approx([377.81, 1_947.19], abs=0.005) + assert (incidence * HOUSEHOLD_WEIGHT).sum() == pytest.approx(2_325_000) + + +@pytest.mark.parametrize("variable", ["household_tax", "gov_tax"]) +def test_allowance_leaves_household_totals_unchanged(allowance_sim, variable): + assert values(allowance_sim, variable) == pytest.approx( + values(allowance_sim.baseline, variable) + ) diff --git a/policyengine_uk/tests/test_firm_entity.py b/policyengine_uk/tests/test_firm_entity.py new file mode 100644 index 0000000000..0b578326ed --- /dev/null +++ b/policyengine_uk/tests/test_firm_entity.py @@ -0,0 +1,437 @@ +"""The firm entity: a root population of its own, beside people, benefit +units and households. + +A simulation built from a household situation or dataset has no firms, and +its household results are those of a simulation without the entity. A +situation's ``firms`` entry, or a dataset's firm table, gives it firms, and +reforms, branches and clones keep them. +""" + +import numpy as np +import pandas as pd +import pytest +from policyengine_core.reforms import Reform +from policyengine_core.simulations import SimulationBuilder + +from policyengine_uk import CountryTaxBenefitSystem, Microsimulation, Simulation +from policyengine_uk.data import UKMultiYearDataset, UKSingleYearDataset +from policyengine_uk.model_api import YEAR as YEAR_PERIOD, Firm, Variable + +YEAR = 2025 +HOUSEHOLD = { + "people": { + "adult": {"age": {YEAR: 40}, "employment_income": {YEAR: 45_000}}, + "child": {"age": {YEAR: 5}}, + }, + "benunits": {"benunit": {"members": ["adult", "child"]}}, + "households": {"household": {"members": ["adult", "child"]}}, +} +FIRMS = { + "acme": { + "firm_paybill": {YEAR: 1_000_000}, + "firm_input_costs": {YEAR: 250_000}, + "firm_is_bank": {YEAR: True}, + }, + "corner_shop": { + "firm_paybill": 40_000, + "firm_legal_form": "SOLE_TRADER", + }, +} +HOUSEHOLD_OUTPUTS = [ + "income_tax", + "national_insurance", + "child_benefit", + "household_tax", + "household_benefits", + "household_net_income", +] + + +class firm_test_costs(Variable): + """A firm aggregate (``adds``) that only the test reform adds.""" + + value_type = float + entity = Firm + label = "Firm paybill and input costs (test only)" + definition_period = YEAR_PERIOD + adds = ["firm_paybill", "firm_input_costs"] + + +class add_firm_test_costs(Reform): + def apply(self): + self.add_variable(firm_test_costs) + + +@pytest.fixture(scope="module") +def with_firms(): + return Simulation(situation={**HOUSEHOLD, "firms": FIRMS}) + + +def test_a_household_situation_has_no_firms(): + simulation = Simulation(situation=HOUSEHOLD) + assert simulation.populations["firm"].count == 0 + assert simulation.firm is simulation.populations["firm"] + assert len(simulation.calculate("firm_paybill", YEAR)) == 0 + + +def test_firms_leave_household_results_unchanged(with_firms): + without = Simulation(situation=HOUSEHOLD) + for variable in HOUSEHOLD_OUTPUTS: + assert np.array_equal( + without.calculate(variable, YEAR), with_firms.calculate(variable, YEAR) + ), variable + + +def test_a_situation_gives_firms_their_inputs(with_firms): + firm = with_firms.populations["firm"] + assert firm.count == 2 + assert list(firm.ids) == ["acme", "corner_shop"] + assert with_firms.calculate("firm_paybill", YEAR).tolist() == [ + 1_000_000, + 40_000, + ] + assert with_firms.calculate("firm_is_bank", YEAR).tolist() == [True, False] + assert with_firms.calculate("firm_legal_form", YEAR).tolist() == [ + "COMPANY", + "SOLE_TRADER", + ] + assert with_firms.calculate("firm_weight", YEAR).tolist() == [1, 1] + assert "firm_paybill" in with_firms.input_variables + + +def test_the_callers_situation_is_not_changed(): + situation = {**HOUSEHOLD, "firms": FIRMS} + Simulation(situation=situation) + assert situation["firms"] is FIRMS + + +def test_a_situation_of_firms_alone_has_no_people(): + simulation = Simulation(situation={"firms": FIRMS}) + assert simulation.populations["person"].count == 0 + assert simulation.populations["household"].count == 0 + assert simulation.calculate("firm_paybill", YEAR).tolist() == [1_000_000, 40_000] + + +def test_a_reform_simulation_and_its_baseline_keep_firms(): + simulation = Simulation( + situation={**HOUSEHOLD, "firms": FIRMS}, + reform={"gov.hmrc.income_tax.rates.uk[0].rate": {"2025": 0.25}}, + ) + for each in (simulation, simulation.baseline): + assert each.populations["firm"].count == 2 + assert each.calculate("firm_paybill", YEAR).tolist() == [1_000_000, 40_000] + assert ( + simulation.calculate("income_tax", YEAR).sum() + > simulation.baseline.calculate("income_tax", YEAR).sum() + ) + + +def test_a_structural_reform_keeps_firms_and_adds_a_firm_aggregate(): + simulation = Simulation(situation={**HOUSEHOLD, "firms": FIRMS}) + simulation.apply_reform(add_firm_test_costs) + assert simulation.populations["firm"].count == 2 + assert simulation.firm.entity is next( + entity + for entity in simulation.tax_benefit_system.entities + if entity.key == "firm" + ) + assert simulation.calculate("firm_test_costs", YEAR).tolist() == [ + 1_250_000, + 40_000, + ] + branch = simulation.get_branch("firm_branch") + assert branch.calculate("firm_test_costs", YEAR).tolist() == [1_250_000, 40_000] + clone = simulation.clone() + assert clone.calculate("firm_test_costs", YEAR).tolist() == [1_250_000, 40_000] + + +def test_a_branch_keeps_firms_and_its_inputs_stay_its_own(with_firms): + branch = with_firms.get_branch("firm_inputs") + assert branch.firm is branch.populations["firm"] + assert branch.firm is not with_firms.firm + branch.set_input("firm_paybill", YEAR, np.array([0.0, 0.0])) + assert branch.calculate("firm_paybill", YEAR).tolist() == [0, 0] + assert with_firms.calculate("firm_paybill", YEAR).tolist() == [ + 1_000_000, + 40_000, + ] + + +def test_a_clone_has_its_own_firms(): + simulation = Simulation(situation={**HOUSEHOLD, "firms": FIRMS}) + clone = simulation.clone() + assert clone.firm is clone.populations["firm"] + assert clone.firm is not simulation.firm + assert clone.firm.simulation is clone + clone.set_input("firm_paybill", YEAR, np.array([1.0, 2.0])) + assert clone.calculate("firm_paybill", YEAR).tolist() == [1, 2] + assert simulation.calculate("firm_paybill", YEAR).tolist() == [ + 1_000_000, + 40_000, + ] + + +def test_firm_values_do_not_map_to_people(with_firms): + with pytest.raises(ValueError, match="firms have no members"): + with_firms.calculate("firm_paybill", YEAR, map_to="person") + + +def test_input_export_leaves_firms_out(with_firms): + frame = with_firms.to_input_dataframe() + assert not any(str(column).startswith("firm_") for column in frame.columns) + assert len(frame) == 2 + + +def tables(firm: pd.DataFrame = None) -> UKSingleYearDataset: + """Two single-person households, and optionally firms.""" + return UKSingleYearDataset( + person=pd.DataFrame( + { + "person_id": [1, 2], + "person_benunit_id": [1, 2], + "person_household_id": [1, 2], + "age": [30, 50], + "employment_income": [20_000.0, 60_000.0], + } + ), + benunit=pd.DataFrame({"benunit_id": [1, 2]}), + # With the columns that extending a dataset to later years reads. + household=pd.DataFrame( + { + "household_id": [1, 2], + "household_weight": [100.0, 200.0], + "region": "LONDON", + "rent": 0.0, + "tenure_type": "OWNED_OUTRIGHT", + "council_tax": 0.0, + } + ), + firm=firm, + fiscal_year=YEAR, + ) + + +FIRM_TABLE = pd.DataFrame( + { + # Not in identifier order: firms keep the order the table gives. + "firm_id": [30, 10, 20], + "firm_weight": [5.0, 7.0, 11.0], + "firm_paybill": [3e6, 1e5, 2e5], + "firm_legal_form": ["PARTNERSHIP", "COMPANY", "SOLE_TRADER"], + } +) + + +def test_a_dataset_without_a_firm_table_loads_with_no_firms(): + simulation = Microsimulation(dataset=tables()) + assert simulation.populations["firm"].count == 0 + assert simulation.calculate("employment_income", YEAR).sum() == ( + 100 * 20_000 + 200 * 60_000 + ) + + +def test_a_dataset_firm_table_loads_in_its_own_order(): + simulation = Microsimulation(dataset=tables(FIRM_TABLE.copy())) + assert simulation.populations["firm"].count == 3 + assert simulation.calculate("firm_id", YEAR).tolist() == [30, 10, 20] + paybill = simulation.calculate("firm_paybill", YEAR) + # Weighted by firm_weight, never by a household or person weight. + assert paybill.weights.tolist() == [5, 7, 11] + assert paybill.sum() == 5 * 3e6 + 7 * 1e5 + 11 * 2e5 + assert simulation.calculate("firm_legal_form", YEAR).tolist() == [ + "PARTNERSHIP", + "COMPANY", + "SOLE_TRADER", + ] + # Later years carry the firms forward. + assert simulation.calculate("firm_paybill", YEAR + 1).tolist() == [ + 3e6, + 1e5, + 2e5, + ] + + +def test_a_firm_table_survives_saving(tmp_path): + path = str(tmp_path / "with_firms.h5") + tables(FIRM_TABLE.copy()).save(path) + loaded = UKSingleYearDataset(file_path=path) + pd.testing.assert_frame_equal( + loaded.firm.reset_index(drop=True), FIRM_TABLE, check_dtype=False + ) + without = str(tmp_path / "without_firms.h5") + tables().save(without) + assert UKSingleYearDataset(file_path=without).firm is None + + +def test_a_dataset_keeps_three_household_tables(): + dataset = tables(FIRM_TABLE.copy()) + assert dataset.table_names == ("person", "benunit", "household") + assert len(dataset.tables) == 3 + assert dataset.copy().firm.equals(dataset.firm) + + +def test_a_simulation_with_firms_is_not_subsampled(): + simulation = Microsimulation(dataset=tables(FIRM_TABLE.copy())) + with pytest.raises(NotImplementedError, match="firms"): + simulation.subsample(n=1) + + +def test_yaml_variable_inputs_give_one_firm_per_value(): + """The YAML test runner builds with core's builder: variable-only input + gives every population, the firm's included, one record per value.""" + system = CountryTaxBenefitSystem() + builder = SimulationBuilder() + builder.set_default_period(YEAR) + simulation = builder.build_from_dict(system, {"firm_paybill": [1.0, 2.0, 3.0]}) + assert simulation.populations["firm"].count == 3 + assert simulation.calculate("firm_paybill", YEAR).tolist() == [1, 2, 3] + + +def test_yaml_firms_block_is_ignored(): + """Core's builder ignores a ``firms:`` block (it knows only people and + their groups), so YAML firm tests must give firm variables directly.""" + system = CountryTaxBenefitSystem() + builder = SimulationBuilder() + builder.set_default_period(YEAR) + simulation = builder.build_from_dict( + system, + { + "people": {"adult": {"age": 40}}, + "firms": {"acme": {"firm_paybill": 1.0}}, + }, + ) + assert simulation.populations["firm"].count == 0 + + +def test_a_firm_cannot_read_household_values_through_a_shortcut(with_firms): + """Core treats a non-group population as people, so ``firm.household`` + would project household values onto people. Firms refuse it, in + branches and clones too.""" + for simulation in (with_firms, with_firms.clone(), with_firms.get_branch("x")): + with pytest.raises(AttributeError, match="no members"): + simulation.populations["firm"].household + + +def test_a_multi_year_dataset_keeps_its_firm_tables(tmp_path): + path = str(tmp_path / "multi_year.h5") + single = tables(FIRM_TABLE.copy()) + later = tables(FIRM_TABLE.iloc[[2, 0, 1]].copy()) + later.time_period = str(YEAR + 1) + UKMultiYearDataset(datasets=[single, later]).save(path) + loaded = UKMultiYearDataset(file_path=path) + assert loaded[YEAR + 1].firm["firm_id"].tolist() == [20, 30, 10] + simulation = Microsimulation(dataset=loaded) + # Each year's rows follow the first year's order of firms. + assert simulation.calculate("firm_weight", YEAR + 1).tolist() == [5, 7, 11] + without = str(tmp_path / "multi_year_without_firms.h5") + UKMultiYearDataset(datasets=[tables()]).save(without) + assert UKMultiYearDataset(file_path=without)[YEAR].firm is None + + +def test_every_export_leaves_firms_out(with_firms): + frame = with_firms.to_input_dataframe(include_computed_variables=True) + assert not any(str(column).startswith("firm_") for column in frame.columns) + exported = with_firms.to_input_dict() + assert not any(name.startswith("firm_") for name in exported) + assert "age" in exported + + +def test_a_variable_only_situation_cannot_give_firm_inputs(): + with pytest.raises(ValueError, match="'firms' entry"): + Simulation(situation={"firm_paybill": [1.0, 2.0]}) + + +def multi_year(first_firm, later_firm) -> UKMultiYearDataset: + first = tables(first_firm) + later = tables(later_firm) + later.time_period = str(YEAR + 1) + return UKMultiYearDataset(datasets=[first, later]) + + +@pytest.mark.parametrize( + "later_rows", + [ + # A firm only in the later year. + pd.concat( + [ + FIRM_TABLE, + pd.DataFrame( + { + "firm_id": [40], + "firm_weight": [1.0], + "firm_paybill": [1.0], + "firm_legal_form": ["COMPANY"], + } + ), + ], + ignore_index=True, + ), + # A firm missing from the later year. + FIRM_TABLE.iloc[:2], + # The same number of firms, but a different one. + FIRM_TABLE.assign(firm_id=[30, 10, 99]), + ], +) +def test_a_later_year_must_give_the_first_years_firms(later_rows): + dataset = multi_year(FIRM_TABLE.copy(), later_rows.copy()) + with pytest.raises(ValueError, match="same firms"): + Microsimulation(dataset=dataset) + + +def test_a_later_year_cannot_give_firms_the_first_year_lacks(): + dataset = multi_year(None, FIRM_TABLE.copy()) + with pytest.raises(ValueError, match="first year"): + Microsimulation(dataset=dataset) + + +def test_filtering_to_a_household_keeps_the_firm_table(): + from policyengine_uk.data.filter_dataset import filter_dataset + + simulation = Microsimulation(dataset=tables(FIRM_TABLE.copy())) + filtered = filter_dataset(simulation, household_id=1, year=YEAR) + assert len(filtered.household) == 1 + assert filtered.firm["firm_id"].tolist() == [30, 10, 20] + + +def test_a_firm_table_without_firm_ids_numbers_its_firms(): + simulation = Microsimulation(dataset=tables(FIRM_TABLE.drop(columns="firm_id"))) + assert simulation.calculate("firm_id", YEAR).tolist() == [0, 1, 2] + assert simulation.calculate("firm_paybill", YEAR).tolist() == [3e6, 1e5, 2e5] + dataset = multi_year( + FIRM_TABLE.drop(columns="firm_id"), FIRM_TABLE.drop(columns="firm_id") + ) + simulation = Microsimulation(dataset=dataset) + assert simulation.calculate("firm_paybill", YEAR + 1).tolist() == [3e6, 1e5, 2e5] + + +def test_a_core_dataset_without_firm_ids_numbers_its_firms(): + from policyengine_uk.simulation import _core_dataset_firm_ids + + system = CountryTaxBenefitSystem() + data = { + "person_id": {YEAR: np.array([1, 2])}, + "firm_paybill": {YEAR: np.array([1.0, 2.0, 3.0])}, + } + assert _core_dataset_firm_ids(data, system).tolist() == [0, 1, 2] + assert _core_dataset_firm_ids({"person_id": data["person_id"]}, system) is None + data["firm_id"] = {YEAR: np.array([7, 8, 9])} + assert _core_dataset_firm_ids(data, system).tolist() == [7, 8, 9] + + +def test_nested_exports_leave_the_simulation_as_found(with_firms): + assert "_get_exportable_input_periods" not in with_firms.__dict__ + with with_firms._exporting_people_only(): + inner = with_firms._get_exportable_input_periods + with with_firms._exporting_people_only(): + pass + assert with_firms._get_exportable_input_periods is inner + assert "age" in with_firms.to_input_dict() + assert "_get_exportable_input_periods" not in with_firms.__dict__ + assert "age" in with_firms.to_input_dict() + + +def test_a_firm_table_cannot_give_other_entities_variables(): + dataset = tables(FIRM_TABLE.assign(employment_income=1.0, not_a_variable=1.0)) + with pytest.raises(ValueError, match="'employment_income' \\(a person"): + dataset.validate() + tables(FIRM_TABLE.assign(not_a_variable=1.0)).validate() diff --git a/policyengine_uk/tests/test_firm_incidence.py b/policyengine_uk/tests/test_firm_incidence.py new file mode 100644 index 0000000000..ce22e9dabb --- /dev/null +++ b/policyengine_uk/tests/test_firm_incidence.py @@ -0,0 +1,635 @@ +"""Firm tax aggregates and their household incidence. + +``firm_tax`` and ``firm_only_tax`` are firm liabilities. ``firm_tax_change_total`` +is the firm_weight-weighted change in ``firm_only_tax`` between a reform and +its baseline, less the change in the Employment Allowance, and ``firm_tax_incidence`` spreads it over households. Both are +0 in a household situation and without a baseline, and are not yet terms of +any household tax. +""" + +import numpy as np +import pandas as pd +import pytest + +from policyengine_uk import Microsimulation, Simulation +from policyengine_uk.data import UKSingleYearDataset + +YEAR = 2026 +# Raise the corporation tax main rate from 25% to 30%. +CT_REFORM = {"gov.hmrc.corporation_tax.main_rate": {"2020-01-01.2035-12-31": 0.3}} + +# 2026-27 values: employer Class 1 15% above 96.153846 a week x 52 (about +# 5,000 a year per employee); Employment Allowance 10,500; corporation tax 25% +# main and 19% small profits, marginal relief 3/200 between 50,000 and 250,000; +# business rates 43.2p small and 48p standard multipliers, small business rate +# relief in full up to a rateable value of 12,000; VAT 20%, registration above +# 90,000 of taxable turnover. +FIRMS = { + # A single-director company: no Employment Allowance. + "consultancy": { + "firm_is_single_director_company": True, + "firm_employees": 1, + "firm_paybill": 60_000, + "firm_taxable_trading_profit": 45_000, + }, + # A sole trader: no corporation tax, and under the VAT threshold. + "shop": { + "firm_legal_form": "SOLE_TRADER", + "firm_employees": 2, + "firm_paybill": 50_000, + "firm_taxable_trading_profit": 70_000, + "firm_rateable_value": 10_000, + "firm_standard_rated_supplies": 85_000, + }, + # A company with exempt distributions, which raise its augmented profits + # and so cut its marginal relief. + "manufacturer": { + "firm_employees": 10, + "firm_paybill": 400_000, + "firm_taxable_trading_profit": 100_000, + "firm_exempt_distributions": 100_000, + "firm_rateable_value": 60_000, + "firm_standard_rated_supplies": 500_000, + "firm_input_vat": 40_000, + }, +} + +EXPECTED = { + # Consultancy: 19% x 45,000 = 8,550 (augmented profits under 50,000). + # Shop: a sole trader pays none. + # Manufacturer: augmented 100,000 + 100,000 = 200,000, in the band; + # relief 3/200 x (250,000 - 200,000) x 100,000/200,000 = 375; + # 25% x 100,000 - 375 = 24,625. + "corporation_tax": [8_550, 0, 24_625], + # Consultancy: excluded as a single-director company. + # Shop: min(10,500, (50,000 - 2 x 5,000) x 15% = 6,000) = 6,000. + # Manufacturer: min(10,500, (400,000 - 10 x 5,000) x 15% = 52,500). + "employment_allowance": [0, 6_000, 10_500], + # (60,000 - 5,000) x 15% = 8,250; 6,000 - 6,000 = 0; 52,500 - 10,500. + "firm_employer_ni": [8_250, 0, 42_000], + # 0.5% of each paybill is under the 15,000 allowance. + "apprenticeship_levy": [0, 0, 0], + # Consultancy: no property. Shop: 10,000 x 43.2p = 4,320, all relieved by + # small business rate relief. Manufacturer: 60,000 x 48p = 28,800. + "firm_business_rates": [0, 0, 28_800], + # Shop: 85,000 is under the threshold. Manufacturer: 20% x 500,000 + # - 40,000 = 60,000. + "firm_vat": [0, 0, 60_000], + # Sums of the above (bank surcharge 0): + # 8,550 + 8,250 = 16,800; 0; 24,625 + 42,000 + 28,800 + 60,000 = 155,425. + "firm_tax": [16_800, 0, 155_425], + # Corporation tax + apprenticeship levy + business rates (the Employment + # Allowance moves with employer NI and is left out): 8,550; 0; + # 24,625 + 28,800 = 53,425. + "firm_only_tax": [8_550, 0, 53_425], +} + +HOUSEHOLD = { + "people": {"adult": {"age": 40, "employment_income": 40_000}}, + "benunits": {"benunit": {"members": ["adult"]}}, + "households": {"household": {"members": ["adult"], "corporate_sector_wealth": 1e6}}, +} + + +@pytest.fixture(scope="module") +def firms_only(): + return Simulation(situation={"firms": FIRMS}) + + +@pytest.mark.parametrize("variable", sorted(EXPECTED)) +def test_firms_only_situation_hand_computed(firms_only, variable): + assert firms_only.populations["person"].count == 0 + assert firms_only.calculate(variable, YEAR) == pytest.approx( + EXPECTED[variable], abs=1 + ) + + +@pytest.mark.parametrize( + "situation", + [HOUSEHOLD, {**HOUSEHOLD, "firms": FIRMS}], + ids=["household", "household_and_firms"], +) +@pytest.mark.parametrize("reform", [None, CT_REFORM], ids=["no_reform", "reform"]) +def test_incidence_is_zero_in_a_situation(situation, reform): + """A situation is not data, so even with firms and a reform that changes + their liability the aggregate and its incidence are 0. (Without a reform + the UK simulation's baseline is a clone of itself.)""" + simulation = Simulation(situation=situation, reform=reform) + assert simulation.calculate("firm_tax_change_total", YEAR).tolist() == [0] + assert simulation.calculate("firm_tax_incidence", YEAR).tolist() == [0] + + +def test_a_situation_reform_still_changes_firm_liability(): + """The zero above is not because the reform misses firms.""" + simulation = Simulation(situation={**HOUSEHOLD, "firms": FIRMS}, reform=CT_REFORM) + change = simulation.calculate( + "corporation_tax", YEAR + ) - simulation.baseline.calculate("corporation_tax", YEAR) + # Only the manufacturer, in the marginal relief band, pays the main rate: + # 5% x 100,000 = 5,000 more; marginal relief does not depend on it. + assert change == pytest.approx([0, 0, 5_000], abs=0.01) + + +HOUSEHOLD_WEIGHTS = [100.0, 200.0] +FIRM_WEIGHTS = [5.0, 7.0, 11.0] +# Firm profits: above the upper limit, in the marginal relief band, and under +# the lower limit. +FIRM_PROFITS = [1_000_000.0, 100_000.0, 40_000.0] + + +def dataset(year: int = YEAR) -> UKSingleYearDataset: + return UKSingleYearDataset( + person=pd.DataFrame( + { + "person_id": [1, 2], + "person_benunit_id": [1, 2], + "person_household_id": [1, 2], + "age": [30, 50], + "employment_income": [20_000.0, 60_000.0], + } + ), + benunit=pd.DataFrame({"benunit_id": [1, 2]}), + household=pd.DataFrame( + { + "household_id": [1, 2], + "household_weight": HOUSEHOLD_WEIGHTS, + "region": "LONDON", + "rent": 0.0, + "tenure_type": "OWNED_OUTRIGHT", + "council_tax": 0.0, + # Weighted total 100 x 100,000 + 200 x 200,000 = 50,000,000, + # so shareholdings are 0.002 and 0.004 and sum (weighted) to 1. + "corporate_sector_wealth": [100_000.0, 200_000.0], + } + ), + firm=pd.DataFrame( + { + "firm_id": [1, 2, 3], + "firm_weight": FIRM_WEIGHTS, + "firm_taxable_trading_profit": FIRM_PROFITS, + "firm_paybill": [2_000_000.0, 300_000.0, 0.0], + "firm_employees": [40.0, 8.0, 0.0], + "firm_rateable_value": [150_000.0, 20_000.0, 0.0], + } + ), + fiscal_year=year, + ) + + +@pytest.fixture(scope="module") +def reformed(): + return Microsimulation(dataset=dataset(), reform=CT_REFORM) + + +def test_dataset_change_total_is_the_weighted_firm_only_tax_change(reformed): + # Per firm, the 5-point rise in the main rate adds 5% x 1,000,000 = + # 50,000; 5% x 100,000 = 5,000 (marginal relief unchanged); and 0 under + # the small profits rate. Nothing else in firm_only_tax moves. + per_firm = np.asarray(reformed.calculate("firm_only_tax", YEAR)) - np.asarray( + reformed.baseline.calculate("firm_only_tax", YEAR) + ) + assert per_firm == pytest.approx([50_000, 5_000, 0], abs=0.01) + # Weighted: 5 x 50,000 + 7 x 5,000 + 11 x 0 = 285,000. + total = np.asarray(reformed.calculate("firm_tax_change_total", YEAR)) + assert total == pytest.approx([285_000, 285_000], abs=0.01) + + +def test_dataset_incidence_sums_to_the_change_total(reformed): + shareholding = np.asarray(reformed.calculate("shareholding", YEAR)) + assert shareholding == pytest.approx([0.002, 0.004]) + incidence = np.asarray(reformed.calculate("firm_tax_incidence", YEAR)) + # Capital incidence 1: 285,000 x 0.002 = 570 and 285,000 x 0.004 = 1,140. + assert incidence == pytest.approx([570, 1_140]) + # 100 x 570 + 200 x 1,140 = 285,000. + assert (incidence * HOUSEHOLD_WEIGHTS).sum() == pytest.approx(285_000) + + +def test_dataset_labour_incidence_sums_to_the_change_total(): + """With all of the change on workers, each household bears its share of + weighted employment income: 100 x 20,000 + 200 x 60,000 = 14,000,000, so + shares of 1/700 and 3/700 of 285,000.""" + simulation = Microsimulation( + dataset=dataset(), + reform={ + **CT_REFORM, + "gov.contrib.policyengine.firm_incidence.capital": { + "2020-01-01.2035-12-31": 0 + }, + "gov.contrib.policyengine.firm_incidence.labour": { + "2020-01-01.2035-12-31": 1 + }, + }, + ) + incidence = np.asarray(simulation.calculate("firm_tax_incidence", YEAR)) + assert incidence == pytest.approx([285_000 / 700, 3 * 285_000 / 700]) + assert (incidence * HOUSEHOLD_WEIGHTS).sum() == pytest.approx(285_000) + + +def test_dataset_without_a_reform_has_no_change(): + """A UK simulation built without a reform has a clone of itself as its + baseline, so the change is 0.""" + simulation = Microsimulation(dataset=dataset()) + for variable in ("firm_tax_change_total", "firm_tax_incidence"): + assert np.asarray(simulation.calculate(variable, YEAR)).tolist() == [0, 0] + + +def test_dataset_with_no_baseline_has_no_change(): + """A UK simulation always has a baseline (its baseline's is a clone of + it), so take it away to reach the no-baseline branch: the change is 0, + though the firms are taxed.""" + simulation = Microsimulation(dataset=dataset(), reform=CT_REFORM) + simulation.baseline = None + assert np.asarray(simulation.calculate("firm_only_tax", YEAR)).sum() > 0 + for variable in ("firm_tax_change_total", "firm_tax_incidence"): + assert np.asarray(simulation.calculate(variable, YEAR)).tolist() == [0, 0] + + +def test_dataset_incidence_leaves_household_tax_unchanged(reformed): + """Not yet wired in: a corporation tax reform leaves household_tax alone.""" + assert np.array_equal( + np.asarray(reformed.calculate("household_tax", YEAR)), + np.asarray(reformed.baseline.calculate("household_tax", YEAR)), + ) + + +def small_payroll_dataset() -> UKSingleYearDataset: + """The dataset above with the second firm's employer NI under the + Employment Allowance: (60,000 - 8 x 5,000) x 15% = 3,000.""" + data = dataset() + data.firm.loc[1, "firm_paybill"] = 60_000.0 + return data + + +EMPLOYER_NI_REFORM = { + "gov.hmrc.national_insurance.class_1.employer_scale[1].rate": { + "2020-01-01.2035-12-31": 0.2 + } +} + + +def test_employer_ni_rate_rise_nets_out_for_a_firm_under_the_allowance(): + """Household ni_employer counts the gross change in employer NI, so the + firm-only total subtracts the full change in the Employment Allowance. + A 15% to 20% rate rise takes the second firm's liability from 3,000 to + 4,000, still under the 10,500 allowance: its allowance rises by 1,000 and + it pays nothing either way. Weighted: -7 x 1,000 = -7,000, which offsets + the 7,000 of extra gross employer NI on the household side.""" + simulation = Microsimulation( + dataset=small_payroll_dataset(), reform=EMPLOYER_NI_REFORM + ) + + def change(variable): + return np.asarray(simulation.calculate(variable, YEAR)) - np.asarray( + simulation.baseline.calculate(variable, YEAR) + ) + + allowance_change = change("employment_allowance") + assert allowance_change == pytest.approx([0, 1_000, 0], abs=0.01) + # For every firm, the gross change less the allowance change is the + # change in what it pays. + assert change("firm_employer_ni_before_allowance") - allowance_change == ( + pytest.approx(change("firm_employer_ni"), abs=0.01) + ) + assert change("firm_employer_ni")[1] == pytest.approx(0, abs=0.01) + total = np.asarray(simulation.calculate("firm_tax_change_total", YEAR)) + assert total == pytest.approx([-7_000, -7_000], abs=0.01) + # Capital incidence by shareholding 0.002 and 0.004. + incidence = np.asarray(simulation.calculate("firm_tax_incidence", YEAR)) + assert incidence == pytest.approx([-14, -28], abs=0.01) + + +def test_april_2025_package_nets_out_for_a_firm_under_the_allowance(): + """The April 2025 employer NI package on a 2024-25 firm: rate 13.8% to + 15%, secondary threshold 9,100 to 5,000 a year, allowance 5,000 to + 10,500. Four employees on a 60,000 paybill: gross liability + (60,000 - 4 x 9,100) x 13.8% = 3,256.80 becomes + (60,000 - 4 x 5,000) x 15% = 6,000. Both are under the allowance, so + the firm pays nothing either way. The household side counts the gross + rise of 2,743.20; the firm-only total subtracts the same rise in the + allowance: -7 x 2,743.20 = -19,202.40. The package also removed the + 100,000 prior-year limit; that is not reformed here, since the firm is + far below it.""" + data = dataset(2024) + data.firm = data.firm.iloc[1:2].copy() + data.firm["firm_paybill"] = 60_000.0 + data.firm["firm_employees"] = 4.0 + data.firm["firm_taxable_trading_profit"] = 0.0 + data.firm["firm_rateable_value"] = 0.0 + simulation = Microsimulation( + dataset=data, + reform={ + "gov.hmrc.national_insurance.class_1.employer_scale[1].rate": { + "2020-01-01.2035-12-31": 0.15 + }, + "gov.hmrc.national_insurance.class_1.employer_scale[1].threshold": { + "2020-01-01.2035-12-31": 5_000 / 52 + }, + "gov.hmrc.national_insurance.employment_allowance.amount": { + "2020-01-01.2035-12-31": 10_500 + }, + }, + ) + + def both(variable): + return ( + np.asarray(simulation.baseline.calculate(variable, 2024)), + np.asarray(simulation.calculate(variable, 2024)), + ) + + gross_before, gross_after = both("firm_employer_ni_before_allowance") + assert gross_before == pytest.approx([3_256.80], abs=0.01) + assert gross_after == pytest.approx([6_000], abs=0.01) + allowance_before, allowance_after = both("employment_allowance") + assert allowance_before == pytest.approx(gross_before, abs=0.01) + assert allowance_after == pytest.approx(gross_after, abs=0.01) + paid_before, paid_after = both("firm_employer_ni") + assert paid_before == pytest.approx([0], abs=0.01) + assert paid_after == pytest.approx([0], abs=0.01) + total = np.asarray(simulation.calculate("firm_tax_change_total", 2024)) + assert total == pytest.approx([-19_202.40, -19_202.40], abs=0.01) + + +def test_employment_allowance_reform_reaches_firm_incidence(): + """Cutting the allowance to 5,000 at baseline liabilities: the first firm + (liability 270,000) loses 5,500, the second (liability 3,000) keeps + 3,000, the third has none. Weighted: 5 x 5,500 = 27,500 more tax.""" + simulation = Microsimulation( + dataset=small_payroll_dataset(), + reform={ + "gov.hmrc.national_insurance.employment_allowance.amount": { + "2020-01-01.2035-12-31": 5_000 + } + }, + ) + total = np.asarray(simulation.calculate("firm_tax_change_total", YEAR)) + assert total == pytest.approx([27_500, 27_500], abs=0.01) + + +def prior_year_limit_dataset() -> UKSingleYearDataset: + """One 2024-25 firm (weight 5) with about 90,000 of secondary Class 1 + liabilities: 13.8% above 9,100 a year, one employee paid + 9,100 + 90,000 / 0.138 = 661,275.""" + data = dataset(2024) + data.firm = data.firm.iloc[:1].copy() + data.firm["firm_paybill"] = 9_100 + 90_000 / 0.138 + data.firm["firm_employees"] = 1.0 + data.firm["firm_taxable_trading_profit"] = 0.0 + data.firm["firm_rateable_value"] = 0.0 + return data + + +def test_employer_ni_rate_rise_past_the_prior_year_limit_counts_the_lost_allowance(): + """In 2024-25 a firm whose prior-year secondary liabilities reach + 100,000 loses the allowance. With no prior-year input, they default to + this year's liabilities under the simulation's own rules, so a rate rise + that lifts the firm from about 90,000 to about 130,000 takes its 5,000 + allowance away. Household ni_employer counts only the gross rise, so the + firm-only total counts the lost allowance: 5 x 5,000 = 25,000.""" + simulation = Microsimulation( + dataset=prior_year_limit_dataset(), reform=EMPLOYER_NI_REFORM + ) + baseline_eligible = simulation.baseline.calculate( + "employment_allowance_eligible", 2024 + ) + reform_eligible = simulation.calculate("employment_allowance_eligible", 2024) + assert np.asarray(baseline_eligible).tolist() == [True] + assert np.asarray(reform_eligible).tolist() == [False] + total = np.asarray(simulation.calculate("firm_tax_change_total", 2024)) + assert total == pytest.approx([25_000, 25_000], abs=0.01) + + +def test_supplied_prior_year_liabilities_keep_the_allowance_through_a_rate_rise(): + """Supplied prior-year liabilities of 90,000 are the same in both + simulations, so the firm keeps its 5,000 allowance (its liability is + above 5,000 either way) and the firm-only total does not move.""" + data = prior_year_limit_dataset() + data.firm["firm_prior_year_secondary_class_1_liabilities"] = 90_000.0 + simulation = Microsimulation(dataset=data, reform=EMPLOYER_NI_REFORM) + assert np.asarray( + simulation.calculate("employment_allowance", 2024) + ) == pytest.approx([5_000]) + total = np.asarray(simulation.calculate("firm_tax_change_total", 2024)) + assert total == pytest.approx([0, 0], abs=0.01) + + +def test_dataset_with_a_firmless_baseline_raises(): + """The baseline must carry the same firm table; one built without firms + cannot be compared firm by firm.""" + data = dataset() + firmless = UKSingleYearDataset( + person=data.person, + benunit=data.benunit, + household=data.household, + fiscal_year=YEAR, + ) + simulation = Microsimulation(dataset=dataset(), reform=CT_REFORM) + simulation.baseline = Microsimulation(dataset=firmless) + with pytest.raises(ValueError, match="different number of firms"): + simulation.calculate("firm_tax_change_total", YEAR) + + +@pytest.mark.parametrize("year", [2025, 2024]) +def test_employment_allowance_eligibility_exclusions(year): + """A charity public body (eligible), a non-charity public body + (excluded), a single-director company (excluded), a non-claimant group + member (excluded), and two ordinary firms with prior-year liabilities + over and under 100,000 (the over one excluded in 2024-25 only).""" + data = dataset(year) + data.firm = pd.DataFrame( + { + "firm_id": [1, 2, 3, 4, 5, 6], + "firm_weight": [2.0, 3.0, 5.0, 7.0, 11.0, 13.0], + "firm_paybill": [300_000.0] * 6, + "firm_employees": [8.0] * 6, + "firm_is_public_body": [True, True, False, False, False, False], + "firm_is_charity": [True, False, False, False, False, False], + "firm_is_single_director_company": [False, False, True] + [False] * 3, + "firm_claims_employment_allowance": [True] * 3 + [False] + [True] * 2, + "firm_prior_year_secondary_class_1_liabilities": [ + 0.0, + 0.0, + 0.0, + 0.0, + 150_000.0, + 50_000.0, + ], + } + ) + simulation = Microsimulation(dataset=data) + eligible = np.asarray(simulation.calculate("employment_allowance_eligible", year)) + if year == 2024: + assert eligible.tolist() == [True, False, False, False, False, True] + else: + assert eligible.tolist() == [True, False, False, False, True, True] + + +# Firm-only parameter reforms on the dataset above. 2026-27 baseline: standard +# multiplier 48p (rateable value 51,000 to 499,999); apprenticeship levy 0.5% +# of the paybill less a 15,000 allowance; corporation tax main rate 25%. +# Firms: profits 1,000,000 / 100,000 / 40,000; paybills 2,000,000 / 300,000 / +# 0; rateable values 150,000 / 20,000 / 0; weights 5 / 7 / 11. +FIRM_ONLY_REFORMS = { + # Only the first firm pays the standard multiplier (20,000 is under the + # 51,000 small business threshold): 150,000 x 2p = 3,000; 5 x 3,000. + "business_rates_standard_multiplier": ( + "gov.hmrc.business_rates.multipliers.standard", + 0.50, + 15_000, + ), + # Baseline 0.5% x 2,000,000 = 10,000 and 1,500 are under the allowance. + # At 1%: 20,000 - 15,000 = 5,000 for the first firm; 3,000 is still + # under it. 5 x 5,000 = 25,000. + "apprenticeship_levy_rate": ( + "gov.hmrc.apprenticeship_levy.rate", + 0.01, + 25_000, + ), + # With no allowance: 10,000 and 1,500. 5 x 10,000 + 7 x 1,500 = 60,500. + "apprenticeship_levy_allowance": ( + "gov.hmrc.apprenticeship_levy.allowance", + 0, + 60_500, + ), + # 1% x 1,000,000 = 10,000; 1% x 100,000 = 1,000 (marginal relief does not + # depend on the main rate); 0 under the lower limit. + # 5 x 10,000 + 7 x 1,000 = 57,000. + "corporation_tax_main_rate": ( + "gov.hmrc.corporation_tax.main_rate", + 0.26, + 57_000, + ), +} + + +@pytest.mark.parametrize( + "parameter, value, expected", + list(FIRM_ONLY_REFORMS.values()), + ids=list(FIRM_ONLY_REFORMS), +) +def test_firm_only_parameter_reform_total_and_incidence(parameter, value, expected): + simulation = Microsimulation( + dataset=dataset(), reform={parameter: {"2020-01-01.2035-12-31": value}} + ) + total = np.asarray(simulation.calculate("firm_tax_change_total", YEAR)) + assert total == pytest.approx([expected, expected], abs=0.01) + incidence = np.asarray(simulation.calculate("firm_tax_incidence", YEAR)) + assert (incidence * HOUSEHOLD_WEIGHTS).sum() == pytest.approx(expected, abs=0.01) + + +def vat_dataset() -> UKSingleYearDataset: + """The dataset above with VAT supplies, 2026-27 (20% standard rate, + registration above 90,000, flat rate scheme joining limit 150,000, + default flat rate 12%), weights 5 / 7 / 11: + + - firm 1: standard-rated supplies 2,000,000 and input VAT 100,000: + 400,000 - 100,000 = 300,000; + - firm 2: 95,000 and 5,000, just over the threshold: 19,000 - 5,000 = + 14,000; + - firm 3: 120,000 on the flat rate scheme: 12% x (120,000 + 24,000) = + 17,280. + + Weighted firm VAT: 5 x 300,000 + 7 x 14,000 + 11 x 17,280 = 1,788,080. + """ + data = dataset() + data.firm["firm_standard_rated_supplies"] = [2_000_000.0, 95_000.0, 120_000.0] + data.firm["firm_input_vat"] = [100_000.0, 5_000.0, 0.0] + data.firm["firm_uses_flat_rate_scheme"] = [False, False, True] + return data + + +VAT_RATE_REFORM = {"gov.hmrc.vat.standard_rate": {"2020-01-01.2035-12-31": 0.25}} +VAT_THRESHOLD_REFORM = { + "gov.hmrc.vat.registration.threshold": {"2020-01-01.2035-12-31": 100_000} +} + + +def test_vat_at_baseline_rates_matches_firm_vat_without_a_reform(): + """With no reform, the firm-only total's VAT under reform rules at + baseline rates is the weighted firm_vat.""" + from policyengine_uk.variables.contrib.policyengine.firm.firm_tax_change_total import ( + _vat_under_reform_rules_at_baseline_rates, + ) + + simulation = Microsimulation(dataset=vat_dataset()) + assert np.asarray(simulation.calculate("firm_vat", YEAR)) == pytest.approx( + [300_000, 14_000, 17_280], abs=0.01 + ) + firms = simulation.populations["firm"] + assert _vat_under_reform_rules_at_baseline_rates( + firms, firms, YEAR + ) == pytest.approx(1_788_080, abs=0.1) + + +def test_vat_rate_reform_does_not_reach_firm_incidence(): + """VAT rates reach households through vat, so a 25% standard rate moves + firm_vat (firm 1: 500,000 - 100,000 = 400,000) but not the firm-only + total.""" + simulation = Microsimulation(dataset=vat_dataset(), reform=VAT_RATE_REFORM) + assert np.asarray(simulation.calculate("firm_vat", YEAR))[0] == pytest.approx( + 400_000, abs=0.01 + ) + total = np.asarray(simulation.calculate("firm_tax_change_total", YEAR)) + assert total == pytest.approx([0, 0], abs=0.1) + + +def test_vat_threshold_reform_reaches_firm_incidence(): + """A 100,000 threshold deregisters firm 2 (95,000), which stops paying + 14,000: -7 x 14,000 = -98,000. Firm 3 (120,000) stays registered.""" + simulation = Microsimulation(dataset=vat_dataset(), reform=VAT_THRESHOLD_REFORM) + assert np.asarray(simulation.calculate("firm_vat_registered", YEAR)).tolist() == [ + True, + False, + True, + ] + total = np.asarray(simulation.calculate("firm_tax_change_total", YEAR)) + assert total == pytest.approx([-98_000, -98_000], abs=0.1) + + +def test_flat_rate_percentage_reform_reaches_firm_incidence(): + """A 15% default flat rate: firm 3 pays 15% x 144,000 = 21,600, 4,320 + more: 11 x 4,320 = 47,520.""" + simulation = Microsimulation( + dataset=vat_dataset(), + reform={ + "gov.hmrc.vat.flat_rate.default_sector_rate": { + "2020-01-01.2035-12-31": 0.15 + } + }, + ) + total = np.asarray(simulation.calculate("firm_tax_change_total", YEAR)) + assert total == pytest.approx([47_520, 47_520], abs=0.1) + + +def test_vat_rate_and_threshold_reform_drops_the_interaction(): + """With both, firm 2's deregistration is valued at baseline rates + (14,000), not at the reform's (95,000 x 25% - 5,000 = 18,750): the total + is the threshold change alone, -98,000.""" + simulation = Microsimulation( + dataset=vat_dataset(), reform={**VAT_RATE_REFORM, **VAT_THRESHOLD_REFORM} + ) + total = np.asarray(simulation.calculate("firm_tax_change_total", YEAR)) + assert total == pytest.approx([-98_000, -98_000], abs=0.1) + + +def test_vat_threshold_cut_registers_a_partly_exempt_firm(): + """Firm 2 with 85,000 of standard-rated and 15,000 of exempt supplies + is under the 90,000 threshold. Cut to 80,000, it registers: recovery + share 85,000 / 100,000 = 85%, so it deducts 85% x 5,000 = 4,250 of + input VAT and pays 17,000 - 4,250 = 12,750: 7 x 12,750 = 89,250.""" + data = vat_dataset() + data.firm.loc[1, "firm_standard_rated_supplies"] = 85_000.0 + data.firm["firm_exempt_supplies"] = [0.0, 15_000.0, 0.0] + simulation = Microsimulation( + dataset=data, + reform={ + "gov.hmrc.vat.registration.threshold": {"2020-01-01.2035-12-31": 80_000} + }, + ) + assert np.asarray( + simulation.baseline.calculate("firm_vat_registered", YEAR) + ).tolist() == [True, False, True] + assert np.asarray(simulation.calculate("firm_vat", YEAR))[1] == pytest.approx( + 12_750, abs=0.01 + ) + total = np.asarray(simulation.calculate("firm_tax_change_total", YEAR)) + assert total == pytest.approx([89_250, 89_250], abs=0.1) diff --git a/policyengine_uk/tests/test_firm_microcosm_contract.py b/policyengine_uk/tests/test_firm_microcosm_contract.py new file mode 100644 index 0000000000..e52067e937 --- /dev/null +++ b/policyengine_uk/tests/test_firm_microcosm_contract.py @@ -0,0 +1,65 @@ +"""Guard the seam between the microcosm firm frame and this model. + +The microcosm firm frame (PolicyEngine/microcosm PR #1706) writes the input +columns below into a dataset's firm table, and its adapter reads back the +outputs below. If a variable here is renamed, moved to another entity or +given another value type, the frame's columns would stop loading or its +adapter would read the wrong thing, so this test fails first. Change the +two sides together. +""" + +import pytest + +from policyengine_uk import CountryTaxBenefitSystem + +# Columns the microcosm firm frame writes. +INPUTS = { + "firm_turnover": float, + "firm_input_costs": float, + "firm_employees": int, + "firm_sic_section": "Enum", + "firm_standard_rated_supplies": float, + "firm_exempt_supplies": float, + "firm_vat_voluntarily_registered": bool, + "firm_input_vat": float, +} + +# Outputs the microcosm adapter reads. +OUTPUTS = { + "firm_vat_liability_if_registered": float, + "firm_vat_registered": bool, +} + + +@pytest.fixture(scope="module") +def variables(): + return CountryTaxBenefitSystem().variables + + +def value_type_name(value_type) -> str: + return value_type if isinstance(value_type, str) else value_type.__name__ + + +@pytest.mark.parametrize("name", sorted({**INPUTS, **OUTPUTS})) +def test_variable_is_a_firm_variable_of_the_expected_type(variables, name): + expected = {**INPUTS, **OUTPUTS}[name] + assert name in variables, f"{name} is missing from the UK system" + variable = variables[name] + assert variable.entity.key == "firm" + assert value_type_name(variable.value_type) == value_type_name(expected) + + +@pytest.mark.parametrize("name", sorted(OUTPUTS)) +def test_outputs_are_computed(variables, name): + assert variables[name].formulas or variables[name].adds + + +def test_sic_section_enum_has_sections_a_to_u(variables): + # The system loads each variable file as its own module, so compare the + # enum by name rather than identity. + sic_section = variables["firm_sic_section"].possible_values + assert sic_section.__name__ == "SICSection" + sections = [chr(code) for code in range(ord("A"), ord("U") + 1)] + for section in sections: + assert section in sic_section.__members__, section + assert set(sic_section.__members__) == set(sections) | {"UNKNOWN"} diff --git a/policyengine_uk/tests/test_firm_microsimulation.py b/policyengine_uk/tests/test_firm_microsimulation.py new file mode 100644 index 0000000000..1eed3e1e55 --- /dev/null +++ b/policyengine_uk/tests/test_firm_microsimulation.py @@ -0,0 +1,247 @@ +"""Firm taxes in a Microsimulation over a seeded synthetic firm table. + +About 200 synthetic firms, with a mix of legal forms, losses, capital +spending, property and VAT, sit beside a few households. Each firm tax is +checked, summed with firm_weight, against an independent numpy calculation +on the firms where the rule is unambiguous, using 2026-27 parameter values +read from the system. The checks also cover the firm_tax identity, finite +values for every firm variable, and that adding the firm table leaves the +household aggregates unchanged. All totals are toy numbers from synthetic +data, not estimates. +""" + +import numpy as np +import pandas as pd +import pytest + +from policyengine_uk import Microsimulation +from policyengine_uk.data import UKSingleYearDataset +from policyengine_uk.model_api import WEEKS_IN_YEAR + +YEAR = 2026 +N_FIRMS = 200 +SEED = 20260401 +# Firm variables are stored as float32. +TOL = 1e-5 + + +def firm_table() -> pd.DataFrame: + rng = np.random.default_rng(SEED) + n = N_FIRMS + legal_form = rng.choice( + ["COMPANY", "SOLE_TRADER", "PARTNERSHIP", "OTHER"], + size=n, + p=[0.6, 0.2, 0.15, 0.05], + ) + employees = rng.integers(0, 120, size=n).astype(float) + # Average pay from 3,000 (below the secondary threshold) to 80,000. + paybill = employees * rng.uniform(3_000, 80_000, size=n) + # About a quarter of firms make a loss. + profit = rng.uniform(-200_000, 1_500_000, size=n) + profit[rng.random(n) < 0.25] *= -1 + capex = np.where(rng.random(n) < 0.3, rng.uniform(0, 500_000, size=n), 0.0) + rateable_value = np.where(rng.random(n) < 0.7, rng.uniform(0, 700_000, size=n), 0.0) + turnover = rng.uniform(10_000, 5_000_000, size=n) + # Some firms under the 90,000 registration threshold. + standard_rated = turnover * rng.uniform(0, 1, size=n) + standard_rated[: n // 10] = rng.uniform(0, 89_000, size=n // 10) + input_vat = standard_rated * rng.uniform(0, 0.15, size=n) + is_bank = np.zeros(n, dtype=bool) + is_bank[[3, 7]] = True + return pd.DataFrame( + { + "firm_id": np.arange(1, n + 1), + "firm_weight": rng.uniform(1, 50, size=n), + "firm_legal_form": legal_form, + "firm_employees": employees, + "firm_paybill": paybill, + "firm_taxable_trading_profit": profit, + "firm_capex_main_pool_new": capex, + "firm_rateable_value": rateable_value, + "firm_standard_rated_supplies": standard_rated, + "firm_input_vat": input_vat, + "firm_turnover": turnover, + "firm_is_bank": is_bank, + } + ) + + +def make_dataset(with_firms: bool) -> UKSingleYearDataset: + return UKSingleYearDataset( + person=pd.DataFrame( + { + "person_id": [1, 2, 3, 4], + "person_benunit_id": [1, 1, 2, 3], + "person_household_id": [1, 1, 2, 3], + "age": [40, 38, 70, 25], + "employment_income": [45_000.0, 20_000.0, 0.0, 28_000.0], + } + ), + benunit=pd.DataFrame({"benunit_id": [1, 2, 3]}), + household=pd.DataFrame( + { + "household_id": [1, 2, 3], + "household_weight": [1_000.0, 800.0, 1_200.0], + "region": "LONDON", + "rent": 0.0, + "tenure_type": "OWNED_OUTRIGHT", + "council_tax": 0.0, + "corporate_sector_wealth": [100_000.0, 300_000.0, 0.0], + } + ), + firm=firm_table() if with_firms else None, + fiscal_year=YEAR, + ) + + +@pytest.fixture(scope="module") +def firms() -> pd.DataFrame: + return firm_table() + + +@pytest.fixture(scope="module") +def sim(): + return Microsimulation(dataset=make_dataset(with_firms=True)) + + +@pytest.fixture(scope="module") +def params(sim): + return sim.tax_benefit_system.parameters(f"{YEAR}-04-06").gov.hmrc + + +def calc(sim, variable): + return np.asarray(sim.calculate(variable, YEAR), dtype=float) + + +def weighted(firms, values, mask=None): + w = firms.firm_weight.values + if mask is None: + mask = np.ones(len(w), dtype=bool) + return float((values * w)[mask].sum()) + + +def test_corporation_tax_matches_hand_calculation(sim, params, firms): + """Companies with no capital spending and a non-negative profit pay + the small profits rate up to the lower limit, the main rate less + marginal relief up to the upper limit, and the main rate above it. + Companies with a loss pay none; other legal forms pay none.""" + p = params.corporation_tax + company = firms.firm_legal_form.values == "COMPANY" + profit = firms.firm_taxable_trading_profit.values + no_capex = firms.firm_capex_main_pool_new.values == 0 + simple = company & no_capex & (profit >= 0) + lower = p.marginal_relief.lower_limit + upper = p.marginal_relief.upper_limit + relief = p.marginal_relief.fraction * (upper - profit) + expected = np.select( + [profit <= lower, profit <= upper], + [profit * p.small_profits_rate, profit * p.main_rate - relief], + default=profit * p.main_rate, + ) + ct = calc(sim, "corporation_tax") + assert simple.sum() >= 20 + assert weighted(firms, ct, simple) == pytest.approx( + weighted(firms, expected, simple), rel=TOL + ) + loss = company & (profit < 0) + assert loss.sum() > 0 + assert ct[loss] == pytest.approx(0) + assert ct[~company] == pytest.approx(0) + # Capital allowances only cut the tax. + with_capex = company & ~no_capex & (profit >= 0) + assert np.all(ct[with_capex] <= profit[with_capex] * p.main_rate + 1e-6) + + +def test_apprenticeship_levy_matches_hand_calculation(sim, params, firms): + p = params.apprenticeship_levy + expected = np.maximum(p.rate * firms.firm_paybill.values - p.allowance, 0) + levy = calc(sim, "apprenticeship_levy") + assert levy == pytest.approx(expected, rel=TOL, abs=0.01) + assert weighted(firms, levy) == pytest.approx(weighted(firms, expected), rel=TOL) + + +def test_employer_ni_before_allowance_matches_hand_calculation(sim, params, firms): + scale = params.national_insurance.class_1.employer_scale + rate = scale.rates[1] + annual_threshold = scale.thresholds[1] * WEEKS_IN_YEAR + expected = rate * np.maximum( + firms.firm_paybill.values - firms.firm_employees.values * annual_threshold, + 0, + ) + ni = calc(sim, "firm_employer_ni_before_allowance") + assert ni == pytest.approx(expected, rel=TOL, abs=0.01) + assert weighted(firms, ni) == pytest.approx(weighted(firms, expected), rel=TOL) + + +def test_business_rates_match_hand_calculation(sim, params, firms): + """One occupied English property per firm, none retail, hospitality or + leisure and no charities: the small, standard or high-value multiplier, + then small business rate relief in full to the full relief threshold + tapering to the taper end.""" + m = params.business_rates.multipliers + sbrr = params.business_rates.reliefs.small_business + rv = firms.firm_rateable_value.values + multiplier = np.select( + [rv >= m.high_value_threshold, rv < m.small_business_threshold], + [m.high_value, m.small_business], + default=m.standard, + ) + gross = rv * multiplier + relief_share = np.clip( + (sbrr.taper_end_threshold - rv) + / (sbrr.taper_end_threshold - sbrr.full_relief_threshold), + 0, + 1, + ) + expected = gross * (1 - relief_share) + rates = calc(sim, "firm_business_rates") + assert rates == pytest.approx(expected, rel=TOL, abs=0.01) + assert weighted(firms, rates) == pytest.approx(weighted(firms, expected), rel=TOL) + + +def test_vat_matches_hand_calculation(sim, params, firms): + """Only standard-rated supplies: registered above the threshold, then + output VAT at the standard rate less all input VAT.""" + p = params.vat + supplies = firms.firm_standard_rated_supplies.values + registered = supplies > p.registration.threshold + expected = np.where( + registered, supplies * p.standard_rate - firms.firm_input_vat.values, 0 + ) + assert (~registered).sum() > 0 + vat = calc(sim, "firm_vat") + assert vat == pytest.approx(expected, rel=TOL, abs=0.01) + assert weighted(firms, vat) == pytest.approx(weighted(firms, expected), rel=TOL) + + +def test_firm_tax_identity(sim): + firm_tax = sim.tax_benefit_system.variables["firm_tax"] + expected = sum(calc(sim, v) for v in firm_tax.adds) - sum( + calc(sim, v) for v in firm_tax.subtracts + ) + assert calc(sim, "firm_tax") == pytest.approx(expected, rel=TOL, abs=0.01) + + +def test_every_firm_variable_is_finite(sim): + names = sorted( + name + for name, variable in sim.tax_benefit_system.variables.items() + if variable.entity.key == "firm" + ) + assert len(names) > 50 + not_finite = [] + for name in names: + values = np.asarray(sim.calculate(name, YEAR)) + assert len(values) == N_FIRMS, name + if values.dtype.kind in "fiub" and not np.all(np.isfinite(values)): + not_finite.append(name) + assert not_finite == [] + + +@pytest.mark.parametrize("variable", ["gov_tax", "household_net_income"]) +def test_firm_table_leaves_household_aggregates_unchanged(sim, variable): + without_firms = Microsimulation(dataset=make_dataset(with_firms=False)) + with_firms = np.asarray(sim.calculate(variable, YEAR)) + assert with_firms == pytest.approx( + np.asarray(without_firms.calculate(variable, YEAR)), abs=0.01 + ) diff --git a/policyengine_uk/tests/test_firm_regression_gate.py b/policyengine_uk/tests/test_firm_regression_gate.py new file mode 100644 index 0000000000..8cee782eb9 --- /dev/null +++ b/policyengine_uk/tests/test_firm_regression_gate.py @@ -0,0 +1,255 @@ +"""The firm entity leaves household results alone. + +Firm-side rules are built but not wired into any household tax or benefit. +These tests check that structurally (no firm variable is a term of +gov_tax or of the household budget totals) and live: for a varied set of +household situations, adding firms to the situation, or reforming +firm-only rules, leaves every household and government total exactly as +it was. (Before review, a frozen fixture also matched the base commit +70014b3 exactly; it was dropped so later changes to household rules do +not break this test.) +""" + +import numpy as np +import pytest + +YEARS = (2025, 2026) + +HOUSEHOLD_VARIABLES = ( + "gov_tax", + "household_tax", + "household_net_income", + "gov_balance", + "household_benefits", +) + +# A firm-only reform: raise the corporation tax main rate and cut the +# Employment Allowance. +FIRM_REFORM = { + "gov.hmrc.corporation_tax.main_rate": {"2020-01-01.2035-12-31": 0.3}, + "gov.hmrc.national_insurance.employment_allowance.amount": { + "2020-01-01.2035-12-31": 1_000 + }, +} + +FIRMS = { + "manufacturer": { + "firm_employees": 20, + "firm_paybill": 700_000, + "firm_taxable_trading_profit": 400_000, + "firm_rateable_value": 60_000, + "firm_standard_rated_supplies": 2_000_000, + "firm_input_vat": 150_000, + }, + "shop": { + "firm_legal_form": "SOLE_TRADER", + "firm_employees": 2, + "firm_paybill": 50_000, + "firm_taxable_trading_profit": 70_000, + }, +} + + +def _household(members, **household_inputs): + return {"members": list(members), **household_inputs} + + +def situations(year: int) -> dict: + """Varied single-household situations for ``year``.""" + + def person(age, **incomes): + return {"age": {year: age}, **{k: {year: v} for k, v in incomes.items()}} + + def single(name, region="LONDON", household=None, **person_inputs): + return { + "people": {name: person(**person_inputs)}, + "benunits": {"benunit": {"members": [name]}}, + "households": { + "household": _household( + [name], region={year: region}, **(household or {}) + ) + }, + } + + couple_members = ["parent1", "parent2", "child1", "child2"] + return { + "single_earner": single( + "adult", region="NORTH_WEST", age=35, employment_income=32_000 + ), + "couple_with_children_on_uc": { + "people": { + "parent1": person(34, employment_income=14_000), + "parent2": person(32), + "child1": person(7), + "child2": person(3), + }, + "benunits": { + "benunit": {"members": couple_members, "would_claim_uc": {year: True}} + }, + "households": { + "household": _household( + couple_members, + region={year: "WEST_MIDLANDS"}, + rent={year: 9_600}, + tenure_type={year: "RENT_PRIVATELY"}, + ) + }, + }, + "pensioner": single( + "pensioner", + region="SOUTH_WEST", + age=72, + state_pension=11_500, + private_pension_income=6_000, + savings_interest_income=1_200, + ), + "self_employed": single( + "trader", region="EAST_MIDLANDS", age=45, self_employment_income=48_000 + ), + "high_earner_with_dividends": single( + "director", + region="SOUTH_EAST", + age=52, + employment_income=160_000, + dividend_income=40_000, + property_income=12_000, + ), + "renter_in_scotland": single( + "renter", + region="SCOTLAND", + household={ + "rent": {year: 7_800}, + "tenure_type": {year: "RENT_PRIVATELY"}, + "council_tax": {year: 1_400}, + "full_rate_vat_consumption": {year: 9_000}, + "reduced_rate_vat_consumption": {year: 600}, + }, + age=28, + employment_income=27_500, + ), + "low_paid_lone_parent_wales": { + "people": { + "parent": person(29, employment_income=11_000), + "child": person(4), + }, + "benunits": { + "benunit": { + "members": ["parent", "child"], + "would_claim_uc": {year: True}, + } + }, + "households": { + "household": _household( + ["parent", "child"], + region={year: "WALES"}, + rent={year: 6_000}, + tenure_type={year: "RENT_FROM_COUNCIL"}, + ) + }, + }, + "two_earner_couple_london": { + "people": { + "a": person(41, employment_income=55_000), + "b": person(39, employment_income=38_000, self_employment_income=6_000), + }, + "benunits": {"benunit": {"members": ["a", "b"]}}, + "households": { + "household": _household( + ["a", "b"], + region={year: "LONDON"}, + tenure_type={year: "OWNED_WITH_MORTGAGE"}, + council_tax={year: 2_100}, + full_rate_vat_consumption={year: 21_000}, + petrol_spending={year: 1_500}, + ) + }, + }, + } + + +def _values(simulation, variables, year) -> dict: + return { + name: [ + float(value) + for value in np.asarray(simulation.calculate(name, year), dtype=float) + ] + for name in variables + } + + +def _values(simulation, variables, year) -> dict: + return { + name: np.asarray(simulation.calculate(name, year), dtype=float) + for name in variables + } + + +CASES = sorted((name, year) for year in YEARS for name in situations(year)) + + +def test_no_firm_variable_is_a_term_of_gov_tax(): + from policyengine_uk import CountryTaxBenefitSystem + from policyengine_uk.variables.gov.gov_tax import GOV_TAX_VARIABLES + + system = CountryTaxBenefitSystem() + assert [ + name + for name in GOV_TAX_VARIABLES + if system.variables[name].entity.key == "firm" + ] == [] + + +def test_no_firm_variable_is_a_budget_term(): + from policyengine_uk import CountryTaxBenefitSystem + from policyengine_uk.programs import budget_programs + + system = CountryTaxBenefitSystem() + assert [ + term.variable + for term in budget_programs() + if term.variable in system.variables + and system.variables[term.variable].entity.key == "firm" + ] == [] + + +@pytest.mark.parametrize("name,year", CASES) +def test_firms_in_a_situation_leave_household_results_unchanged(name, year): + from policyengine_uk import Simulation + from policyengine_uk.variables.gov.gov_tax import GOV_TAX_VARIABLES + + situation = situations(year)[name] + variables = HOUSEHOLD_VARIABLES + tuple(GOV_TAX_VARIABLES) + without = _values(Simulation(situation=situation), variables, year) + with_firms = Simulation(situation={**situation, "firms": FIRMS}) + assert np.asarray(with_firms.calculate("firm_tax", year)).sum() > 0 + actual = _values(with_firms, variables, year) + mismatches = { + variable: (without[variable], actual[variable]) + for variable in variables + if not np.array_equal(without[variable], actual[variable]) + } + assert not mismatches, mismatches + + +@pytest.mark.parametrize("name,year", CASES) +def test_firm_only_reform_leaves_household_results_unchanged(name, year): + from policyengine_uk import Simulation + from policyengine_uk.variables.gov.gov_tax import GOV_TAX_VARIABLES + + situation = {**situations(year)[name], "firms": FIRMS} + baseline = Simulation(situation=situation) + reformed = Simulation(situation=situation, reform=FIRM_REFORM) + # The reform must move the firms, or it proves nothing. + assert ( + np.asarray(reformed.calculate("firm_tax", year)).sum() + > np.asarray(baseline.calculate("firm_tax", year)).sum() + ) + variables = HOUSEHOLD_VARIABLES + tuple(GOV_TAX_VARIABLES) + expected = _values(baseline, variables, year) + actual = _values(reformed, variables, year) + mismatches = { + variable: (expected[variable], actual[variable]) + for variable in variables + if not np.array_equal(expected[variable], actual[variable]) + } + assert not mismatches, mismatches diff --git a/policyengine_uk/tests/test_firm_yaml_guard.py b/policyengine_uk/tests/test_firm_yaml_guard.py new file mode 100644 index 0000000000..f840ee64e8 --- /dev/null +++ b/policyengine_uk/tests/test_firm_yaml_guard.py @@ -0,0 +1,113 @@ +"""Guard: YAML policy tests never give firms through a ``firms:`` block. + +The YAML test runner builds each case with policyengine-core's +``SimulationBuilder.build_from_dict``, which knows only people and their +groups. Observed behaviour (policyengine-core 3.34.9): + +- With people in the situation, a ``firms:`` block is silently ignored: the + simulation has no firms, a firm variable comes back as an empty array, and + core's ``assert_near`` passes an empty array against any expected value. A + firm test written that way passes whatever it expects. +- With a ``firms:`` block alone, the builder raises a ``SituationParsingError`` + ("No person found"). + +Firm YAML tests must therefore give firm variables directly (variable-only +input, one array position per firm). Mixed household and firm cases belong in +Python tests, where the UK ``Simulation`` reads a situation's ``firms`` entry. +""" + +from pathlib import Path + +import numpy as np +import pytest +import yaml +from policyengine_core.errors import SituationParsingError +from policyengine_core.simulations import SimulationBuilder +from policyengine_core.tools import assert_near + +from policyengine_uk import CountryTaxBenefitSystem + +POLICY_TESTS = Path(__file__).parent / "policy" +YEAR = 2026 +FIRMS = {"acme": {"firm_paybill": 1_000_000}} + + +def _cases(path: Path): + tests = yaml.safe_load(path.read_text()) + for case in tests if isinstance(tests, list) else [tests]: + if isinstance(case, dict): + yield case + + +def firms_block_cases(root: Path) -> list: + """Every YAML test case under ``root`` whose input has a ``firms`` key.""" + paths = sorted(root.rglob("*.yaml")) + sorted(root.rglob("*.yml")) + return [ + f"{path.relative_to(root)}: {case.get('name', '')}" + for path in paths + for case in _cases(path) + if isinstance(case.get("input"), dict) and "firms" in case["input"] + ] + + +def test_no_yaml_policy_test_has_a_firms_block(): + assert any(POLICY_TESTS.rglob("*.yaml")), "No YAML policy tests found" + offenders = firms_block_cases(POLICY_TESTS) + assert not offenders, ( + "YAML tests must not use a `firms:` block (the core builder ignores " + "it); give firm variables directly instead:\n" + "\n".join(offenders) + ) + + +def test_the_guard_finds_a_firms_block(tmp_path): + (tmp_path / "nested").mkdir() + (tmp_path / "nested" / "cases.yaml").write_text( + yaml.safe_dump( + [ + { + "name": "Case 1, firms block.", + "period": YEAR, + "input": {"people": {"person1": {}}, "firms": FIRMS}, + "output": {"firm_paybill": 1}, + }, + { + "name": "Case 2, variable-only input.", + "period": YEAR, + "input": {"firm_paybill": [1]}, + "output": {"firm_paybill": [1]}, + }, + ] + ) + ) + assert firms_block_cases(tmp_path) == ["nested/cases.yaml: Case 1, firms block."] + + +@pytest.fixture(scope="module") +def system(): + return CountryTaxBenefitSystem() + + +def _build(system, situation): + builder = SimulationBuilder() + builder.set_default_period(YEAR) + return builder.build_from_dict(system, situation) + + +def test_a_firms_block_beside_people_is_ignored_and_passes_vacuously(system): + simulation = _build(system, {"people": {"adult": {"age": 40}}, "firms": FIRMS}) + paybill = simulation.calculate("firm_paybill", YEAR) + assert simulation.populations["firm"].count == 0 + assert len(paybill) == 0 + # Why the guard is needed: the runner's comparison accepts any value. + assert_near(paybill, 123_456_789, absolute_error_margin=0) + + +def test_a_firms_block_alone_is_rejected(system): + with pytest.raises(SituationParsingError): + _build(system, {"firms": FIRMS}) + + +def test_variable_only_input_gives_one_firm_per_value(system): + simulation = _build(system, {"firm_paybill": [1.0, 2.0]}) + assert simulation.populations["firm"].count == 2 + assert np.array_equal(simulation.calculate("firm_paybill", YEAR), [1.0, 2.0]) diff --git a/policyengine_uk/tests/test_subsample.py b/policyengine_uk/tests/test_subsample.py index cf0317bc9e..0bb82a3dd9 100644 --- a/policyengine_uk/tests/test_subsample.py +++ b/policyengine_uk/tests/test_subsample.py @@ -346,11 +346,13 @@ def test_other_supplied_weights_keep_their_totals_over_their_own_entity(): def test_every_weight_variable_is_listed(): """A new sampling weight must be rescaled by a subsample, so it has to be listed. A variable that only ends in "weight" must be left out on purpose: - household_bus_fare_age_weight shares out bus fare spending by age.""" + household_bus_fare_age_weight shares out bus fare spending by age, and + firm_weight weights firms, which a subsample of households does not draw + (a simulation with firms is not subsampled).""" named = { name for name in CountryTaxBenefitSystem().variables if name.endswith("weight") } - assert named == WEIGHT_VARIABLES | {"household_bus_fare_age_weight"} + assert named == WEIGHT_VARIABLES | {"household_bus_fare_age_weight", "firm_weight"} # Inputs. diff --git a/policyengine_uk/utils/entity_ids.py b/policyengine_uk/utils/entity_ids.py index fa5ed754c7..554bdf6319 100644 --- a/policyengine_uk/utils/entity_ids.py +++ b/policyengine_uk/utils/entity_ids.py @@ -34,6 +34,12 @@ "household_id", ) +# The variable that stores the identifiers of firms, the optional root +# population ``build_from_ids`` takes as ``firm_id``. Kept apart from +# ``ENTITY_ID_VARIABLES``: firms have no members, and a dataset need not have +# any. +FIRM_ID_VARIABLE = "firm_id" + class EntityIdWarning(UserWarning): """An identifier changes when the simulation stores it.""" diff --git a/policyengine_uk/utils/household_subset.py b/policyengine_uk/utils/household_subset.py index 99526551af..40b9e1cb55 100644 --- a/policyengine_uk/utils/household_subset.py +++ b/policyengine_uk/utils/household_subset.py @@ -16,6 +16,7 @@ from typing import Optional import numpy as np +from policyengine_core.populations import GroupPopulation # Every formula that reads beyond its own households directly: a weighted # total, a weighted rank or median, records spread by weight over the @@ -45,6 +46,7 @@ "employer_ni_response_capital_incidence", "employer_ni_response_consumer_incidence", "employment_income_behavioral_response", + "firm_tax_incidence", "household_income_decile", "household_income_decile_ahc", "household_wealth_decile", @@ -161,6 +163,11 @@ def _positions(simulation, households): for key, population in simulation.populations.items(): if key == "person": continue + if not isinstance(population, GroupPopulation): + # A root population (the firm's) has no members in households: + # keep it whole. + positions[key] = np.arange(population.count) + continue members = np.asarray(population.members_entity_id) kept = np.zeros(population.count, dtype=bool) kept[members[kept_people]] = True @@ -222,7 +229,7 @@ def _restrict(branch, positions) -> bool: # The branch's arrays are its own copies now, not views of its # parent's (see InMemoryStorage.clone). storage.__dict__.pop("_shared", None) - if key != "person": + if isinstance(population, GroupPopulation): new_position = np.full(population.count, -1) new_position[kept] = np.arange(len(kept)) population.members_entity_id = new_position[ diff --git a/policyengine_uk/utils/input_dataframe_export.py b/policyengine_uk/utils/input_dataframe_export.py index afed6ca230..8f757d8c56 100644 --- a/policyengine_uk/utils/input_dataframe_export.py +++ b/policyengine_uk/utils/input_dataframe_export.py @@ -1,6 +1,7 @@ """Export recorded inputs without treating formulas or caches as provenance.""" import pandas as pd +from policyengine_core.populations import GroupPopulation from policyengine_uk.utils.supplied_inputs import _is_model_value @@ -67,7 +68,15 @@ def input_dataframe(simulation): periods_by_variable.setdefault(variable, set()).add(period) columns = {} + person_key = simulation.persons.entity.key for name, variable in simulation.tax_benefit_system.variables.items(): + population = simulation.populations.get(variable.entity.key) + if variable.entity.key != person_key and not isinstance( + population, GroupPopulation + ): + # A root (firm) variable: firms are not people, so the frame of + # one row per person has no place for it. + continue for period in sorted(periods_by_variable.get(name, ()), key=str): if variable.definition_period != period.unit: continue diff --git a/policyengine_uk/utils/supplied_inputs.py b/policyengine_uk/utils/supplied_inputs.py index d8b5af67fa..dfa806efb4 100644 --- a/policyengine_uk/utils/supplied_inputs.py +++ b/policyengine_uk/utils/supplied_inputs.py @@ -77,6 +77,7 @@ from policyengine_core.holders.helpers import _is_input as _stored_as_input_in from policyengine_core.holders.helpers import get_stored_input from policyengine_core.periods import Period +from policyengine_core.populations import GroupPopulation from policyengine_core.simulations.simulation import _latest_input_key @@ -732,9 +733,14 @@ def copy_other_populations(simulation, populations): simulation, share_arrays=True ) for key in copied - {person_key}: - result[key] = populations[key].clone( - simulation, result[person_key], share_arrays=True - ) + population = populations[key] + if isinstance(population, GroupPopulation): + result[key] = population.clone( + simulation, result[person_key], share_arrays=True + ) + else: + # A root population (the firm's) has no members. + result[key] = population.clone(simulation, share_arrays=True) adopted = [] for (key, name), record in records.items(): population = result[key] diff --git a/policyengine_uk/variables/contrib/policyengine/firm/firm_only_tax.py b/policyengine_uk/variables/contrib/policyengine/firm/firm_only_tax.py new file mode 100644 index 0000000000..96b1598ad3 --- /dev/null +++ b/policyengine_uk/variables/contrib/policyengine/firm/firm_only_tax.py @@ -0,0 +1,43 @@ +from policyengine_uk.model_api import * + + +class firm_only_tax(Variable): + label = "Firm-only tax liability" + documentation = ( + "The part of a firm's tax liability set by rules that only the firm " + "side models, so that a reform to them reaches households through " + "firm_tax_incidence without counting a change twice: corporation " + "tax, the bank surcharge, the apprenticeship levy, business rates, " + "Class 1A on termination awards, Class 1B, the soft drinks industry " + "levy, the plastic packaging tax, the residential property developer " + "tax, the digital services tax and the energy profits levy, less R&D tax credits paid out " + "to the firm. Class 1A on termination awards and Class 1B have no " + "household-side counterpart, so they belong here. Off-payroll " + "secondary Class 1 and Class 1A on benefits in kind are left out " + "with the rest of employer National Insurance. Employer National Insurance rates and thresholds, and VAT " + "rates, reach households through ni_employer and vat on the " + "household side, so they are left out. The Employment Allowance is " + "left out too: firm_tax_change_total subtracts its full change, " + "which with the gross change in ni_employer counts the change in " + "what firms pay. firm_tax_change_total also adds the change in firm " + "VAT from VAT rules other than the rates, with the rates held at " + "baseline." + ) + entity = Firm + definition_period = YEAR + value_type = float + unit = GBP + adds = [ + "corporation_tax", + "bank_surcharge", + "apprenticeship_levy", + "firm_business_rates", + "firm_termination_award_class_1a_ni", + "firm_class_1b_ni", + "soft_drinks_industry_levy", + "plastic_packaging_tax", + "residential_property_developer_tax", + "digital_services_tax", + "energy_profits_levy", + ] + subtracts = ["firm_rdec_excess_payable", "firm_rd_payable_credit"] diff --git a/policyengine_uk/variables/contrib/policyengine/firm/firm_tax.py b/policyengine_uk/variables/contrib/policyengine/firm/firm_tax.py new file mode 100644 index 0000000000..eabb8c5896 --- /dev/null +++ b/policyengine_uk/variables/contrib/policyengine/firm/firm_tax.py @@ -0,0 +1,44 @@ +from policyengine_uk.model_api import * + + +class firm_tax(Variable): + label = "Firm tax liability" + documentation = ( + "The firm's statutory liability to the firm-side taxes this model " + "covers: corporation tax, the bank surcharge, the apprenticeship " + "levy, employer National Insurance (secondary Class 1 after the Employment Allowance, " + "off-payroll secondary Class 1, Class 1A on benefits in kind and on " + "termination awards, and Class 1B), business rates, VAT, the soft " + "drinks industry levy, the plastic packaging tax, the residential " + "property developer tax, the digital services tax and the energy " + "profits levy, less R&D tax credits paid out to the firm " + "(R&D expenditure credit above its corporation tax, and the payable " + "credit for loss-making SMEs: every SME claiming the SME scheme " + "before April 2024, and R&D-intensive SMEs from then). This is liability, not " + "incidence: summed " + "over firms with firm_weight it is a receipts measure that must not " + "be added to gov_tax, whose household terms already include employer " + "National Insurance, VAT and business rates as incidence." + ) + entity = Firm + definition_period = YEAR + value_type = float + unit = GBP + adds = [ + "corporation_tax", + "bank_surcharge", + "apprenticeship_levy", + "firm_employer_ni", + "firm_class_1a_ni", + "firm_off_payroll_employer_ni", + "firm_termination_award_class_1a_ni", + "firm_class_1b_ni", + "firm_business_rates", + "soft_drinks_industry_levy", + "plastic_packaging_tax", + "residential_property_developer_tax", + "digital_services_tax", + "energy_profits_levy", + "firm_vat", + ] + subtracts = ["firm_rdec_excess_payable", "firm_rd_payable_credit"] diff --git a/policyengine_uk/variables/contrib/policyengine/firm/firm_tax_change_total.py b/policyengine_uk/variables/contrib/policyengine/firm/firm_tax_change_total.py new file mode 100644 index 0000000000..15f6af262c --- /dev/null +++ b/policyengine_uk/variables/contrib/policyengine/firm/firm_tax_change_total.py @@ -0,0 +1,94 @@ +from policyengine_uk.model_api import * +from policyengine_uk.utils.data_source import built_from_data + + +def _firms(simulation): + firms = simulation.populations.get("firm") + if firms is None or firms.count == 0: + return None + return firms + + +def _weighted_total(firms, variable: str, period) -> float: + if firms is None: + return 0.0 + return float((firms(variable, period) * firms("firm_weight", period)).sum()) + + +def _vat_under_reform_rules_at_baseline_rates(firms, baseline_firms, period) -> float: + """The weighted firm VAT under the reform's rules (registration, the flat + rate scheme and partial exemption) with the VAT rates held at baseline. + Only firm_output_vat reads the rates, and firm_flat_rate_turnover takes + them through it, so those two come from the baseline and everything + else from the reform. This repeats the two top-level choices in + firm_vat and firm_vat_liability_if_registered; keep them in step.""" + registered = firms("firm_vat_registered", period) + uses_flat_rate = firms("firm_uses_flat_rate_scheme", period) & firms( + "firm_flat_rate_scheme_eligible", period + ) + flat_rate = firms("firm_flat_rate_percentage", period) * baseline_firms( + "firm_flat_rate_turnover", period + ) + normal = baseline_firms("firm_output_vat", period) - firms( + "firm_recoverable_input_vat", period + ) + liability = where(registered, where(uses_flat_rate, flat_rate, normal), 0) + return float((liability * firms("firm_weight", period)).sum()) + + +class firm_tax_change_total(Variable): + label = "UK change in firm-only tax liability" + documentation = ( + "The change in firm_only_tax summed over the simulation's firms with " + "firm_weight, the reform less its baseline, less the change in the " + "weighted Employment Allowance, each computed by its own simulation " + "on its own employer National Insurance liabilities. Household " + "ni_employer counts the change in gross employer National Insurance, " + "so subtracting the full change in the allowance leaves the change " + "in what firms pay after it: a firm that stays under the allowance " + "after a rate rise nets to zero. It also adds the change in firm " + "VAT from VAT rules other than the rates (the registration " + "threshold, the flat rate scheme and partial exemption, including " + "the de minimis tests), with the " + "rates held at baseline, since household vat already carries rate " + "changes; a reform that changes both drops their interaction. " + "Without a supplied prior-year " + "input, the 2020-21 to 2024-25 prior-year limit reads this year's " + "liabilities under each simulation's own rules, so a rate rise can " + "take a firm over the limit and remove its allowance. Every " + "household carries the same " + "total. It is 0 without a baseline, in a household situation (which " + "has no UK population of firms to sum), and where the simulation has " + "no firms. The baseline must carry the same firm table; a baseline " + "with a different number of firms (including none) raises an error." + ) + entity = Household + definition_period = YEAR + value_type = float + unit = GBP + + def formula(household, period, parameters): + simulation = household.simulation + zero = np.zeros(household.count) + baseline = simulation.baseline + if baseline is None or not built_from_data(simulation): + return zero + firms = _firms(simulation) + if firms is None: + return zero + baseline_firms = _firms(baseline) + if baseline_firms is None or baseline_firms.count != firms.count: + raise ValueError( + "The baseline holds a different number of firms from the " + "reform, so their taxes cannot be compared firm by firm. " + "Build both from the same firm table." + ) + change = ( + _weighted_total(firms, "firm_only_tax", period) + - _weighted_total(baseline_firms, "firm_only_tax", period) + - _weighted_total(firms, "employment_allowance", period) + + _weighted_total(baseline_firms, "employment_allowance", period) + + _vat_under_reform_rules_at_baseline_rates(firms, baseline_firms, period) + - _weighted_total(baseline_firms, "firm_vat", period) + ) + return zero + change diff --git a/policyengine_uk/variables/contrib/policyengine/firm/firm_tax_incidence.py b/policyengine_uk/variables/contrib/policyengine/firm/firm_tax_incidence.py new file mode 100644 index 0000000000..ea30a97a51 --- /dev/null +++ b/policyengine_uk/variables/contrib/policyengine/firm/firm_tax_incidence.py @@ -0,0 +1,38 @@ +from policyengine_uk.model_api import * + + +class firm_tax_incidence(Variable): + label = "Household incidence of firm-only tax changes" + documentation = ( + "The household's share of firm_tax_change_total, split between " + "capital (by shareholding), consumers (by consumption_shareholding) " + "and workers (by the household's share of the weighted employment " + "income total) with the gov.contrib.policyengine.firm_incidence " + "parameters. Not yet a term of gov_tax or household_tax: it will " + "be once a calibrated firm dataset is available." + ) + entity = Household + definition_period = YEAR + value_type = float + unit = GBP + + def formula(household, period, parameters): + total = household("firm_tax_change_total", period) + if not np.any(total): + return np.zeros(household.count) + p = parameters(period).gov.contrib.policyengine.firm_incidence + capital = household("shareholding", period) + consumer = household("consumption_shareholding", period) + employment_income = household.sum( + household.members("employment_income", period) + ) + weight = household("household_weight", period) + weighted_employment_income = (employment_income * weight).sum() + labour = np.divide( + employment_income, + weighted_employment_income, + out=np.zeros(household.count), + where=weighted_employment_income > 0, + ) + share = p.capital * capital + p.consumer * consumer + p.labour * labour + return total * share diff --git a/policyengine_uk/variables/firm/business_rates/firm_in_england.py b/policyengine_uk/variables/firm/business_rates/firm_in_england.py new file mode 100644 index 0000000000..78fb7bffbf --- /dev/null +++ b/policyengine_uk/variables/firm/business_rates/firm_in_england.py @@ -0,0 +1,12 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_in_england(Variable): + value_type = bool + entity = Firm + label = "Firm's property is in England" + documentation = "Whether the firm's property is in England. A firm_region of Wales, Scotland or Northern Ireland overrides it: Welsh and Scottish rates follow their own rules, and Northern Ireland rates are not modelled (0)." + definition_period = YEAR + hidden_input = True + default_value = True diff --git a/policyengine_uk/variables/firm/business_rates/firm_is_industrial_property.py b/policyengine_uk/variables/firm/business_rates/firm_is_industrial_property.py new file mode 100644 index 0000000000..72ec7fdaf1 --- /dev/null +++ b/policyengine_uk/variables/firm/business_rates/firm_is_industrial_property.py @@ -0,0 +1,12 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_is_industrial_property(Variable): + value_type = bool + entity = Firm + label = "Firm's property is a qualifying industrial property" + documentation = "Whether the firm's property is a qualifying industrial hereditament, which gets a longer empty property rates exemption in England." + definition_period = YEAR + hidden_input = True + default_value = False diff --git a/policyengine_uk/variables/firm/business_rates/firm_is_live_music_venue.py b/policyengine_uk/variables/firm/business_rates/firm_is_live_music_venue.py new file mode 100644 index 0000000000..b2fbbc0a9f --- /dev/null +++ b/policyengine_uk/variables/firm/business_rates/firm_is_live_music_venue.py @@ -0,0 +1,18 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_is_live_music_venue(Variable): + value_type = bool + entity = Firm + label = "Firm's property is a live music venue" + documentation = ( + "Whether the firm's property is a live music venue, as opposed to a " + "pub, for the pubs and live music venues business rates relief in " + "England. Only matters together with firm_is_pub_or_live_music_venue: " + "live music venues with rateable value of £1m or more keep 15% relief " + "in 2027-28 and 2028-29, while pubs of any size get 35%." + ) + definition_period = YEAR + hidden_input = True + default_value = False diff --git a/policyengine_uk/variables/firm/business_rates/firm_is_pub_or_live_music_venue.py b/policyengine_uk/variables/firm/business_rates/firm_is_pub_or_live_music_venue.py new file mode 100644 index 0000000000..b90b39edca --- /dev/null +++ b/policyengine_uk/variables/firm/business_rates/firm_is_pub_or_live_music_venue.py @@ -0,0 +1,12 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_is_pub_or_live_music_venue(Variable): + value_type = bool + entity = Firm + label = "Firm's property is a pub or live music venue" + documentation = "Whether the firm's property is a pub or live music venue eligible for the pubs and live music venues business rates relief in England." + definition_period = YEAR + hidden_input = True + default_value = False diff --git a/policyengine_uk/variables/firm/business_rates/firm_is_rhl_property.py b/policyengine_uk/variables/firm/business_rates/firm_is_rhl_property.py new file mode 100644 index 0000000000..614ec6d1a0 --- /dev/null +++ b/policyengine_uk/variables/firm/business_rates/firm_is_rhl_property.py @@ -0,0 +1,12 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_is_rhl_property(Variable): + value_type = bool + entity = Firm + label = "Firm's property is a qualifying retail, hospitality or leisure property" + documentation = "Whether the firm's property qualifies as retail, hospitality or leisure (RHL) for business rates in England: the RHL multipliers from 2026-27, RHL relief to 2025-26 and the higher RHL small business rate relief thresholds from 2027-28." + definition_period = YEAR + hidden_input = True + default_value = False diff --git a/policyengine_uk/variables/firm/business_rates/firm_is_wales_higher_multiplier_excluded.py b/policyengine_uk/variables/firm/business_rates/firm_is_wales_higher_multiplier_excluded.py new file mode 100644 index 0000000000..e635e4082e --- /dev/null +++ b/policyengine_uk/variables/firm/business_rates/firm_is_wales_higher_multiplier_excluded.py @@ -0,0 +1,24 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_is_wales_higher_multiplier_excluded(Variable): + value_type = bool + entity = Firm + label = ( + "Firm's Welsh property has a description excluded from the higher multiplier" + ) + documentation = ( + "Whether the firm's property in Wales is described on the local " + "rating list as one of the 19 descriptions that WSI 2025/1163 reg 4 " + "keeps on the standard multiplier above £100,000: ambulance station, " + "auxiliary defence establishment, cemetery, college, crematorium, " + "fire station, health centre, hospital, law court, leisure centre, " + "library, museum, police station, prison, school, sports centre, " + "surgery, swimming pool or university (each with premises). Ignored " + "outside Wales." + ) + definition_period = YEAR + hidden_input = True + default_value = False + reference = "https://www.legislation.gov.uk/wsi/2025/1163/made" diff --git a/policyengine_uk/variables/firm/business_rates/firm_is_wales_retail_property.py b/policyengine_uk/variables/firm/business_rates/firm_is_wales_retail_property.py new file mode 100644 index 0000000000..9051f5e2ff --- /dev/null +++ b/policyengine_uk/variables/firm/business_rates/firm_is_wales_retail_property.py @@ -0,0 +1,24 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_is_wales_retail_property(Variable): + value_type = bool + entity = Firm + label = ( + "Firm's Welsh property is described as a shop, kiosk, pharmacy or post office" + ) + documentation = ( + "Whether the firm's property in Wales is described on the local " + "rating list as a kiosk, pharmacy, post office, shop, or shop and " + "post office, with premises. From 2026-27 such properties with " + "rateable value below £51,000 pay the Welsh retail multiplier (WSI " + "2025/1163 reg 3). Local-list properties only. From 2027-28 WSI " + "2026/133 widens this lower multiplier to about 37 descriptions, " + "including pubs, restaurants, hotels and leisure; that change is not " + "modelled. Ignored outside Wales." + ) + definition_period = YEAR + hidden_input = True + default_value = False + reference = "https://www.legislation.gov.uk/wsi/2025/1163/made" diff --git a/policyengine_uk/variables/firm/business_rates/firm_months_empty.py b/policyengine_uk/variables/firm/business_rates/firm_months_empty.py new file mode 100644 index 0000000000..c7568d0e17 --- /dev/null +++ b/policyengine_uk/variables/firm/business_rates/firm_months_empty.py @@ -0,0 +1,17 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_months_empty(Variable): + value_type = int + entity = Firm + label = "Months the firm's property was already empty at the start of the year" + documentation = ( + "For an unoccupied property, how many months it had already been " + "continuously empty before the start of the year. The empty property " + "exemption covers only what is left of the exemption period. Ignored " + "when the property is occupied." + ) + definition_period = YEAR + hidden_input = True + default_value = 0 diff --git a/policyengine_uk/variables/firm/business_rates/firm_n_properties.py b/policyengine_uk/variables/firm/business_rates/firm_n_properties.py new file mode 100644 index 0000000000..dbdbde166b --- /dev/null +++ b/policyengine_uk/variables/firm/business_rates/firm_n_properties.py @@ -0,0 +1,17 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_n_properties(Variable): + value_type = int + entity = Firm + label = "Number of non-domestic properties the firm occupies" + documentation = ( + "How many non-domestic properties the firm occupies. The model treats " + "the firm's rateable value as one aggregate property; this count only " + "decides small business relief eligibility: SBRR in England and " + "Wales, and the Small Business Bonus Scheme in Scotland." + ) + definition_period = YEAR + hidden_input = True + default_value = 1 diff --git a/policyengine_uk/variables/firm/business_rates/firm_northern_ireland_district.py b/policyengine_uk/variables/firm/business_rates/firm_northern_ireland_district.py new file mode 100644 index 0000000000..c95a7ef7a9 --- /dev/null +++ b/policyengine_uk/variables/firm/business_rates/firm_northern_ireland_district.py @@ -0,0 +1,34 @@ +from policyengine_uk.model_api import * + + +class NorthernIrelandDistrict(Enum): + UNKNOWN = "Unknown" + ANTRIM_AND_NEWTOWNABBEY = "Antrim and Newtownabbey" + ARDS_AND_NORTH_DOWN = "Ards and North Down" + ARMAGH_CITY_BANBRIDGE_AND_CRAIGAVON = "Armagh City, Banbridge and Craigavon" + BELFAST = "Belfast" + CAUSEWAY_COAST_AND_GLENS = "Causeway Coast and Glens" + DERRY_CITY_AND_STRABANE = "Derry City and Strabane" + FERMANAGH_AND_OMAGH = "Fermanagh and Omagh" + LISBURN_AND_CASTLEREAGH = "Lisburn and Castlereagh" + MID_AND_EAST_ANTRIM = "Mid and East Antrim" + MID_ULSTER = "Mid Ulster" + NEWRY_MOURNE_AND_DOWN = "Newry, Mourne and Down" + + +class firm_northern_ireland_district(Variable): + value_type = Enum + entity = Firm + label = "Firm Northern Ireland district council" + documentation = ( + "The district council area of the firm's property, for a firm whose " + "firm_region is Northern Ireland. Its district rate is added to the " + "regional rate. At the default, UNKNOWN, a Northern Ireland firm's " + "business rates are not modelled and are 0. Ignored outside " + "Northern Ireland." + ) + definition_period = YEAR + hidden_input = True + possible_values = NorthernIrelandDistrict + default_value = NorthernIrelandDistrict.UNKNOWN + reference = "https://www.legislation.gov.uk/nisi/1977/2157/article/6" diff --git a/policyengine_uk/variables/firm/business_rates/firm_property_occupied.py b/policyengine_uk/variables/firm/business_rates/firm_property_occupied.py new file mode 100644 index 0000000000..8b2219ae60 --- /dev/null +++ b/policyengine_uk/variables/firm/business_rates/firm_property_occupied.py @@ -0,0 +1,12 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_property_occupied(Variable): + value_type = bool + entity = Firm + label = "Firm's property is occupied" + documentation = "Whether the firm's property is occupied throughout the year. If not, it is treated as unoccupied throughout the year for business rates, and gets the empty property exemption but no other relief." + definition_period = YEAR + hidden_input = True + default_value = True diff --git a/policyengine_uk/variables/firm/capital_allowances/firm_aia_share.py b/policyengine_uk/variables/firm/capital_allowances/firm_aia_share.py new file mode 100644 index 0000000000..231d9442e1 --- /dev/null +++ b/policyengine_uk/variables/firm/capital_allowances/firm_aia_share.py @@ -0,0 +1,12 @@ +from policyengine_uk.model_api import * + + +class firm_aia_share(Variable): + value_type = float + entity = Firm + label = "Firm share of the annual investment allowance" + documentation = "Share of the annual investment allowance limit allocated to this firm. Group companies and related businesses share one limit; a stand-alone business has the whole limit." + definition_period = YEAR + hidden_input = True + unit = "/1" + default_value = 1 diff --git a/policyengine_uk/variables/firm/capital_allowances/firm_capex_main_pool_new.py b/policyengine_uk/variables/firm/capital_allowances/firm_capex_main_pool_new.py new file mode 100644 index 0000000000..4ac3677826 --- /dev/null +++ b/policyengine_uk/variables/firm/capital_allowances/firm_capex_main_pool_new.py @@ -0,0 +1,11 @@ +from policyengine_uk.model_api import * + + +class firm_capex_main_pool_new(Variable): + value_type = float + entity = Firm + label = "Firm new main-rate plant and machinery expenditure" + documentation = "Expenditure in the year on unused, not second-hand plant and machinery that falls in the main pool. Excludes cars and plant provided for leasing, which goes in firm_capex_main_pool_new_for_leasing." + definition_period = YEAR + hidden_input = True + unit = GBP diff --git a/policyengine_uk/variables/firm/capital_allowances/firm_capex_main_pool_new_for_leasing.py b/policyengine_uk/variables/firm/capital_allowances/firm_capex_main_pool_new_for_leasing.py new file mode 100644 index 0000000000..2d4ac03b95 --- /dev/null +++ b/policyengine_uk/variables/firm/capital_allowances/firm_capex_main_pool_new_for_leasing.py @@ -0,0 +1,26 @@ +from policyengine_uk.model_api import * + + +class firm_capex_main_pool_new_for_leasing(Variable): + value_type = float + entity = Firm + label = "Firm new main-rate plant and machinery expenditure for leasing" + documentation = ( + "Expenditure in the year on unused, not second-hand main-rate plant " + "and machinery provided for leasing. General exclusion 6 in section " + "46(2) of the Capital Allowances Act 2001 bars full expensing on it, " + "so it takes the annual investment allowance, then the main-rate " + "first-year allowance, and the rest joins the main pool. Assumes the " + "lessee conditions in section 46(4B) are met, so the main-rate " + "first-year allowance is available. Background plant leased with a " + "building, which keeps full expensing under section 46(4A), belongs " + "in firm_capex_main_pool_new. Excludes cars." + ) + definition_period = YEAR + hidden_input = True + default_value = 0 + unit = GBP + reference = ( + "https://www.legislation.gov.uk/ukpga/2001/2/section/46", + "https://www.legislation.gov.uk/ukpga/2001/2/section/45U", + ) diff --git a/policyengine_uk/variables/firm/capital_allowances/firm_capex_main_pool_used.py b/policyengine_uk/variables/firm/capital_allowances/firm_capex_main_pool_used.py new file mode 100644 index 0000000000..0701e504a7 --- /dev/null +++ b/policyengine_uk/variables/firm/capital_allowances/firm_capex_main_pool_used.py @@ -0,0 +1,11 @@ +from policyengine_uk.model_api import * + + +class firm_capex_main_pool_used(Variable): + value_type = float + entity = Firm + label = "Firm second-hand main-rate plant and machinery expenditure" + documentation = "Expenditure in the year on second-hand plant and machinery that falls in the main pool. Excludes cars." + definition_period = YEAR + hidden_input = True + unit = GBP diff --git a/policyengine_uk/variables/firm/capital_allowances/firm_capex_special_rate_new.py b/policyengine_uk/variables/firm/capital_allowances/firm_capex_special_rate_new.py new file mode 100644 index 0000000000..427b21cdf0 --- /dev/null +++ b/policyengine_uk/variables/firm/capital_allowances/firm_capex_special_rate_new.py @@ -0,0 +1,11 @@ +from policyengine_uk.model_api import * + + +class firm_capex_special_rate_new(Variable): + value_type = float + entity = Firm + label = "Firm new special-rate plant and machinery expenditure" + documentation = "Expenditure in the year on unused, not second-hand special rate plant and machinery, such as integral features and long-life assets. Excludes cars. Special-rate plant for leasing gets no first-year allowance (general exclusion 6 in section 46(2) of the Capital Allowances Act 2001 bars section 45S, and section 45U(b) excludes special rate expenditure), but this input would give it the 50% allowance; enter it as firm_capex_special_rate_used instead, which takes the annual investment allowance and then the special rate pool." + definition_period = YEAR + hidden_input = True + unit = GBP diff --git a/policyengine_uk/variables/firm/capital_allowances/firm_capex_special_rate_used.py b/policyengine_uk/variables/firm/capital_allowances/firm_capex_special_rate_used.py new file mode 100644 index 0000000000..d88ce3ed31 --- /dev/null +++ b/policyengine_uk/variables/firm/capital_allowances/firm_capex_special_rate_used.py @@ -0,0 +1,11 @@ +from policyengine_uk.model_api import * + + +class firm_capex_special_rate_used(Variable): + value_type = float + entity = Firm + label = "Firm second-hand special-rate plant and machinery expenditure" + documentation = "Expenditure in the year on second-hand special rate plant and machinery. Excludes cars." + definition_period = YEAR + hidden_input = True + unit = GBP diff --git a/policyengine_uk/variables/firm/capital_allowances/firm_capex_structures.py b/policyengine_uk/variables/firm/capital_allowances/firm_capex_structures.py new file mode 100644 index 0000000000..9fba205c6b --- /dev/null +++ b/policyengine_uk/variables/firm/capital_allowances/firm_capex_structures.py @@ -0,0 +1,11 @@ +from policyengine_uk.model_api import * + + +class firm_capex_structures(Variable): + value_type = float + entity = Firm + label = "Firm structures and buildings expenditure" + documentation = "Qualifying expenditure in the year on non-residential structures and buildings brought into qualifying use this year, for the structures and buildings allowance." + definition_period = YEAR + hidden_input = True + unit = GBP diff --git a/policyengine_uk/variables/firm/capital_allowances/firm_disposal_proceeds_full_expensing.py b/policyengine_uk/variables/firm/capital_allowances/firm_disposal_proceeds_full_expensing.py new file mode 100644 index 0000000000..caf5e56e69 --- /dev/null +++ b/policyengine_uk/variables/firm/capital_allowances/firm_disposal_proceeds_full_expensing.py @@ -0,0 +1,28 @@ +from policyengine_uk.model_api import * + + +class firm_disposal_proceeds_full_expensing(Variable): + value_type = float + entity = Firm + label = "Firm disposal proceeds of fully expensed main-rate plant" + documentation = ( + "The part of the main pool disposal proceeds " + "(firm_disposal_proceeds_main_pool) that relates to new main-rate " + "plant and machinery on which the company claimed full expensing " + "under section 45S of the Capital Allowances Act 2001: the disposal " + "value times the relevant proportion, which is 1 where the whole cost " + "was fully expensed. It is included in, not added to, the main pool " + "disposal proceeds. A company is charged on it in full as a balancing " + "charge, and the pool's disposal receipts are reduced by the same " + "amount (section 59A). Disposals of special-rate plant that had the " + "50% section 45S allowance (section 59B) and of plant that had the " + "super-deduction are not modelled." + ) + definition_period = YEAR + hidden_input = True + default_value = 0 + unit = GBP + reference = ( + "https://www.legislation.gov.uk/ukpga/2001/2/section/59A", + "https://www.legislation.gov.uk/ukpga/2001/2/section/45S", + ) diff --git a/policyengine_uk/variables/firm/capital_allowances/firm_disposal_proceeds_main_pool.py b/policyengine_uk/variables/firm/capital_allowances/firm_disposal_proceeds_main_pool.py new file mode 100644 index 0000000000..c7c77149e8 --- /dev/null +++ b/policyengine_uk/variables/firm/capital_allowances/firm_disposal_proceeds_main_pool.py @@ -0,0 +1,11 @@ +from policyengine_uk.model_api import * + + +class firm_disposal_proceeds_main_pool(Variable): + value_type = float + entity = Firm + label = "Firm main pool disposal proceeds" + documentation = "Disposal values brought into account in the main pool for plant and machinery sold or scrapped in the year, capped at original cost. Includes the proceeds of fully expensed plant, which firm_disposal_proceeds_full_expensing also reports." + definition_period = YEAR + hidden_input = True + unit = GBP diff --git a/policyengine_uk/variables/firm/capital_allowances/firm_main_pool_brought_forward.py b/policyengine_uk/variables/firm/capital_allowances/firm_main_pool_brought_forward.py new file mode 100644 index 0000000000..4b71670590 --- /dev/null +++ b/policyengine_uk/variables/firm/capital_allowances/firm_main_pool_brought_forward.py @@ -0,0 +1,11 @@ +from policyengine_uk.model_api import * + + +class firm_main_pool_brought_forward(Variable): + value_type = float + entity = Firm + label = "Firm main pool brought forward" + documentation = "Tax written-down value of the main pool of plant and machinery brought forward from the previous year, including first-year allowance balances carried into the pool." + definition_period = YEAR + hidden_input = True + unit = GBP diff --git a/policyengine_uk/variables/firm/capital_allowances/firm_sba_qualifying_cost_brought_forward.py b/policyengine_uk/variables/firm/capital_allowances/firm_sba_qualifying_cost_brought_forward.py new file mode 100644 index 0000000000..8c9d935f84 --- /dev/null +++ b/policyengine_uk/variables/firm/capital_allowances/firm_sba_qualifying_cost_brought_forward.py @@ -0,0 +1,11 @@ +from policyengine_uk.model_api import * + + +class firm_sba_qualifying_cost_brought_forward(Variable): + value_type = float + entity = Firm + label = "Firm structures and buildings qualifying cost brought forward" + documentation = "Qualifying cost of non-residential structures and buildings brought into use in earlier years on which the structures and buildings allowance is still being claimed." + definition_period = YEAR + hidden_input = True + unit = GBP diff --git a/policyengine_uk/variables/firm/capital_allowances/firm_special_rate_pool_brought_forward.py b/policyengine_uk/variables/firm/capital_allowances/firm_special_rate_pool_brought_forward.py new file mode 100644 index 0000000000..00c1caa5bb --- /dev/null +++ b/policyengine_uk/variables/firm/capital_allowances/firm_special_rate_pool_brought_forward.py @@ -0,0 +1,11 @@ +from policyengine_uk.model_api import * + + +class firm_special_rate_pool_brought_forward(Variable): + value_type = float + entity = Firm + label = "Firm special rate pool brought forward" + documentation = "Tax written-down value of the special rate pool of plant and machinery brought forward from the previous year, including first-year allowance balances carried into the pool." + definition_period = YEAR + hidden_input = True + unit = GBP diff --git a/policyengine_uk/variables/firm/corporation_tax/firm_bank_surcharge_allowance_share.py b/policyengine_uk/variables/firm/corporation_tax/firm_bank_surcharge_allowance_share.py new file mode 100644 index 0000000000..fdb407b9b5 --- /dev/null +++ b/policyengine_uk/variables/firm/corporation_tax/firm_bank_surcharge_allowance_share.py @@ -0,0 +1,23 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class firm_bank_surcharge_allowance_share(Variable): + value_type = float + entity = Firm + label = "Firm share of the bank surcharge allowance" + documentation = ( + "Share of the bank surcharge allowance available to this banking " + "company. A group with more than one banking company shares one " + "allowance, allocated between them by the group's allocation " + "statement; the shares sum to at most one across the group. The " + "default of 1 gives a stand-alone bank the whole allowance." + ) + definition_period = YEAR + hidden_input = True + unit = "/1" + default_value = 1 + reference = ( + "https://www.legislation.gov.uk/ukpga/2010/4/section/269DE", + "https://www.legislation.gov.uk/ukpga/2010/4/section/269DF", + ) diff --git a/policyengine_uk/variables/firm/corporation_tax/firm_deductions_allowance_share.py b/policyengine_uk/variables/firm/corporation_tax/firm_deductions_allowance_share.py new file mode 100644 index 0000000000..2d68ab7005 --- /dev/null +++ b/policyengine_uk/variables/firm/corporation_tax/firm_deductions_allowance_share.py @@ -0,0 +1,17 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class firm_deductions_allowance_share(Variable): + value_type = float + entity = Firm + label = "Firm share of the losses deductions allowance" + documentation = ( + "Share of the £5m corporation tax deductions allowance allocated to " + "this company. A group shares one allowance between its members; " + "the default of 1 gives the company the whole allowance." + ) + definition_period = YEAR + hidden_input = True + unit = "/1" + default_value = 1 diff --git a/policyengine_uk/variables/firm/corporation_tax/firm_exempt_distributions.py b/policyengine_uk/variables/firm/corporation_tax/firm_exempt_distributions.py new file mode 100644 index 0000000000..29ae1f72af --- /dev/null +++ b/policyengine_uk/variables/firm/corporation_tax/firm_exempt_distributions.py @@ -0,0 +1,17 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class firm_exempt_distributions(Variable): + value_type = float + entity = Firm + label = "Firm exempt distributions" + documentation = ( + "Exempt distributions received from non-group companies, which are " + "added to taxable total profits to give augmented profits for the " + "small profits rate and marginal relief." + ) + definition_period = YEAR + hidden_input = True + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/2010/4/section/18L" diff --git a/policyengine_uk/variables/firm/corporation_tax/firm_group_relief_claimed.py b/policyengine_uk/variables/firm/corporation_tax/firm_group_relief_claimed.py new file mode 100644 index 0000000000..e2201bb872 --- /dev/null +++ b/policyengine_uk/variables/firm/corporation_tax/firm_group_relief_claimed.py @@ -0,0 +1,13 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class firm_group_relief_claimed(Variable): + value_type = float + entity = Firm + label = "Firm group relief claimed" + documentation = "Losses and other amounts surrendered to the firm by other group companies that it claims as group relief for the year under CTA 2010 Part 5. The firm's deduction, firm_group_relief, is capped at its total profits. Enter group relief for carried-forward losses (Part 5A) in firm_group_relief_for_carried_forward_losses_claimed instead, so that it is restricted with the firm's own carried-forward losses. Defaults to 0." + definition_period = YEAR + hidden_input = True + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/2010/4/section/137" diff --git a/policyengine_uk/variables/firm/corporation_tax/firm_group_relief_for_carried_forward_losses_claimed.py b/policyengine_uk/variables/firm/corporation_tax/firm_group_relief_for_carried_forward_losses_claimed.py new file mode 100644 index 0000000000..52542f06c3 --- /dev/null +++ b/policyengine_uk/variables/firm/corporation_tax/firm_group_relief_for_carried_forward_losses_claimed.py @@ -0,0 +1,13 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class firm_group_relief_for_carried_forward_losses_claimed(Variable): + value_type = float + entity = Firm + label = "Firm group relief for carried-forward losses claimed" + documentation = "Carried-forward losses surrendered to the firm by other group companies that it claims for the year under CTA 2010 Part 5A, from 1 April 2017. The deduction is limited to the room left within the firm's relevant maximum after its own carried-forward losses, and is not given while its own carried-forward losses are unused. Defaults to 0." + definition_period = YEAR + hidden_input = True + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/2010/4/section/188CK" diff --git a/policyengine_uk/variables/firm/corporation_tax/firm_losses_brought_forward.py b/policyengine_uk/variables/firm/corporation_tax/firm_losses_brought_forward.py new file mode 100644 index 0000000000..afe7c7bc62 --- /dev/null +++ b/policyengine_uk/variables/firm/corporation_tax/firm_losses_brought_forward.py @@ -0,0 +1,16 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class firm_losses_brought_forward(Variable): + value_type = float + entity = Firm + label = "Firm losses brought forward" + documentation = ( + "Carried-forward losses available for relief against the firm's " + "total profits in the year, before the deductions allowance " + "restriction." + ) + definition_period = YEAR + hidden_input = True + unit = GBP diff --git a/policyengine_uk/variables/firm/corporation_tax/firm_non_banking_group_relief_claimed.py b/policyengine_uk/variables/firm/corporation_tax/firm_non_banking_group_relief_claimed.py new file mode 100644 index 0000000000..84406e7217 --- /dev/null +++ b/policyengine_uk/variables/firm/corporation_tax/firm_non_banking_group_relief_claimed.py @@ -0,0 +1,13 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class firm_non_banking_group_relief_claimed(Variable): + value_type = float + entity = Firm + label = "Firm non-banking group relief claimed" + documentation = "For a banking company, the part of its group relief claimed (Parts 5 and 5A) that was surrendered by non-banking companies. It is added back to the bank surcharge profits (CTA 2010 ss.269DA and 269DB). Defaults to 0." + definition_period = YEAR + hidden_input = True + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/2010/4/section/269DB" diff --git a/policyengine_uk/variables/firm/corporation_tax/firm_non_trading_profits.py b/policyengine_uk/variables/firm/corporation_tax/firm_non_trading_profits.py new file mode 100644 index 0000000000..b43e3b6711 --- /dev/null +++ b/policyengine_uk/variables/firm/corporation_tax/firm_non_trading_profits.py @@ -0,0 +1,16 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class firm_non_trading_profits(Variable): + value_type = float + entity = Firm + label = "Firm non-trading profits" + documentation = ( + "Profits chargeable to corporation tax other than trading profits, " + "such as non-trading loan relationship credits, property income and " + "chargeable gains, net of their own reliefs." + ) + definition_period = YEAR + hidden_input = True + unit = GBP diff --git a/policyengine_uk/variables/firm/corporation_tax/firm_relevant_ip_profits.py b/policyengine_uk/variables/firm/corporation_tax/firm_relevant_ip_profits.py new file mode 100644 index 0000000000..ac064e7817 --- /dev/null +++ b/policyengine_uk/variables/firm/corporation_tax/firm_relevant_ip_profits.py @@ -0,0 +1,18 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class firm_relevant_ip_profits(Variable): + value_type = float + entity = Firm + label = "Firm relevant IP profits" + documentation = ( + "Relevant IP profits of a company that has elected into the Patent " + "Box (CTA 2010 Part 8A), after streaming and the nexus fraction, " + "which firm data cannot reproduce. Defaults to 0, so no Patent Box " + "deduction is made." + ) + definition_period = YEAR + hidden_input = True + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/2010/4/section/357A" diff --git a/policyengine_uk/variables/firm/corporation_tax/firm_small_profits_rate_excluded.py b/policyengine_uk/variables/firm/corporation_tax/firm_small_profits_rate_excluded.py new file mode 100644 index 0000000000..b4d55fcd18 --- /dev/null +++ b/policyengine_uk/variables/firm/corporation_tax/firm_small_profits_rate_excluded.py @@ -0,0 +1,23 @@ +from policyengine_uk.model_api import * + + +class firm_small_profits_rate_excluded(Variable): + value_type = bool + entity = Firm + label = "Firm excluded from the corporation tax small profits rate" + documentation = ( + "Whether the company is barred from the small profits rate and " + "marginal relief because it is a close investment-holding company " + "(section 18N of the Corporation Tax Act 2010) or is not UK resident " + "in the accounting period (sections 18A(1) and 18B(1)). Such a " + "company pays the main rate on all its taxable total profits. " + "Defaults to false." + ) + definition_period = YEAR + hidden_input = True + default_value = False + reference = ( + "https://www.legislation.gov.uk/ukpga/2010/4/section/18A", + "https://www.legislation.gov.uk/ukpga/2010/4/section/18B", + "https://www.legislation.gov.uk/ukpga/2010/4/section/18N", + ) diff --git a/policyengine_uk/variables/firm/corporation_tax/firm_trading_loss_surrendered.py b/policyengine_uk/variables/firm/corporation_tax/firm_trading_loss_surrendered.py new file mode 100644 index 0000000000..ef5f59d808 --- /dev/null +++ b/policyengine_uk/variables/firm/corporation_tax/firm_trading_loss_surrendered.py @@ -0,0 +1,13 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class firm_trading_loss_surrendered(Variable): + value_type = float + entity = Firm + label = "Firm trading loss surrendered as group relief" + documentation = "Trading loss of the year that the firm surrenders to other group companies as group relief. It reduces the loss the firm can surrender for an SME R&D payable credit (CTA 2009 s.1056(2)(c)). Its effect on the claimant is entered there as firm_group_relief_claimed. Defaults to 0." + definition_period = YEAR + hidden_input = True + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/2009/4/section/1056" diff --git a/policyengine_uk/variables/firm/employer_costs/firm_apprenticeship_levy_allowance_share.py b/policyengine_uk/variables/firm/employer_costs/firm_apprenticeship_levy_allowance_share.py new file mode 100644 index 0000000000..ab278ba1aa --- /dev/null +++ b/policyengine_uk/variables/firm/employer_costs/firm_apprenticeship_levy_allowance_share.py @@ -0,0 +1,23 @@ +from policyengine_uk.model_api import * + + +class firm_apprenticeship_levy_allowance_share(Variable): + value_type = float + entity = Firm + label = "Firm share of the apprenticeship levy allowance" + documentation = ( + "Share of the levy allowance allocated to the firm. Connected " + "companies form a company unit whose members share one allowance and " + "choose each member's part; the shares sum to one across the unit. 1 " + "for a firm with no connected companies." + ) + definition_period = YEAR + hidden_input = True + unit = "/1" + default_value = 1 + reference = [ + dict( + title="Finance Act 2016 s.101", + href="https://www.legislation.gov.uk/ukpga/2016/24/section/101", + ), + ] diff --git a/policyengine_uk/variables/firm/employer_costs/firm_claims_employment_allowance.py b/policyengine_uk/variables/firm/employer_costs/firm_claims_employment_allowance.py new file mode 100644 index 0000000000..ec6a8493bc --- /dev/null +++ b/policyengine_uk/variables/firm/employer_costs/firm_claims_employment_allowance.py @@ -0,0 +1,22 @@ +from policyengine_uk.model_api import * + + +class firm_claims_employment_allowance(Variable): + value_type = bool + entity = Firm + label = "Firm is the group member that claims the Employment Allowance" + documentation = ( + "Whether the firm is the member of its group of connected companies " + "or charities that the group chooses to claim the Employment " + "Allowance. Only one member of a connected group may claim. True for " + "a firm with no connected companies." + ) + definition_period = YEAR + hidden_input = True + default_value = True + reference = [ + dict( + title="National Insurance Contributions Act 2014 s.3", + href="https://www.legislation.gov.uk/ukpga/2014/7/section/3", + ), + ] diff --git a/policyengine_uk/variables/firm/employer_costs/firm_employees_above_auto_enrolment_upper_limit.py b/policyengine_uk/variables/firm/employer_costs/firm_employees_above_auto_enrolment_upper_limit.py new file mode 100644 index 0000000000..0201c609e7 --- /dev/null +++ b/policyengine_uk/variables/firm/employer_costs/firm_employees_above_auto_enrolment_upper_limit.py @@ -0,0 +1,21 @@ +from policyengine_uk.model_api import * + + +class firm_employees_above_auto_enrolment_upper_limit(Variable): + value_type = int + entity = Firm + label = "Firm employees paid above the qualifying earnings upper limit" + documentation = ( + "Number of the firm's enrolled employees whose annual earnings " + "exceed the upper limit of the qualifying earnings band, so each has " + "qualifying earnings of the full band width. Defaults to 0." + ) + definition_period = YEAR + hidden_input = True + unit = "person" + reference = [ + dict( + title="Pensions Act 2008 s.13", + href="https://www.legislation.gov.uk/ukpga/2008/30/section/13", + ), + ] diff --git a/policyengine_uk/variables/firm/employer_costs/firm_employees_below_auto_enrolment_earnings_trigger.py b/policyengine_uk/variables/firm/employer_costs/firm_employees_below_auto_enrolment_earnings_trigger.py new file mode 100644 index 0000000000..b6c040cfdd --- /dev/null +++ b/policyengine_uk/variables/firm/employer_costs/firm_employees_below_auto_enrolment_earnings_trigger.py @@ -0,0 +1,22 @@ +from policyengine_uk.model_api import * + + +class firm_employees_below_auto_enrolment_earnings_trigger(Variable): + value_type = int + entity = Firm + label = "Firm employees paid at or below the automatic enrolment earnings trigger" + documentation = ( + "Number of the firm's employees whose annual earnings are at or below " + "the automatic enrolment earnings trigger, so the employer need not " + "enrol them (enrolment requires earnings above the trigger). They are treated as not enrolled (no opt-ins). Defaults to 0, " + "which keeps the plain average-pay approximation." + ) + definition_period = YEAR + hidden_input = True + unit = "person" + reference = [ + dict( + title="Pensions Act 2008 s.3(1)(c)", + href="https://www.legislation.gov.uk/ukpga/2008/30/section/3", + ), + ] diff --git a/policyengine_uk/variables/firm/employer_costs/firm_employees_below_secondary_threshold.py b/policyengine_uk/variables/firm/employer_costs/firm_employees_below_secondary_threshold.py new file mode 100644 index 0000000000..0f0969d1f1 --- /dev/null +++ b/policyengine_uk/variables/firm/employer_costs/firm_employees_below_secondary_threshold.py @@ -0,0 +1,27 @@ +from policyengine_uk.model_api import * + + +class firm_employees_below_secondary_threshold(Variable): + value_type = int + entity = Firm + label = "Firm employees paid at or below the secondary threshold" + documentation = ( + "Number of the firm's employees whose Class 1 earnings for the year " + "are at or below the annual secondary threshold, so pay no secondary " + "contributions. Used with their pay to remove them from the " + "average-pay approximation of earnings above the threshold. Defaults " + "to 0, which keeps the plain average-pay approximation." + " Measure the split at the simulated year's secondary threshold " + "(£9,100 in 2022-23 to 2024-25, £5,000 from 2025-26); with a split " + "measured at another threshold, or a reform to the threshold, the " + "base is approximate." + ) + definition_period = YEAR + hidden_input = True + unit = "person" + reference = [ + dict( + title="Social Security Contributions and Benefits Act 1992 s.9", + href="https://www.legislation.gov.uk/ukpga/1992/4/section/9", + ), + ] diff --git a/policyengine_uk/variables/firm/employer_costs/firm_is_public_body.py b/policyengine_uk/variables/firm/employer_costs/firm_is_public_body.py new file mode 100644 index 0000000000..46ea7c69b4 --- /dev/null +++ b/policyengine_uk/variables/firm/employer_costs/firm_is_public_body.py @@ -0,0 +1,21 @@ +from policyengine_uk.model_api import * + + +class firm_is_public_body(Variable): + value_type = bool + entity = Firm + label = "Firm is a public authority" + documentation = ( + "Whether the firm is a public authority, including a body whose " + "activities are mainly of a public nature. A public authority that is " + "not a charity cannot claim the Employment Allowance." + ) + definition_period = YEAR + hidden_input = True + default_value = False + reference = [ + dict( + title="National Insurance Contributions Act 2014 s.2", + href="https://www.legislation.gov.uk/ukpga/2014/7/section/2", + ), + ] diff --git a/policyengine_uk/variables/firm/employer_costs/firm_off_payroll_deemed_payments.py b/policyengine_uk/variables/firm/employer_costs/firm_off_payroll_deemed_payments.py new file mode 100644 index 0000000000..6cdab5f4c7 --- /dev/null +++ b/policyengine_uk/variables/firm/employer_costs/firm_off_payroll_deemed_payments.py @@ -0,0 +1,12 @@ +from policyengine_uk.model_api import * + + +class firm_off_payroll_deemed_payments(Variable): + value_type = float + entity = Firm + label = "Firm off-payroll deemed direct payments" + documentation = "Deemed direct payments the firm makes as the fee-payer under the off-payroll working rules: the chain payments for workers engaged through intermediaries, less VAT, materials and any expenses deducted (SI 2000/727 reg 17(1)). Not part of firm_paybill. A small private-sector client is outside the rules from April 2021, so leave this at 0 for one. Defaults to 0." + definition_period = YEAR + hidden_input = True + unit = GBP + reference = "https://www.legislation.gov.uk/uksi/2000/727/regulation/17" diff --git a/policyengine_uk/variables/firm/employer_costs/firm_off_payroll_deemed_workers.py b/policyengine_uk/variables/firm/employer_costs/firm_off_payroll_deemed_workers.py new file mode 100644 index 0000000000..4e2f911cbb --- /dev/null +++ b/policyengine_uk/variables/firm/employer_costs/firm_off_payroll_deemed_workers.py @@ -0,0 +1,12 @@ +from policyengine_uk.model_api import * + + +class firm_off_payroll_deemed_workers(Variable): + value_type = int + entity = Firm + label = "Firm off-payroll deemed workers" + documentation = "Number of workers whose deemed direct payments make up firm_off_payroll_deemed_payments. The secondary threshold is deducted once for each. At the default of 0, firm_off_payroll_deemed_payments is treated as already above the threshold." + definition_period = YEAR + hidden_input = True + unit = "person" + reference = "https://www.legislation.gov.uk/ukpga/1992/4/section/9" diff --git a/policyengine_uk/variables/firm/employer_costs/firm_paybill_above_auto_enrolment_upper_limit.py b/policyengine_uk/variables/firm/employer_costs/firm_paybill_above_auto_enrolment_upper_limit.py new file mode 100644 index 0000000000..4a90ec625d --- /dev/null +++ b/policyengine_uk/variables/firm/employer_costs/firm_paybill_above_auto_enrolment_upper_limit.py @@ -0,0 +1,20 @@ +from policyengine_uk.model_api import * + + +class firm_paybill_above_auto_enrolment_upper_limit(Variable): + value_type = float + entity = Firm + label = "Firm paybill of employees paid above the qualifying earnings upper limit" + documentation = ( + "Total annual earnings of the employees counted in " + "firm_employees_above_auto_enrolment_upper_limit. Defaults to 0." + ) + definition_period = YEAR + hidden_input = True + unit = GBP + reference = [ + dict( + title="Pensions Act 2008 s.13", + href="https://www.legislation.gov.uk/ukpga/2008/30/section/13", + ), + ] diff --git a/policyengine_uk/variables/firm/employer_costs/firm_paybill_below_auto_enrolment_earnings_trigger.py b/policyengine_uk/variables/firm/employer_costs/firm_paybill_below_auto_enrolment_earnings_trigger.py new file mode 100644 index 0000000000..441d4252d4 --- /dev/null +++ b/policyengine_uk/variables/firm/employer_costs/firm_paybill_below_auto_enrolment_earnings_trigger.py @@ -0,0 +1,23 @@ +from policyengine_uk.model_api import * + + +class firm_paybill_below_auto_enrolment_earnings_trigger(Variable): + value_type = float + entity = Firm + label = ( + "Firm paybill of employees paid at or below the automatic enrolment " + "earnings trigger" + ) + documentation = ( + "Total annual earnings of the employees counted in " + "firm_employees_below_auto_enrolment_earnings_trigger. Defaults to 0." + ) + definition_period = YEAR + hidden_input = True + unit = GBP + reference = [ + dict( + title="Pensions Act 2008 s.3(1)(c)", + href="https://www.legislation.gov.uk/ukpga/2008/30/section/3", + ), + ] diff --git a/policyengine_uk/variables/firm/employer_costs/firm_paybill_below_secondary_threshold.py b/policyengine_uk/variables/firm/employer_costs/firm_paybill_below_secondary_threshold.py new file mode 100644 index 0000000000..c22c9a49d5 --- /dev/null +++ b/policyengine_uk/variables/firm/employer_costs/firm_paybill_below_secondary_threshold.py @@ -0,0 +1,24 @@ +from policyengine_uk.model_api import * + + +class firm_paybill_below_secondary_threshold(Variable): + value_type = float + entity = Firm + label = "Firm paybill of employees paid at or below the secondary threshold" + documentation = ( + "Total Class 1 earnings for the year of the employees counted in " + "firm_employees_below_secondary_threshold. Defaults to 0." + " Measure the split at the simulated year's secondary threshold " + "(£9,100 in 2022-23 to 2024-25, £5,000 from 2025-26); with a split " + "measured at another threshold, or a reform to the threshold, the " + "base is approximate." + ) + definition_period = YEAR + hidden_input = True + unit = GBP + reference = [ + dict( + title="Social Security Contributions and Benefits Act 1992 s.9", + href="https://www.legislation.gov.uk/ukpga/1992/4/section/9", + ), + ] diff --git a/policyengine_uk/variables/firm/employer_costs/firm_psa_chargeable_earnings.py b/policyengine_uk/variables/firm/employer_costs/firm_psa_chargeable_earnings.py new file mode 100644 index 0000000000..08ef03a79d --- /dev/null +++ b/policyengine_uk/variables/firm/employer_costs/firm_psa_chargeable_earnings.py @@ -0,0 +1,12 @@ +from policyengine_uk.model_api import * + + +class firm_psa_chargeable_earnings(Variable): + value_type = float + entity = Firm + label = "Firm PAYE settlement agreement chargeable earnings" + documentation = "General earnings included in the firm's PAYE settlement agreements that would otherwise bear secondary Class 1 or Class 1A contributions (SSCBA 1992 s.10A(1)(a), (4)). Do not also include them in firm_paybill or firm_class_1a_benefits. Defaults to 0." + definition_period = YEAR + hidden_input = True + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/1992/4/section/10A" diff --git a/policyengine_uk/variables/firm/employer_costs/firm_psa_income_tax.py b/policyengine_uk/variables/firm/employer_costs/firm_psa_income_tax.py new file mode 100644 index 0000000000..df99b7bb09 --- /dev/null +++ b/policyengine_uk/variables/firm/employer_costs/firm_psa_income_tax.py @@ -0,0 +1,12 @@ +from policyengine_uk.model_api import * + + +class firm_psa_income_tax(Variable): + value_type = float + entity = Firm + label = "Firm PAYE settlement agreement income tax" + documentation = "Total income tax, grossed up, for which the firm is accountable under its PAYE settlement agreements (SSCBA 1992 s.10A(1)(b)). Defaults to 0." + definition_period = YEAR + hidden_input = True + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/1992/4/section/10A" diff --git a/policyengine_uk/variables/firm/employer_costs/firm_termination_award_recipients.py b/policyengine_uk/variables/firm/employer_costs/firm_termination_award_recipients.py new file mode 100644 index 0000000000..2a4d33564e --- /dev/null +++ b/policyengine_uk/variables/firm/employer_costs/firm_termination_award_recipients.py @@ -0,0 +1,12 @@ +from policyengine_uk.model_api import * + + +class firm_termination_award_recipients(Variable): + value_type = int + entity = Firm + label = "Firm termination award recipients" + documentation = "Number of employees whose awards make up firm_termination_awards. The £30,000 threshold is deducted once for each. At the default of 0, firm_termination_awards is treated as already above the threshold." + definition_period = YEAR + hidden_input = True + unit = "person" + reference = "https://www.legislation.gov.uk/ukpga/2003/1/section/403" diff --git a/policyengine_uk/variables/firm/employer_costs/firm_termination_awards.py b/policyengine_uk/variables/firm/employer_costs/firm_termination_awards.py new file mode 100644 index 0000000000..82f1cad887 --- /dev/null +++ b/policyengine_uk/variables/firm/employer_costs/firm_termination_awards.py @@ -0,0 +1,12 @@ +from policyengine_uk.model_api import * + + +class firm_termination_awards(Variable): + value_type = float + entity = Firm + label = "Firm termination awards" + documentation = "Termination awards the firm pays that count as employment income under ITEPA 2003 s.403, before the £30,000 threshold, aggregated for each employee. Leave out amounts charged to Class 1, such as post-employment notice pay (s.402B). Defaults to 0." + definition_period = YEAR + hidden_input = True + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/2003/1/section/403" diff --git a/policyengine_uk/variables/firm/employer_costs/firm_zero_rated_class_1_earnings.py b/policyengine_uk/variables/firm/employer_costs/firm_zero_rated_class_1_earnings.py new file mode 100644 index 0000000000..07621f5f48 --- /dev/null +++ b/policyengine_uk/variables/firm/employer_costs/firm_zero_rated_class_1_earnings.py @@ -0,0 +1,45 @@ +from policyengine_uk.model_api import * + + +class firm_zero_rated_class_1_earnings(Variable): + value_type = float + entity = Firm + label = "Firm Class 1 earnings in a zero-rate band" + documentation = ( + "Earnings of the firm's employees between the secondary threshold and " + "the upper threshold of a 0% secondary band: the upper secondary " + "threshold for an earner under 21 (SSCBA 1992 s.9A), the apprentice " + "upper secondary threshold for a relevant apprentice under 25 (s.9B), " + "the freeport or investment zone upper secondary threshold for an " + "eligible employee (National Insurance Contributions Act 2022 s.1), " + "or the veterans upper secondary threshold for a veteran in the first " + "year of civilian employment (s.6, available in tax years 2022-23 to " + "2027-28 under s.6(4); £50,270 in 2026-27). " + "The caller applies the relevant threshold to each employee; the " + "firm-level model has no per-employee pay." + ) + definition_period = YEAR + hidden_input = True + unit = GBP + reference = [ + dict( + title="Social Security Contributions and Benefits Act 1992 s.9A", + href="https://www.legislation.gov.uk/ukpga/1992/4/section/9A", + ), + dict( + title="Social Security Contributions and Benefits Act 1992 s.9B", + href="https://www.legislation.gov.uk/ukpga/1992/4/section/9B", + ), + dict( + title="National Insurance Contributions Act 2022 s.1", + href="https://www.legislation.gov.uk/ukpga/2022/9/section/1", + ), + dict( + title="National Insurance Contributions Act 2022 s.6 (veterans)", + href="https://www.legislation.gov.uk/ukpga/2022/9/section/6", + ), + dict( + title="HMRC, Rates and thresholds for employers 2026 to 2027 (veterans upper secondary threshold)", + href="https://www.gov.uk/guidance/rates-and-thresholds-for-employers-2026-to-2027", + ), + ] diff --git a/policyengine_uk/variables/firm/firm_class_1a_benefits.py b/policyengine_uk/variables/firm/firm_class_1a_benefits.py new file mode 100644 index 0000000000..4548685c4b --- /dev/null +++ b/policyengine_uk/variables/firm/firm_class_1a_benefits.py @@ -0,0 +1,23 @@ +from policyengine_uk.model_api import * + + +class firm_class_1a_benefits(Variable): + value_type = float + entity = Firm + label = "Firm benefits in kind liable to Class 1A" + documentation = ( + "Cash equivalent of the taxable benefits in kind the firm provides to " + "its employees in the year, which are general earnings under ITEPA " + "2003 but not Class 1 earnings, and on which the firm pays Class 1A " + "contributions (SSCBA 1992 s.10(1))." + ) + definition_period = YEAR + hidden_input = True + default_value = 0 + unit = GBP + reference = [ + dict( + title="Social Security Contributions and Benefits Act 1992 s.10", + href="https://www.legislation.gov.uk/ukpga/1992/4/section/10", + ), + ] diff --git a/policyengine_uk/variables/firm/firm_employees.py b/policyengine_uk/variables/firm/firm_employees.py new file mode 100644 index 0000000000..5041d5c0b1 --- /dev/null +++ b/policyengine_uk/variables/firm/firm_employees.py @@ -0,0 +1,11 @@ +from policyengine_uk.model_api import * + + +class firm_employees(Variable): + value_type = int + entity = Firm + label = "Number of employees" + documentation = "Number of employees on the firm's payroll in the year (headcount)." + definition_period = YEAR + hidden_input = True + unit = "person" diff --git a/policyengine_uk/variables/firm/firm_id.py b/policyengine_uk/variables/firm/firm_id.py new file mode 100644 index 0000000000..4a5772c3df --- /dev/null +++ b/policyengine_uk/variables/firm/firm_id.py @@ -0,0 +1,10 @@ +from policyengine_uk.model_api import * + + +class firm_id(Variable): + value_type = int + entity = Firm + label = "Firm ID" + documentation = "Identifier of the firm. Unique within a dataset or situation." + definition_period = YEAR + hidden_input = True diff --git a/policyengine_uk/variables/firm/firm_in_freeport.py b/policyengine_uk/variables/firm/firm_in_freeport.py new file mode 100644 index 0000000000..6a1f82ff66 --- /dev/null +++ b/policyengine_uk/variables/firm/firm_in_freeport.py @@ -0,0 +1,17 @@ +from policyengine_uk.model_api import * + + +class firm_in_freeport(Variable): + value_type = bool + entity = Firm + label = "Firm operates in a freeport" + documentation = ( + "Whether the firm's employees work in a freeport or investment zone " + "tax site. No rule reads it yet: the employer National Insurance zero " + "rate for those employees enters through " + "firm_zero_rated_class_1_earnings, and freeport capital allowances " + "and business rates relief are not modelled." + ) + definition_period = YEAR + hidden_input = True + default_value = False diff --git a/policyengine_uk/variables/firm/firm_input_costs.py b/policyengine_uk/variables/firm/firm_input_costs.py new file mode 100644 index 0000000000..bffd4b73e5 --- /dev/null +++ b/policyengine_uk/variables/firm/firm_input_costs.py @@ -0,0 +1,11 @@ +from policyengine_uk.model_api import * + + +class firm_input_costs(Variable): + value_type = float + entity = Firm + label = "Firm input costs" + documentation = "Value of the goods and services the firm buys from other businesses in the year, excluding VAT and excluding pay and capital investment." + definition_period = YEAR + hidden_input = True + unit = GBP diff --git a/policyengine_uk/variables/firm/firm_is_bank.py b/policyengine_uk/variables/firm/firm_is_bank.py new file mode 100644 index 0000000000..7848c40573 --- /dev/null +++ b/policyengine_uk/variables/firm/firm_is_bank.py @@ -0,0 +1,11 @@ +from policyengine_uk.model_api import * + + +class firm_is_bank(Variable): + value_type = bool + entity = Firm + label = "Firm is a bank" + documentation = "Whether the firm is a bank or a member of a banking group for corporation tax purposes, including the bank surcharge." + definition_period = YEAR + hidden_input = True + default_value = False diff --git a/policyengine_uk/variables/firm/firm_is_charity.py b/policyengine_uk/variables/firm/firm_is_charity.py new file mode 100644 index 0000000000..2ec5703569 --- /dev/null +++ b/policyengine_uk/variables/firm/firm_is_charity.py @@ -0,0 +1,11 @@ +from policyengine_uk.model_api import * + + +class firm_is_charity(Variable): + value_type = bool + entity = Firm + label = "Firm is a charity" + documentation = "Whether the firm is a registered charity." + definition_period = YEAR + hidden_input = True + default_value = False diff --git a/policyengine_uk/variables/firm/firm_is_single_director_company.py b/policyengine_uk/variables/firm/firm_is_single_director_company.py new file mode 100644 index 0000000000..6e27966dd5 --- /dev/null +++ b/policyengine_uk/variables/firm/firm_is_single_director_company.py @@ -0,0 +1,11 @@ +from policyengine_uk.model_api import * + + +class firm_is_single_director_company(Variable): + value_type = bool + entity = Firm + label = "Firm is a single-director company" + documentation = "Whether the firm is a company whose only employee paid above the secondary threshold is a director, which excludes it from the Employment Allowance." + definition_period = YEAR + hidden_input = True + default_value = False diff --git a/policyengine_uk/variables/firm/firm_legal_form.py b/policyengine_uk/variables/firm/firm_legal_form.py new file mode 100644 index 0000000000..4388bd856d --- /dev/null +++ b/policyengine_uk/variables/firm/firm_legal_form.py @@ -0,0 +1,19 @@ +from policyengine_uk.model_api import * + + +class FirmLegalForm(Enum): + COMPANY = "Company" + SOLE_TRADER = "Sole trader" + PARTNERSHIP = "Partnership" + OTHER = "Other" + + +class firm_legal_form(Variable): + value_type = Enum + entity = Firm + label = "Firm legal form" + documentation = "Legal form of the business: a company, a sole trader, a partnership or another form." + definition_period = YEAR + hidden_input = True + possible_values = FirmLegalForm + default_value = FirmLegalForm.COMPANY diff --git a/policyengine_uk/variables/firm/firm_low_paid_hours.py b/policyengine_uk/variables/firm/firm_low_paid_hours.py new file mode 100644 index 0000000000..6ddfaea8ad --- /dev/null +++ b/policyengine_uk/variables/firm/firm_low_paid_hours.py @@ -0,0 +1,21 @@ +from policyengine_uk.model_api import * + + +class firm_low_paid_hours(Variable): + value_type = float + entity = Firm + label = "Firm hours worked by low-paid workers" + documentation = ( + "Annual hours worked by the firm's low-paid workers, the block whose " + "pay firm_minimum_wage_cost compares with the adult minimum wage. " + "firm_low_paid_paybill is the pay for these hours. Defaults to 0." + ) + definition_period = YEAR + hidden_input = True + unit = "hour" + reference = [ + dict( + title="National Minimum Wage Act 1998 s.1", + href="https://www.legislation.gov.uk/ukpga/1998/39/section/1", + ), + ] diff --git a/policyengine_uk/variables/firm/firm_low_paid_paybill.py b/policyengine_uk/variables/firm/firm_low_paid_paybill.py new file mode 100644 index 0000000000..fb54ffe8fb --- /dev/null +++ b/policyengine_uk/variables/firm/firm_low_paid_paybill.py @@ -0,0 +1,20 @@ +from policyengine_uk.model_api import * + + +class firm_low_paid_paybill(Variable): + value_type = float + entity = Firm + label = "Firm paybill of low-paid workers" + documentation = ( + "Pay for the hours in firm_low_paid_hours, included in firm_paybill. " + "Defaults to 0." + ) + definition_period = YEAR + hidden_input = True + unit = GBP + reference = [ + dict( + title="National Minimum Wage Act 1998 s.1", + href="https://www.legislation.gov.uk/ukpga/1998/39/section/1", + ), + ] diff --git a/policyengine_uk/variables/firm/firm_n_associated_companies.py b/policyengine_uk/variables/firm/firm_n_associated_companies.py new file mode 100644 index 0000000000..ee6e7bdea5 --- /dev/null +++ b/policyengine_uk/variables/firm/firm_n_associated_companies.py @@ -0,0 +1,10 @@ +from policyengine_uk.model_api import * + + +class firm_n_associated_companies(Variable): + value_type = int + entity = Firm + label = "Number of associated companies" + documentation = "Number of companies associated with the firm for corporation tax purposes (excluding the firm itself), which divides the small profits and upper limits." + definition_period = YEAR + hidden_input = True diff --git a/policyengine_uk/variables/firm/firm_paybill.py b/policyengine_uk/variables/firm/firm_paybill.py new file mode 100644 index 0000000000..76b40a008d --- /dev/null +++ b/policyengine_uk/variables/firm/firm_paybill.py @@ -0,0 +1,11 @@ +from policyengine_uk.model_api import * + + +class firm_paybill(Variable): + value_type = float + entity = Firm + label = "Firm paybill" + documentation = "Earnings paid to the firm's employees in the year that count as Class 1 National Insurance earnings, before any employer contributions." + definition_period = YEAR + hidden_input = True + unit = GBP diff --git a/policyengine_uk/variables/firm/firm_rateable_value.py b/policyengine_uk/variables/firm/firm_rateable_value.py new file mode 100644 index 0000000000..f83f49c1bf --- /dev/null +++ b/policyengine_uk/variables/firm/firm_rateable_value.py @@ -0,0 +1,11 @@ +from policyengine_uk.model_api import * + + +class firm_rateable_value(Variable): + value_type = float + entity = Firm + label = "Firm rateable value" + documentation = "Total rateable value of the non-domestic properties the firm occupies, as set by the Valuation Office Agency (in Scotland, the assessor). In Northern Ireland it is the net annual value set by Land and Property Services." + definition_period = YEAR + hidden_input = True + unit = GBP diff --git a/policyengine_uk/variables/firm/firm_region.py b/policyengine_uk/variables/firm/firm_region.py new file mode 100644 index 0000000000..9899ccbdae --- /dev/null +++ b/policyengine_uk/variables/firm/firm_region.py @@ -0,0 +1,13 @@ +from policyengine_uk.model_api import * +from policyengine_uk.variables.household.demographic.geography import Region + + +class firm_region(Variable): + value_type = Enum + entity = Firm + label = "Firm region" + documentation = "ITL1 region (or nation) where the firm is based." + definition_period = YEAR + hidden_input = True + possible_values = Region + default_value = Region.LONDON diff --git a/policyengine_uk/variables/firm/firm_sic_section.py b/policyengine_uk/variables/firm/firm_sic_section.py new file mode 100644 index 0000000000..94f890ab9f --- /dev/null +++ b/policyengine_uk/variables/firm/firm_sic_section.py @@ -0,0 +1,37 @@ +from policyengine_uk.model_api import * + + +class SICSection(Enum): + UNKNOWN = "Unknown" + A = "Agriculture, forestry and fishing" + B = "Mining and quarrying" + C = "Manufacturing" + D = "Electricity, gas, steam and air conditioning supply" + E = "Water supply; sewerage, waste management and remediation activities" + F = "Construction" + G = "Wholesale and retail trade; repair of motor vehicles and motorcycles" + H = "Transportation and storage" + I = "Accommodation and food service activities" + J = "Information and communication" + K = "Financial and insurance activities" + L = "Real estate activities" + M = "Professional, scientific and technical activities" + N = "Administrative and support service activities" + O = "Public administration and defence; compulsory social security" + P = "Education" + Q = "Human health and social work activities" + R = "Arts, entertainment and recreation" + S = "Other service activities" + T = "Activities of households as employers" + U = "Activities of extraterritorial organisations and bodies" + + +class firm_sic_section(Variable): + value_type = Enum + entity = Firm + label = "Firm industry (SIC section)" + documentation = "Section of the UK Standard Industrial Classification of economic activities 2007 (SIC 2007) of the firm's main activity." + definition_period = YEAR + hidden_input = True + possible_values = SICSection + default_value = SICSection.UNKNOWN diff --git a/policyengine_uk/variables/firm/firm_taxable_trading_profit.py b/policyengine_uk/variables/firm/firm_taxable_trading_profit.py new file mode 100644 index 0000000000..d0a1d175cd --- /dev/null +++ b/policyengine_uk/variables/firm/firm_taxable_trading_profit.py @@ -0,0 +1,11 @@ +from policyengine_uk.model_api import * + + +class firm_taxable_trading_profit(Variable): + value_type = float + entity = Firm + label = "Firm taxable trading profit" + documentation = "The firm's trading profit for the year as adjusted for tax, before capital allowances, reliefs and losses. Negative for a trading loss." + definition_period = YEAR + hidden_input = True + unit = GBP diff --git a/policyengine_uk/variables/firm/firm_turnover.py b/policyengine_uk/variables/firm/firm_turnover.py new file mode 100644 index 0000000000..85fca77f80 --- /dev/null +++ b/policyengine_uk/variables/firm/firm_turnover.py @@ -0,0 +1,13 @@ +from policyengine_uk.model_api import * + + +class firm_turnover(Variable): + value_type = float + entity = Firm + label = "Firm turnover" + documentation = ( + "Value of the firm's sales of goods and services in the year, excluding VAT." + ) + definition_period = YEAR + hidden_input = True + unit = GBP diff --git a/policyengine_uk/variables/firm/firm_weight.py b/policyengine_uk/variables/firm/firm_weight.py new file mode 100644 index 0000000000..2bf175eb92 --- /dev/null +++ b/policyengine_uk/variables/firm/firm_weight.py @@ -0,0 +1,11 @@ +from policyengine_uk.model_api import * + + +class firm_weight(Variable): + value_type = float + entity = Firm + label = "Firm weight" + documentation = "Number of firms in the population this firm represents. Defaults to one, so a firm in a situation counts once." + definition_period = YEAR + hidden_input = True + default_value = 1 diff --git a/policyengine_uk/variables/firm/product_taxes/firm_plastic_packaging_tonnes_chargeable.py b/policyengine_uk/variables/firm/product_taxes/firm_plastic_packaging_tonnes_chargeable.py new file mode 100644 index 0000000000..5399ea2d97 --- /dev/null +++ b/policyengine_uk/variables/firm/product_taxes/firm_plastic_packaging_tonnes_chargeable.py @@ -0,0 +1,12 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_plastic_packaging_tonnes_chargeable(Variable): + label = "Chargeable plastic packaging tonnes" + documentation = "Tonnes of chargeable plastic packaging components, with less than 30% recycled plastic, that the firm manufactures in or imports into the UK in the year (Finance Act 2021 ss.43 and 47). Defaults to 0." + entity = Firm + definition_period = YEAR + hidden_input = True + value_type = float + reference = "https://www.legislation.gov.uk/ukpga/2021/26/section/43" diff --git a/policyengine_uk/variables/firm/product_taxes/firm_plastic_packaging_tonnes_total.py b/policyengine_uk/variables/firm/product_taxes/firm_plastic_packaging_tonnes_total.py new file mode 100644 index 0000000000..0cc37bb28d --- /dev/null +++ b/policyengine_uk/variables/firm/product_taxes/firm_plastic_packaging_tonnes_total.py @@ -0,0 +1,20 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_plastic_packaging_tonnes_total(Variable): + label = "Plastic packaging tonnes for the registration test" + documentation = ( + "Tonnes of finished plastic packaging components the firm " + "manufactures in or imports into the UK in the year, whatever their " + "recycled content, less the exempt components, for the 10 tonne " + "registration test (Finance Act 2021 s.55). Defaults to the " + "chargeable tonnes; supply it where the firm also has components " + "with 30% or more recycled plastic. The test is applied to the " + "year, not the rolling 12 months or the next 30 days in s.55." + ) + entity = Firm + definition_period = YEAR + value_type = float + reference = "https://www.legislation.gov.uk/ukpga/2021/26/section/55" + adds = ["firm_plastic_packaging_tonnes_chargeable"] diff --git a/policyengine_uk/variables/firm/product_taxes/firm_sdil_annual_production_litres.py b/policyengine_uk/variables/firm/product_taxes/firm_sdil_annual_production_litres.py new file mode 100644 index 0000000000..a3a5961b52 --- /dev/null +++ b/policyengine_uk/variables/firm/product_taxes/firm_sdil_annual_production_litres.py @@ -0,0 +1,23 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_sdil_annual_production_litres(Variable): + label = "Soft drinks levy small producer test litres" + documentation = ( + "Litres of chargeable soft drinks produced in the year by the firm " + "as producer and by persons connected with it, for the small " + "producer test (Finance Act 2017 ss.37-38). Defaults to the firm's " + "own higher and lower rate litres. Supply it where the firm is in " + "a group, or where it imports drinks whose producer's output " + "differs from its own. A value of 0 or below is read as not " + "supplied, so the firm's own litres are used." + ) + entity = Firm + definition_period = YEAR + value_type = float + reference = [ + "https://www.legislation.gov.uk/ukpga/2017/10/section/37", + "https://www.legislation.gov.uk/ukpga/2017/10/section/38", + ] + adds = ["firm_sdil_litres_higher_rate", "firm_sdil_litres_lower_rate"] diff --git a/policyengine_uk/variables/firm/product_taxes/firm_sdil_litres_higher_rate.py b/policyengine_uk/variables/firm/product_taxes/firm_sdil_litres_higher_rate.py new file mode 100644 index 0000000000..b414f1591d --- /dev/null +++ b/policyengine_uk/variables/firm/product_taxes/firm_sdil_litres_higher_rate.py @@ -0,0 +1,12 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_sdil_litres_higher_rate(Variable): + label = "Soft drinks levy litres at the higher rate" + documentation = "Litres of chargeable soft drinks with 8 grams or more of sugar per 100 millilitres that the firm packages or imports in the year (Finance Act 2017 s.30). Defaults to 0." + entity = Firm + definition_period = YEAR + hidden_input = True + value_type = float + reference = "https://www.legislation.gov.uk/ukpga/2017/10/section/30" diff --git a/policyengine_uk/variables/firm/product_taxes/firm_sdil_litres_lower_rate.py b/policyengine_uk/variables/firm/product_taxes/firm_sdil_litres_lower_rate.py new file mode 100644 index 0000000000..8b42da4faf --- /dev/null +++ b/policyengine_uk/variables/firm/product_taxes/firm_sdil_litres_lower_rate.py @@ -0,0 +1,12 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_sdil_litres_lower_rate(Variable): + label = "Soft drinks levy litres at the lower rate" + documentation = "Litres of chargeable soft drinks with at least 5 but less than 8 grams of sugar per 100 millilitres that the firm packages or imports in the year (Finance Act 2017 s.30). Defaults to 0." + entity = Firm + definition_period = YEAR + hidden_input = True + value_type = float + reference = "https://www.legislation.gov.uk/ukpga/2017/10/section/30" diff --git a/policyengine_uk/variables/firm/profit_taxes/firm_epl_profits.py b/policyengine_uk/variables/firm/profit_taxes/firm_epl_profits.py new file mode 100644 index 0000000000..15f3cae9ac --- /dev/null +++ b/policyengine_uk/variables/firm/profit_taxes/firm_epl_profits.py @@ -0,0 +1,13 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class firm_epl_profits(Variable): + value_type = float + entity = Firm + label = "Firm energy profits levy profits" + documentation = "The firm's profits chargeable to the energy profits levy: its ring fence profits adjusted as the Energy (Oil and Gas) Profits Levy Act 2022 requires, after the investment and decarbonisation allowances and levy loss relief. Defaults to 0." + definition_period = YEAR + hidden_input = True + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/2022/40/section/1" diff --git a/policyengine_uk/variables/firm/profit_taxes/firm_group_digital_services_revenues.py b/policyengine_uk/variables/firm/profit_taxes/firm_group_digital_services_revenues.py new file mode 100644 index 0000000000..fe05e6b0b4 --- /dev/null +++ b/policyengine_uk/variables/firm/profit_taxes/firm_group_digital_services_revenues.py @@ -0,0 +1,13 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class firm_group_digital_services_revenues(Variable): + value_type = float + entity = Firm + label = "Firm group worldwide digital services revenues" + documentation = "Worldwide digital services revenues of the group the firm belongs to, for the £500 million threshold (Finance Act 2020 s.46). Defaults to 0, read as the group's UK revenues." + definition_period = YEAR + hidden_input = True + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/2020/14/section/46" diff --git a/policyengine_uk/variables/firm/profit_taxes/firm_group_uk_digital_services_revenues.py b/policyengine_uk/variables/firm/profit_taxes/firm_group_uk_digital_services_revenues.py new file mode 100644 index 0000000000..98a8f523e1 --- /dev/null +++ b/policyengine_uk/variables/firm/profit_taxes/firm_group_uk_digital_services_revenues.py @@ -0,0 +1,13 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class firm_group_uk_digital_services_revenues(Variable): + value_type = float + entity = Firm + label = "Firm group UK digital services revenues" + documentation = "UK digital services revenues of the whole group the firm belongs to, for the threshold test and the allowance (Finance Act 2020 ss.46-47). Defaults to 0, read as the firm's own UK revenues." + definition_period = YEAR + hidden_input = True + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/2020/14/section/46" diff --git a/policyengine_uk/variables/firm/profit_taxes/firm_rpd_profits.py b/policyengine_uk/variables/firm/profit_taxes/firm_rpd_profits.py new file mode 100644 index 0000000000..dd62f1c821 --- /dev/null +++ b/policyengine_uk/variables/firm/profit_taxes/firm_rpd_profits.py @@ -0,0 +1,13 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class firm_rpd_profits(Variable): + value_type = float + entity = Firm + label = "Firm residential property developer tax profits" + documentation = "The firm's RPD profits for the year, the profits of its residential property development activities as Finance Act 2022 Part 2 defines them, before the allowance. Defaults to 0." + definition_period = YEAR + hidden_input = True + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/2022/3/section/33" diff --git a/policyengine_uk/variables/firm/profit_taxes/firm_rpdt_allowance_share.py b/policyengine_uk/variables/firm/profit_taxes/firm_rpdt_allowance_share.py new file mode 100644 index 0000000000..3dfba4bdaa --- /dev/null +++ b/policyengine_uk/variables/firm/profit_taxes/firm_rpdt_allowance_share.py @@ -0,0 +1,14 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class firm_rpdt_allowance_share(Variable): + value_type = float + entity = Firm + label = "Firm share of the RPDT allowance" + documentation = "Share of the residential property developer tax allowance allocated to the firm within its group (Finance Act 2022 s.43). Defaults to 1, a company with no other group member using the allowance. Values are clipped to between 0 and 1." + definition_period = YEAR + hidden_input = True + unit = "/1" + default_value = 1 + reference = "https://www.legislation.gov.uk/ukpga/2022/3/section/43" diff --git a/policyengine_uk/variables/firm/profit_taxes/firm_uk_digital_services_revenues.py b/policyengine_uk/variables/firm/profit_taxes/firm_uk_digital_services_revenues.py new file mode 100644 index 0000000000..823e23672c --- /dev/null +++ b/policyengine_uk/variables/firm/profit_taxes/firm_uk_digital_services_revenues.py @@ -0,0 +1,13 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class firm_uk_digital_services_revenues(Variable): + value_type = float + entity = Firm + label = "Firm UK digital services revenues" + documentation = "The firm's revenues from its digital services activity arising in connection with UK users in the accounting period (Finance Act 2020 ss.40-45). Defaults to 0." + definition_period = YEAR + hidden_input = True + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/2020/14/section/40" diff --git a/policyengine_uk/variables/firm/rd/firm_is_sme.py b/policyengine_uk/variables/firm/rd/firm_is_sme.py new file mode 100644 index 0000000000..5e675fe9d1 --- /dev/null +++ b/policyengine_uk/variables/firm/rd/firm_is_sme.py @@ -0,0 +1,11 @@ +from policyengine_uk.model_api import * + + +class firm_is_sme(Variable): + value_type = bool + entity = Firm + label = "Firm is an SME for R&D relief" + documentation = "Whether the firm, with its linked and partner enterprises, is a small or medium-sized enterprise for research and development relief: fewer than 500 staff and either turnover of no more than 100 million euros or a balance sheet of no more than 86 million euros." + definition_period = YEAR + hidden_input = True + default_value = False diff --git a/policyengine_uk/variables/firm/rd/firm_qualifying_rd_expenditure.py b/policyengine_uk/variables/firm/rd/firm_qualifying_rd_expenditure.py new file mode 100644 index 0000000000..ce4e5669e9 --- /dev/null +++ b/policyengine_uk/variables/firm/rd/firm_qualifying_rd_expenditure.py @@ -0,0 +1,11 @@ +from policyengine_uk.model_api import * + + +class firm_qualifying_rd_expenditure(Variable): + value_type = float + entity = Firm + label = "Firm qualifying research and development expenditure" + documentation = "Qualifying research and development expenditure in the year (staff, externally provided workers, consumables, software, data and cloud costs and qualifying subcontracting), already deducted in computing trading profit." + definition_period = YEAR + hidden_input = True + unit = GBP diff --git a/policyengine_uk/variables/firm/rd/firm_rd_staff_paye_nic.py b/policyengine_uk/variables/firm/rd/firm_rd_staff_paye_nic.py new file mode 100644 index 0000000000..7e4b0929cc --- /dev/null +++ b/policyengine_uk/variables/firm/rd/firm_rd_staff_paye_nic.py @@ -0,0 +1,24 @@ +from policyengine_uk.model_api import * + + +class firm_rd_staff_paye_nic(Variable): + value_type = float + entity = Firm + label = "Firm PAYE and NIC on R&D staff" + documentation = ( + "Total expenditure on workers for the R&D expenditure credit cap " + "before April 2024 (section 104P of the Corporation Tax Act 2009 as " + "at 31 March 2024): staffing costs of directors and employees directly " + "and actively engaged in R&D that form part of the company's PAYE " + "income tax and Class 1 National Insurance liabilities, plus the " + "relevant portion for externally provided workers from other group " + "members. Used only when firm_rdec_paye_nic_cap_supplied is true." + ) + definition_period = YEAR + hidden_input = True + unit = GBP + default_value = 0 + reference = ( + "https://www.legislation.gov.uk/ukpga/2009/4/section/104P/2024-03-31", + "https://www.legislation.gov.uk/ukpga/2009/4/section/104Q/2024-03-31", + ) diff --git a/policyengine_uk/variables/firm/rd/firm_rdec_paye_nic_cap_supplied.py b/policyengine_uk/variables/firm/rd/firm_rdec_paye_nic_cap_supplied.py new file mode 100644 index 0000000000..80fffa62d2 --- /dev/null +++ b/policyengine_uk/variables/firm/rd/firm_rdec_paye_nic_cap_supplied.py @@ -0,0 +1,20 @@ +from policyengine_uk.model_api import * + + +class firm_rdec_paye_nic_cap_supplied(Variable): + value_type = bool + entity = Firm + label = "Firm PAYE and NIC figures for the RDEC cap are supplied" + documentation = ( + "Whether firm_relevant_paye_nic_liabilities (from April 2024) or " + "firm_rd_staff_paye_nic (before) is supplied, so the PAYE and NIC " + "cap on the payable R&D expenditure credit applies, and the same cap " + "on the SME (ERIS) payable credit from April 2021 (CTA 2009 s.1058(1A), " + "then s.1112B). Defaults to " + "false: no cap. Set the matching input too: with the flag true and " + "the input at 0 the RDEC cap is nil before April 2024 and £20,000 after, and the SME payable credit cap is £20,000 from April 2021. Leave it false for a company exempt from the cap " + "under section 1112E of the Corporation Tax Act 2009." + ) + definition_period = YEAR + hidden_input = True + default_value = False diff --git a/policyengine_uk/variables/firm/rd/firm_relevant_paye_nic_liabilities.py b/policyengine_uk/variables/firm/rd/firm_relevant_paye_nic_liabilities.py new file mode 100644 index 0000000000..b1c71d3309 --- /dev/null +++ b/policyengine_uk/variables/firm/rd/firm_relevant_paye_nic_liabilities.py @@ -0,0 +1,27 @@ +from policyengine_uk.model_api import * + + +class firm_relevant_paye_nic_liabilities(Variable): + value_type = float + entity = Firm + label = "Firm relevant PAYE and NIC liabilities" + documentation = ( + "Relevant PAYE and NIC liabilities for the merged R&D expenditure " + "credit cap (sections 1112C and 1112D of the Corporation Tax Act " + "2009): income tax under PAYE plus Class 1 National Insurance the " + "company accounts for on all its employees for payment periods ending " + "in the accounting period, plus or minus the amounts for workers and " + "contractors provided by connected companies. Used for the RDEC cap " + "from April 2024, and for the SME (ERIS) payable credit cap from " + "April 2021 (s.1058(1A) and ss.1058A-1058C before April 2024). " + "Used only when firm_rdec_paye_nic_cap_supplied is true; " + "leave it unset for a company exempt from the cap under section 1112E." + ) + definition_period = YEAR + hidden_input = True + unit = GBP + default_value = 0 + reference = ( + "https://www.legislation.gov.uk/ukpga/2009/4/section/1112C", + "https://www.legislation.gov.uk/ukpga/2009/4/section/1112D", + ) diff --git a/policyengine_uk/variables/firm/rd/firm_total_relevant_expenditure.py b/policyengine_uk/variables/firm/rd/firm_total_relevant_expenditure.py new file mode 100644 index 0000000000..e964228a84 --- /dev/null +++ b/policyengine_uk/variables/firm/rd/firm_total_relevant_expenditure.py @@ -0,0 +1,11 @@ +from policyengine_uk.model_api import * + + +class firm_total_relevant_expenditure(Variable): + value_type = float + entity = Firm + label = "Firm total relevant expenditure" + documentation = "Total relevant expenditure in the year used as the denominator of the R&D intensity test: expenditure deducted in computing trading profits plus capitalised R&D, excluding payments to connected companies." + definition_period = YEAR + hidden_input = True + unit = GBP diff --git a/policyengine_uk/variables/firm/vat/firm_applies_partial_exemption_de_minimis.py b/policyengine_uk/variables/firm/vat/firm_applies_partial_exemption_de_minimis.py new file mode 100644 index 0000000000..c2af5b9c3c --- /dev/null +++ b/policyengine_uk/variables/firm/vat/firm_applies_partial_exemption_de_minimis.py @@ -0,0 +1,21 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_applies_partial_exemption_de_minimis(Variable): + label = "Partial exemption de minimis tests applied" + documentation = ( + "Whether the partial exemption de minimis tests are applied to the " + "firm (SI 1995/2518 regs 105A and 106). Where they are met, the " + "firm's exempt input tax is treated as attributable to taxable " + "supplies, so all its input VAT is recoverable. The tests are " + "mandatory in law, but this defaults to false so that existing " + "results are unchanged; with it unset, VAT is overstated for small " + "partly exempt firms, so a data builder should set it." + ) + entity = Firm + definition_period = YEAR + hidden_input = True + value_type = bool + default_value = False + reference = "https://www.legislation.gov.uk/uksi/1995/2518/regulation/106" diff --git a/policyengine_uk/variables/firm/vat/firm_exempt_supplies.py b/policyengine_uk/variables/firm/vat/firm_exempt_supplies.py new file mode 100644 index 0000000000..20d643e122 --- /dev/null +++ b/policyengine_uk/variables/firm/vat/firm_exempt_supplies.py @@ -0,0 +1,12 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_exempt_supplies(Variable): + label = "Exempt supplies" + documentation = "Value of the firm's VAT-exempt supplies in the year." + entity = Firm + definition_period = YEAR + hidden_input = True + value_type = float + unit = GBP diff --git a/policyengine_uk/variables/firm/vat/firm_input_vat.py b/policyengine_uk/variables/firm/vat/firm_input_vat.py new file mode 100644 index 0000000000..d1f576fc5c --- /dev/null +++ b/policyengine_uk/variables/firm/vat/firm_input_vat.py @@ -0,0 +1,12 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_input_vat(Variable): + label = "Input VAT" + documentation = "VAT the firm is charged on its purchases in the year that would be recoverable before any partial exemption restriction." + entity = Firm + definition_period = YEAR + hidden_input = True + value_type = float + unit = GBP diff --git a/policyengine_uk/variables/firm/vat/firm_input_vat_attributable_to_exempt_supplies.py b/policyengine_uk/variables/firm/vat/firm_input_vat_attributable_to_exempt_supplies.py new file mode 100644 index 0000000000..ce94719901 --- /dev/null +++ b/policyengine_uk/variables/firm/vat/firm_input_vat_attributable_to_exempt_supplies.py @@ -0,0 +1,22 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_input_vat_attributable_to_exempt_supplies(Variable): + label = "Input VAT directly attributable to exempt supplies" + documentation = ( + "The part of firm_input_vat on goods and services used, or to be " + "used, exclusively in making exempt supplies, which is not recoverable under the " + "partial exemption standard method (SI 1995/2518 reg 101(2)). The " + "rest of firm_input_vat is residual input tax, recovered at " + "firm_partial_exemption_recovery_share. Defaults to 0, so all input " + "VAT is treated as residual. Negative values count as 0, and the " + "two attributed amounts together are capped at firm_input_vat, " + "taxable first." + ) + entity = Firm + definition_period = YEAR + hidden_input = True + value_type = float + unit = GBP + reference = "https://www.legislation.gov.uk/uksi/1995/2518/regulation/101" diff --git a/policyengine_uk/variables/firm/vat/firm_input_vat_attributable_to_taxable_supplies.py b/policyengine_uk/variables/firm/vat/firm_input_vat_attributable_to_taxable_supplies.py new file mode 100644 index 0000000000..1ae0bf91cf --- /dev/null +++ b/policyengine_uk/variables/firm/vat/firm_input_vat_attributable_to_taxable_supplies.py @@ -0,0 +1,22 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_input_vat_attributable_to_taxable_supplies(Variable): + label = "Input VAT directly attributable to taxable supplies" + documentation = ( + "The part of firm_input_vat on goods and services used, or to be " + "used, exclusively in making taxable supplies, which is fully recoverable under the " + "partial exemption standard method (SI 1995/2518 reg 101(2)). The " + "rest of firm_input_vat is residual input tax, recovered at " + "firm_partial_exemption_recovery_share. Defaults to 0, so all input " + "VAT is treated as residual. Negative values count as 0, and the " + "two attributed amounts together are capped at firm_input_vat, " + "taxable first." + ) + entity = Firm + definition_period = YEAR + hidden_input = True + value_type = float + unit = GBP + reference = "https://www.legislation.gov.uk/uksi/1995/2518/regulation/101" diff --git a/policyengine_uk/variables/firm/vat/firm_is_limited_cost_trader.py b/policyengine_uk/variables/firm/vat/firm_is_limited_cost_trader.py new file mode 100644 index 0000000000..817e05a035 --- /dev/null +++ b/policyengine_uk/variables/firm/vat/firm_is_limited_cost_trader.py @@ -0,0 +1,12 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_is_limited_cost_trader(Variable): + label = "Limited cost trader" + documentation = "Whether the firm is a limited cost trader for the VAT flat rate scheme (VAT Regulations 1995, regulation 55KA)." + entity = Firm + definition_period = YEAR + hidden_input = True + value_type = bool + default_value = False diff --git a/policyengine_uk/variables/firm/vat/firm_reduced_rated_supplies.py b/policyengine_uk/variables/firm/vat/firm_reduced_rated_supplies.py new file mode 100644 index 0000000000..3cfb8b736f --- /dev/null +++ b/policyengine_uk/variables/firm/vat/firm_reduced_rated_supplies.py @@ -0,0 +1,14 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_reduced_rated_supplies(Variable): + label = "Reduced-rated supplies" + documentation = ( + "Value of the firm's reduced-rated supplies in the year, excluding VAT." + ) + entity = Firm + definition_period = YEAR + hidden_input = True + value_type = float + unit = GBP diff --git a/policyengine_uk/variables/firm/vat/firm_standard_rated_supplies.py b/policyengine_uk/variables/firm/vat/firm_standard_rated_supplies.py new file mode 100644 index 0000000000..f6ddc5a09b --- /dev/null +++ b/policyengine_uk/variables/firm/vat/firm_standard_rated_supplies.py @@ -0,0 +1,14 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_standard_rated_supplies(Variable): + label = "Standard-rated supplies" + documentation = ( + "Value of the firm's standard-rated supplies in the year, excluding VAT." + ) + entity = Firm + definition_period = YEAR + hidden_input = True + value_type = float + unit = GBP diff --git a/policyengine_uk/variables/firm/vat/firm_uses_flat_rate_scheme.py b/policyengine_uk/variables/firm/vat/firm_uses_flat_rate_scheme.py new file mode 100644 index 0000000000..22e663fc57 --- /dev/null +++ b/policyengine_uk/variables/firm/vat/firm_uses_flat_rate_scheme.py @@ -0,0 +1,12 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_uses_flat_rate_scheme(Variable): + label = "Elects the VAT flat rate scheme" + documentation = "Whether the firm elects to account for VAT under the flat rate scheme (VAT Regulations 1995, Part VIIA)." + entity = Firm + definition_period = YEAR + hidden_input = True + value_type = bool + default_value = False diff --git a/policyengine_uk/variables/firm/vat/firm_vat_voluntarily_registered.py b/policyengine_uk/variables/firm/vat/firm_vat_voluntarily_registered.py new file mode 100644 index 0000000000..ae865d88f5 --- /dev/null +++ b/policyengine_uk/variables/firm/vat/firm_vat_voluntarily_registered.py @@ -0,0 +1,12 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_vat_voluntarily_registered(Variable): + label = "Voluntarily registered for VAT" + documentation = "Whether the firm is registered for VAT although its taxable turnover does not exceed the registration threshold." + entity = Firm + definition_period = YEAR + hidden_input = True + value_type = bool + default_value = False diff --git a/policyengine_uk/variables/firm/vat/firm_zero_rated_supplies.py b/policyengine_uk/variables/firm/vat/firm_zero_rated_supplies.py new file mode 100644 index 0000000000..90009c9244 --- /dev/null +++ b/policyengine_uk/variables/firm/vat/firm_zero_rated_supplies.py @@ -0,0 +1,12 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_zero_rated_supplies(Variable): + label = "Zero-rated supplies" + documentation = "Value of the firm's zero-rated supplies in the year." + entity = Firm + definition_period = YEAR + hidden_input = True + value_type = float + unit = GBP diff --git a/policyengine_uk/variables/gov/dwp/auto_enrolment/firm_auto_enrolment_employer_contribution.py b/policyengine_uk/variables/gov/dwp/auto_enrolment/firm_auto_enrolment_employer_contribution.py new file mode 100644 index 0000000000..9522ef0563 --- /dev/null +++ b/policyengine_uk/variables/gov/dwp/auto_enrolment/firm_auto_enrolment_employer_contribution.py @@ -0,0 +1,30 @@ +from policyengine_uk.model_api import * + + +class firm_auto_enrolment_employer_contribution(Variable): + value_type = float + entity = Firm + label = "Firm automatic enrolment employer minimum contribution" + documentation = ( + "The employer's minimum contribution to a money purchase scheme used " + "for automatic enrolment: the minimum rate times its employees' " + "qualifying earnings (Pensions Act 2008 s.20(1)(b)). It is an " + "employment cost, not a tax." + ) + definition_period = YEAR + unit = GBP + reference = [ + dict( + title="Pensions Act 2008 s.20(1)(b)", + href="https://www.legislation.gov.uk/ukpga/2008/30/section/20", + ), + dict( + title="Pensions Act 2008 s.29", + href="https://www.legislation.gov.uk/ukpga/2008/30/section/29", + ), + ] + + def formula(firm, period, parameters): + p = parameters(period).gov.dwp.auto_enrolment + qualifying_earnings = firm("firm_auto_enrolment_qualifying_earnings", period) + return p.employer_minimum_contribution_rate * qualifying_earnings diff --git a/policyengine_uk/variables/gov/dwp/auto_enrolment/firm_auto_enrolment_qualifying_earnings.py b/policyengine_uk/variables/gov/dwp/auto_enrolment/firm_auto_enrolment_qualifying_earnings.py new file mode 100644 index 0000000000..9ae41c88f7 --- /dev/null +++ b/policyengine_uk/variables/gov/dwp/auto_enrolment/firm_auto_enrolment_qualifying_earnings.py @@ -0,0 +1,99 @@ +from policyengine_uk.model_api import * + + +class firm_auto_enrolment_qualifying_earnings(Variable): + value_type = float + entity = Firm + label = "Firm automatic enrolment qualifying earnings" + documentation = ( + "Total of each enrolled employee's earnings between the lower and " + "upper limits of the qualifying earnings band (Pensions Act 2008 " + "s.13). Supply it as an input where per-employee pay is known. " + "Otherwise the formula splits the workforce into three pay bands. " + "Employees supplied as paid at or below the earnings trigger " + "(s.3(1)(c) requires earnings above it; " + "firm_employees_below_auto_enrolment_earnings_trigger and their " + "paybill) are not enrolled and contribute nothing; this is how the " + "trigger is applied, as the formula does not read the trigger itself. " + "Employees supplied as paid above the upper limit " + "(firm_employees_above_auto_enrolment_upper_limit and their paybill) " + "each contribute the band width. The remaining employees are assumed " + "paid the average of the remaining paybill, contributing the " + "headcount times that average less the lower limit, capped at the " + "band width and floored at zero; this is exact when each of them " + "earns between the lower and upper limits. With no split supplied " + "(all 0) every employee is treated as enrolled at the firm's average " + "pay, so the trigger is not applied: it overstates for firms with " + "many staff at or below the trigger and understates where pay is spread " + "around a low average. It ignores the age conditions, opt-outs and " + "opt-ins, and applies the band annually rather than per pay " + "reference period. Inconsistent inputs are clipped silently: each " + "headcount and paybill is floored at zero; the headcount at or below " + "the trigger is capped at firm_employees and the headcount above the " + "upper limit at the employees left; each paybill is capped at the " + "paybill left. If the paybill above the upper limit is less than " + "that headcount times the upper limit, the split is inconsistent and " + "those employees and their paybill are treated as part of the " + "remaining group instead. The paybill is " + "firm_paybill_after_minimum_wage, firm_paybill plus any pay needed " + "to meet the minimum wage; with a pay split supplied, that extra pay " + "all falls in the remaining group, which overstates qualifying " + "earnings if the low-paid staff earn at or below the earnings " + "trigger." + ) + definition_period = YEAR + unit = GBP + reference = [ + dict( + title="Pensions Act 2008 s.3", + href="https://www.legislation.gov.uk/ukpga/2008/30/section/3", + ), + dict( + title="Pensions Act 2008 s.13", + href="https://www.legislation.gov.uk/ukpga/2008/30/section/13", + ), + ] + + def formula(firm, period, parameters): + band = parameters(period).gov.dwp.auto_enrolment.qualifying_earnings + band_width = band.upper_limit - band.lower_limit + paybill = firm("firm_paybill_after_minimum_wage", period) + employees = firm("firm_employees", period) + employees_below_trigger = min_( + max_( + firm("firm_employees_below_auto_enrolment_earnings_trigger", period), + 0, + ), + employees, + ) + paybill_below_trigger = min_( + max_( + firm("firm_paybill_below_auto_enrolment_earnings_trigger", period), + 0, + ), + paybill, + ) + employees_above_upper = min_( + max_(firm("firm_employees_above_auto_enrolment_upper_limit", period), 0), + employees - employees_below_trigger, + ) + paybill_above_upper = min_( + max_(firm("firm_paybill_above_auto_enrolment_upper_limit", period), 0), + paybill - paybill_below_trigger, + ) + # Staff above the upper limit must be paid more than it in total; if + # not, the split is inconsistent and they rejoin the remaining group. + above_split_consistent = ( + paybill_above_upper >= employees_above_upper * band.upper_limit + ) + employees_above_upper = where(above_split_consistent, employees_above_upper, 0) + paybill_above_upper = where(above_split_consistent, paybill_above_upper, 0) + employees_in_band = max_( + employees - employees_below_trigger - employees_above_upper, 0 + ) + paybill_in_band = max_(paybill - paybill_below_trigger - paybill_above_upper, 0) + has_employees = employees_in_band > 0 + average_pay = paybill_in_band / where(has_employees, employees_in_band, 1) + per_employee = min_(max_(average_pay - band.lower_limit, 0), band_width) + in_band = where(has_employees, employees_in_band * per_employee, 0) + return in_band + employees_above_upper * band_width diff --git a/policyengine_uk/variables/gov/hmrc/apprenticeship_levy/apprenticeship_levy.py b/policyengine_uk/variables/gov/hmrc/apprenticeship_levy/apprenticeship_levy.py new file mode 100644 index 0000000000..5c863607c8 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/apprenticeship_levy/apprenticeship_levy.py @@ -0,0 +1,42 @@ +from policyengine_uk.model_api import * + + +class apprenticeship_levy(Variable): + value_type = float + entity = Firm + label = "Apprenticeship levy" + documentation = ( + "The relevant percentage of the firm's pay bill, less its levy " + "allowance, floored at zero (Finance Act 2016 s.99). The pay bill is " + "all earnings on which the firm incurs secondary Class 1 liabilities, " + "including earnings below the secondary threshold (s.100(3)) and " + "earnings zero-rated at £0 (s.100(6)), so it is " + "firm_paybill_after_minimum_wage: firm_paybill plus any pay needed to " + "meet the minimum wage, plus deemed direct payments under the " + "off-payroll working rules (firm_off_payroll_levy_earnings). A member of a company unit of connected companies receives its allocated share of " + "one allowance (s.101)." + ) + definition_period = YEAR + unit = GBP + reference = [ + dict( + title="Finance Act 2016 s.99", + href="https://www.legislation.gov.uk/ukpga/2016/24/section/99", + ), + dict( + title="Finance Act 2016 s.100(2), (3) and (6)", + href="https://www.legislation.gov.uk/ukpga/2016/24/section/100", + ), + dict( + title="Finance Act 2016 s.101", + href="https://www.legislation.gov.uk/ukpga/2016/24/section/101", + ), + ] + + def formula(firm, period, parameters): + p = parameters(period).gov.hmrc.apprenticeship_levy + paybill = firm("firm_paybill_after_minimum_wage", period) + firm( + "firm_off_payroll_levy_earnings", period + ) + share = firm("firm_apprenticeship_levy_allowance_share", period) + return max_(p.rate * paybill - p.allowance * share, 0) diff --git a/policyengine_uk/variables/gov/hmrc/bank_surcharge/bank_surcharge.py b/policyengine_uk/variables/gov/hmrc/bank_surcharge/bank_surcharge.py new file mode 100644 index 0000000000..321d6d39da --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/bank_surcharge/bank_surcharge.py @@ -0,0 +1,57 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class bank_surcharge(Variable): + value_type = float + entity = Firm + label = "Bank corporation tax surcharge" + documentation = ( + "Surcharge on a banking company's surcharge profits above its " + "surcharge allowance. Surcharge profits are taxable total profits " + "plus group relief surrendered by non-banking companies " + "(firm_non_banking_group_relief_claimed, capped at the group relief " + "given), less the R&D expenditure credit brought in as a receipt of " + "the trade (s.269DA). Not modelled: the add-back of carried-forward " + "losses from non-banking or pre-2016 periods (s.269DC), the 25% cap " + "on a bank's pre-April 2015 trading losses (s.269CA), and the " + "transferred gains adjustments. A " + "company in a group with other banking companies receives the share " + "of the allowance in firm_bank_surcharge_allowance_share. The rate is " + "day-weighted over each 6 April to 5 April year, approximating the " + "split of an accounting period that straddles a rate change such as " + "the 6% rate from 1 January 2027." + ) + definition_period = YEAR + unit = GBP + defined_for = "firm_liable_to_corporation_tax" + reference = ( + "https://www.legislation.gov.uk/ukpga/2010/4/section/269DA", + "https://www.legislation.gov.uk/ukpga/2010/4/section/269DE", + "https://www.legislation.gov.uk/ukpga/2010/4/section/269DJ", + ) + + def formula(firm, period, parameters): + p = parameters(period).gov.hmrc.bank_surcharge + is_bank = firm("firm_is_bank", period) + # s.269DA(2) deducts the RDEC brought into account as a receipt. + # s.269DA(2) and s.269DB add back group relief surrendered by + # non-banking companies. + group_relief = add( + firm, + period, + ["firm_group_relief", "firm_group_relief_for_carried_forward_losses"], + ) + non_banking = min_( + max_(firm("firm_non_banking_group_relief_claimed", period), 0), + group_relief, + ) + profits = max_( + firm("firm_taxable_profit", period) + + non_banking + - firm("firm_rd_expenditure_credit", period), + 0, + ) + allowance = p.allowance * firm("firm_bank_surcharge_allowance_share", period) + surcharge = p.rate * max_(profits - allowance, 0) + return where(is_bank, surcharge, 0) diff --git a/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_business_rates.py b/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_business_rates.py new file mode 100644 index 0000000000..27e2f365f6 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_business_rates.py @@ -0,0 +1,24 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_business_rates(Variable): + value_type = float + entity = Firm + label = "Business rates of the firm" + documentation = ( + "Net business rates (non-domestic rates) the firm pays in England, " + "Wales, Scotland or Northern Ireland: gross rates less reliefs, not " + "below zero. The firm's rateable value (the net annual value in " + "Northern Ireland) is treated as one aggregate property. Northern " + "Ireland is modelled from 2023-24 where firm_northern_ireland_district " + "is set, and gives 0 otherwise." + ) + definition_period = YEAR + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/1988/41/schedule/4ZA" + + def formula(firm, period, parameters): + gross = firm("firm_gross_business_rates", period) + reliefs = firm("firm_business_rates_reliefs", period) + return max_(gross - reliefs, 0) diff --git a/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_business_rates_multiplier.py b/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_business_rates_multiplier.py new file mode 100644 index 0000000000..744e7a4c2c --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_business_rates_multiplier.py @@ -0,0 +1,109 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_business_rates_multiplier(Variable): + value_type = float + entity = Firm + label = "Business rates multiplier for the firm's property" + documentation = ( + "The non-domestic rating multiplier, in pounds per pound of rateable " + "value, for the firm's property, chosen by firm_region. " + "England: a small business multiplier applies below the small " + "business threshold (£51,000), the standard one from there, and from " + "2026-27 the high-value multiplier at £500,000 or more. From 2026-27 " + "qualifying retail, hospitality and leisure (RHL) properties below " + "£500,000 pay the lower RHL multipliers. The small multiplier is " + "chosen by rateable value alone from 2024-25; before then unoccupied " + "and charity property paid the standard multiplier. The RHL " + "multipliers apply to occupied property only. The 1p Transitional Relief " + "Supplement for 2026-27, extended to 2027-28 and 2028-29 (BRIL " + "8/2026), is not modelled. " + "Wales: one multiplier to 2025-26. From 2026-27 the retail " + "multiplier for shops, kiosks, pharmacies and post offices below " + "£51,000 (firm_is_wales_retail_property), the higher multiplier " + "above £100,000 unless the property has one of the 19 excluded " + "public-service descriptions " + "(firm_is_wales_higher_multiplier_excluded), and the standard " + "multiplier otherwise (WSI 2025/1163 regs 3 and 4). " + "Scotland: the basic property rate, plus the intermediate property " + "supplement above £51,000 up to £100,000, or the higher property " + "supplement above £100,000. The firm's rateable value is treated as " + "one property." + ) + definition_period = YEAR + unit = "/1" + reference = [ + "https://www.legislation.gov.uk/ukpga/1988/41/schedule/4ZA", + "https://www.gov.uk/government/publications/52025-confirmation-of-budget-package-and-the-non-domestic-rating-multipliers-for-20262027/52025-confirmation-of-budget-package-and-the-non-domestic-rating-multipliers-for-20262027", + "https://businesswales.gov.wales/non-domestic-rates-multipliers", + "https://www.legislation.gov.uk/wsi/2025/1163/made", + "https://www.legislation.gov.uk/ssi/2026/68/made", + ] + + def formula(firm, period, parameters): + br = parameters(period).gov.hmrc.business_rates + rateable_value = firm("firm_rateable_value", period) + region = firm("firm_region", period) + regions = region.possible_values + + # England + p = br.multipliers + occupied = firm("firm_property_occupied", period) + # The RHL multipliers apply to occupied property only. + is_rhl = firm("firm_is_rhl_property", period) & occupied + # Before 2024-25 unoccupied property and charities paid the standard + # multiplier whatever their rateable value. + small_allowed = p.small_business_applies_to_empty_and_charities | ( + occupied & ~firm("firm_is_charity", period) + ) + is_small = (rateable_value < p.small_business_threshold) & small_allowed + is_high_value = rateable_value >= p.high_value_threshold + small = where(is_rhl, p.small_business_rhl, p.small_business) + standard = where(is_rhl, p.standard_rhl, p.standard) + england = select( + [is_high_value, is_small], + [p.high_value, small], + default=standard, + ) + + # Wales + w = br.wales.multipliers + is_wales_retail = firm("firm_is_wales_retail_property", period) & ( + rateable_value < w.retail_threshold + ) + is_wales_higher = (rateable_value > w.higher_threshold) & ~firm( + "firm_is_wales_higher_multiplier_excluded", period + ) + wales = select( + [is_wales_retail, is_wales_higher], + [w.retail, w.higher], + default=w.standard, + ) + + # Scotland + s = br.scotland.poundage + supplement = select( + [ + rateable_value > s.higher_threshold, + rateable_value > s.intermediate_threshold, + ], + [s.higher_supplement, s.intermediate_supplement], + default=0, + ) + scotland = s.basic + supplement + + # Northern Ireland: regional rate plus the council's district rate. + ni = parameters(period).gov.hmrc.business_rates.northern_ireland + if ni.modelled: + district = firm("firm_northern_ireland_district", period) + northern_ireland = ni.regional_rate + ni.district_rate[district] + else: + northern_ireland = 0 + is_ni = firm("firm_rates_in_northern_ireland", period) + + return select( + [region == regions.WALES, region == regions.SCOTLAND, is_ni], + [wales, scotland, northern_ireland], + default=england, + ) diff --git a/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_business_rates_reliefs.py b/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_business_rates_reliefs.py new file mode 100644 index 0000000000..c484ad3e49 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_business_rates_reliefs.py @@ -0,0 +1,165 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_business_rates_reliefs(Variable): + value_type = float + entity = Firm + label = "Business rates reliefs of the firm" + documentation = ( + "Total business rates reliefs and exemptions of the firm. " + "England: empty property, charitable, small business, retail " + "hospitality and leisure, and pubs and live music venues reliefs; " + "transitional relief, Supporting Small Business relief, rural rate " + "relief, improvement relief and local discretionary reliefs are not " + "modelled. " + "Wales: mandatory charitable relief (80%) and small business rates " + "relief, 100% at or below £6,000 tapering to 0% at £12,000, for an " + "occupied property of a firm with at most two properties (the limit " + "is per local authority, applied here to the firm). Where both apply " + "the charity calculation is used (LGFA 1988 Schedule 4ZA para 9; " + "s.43(8B) before April 2024), so a charity gets 80% even where SBRR " + "would give more. Not modelled in Wales: the childcare and post " + "office rules, the independent school exclusion from charitable " + "relief, discretionary top-ups, empty property relief, retail and " + "hospitality reliefs and transitional relief. " + "Scotland: mandatory charitable relief (80%) and Small Business Bonus " + "Scheme single-entry relief, 100% at or below £12,000, tapering to " + "25% at £15,000 and to 0% at £20,000, for an occupied property of a " + "firm with one property. SBBS is reduced by any charitable relief, " + "but not below nil (levying regulations, regulation 3(4)), so a " + "charity gets the larger of the two. Not modelled in Scotland: SBBS " + "for several properties (cumulative rateable value up to £35,000), " + "its excluded property uses, the independent school exclusion from " + "charitable relief, discretionary top-ups, empty property, retail " + "hospitality and leisure, and transitional reliefs. " + "Northern Ireland, from 2023-24: a charity's occupied property is " + "exempt (Rates (NI) Order 1977 Art 41); small business rate relief " + "is 50% at a net annual value up to £2,000, 25% up to £5,000 and " + "20% up to £15,000, for a wholly occupied, non-industrial property " + "of a firm with at most three properties, to 31 March 2027 (SR " + "2010/4 reg 3; SR 2026/45); and unoccupied property is charged half " + "the bill after its first three months empty, and nothing below " + "£2,000 or for industrial property (Sch 8A; SR 2011/36). The bands " + "are applied to the firm's aggregate value. Not modelled in " + "Northern Ireland: industrial and freight derating, sport and " + "recreation relief, the post office bands and other exclusions " + "from small business relief, hardship relief, Back in Business, " + "part-exempt apportionment, the contiguous-hereditaments rule, the " + "other unoccupied-property exclusions (such as listed buildings and " + "insolvency) and any exemption of unoccupied charity property, " + "which is charged like other unoccupied property here." + ) + definition_period = YEAR + unit = GBP + reference = [ + "https://www.legislation.gov.uk/ukpga/1988/41/schedule/4ZA", + "https://www.legislation.gov.uk/ukpga/1988/41/section/43/2023-04-01", + "https://www.legislation.gov.uk/ukpga/1962/9/section/4", + "https://www.legislation.gov.uk/ssi/2026/68/regulation/3/made", + "https://businesswales.gov.wales/non-domestic-rates-small-business-rates-relief", + "https://www.gov.scot/publications/local-government-finance-circular-7-2026-non-domestic-rates-relief-guidance/pages/non-domestic-rates-relief-information-for-scottish-local-authorities/", + "https://www.legislation.gov.uk/nisi/1977/2157/article/41", + "https://www.legislation.gov.uk/nisr/2010/4", + "https://www.legislation.gov.uk/nisi/1977/2157/schedule/8A", + "https://www.legislation.gov.uk/nisr/2011/36", + ] + + def formula(firm, period, parameters): + br = parameters(period).gov.hmrc.business_rates + region = firm("firm_region", period) + regions = region.possible_values + is_wales = region == regions.WALES + is_scotland = region == regions.SCOTLAND + + england = add( + firm, + period, + [ + "firm_empty_property_rates_exemption", + "firm_charitable_rate_relief", + "firm_small_business_rate_relief", + "firm_retail_hospitality_leisure_rate_relief", + "firm_pubs_and_live_music_venues_rate_relief", + ], + ) + + gross = firm("firm_gross_business_rates", period) + rateable_value = firm("firm_rateable_value", period) + n_properties = firm("firm_n_properties", period) + occupied = firm("firm_property_occupied", period) + + # Wales small business rates relief + w = br.wales.small_business + wales_share = clip( + (w.taper_end_threshold - rateable_value) + / (w.taper_end_threshold - w.full_relief_threshold), + 0, + 1, + ) + wales_eligible = occupied & (n_properties <= w.max_properties) + wales_sbrr = where(wales_eligible, gross * wales_share, 0) + # Where charitable relief and SBRR both apply, the chargeable amount + # follows the charity calculation (Sch 4ZA para 9; s.43(8B)). + charitable = firm("firm_charitable_rate_relief", period) + is_charity = firm("firm_is_charity", period) + wales = where(is_charity, charitable, wales_sbrr) + + # Scotland Small Business Bonus Scheme, single entry + s = br.scotland.small_business_bonus + upper_share = s.middle_relief_rate + (1 - s.middle_relief_rate) * clip( + (s.middle_threshold - rateable_value) + / (s.middle_threshold - s.full_relief_threshold), + 0, + 1, + ) + lower_share = s.middle_relief_rate * clip( + (s.taper_end_threshold - rateable_value) + / (s.taper_end_threshold - s.middle_threshold), + 0, + 1, + ) + scotland_share = where( + rateable_value <= s.middle_threshold, upper_share, lower_share + ) + scotland_eligible = occupied & (n_properties == 1) + scotland_sbbs = where(scotland_eligible, gross * scotland_share, 0) + # SBBS is reduced by charitable relief but not below nil, so the + # total is the larger of the two (levying regulations reg 3(4)). + scotland = max_(scotland_sbbs, charitable) + + # Northern Ireland + ni = parameters(period).gov.hmrc.business_rates.northern_ireland + is_ni = firm("firm_rates_in_northern_ireland", period) + if ni.modelled: + industrial = firm("firm_is_industrial_property", period) + sb = ni.small_business + sbrr_rate = sb.relief_rate.calc(rateable_value, right=True) + sbrr_eligible = ( + sb.in_effect + & occupied + & ~industrial + & (n_properties <= sb.max_properties) + ) + sbrr = where(sbrr_eligible, gross * sbrr_rate, 0) + occupied_relief = where(is_charity, gross, sbrr) + u = ni.unoccupied + free_months_this_year = clip( + u.free_months - firm("firm_months_empty", period), 0, MONTHS_IN_YEAR + ) + charged = ( + gross + * u.rate + * (MONTHS_IN_YEAR - free_months_this_year) + / MONTHS_IN_YEAR + ) + exempt = industrial | (rateable_value < u.exempt_nav_threshold) + unoccupied_relief = where(exempt, gross, gross - charged) + northern_ireland = where(occupied, occupied_relief, unoccupied_relief) + else: + northern_ireland = 0 + return select( + [is_wales, is_scotland, is_ni], + [wales, scotland, northern_ireland], + default=england, + ) diff --git a/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_charitable_rate_relief.py b/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_charitable_rate_relief.py new file mode 100644 index 0000000000..468bf8dae0 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_charitable_rate_relief.py @@ -0,0 +1,38 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_charitable_rate_relief(Variable): + value_type = float + entity = Firm + label = "Mandatory charitable rate relief of the firm" + documentation = ( + "80% of gross business rates for an occupied property of a charity in " + "England, Wales or Scotland: the ratepayer pays one fifth of the bill " + "(LGFA 1988 Schedule 4ZA para 2 in England and Wales, s.43(5)-(6) " + "before April 2024; Local Government (Financial Provisions etc.) " + "(Scotland) Act 1962 s.4(2) in Scotland). How it combines with the " + "Welsh and Scottish small business reliefs is set in " + "firm_business_rates_reliefs. Not modelled: the private and " + "independent school exclusions (England from April 2025, Wales from " + "April 2025, Scotland from April 2022) and the zero rating of empty " + "charity property." + ) + definition_period = YEAR + unit = GBP + reference = [ + "https://www.legislation.gov.uk/ukpga/1988/41/schedule/4ZA", + "https://www.legislation.gov.uk/ukpga/1988/41/section/43/2023-04-01", + "https://www.legislation.gov.uk/ukpga/1962/9/section/4", + ] + defined_for = "firm_property_occupied" + + def formula(firm, period, parameters): + p = parameters(period).gov.hmrc.business_rates.reliefs.charity + gross = firm("firm_gross_business_rates", period) + is_charity = firm("firm_is_charity", period) + region = firm("firm_region", period) + regions = region.possible_values + in_england = firm("firm_rates_in_england", period) + modelled = in_england | (region == regions.WALES) | (region == regions.SCOTLAND) + return where(is_charity & modelled, gross * p.rate, 0) diff --git a/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_empty_property_rates_exemption.py b/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_empty_property_rates_exemption.py new file mode 100644 index 0000000000..29b64c83e8 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_empty_property_rates_exemption.py @@ -0,0 +1,43 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_empty_property_rates_exemption(Variable): + value_type = float + entity = Firm + label = "Empty property rates exemption of the firm" + documentation = ( + "An unoccupied property pays no rates for its first 3 months empty " + "(6 for a qualifying industrial property), then full rates. The model " + "treats an unoccupied property as empty throughout the year, so the " + "exemption is gross rates times the months of the exemption period " + "left at the start of the year (after firm_months_empty) over 12. " + "Property with rateable value below £2,900 (from 2017-18; lower " + "amounts before, in the parameter) " + "is exempt for the whole year while empty (reg 4(g)). The " + "reoccupation rule in reg 5 and the other unoccupied property " + "exemptions (listed buildings, charity next use and others) are not " + "modelled." + ) + definition_period = YEAR + unit = GBP + reference = "https://www.legislation.gov.uk/uksi/2008/386/regulation/4" + + def formula(firm, period, parameters): + p = parameters(period).gov.hmrc.business_rates.reliefs.empty_property + gross = firm("firm_gross_business_rates", period) + occupied = firm("firm_property_occupied", period) + industrial = firm("firm_is_industrial_property", period) + months_already_empty = firm("firm_months_empty", period) + exemption_months = where( + industrial, p.industrial_exempt_months, p.exempt_months + ) + exempt_months_this_year = clip( + exemption_months - months_already_empty, 0, MONTHS_IN_YEAR + ) + small = firm("firm_rateable_value", period) < p.small_property_threshold + exempt_months_this_year = where(small, MONTHS_IN_YEAR, exempt_months_this_year) + in_england = firm("firm_rates_in_england", period) + return where( + occupied | ~in_england, 0, gross * exempt_months_this_year / MONTHS_IN_YEAR + ) diff --git a/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_gross_business_rates.py b/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_gross_business_rates.py new file mode 100644 index 0000000000..eed1790575 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_gross_business_rates.py @@ -0,0 +1,38 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_gross_business_rates(Variable): + value_type = float + entity = Firm + label = "Gross business rates of the firm before reliefs" + documentation = ( + "Rateable value times the business rates multiplier (the poundage in " + "Scotland), before any relief. Modelled for England, Wales, " + "Scotland and, from 2023-24, Northern Ireland, where it is the net " + "annual value times the regional and district rates. The nation " + "comes from firm_region; a firm in England also needs " + "firm_in_england, and one in Northern Ireland " + "firm_northern_ireland_district. Zero in Northern Ireland without a " + "district." + ) + definition_period = YEAR + unit = GBP + reference = [ + "https://www.legislation.gov.uk/ukpga/1988/41/schedule/4ZA", + "https://www.legislation.gov.uk/ukpga/1988/41/schedule/7", + "https://www.legislation.gov.uk/ssi/2026/68/made", + "https://www.legislation.gov.uk/nisi/1977/2157/article/6", + ] + + def formula(firm, period, parameters): + rateable_value = firm("firm_rateable_value", period) + multiplier = firm("firm_business_rates_multiplier", period) + region = firm("firm_region", period) + regions = region.possible_values + is_wales = region == regions.WALES + is_scotland = region == regions.SCOTLAND + in_england = firm("firm_rates_in_england", period) + is_ni = firm("firm_rates_in_northern_ireland", period) + modelled = in_england | is_wales | is_scotland | is_ni + return where(modelled, rateable_value * multiplier, 0) diff --git a/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_pubs_and_live_music_venues_rate_relief.py b/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_pubs_and_live_music_venues_rate_relief.py new file mode 100644 index 0000000000..c96c6bce97 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_pubs_and_live_music_venues_rate_relief.py @@ -0,0 +1,48 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_pubs_and_live_music_venues_rate_relief(Variable): + value_type = float + entity = Firm + label = "Pubs and live music venues business rates relief of the firm" + documentation = ( + "Relief for occupied pubs and live music venues in England: 15% in " + "2026-27 and 35% in 2027-28 and 2028-29, except that live music " + "venues (not pubs) with rateable value of £1m or more stay at 15%. " + "The model applies it to the bill left after all other reliefs (the " + "order is an assumption). Social clubs, covered from 2027-28, are not " + "separately flagged." + ) + definition_period = YEAR + unit = GBP + reference = [ + "https://www.gov.uk/apply-for-business-rate-relief/pubs-and-live-music-venues-relief", + "https://www.gov.uk/government/publications/82026-details-of-the-budget-package-and-the-multipliers-for-20272028/82026-details-of-the-budget-package-and-the-multipliers-for-20272028", + ] + defined_for = "firm_property_occupied" + + def formula(firm, period, parameters): + p = parameters( + period + ).gov.hmrc.business_rates.reliefs.pubs_and_live_music_venues + gross = firm("firm_gross_business_rates", period) + other_reliefs = add( + firm, + period, + [ + "firm_charitable_rate_relief", + "firm_small_business_rate_relief", + "firm_retail_hospitality_leisure_rate_relief", + ], + ) + remaining = max_(gross - other_reliefs, 0) + rateable_value = firm("firm_rateable_value", period) + is_live_music_venue = firm("firm_is_live_music_venue", period) + large_live_music_venue = is_live_music_venue & ( + rateable_value >= p.large_venue_threshold + ) + rate = where(large_live_music_venue, p.large_venue_rate, p.rate) + is_venue = firm("firm_is_pub_or_live_music_venue", period) + in_england = firm("firm_rates_in_england", period) + return where(is_venue & in_england, remaining * rate, 0) diff --git a/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_rates_in_england.py b/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_rates_in_england.py new file mode 100644 index 0000000000..6872b8f1a0 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_rates_in_england.py @@ -0,0 +1,26 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_rates_in_england(Variable): + value_type = bool + entity = Firm + label = "Firm pays English business rates" + documentation = ( + "Whether the firm's business rates follow the English rules: " + "firm_in_england is true and firm_region is not Wales, Scotland or " + "Northern Ireland. The English reliefs apply only where this is true; " + "Wales and Scotland have their own reliefs in " + "firm_business_rates_reliefs." + ) + definition_period = YEAR + + def formula(firm, period, parameters): + region = firm("firm_region", period) + regions = region.possible_values + return ( + firm("firm_in_england", period) + & (region != regions.WALES) + & (region != regions.SCOTLAND) + & (region != regions.NORTHERN_IRELAND) + ) diff --git a/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_rates_in_northern_ireland.py b/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_rates_in_northern_ireland.py new file mode 100644 index 0000000000..c581395377 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_rates_in_northern_ireland.py @@ -0,0 +1,26 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_rates_in_northern_ireland(Variable): + value_type = bool + entity = Firm + label = "Firm pays modelled Northern Ireland rates" + documentation = ( + "Whether the firm's business rates follow the Northern Ireland " + "rules: firm_region is Northern Ireland, firm_northern_ireland_district " + "is set, and the year is 2023-24 or later, the years whose rate " + "poundages are held." + ) + definition_period = YEAR + reference = "https://www.legislation.gov.uk/nisi/1977/2157/article/6" + + def formula(firm, period, parameters): + p = parameters(period).gov.hmrc.business_rates.northern_ireland + region = firm("firm_region", period) + district = firm("firm_northern_ireland_district", period) + return ( + p.modelled + & (region == region.possible_values.NORTHERN_IRELAND) + & (district != district.possible_values.UNKNOWN) + ) diff --git a/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_retail_hospitality_leisure_rate_relief.py b/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_retail_hospitality_leisure_rate_relief.py new file mode 100644 index 0000000000..4ab9ffaf88 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_retail_hospitality_leisure_rate_relief.py @@ -0,0 +1,34 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_retail_hospitality_leisure_rate_relief(Variable): + value_type = float + entity = Firm + label = "Retail, hospitality and leisure business rates relief of the firm" + documentation = ( + "Retail, hospitality and leisure (RHL) relief in England: 75% in " + "2023-24 and 2024-25 and 40% in 2025-26 of the bill left after " + "mandatory reliefs, capped at £110,000 per business. It ended on 31 " + "March 2026. Only for occupied property. The subsidy control limits " + "and the right to opt out are not modelled." + ) + definition_period = YEAR + unit = GBP + reference = "https://www.gov.uk/guidance/business-rates-relief-202526-retail-hospitality-and-leisure-scheme" + defined_for = "firm_property_occupied" + + def formula(firm, period, parameters): + p = parameters( + period + ).gov.hmrc.business_rates.reliefs.retail_hospitality_leisure + gross = firm("firm_gross_business_rates", period) + mandatory_reliefs = add( + firm, + period, + ["firm_charitable_rate_relief", "firm_small_business_rate_relief"], + ) + remaining = max_(gross - mandatory_reliefs, 0) + is_rhl = firm("firm_is_rhl_property", period) + in_england = firm("firm_rates_in_england", period) + return where(is_rhl & in_england, min_(remaining * p.rate, p.cap), 0) diff --git a/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_small_business_rate_relief.py b/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_small_business_rate_relief.py new file mode 100644 index 0000000000..53597b2421 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/business_rates/firm/firm_small_business_rate_relief.py @@ -0,0 +1,67 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_small_business_rate_relief(Variable): + value_type = float + entity = Firm + label = "Small business rate relief of the firm" + documentation = ( + "Small business rate relief in England. Sch 4ZA para 4(1) to the " + "Local Government Finance Act 1988 divides the gross bill by E. Up to " + "the full relief threshold (£12,000) the model gives 100% relief " + "(the law sets E at 5,000,000, which leaves a bill of gross / " + "5,000,000, under a penny a year). Above it and up to the taper end " + "(£15,000), E = 3,000 / (rateable value - 12,000), rounded to three " + "decimal places (SI 2023/1250 reg 3), and relief is gross - gross / " + "E. The rounding withholds all relief just below the taper end (E " + "rounds to 1.000 at £14,999). From 2027-28 to 2028-29 qualifying " + "retail, hospitality and leisure properties use £18,000 and £21,000, " + "with E = 3,000 / (rateable value - 18,000) assumed until the " + "amending regulations are made. Only for occupied property of a firm " + "with one property, and not for a charity, which gets charitable " + "relief instead. Not modelled: relief kept on the main property when " + "the other properties are each under £2,900 and in total under " + "£20,000 (£28,000 in London), replaced by BRIL 8/2026 with a single " + "£29,999 aggregate threshold, the grace period after taking on a " + "second property, and the exclusion of vape shops." + ) + definition_period = YEAR + unit = GBP + reference = [ + "https://www.legislation.gov.uk/ukpga/1988/41/schedule/4ZA", + "https://www.legislation.gov.uk/uksi/2023/1250/regulation/3", + "https://www.gov.uk/apply-for-business-rate-relief/small-business-rate-relief", + ] + defined_for = "firm_property_occupied" + + def formula(firm, period, parameters): + p = parameters(period).gov.hmrc.business_rates.reliefs.small_business + gross = firm("firm_gross_business_rates", period) + rateable_value = firm("firm_rateable_value", period) + is_rhl = firm("firm_is_rhl_property", period) + full_threshold = where( + is_rhl, p.rhl_full_relief_threshold, p.full_relief_threshold + ) + taper_end = where(is_rhl, p.rhl_taper_end_threshold, p.taper_end_threshold) + # Sch 4ZA para 4(1): chargeable amount = gross / E. In the taper, + # E = band width / (rateable value - full threshold), "calculated to + # three decimal places only" (SI 2023/1250 reg 3(4)). The regulation + # does not say round or truncate; this rounds to nearest. + in_taper = (rateable_value > full_threshold) & (rateable_value <= taper_end) + excess = where(in_taper, rateable_value - full_threshold, 1) + e = np.round( + (taper_end - full_threshold).astype(np.float64) / excess.astype(np.float64), + 3, + ) + taper_relief = gross * (1 - 1 / e) + relief = select( + [rateable_value <= full_threshold, in_taper], + [gross, taper_relief], + default=0, + ) + eligible = (firm("firm_n_properties", period) == 1) & ~firm( + "firm_is_charity", period + ) + in_england = firm("firm_rates_in_england", period) + return where(eligible & in_england, relief, 0) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_aia_main_pool_new.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_aia_main_pool_new.py new file mode 100644 index 0000000000..b3ae328970 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_aia_main_pool_new.py @@ -0,0 +1,51 @@ +from policyengine_uk.model_api import * + + +class firm_aia_main_pool_new(Variable): + value_type = float + entity = Firm + label = "Firm annual investment allowance on new main-rate plant" + documentation = ( + "Annual investment allowance claimed on new main-rate plant and machinery not claimed under full expensing. The allowance goes " + "first to second-hand special-rate spend, then to new special-rate " + "spend where no special-rate first-year allowance is available, then " + "to second-hand main-rate spend. It then goes to new special-rate " + "spend that has the special-rate first-year allowance and to new " + "main-rate spend not fully expensed (in practice plant for leasing), " + "taking first whichever has the lower first-year allowance rate; on " + "a tie the special-rate spend goes first. This order gives the most " + "relief in the year." + ) + definition_period = YEAR + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/2001/2/section/51A" + + def formula(firm, period, parameters): + p = parameters( + period + ).gov.hmrc.corporation_tax.capital_allowances.first_year_allowances + limit = firm("firm_annual_investment_allowance_limit", period) + available = firm("firm_special_rate_first_year_allowance_available", period) + special_used = firm("firm_aia_special_rate_used", period) + special_new_spend = firm("firm_capex_special_rate_new", period) + # New special-rate spend without the first-year allowance comes + # before second-hand main-rate spend, as in firm_aia_main_pool_used. + special_new_without_fya = where( + available, 0, min_(special_new_spend, max_(limit - special_used, 0)) + ) + after_used = max_( + limit + - special_used + - special_new_without_fya + - firm("firm_aia_main_pool_used", period), + 0, + ) + # New special-rate spend with the first-year allowance comes before + # this spend unless the main-rate first-year allowance is lower. + main_first = p.main_rate < p.special_rate + special_new_with_fya = where( + available & (not main_first), min_(special_new_spend, after_used), 0 + ) + remaining = max_(after_used - special_new_with_fya, 0) + spend = firm("firm_main_pool_new_expenditure_after_full_expensing", period) + return min_(spend, remaining) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_aia_main_pool_used.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_aia_main_pool_used.py new file mode 100644 index 0000000000..25e1da8a94 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_aia_main_pool_used.py @@ -0,0 +1,32 @@ +from policyengine_uk.model_api import * + + +class firm_aia_main_pool_used(Variable): + value_type = float + entity = Firm + label = "Firm annual investment allowance on second-hand main-rate plant" + documentation = ( + "Annual investment allowance claimed on second-hand main-rate plant and machinery. The allowance goes " + "first to second-hand special-rate spend, then to new special-rate " + "spend where no special-rate first-year allowance is available, then " + "to second-hand main-rate spend. It then goes to new special-rate " + "spend that has the special-rate first-year allowance and to new " + "main-rate spend not fully expensed (in practice plant for leasing), " + "taking first whichever has the lower first-year allowance rate; on " + "a tie the special-rate spend goes first. This order gives the most " + "relief in the year." + ) + definition_period = YEAR + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/2001/2/section/51A" + + def formula(firm, period, parameters): + limit = firm("firm_annual_investment_allowance_limit", period) + after_special_used = max_(limit - firm("firm_aia_special_rate_used", period), 0) + special_new_first = where( + firm("firm_special_rate_first_year_allowance_available", period), + 0, + min_(firm("firm_capex_special_rate_new", period), after_special_used), + ) + remaining = max_(after_special_used - special_new_first, 0) + return min_(firm("firm_capex_main_pool_used", period), remaining) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_aia_special_rate_new.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_aia_special_rate_new.py new file mode 100644 index 0000000000..44967954b6 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_aia_special_rate_new.py @@ -0,0 +1,43 @@ +from policyengine_uk.model_api import * + + +class firm_aia_special_rate_new(Variable): + value_type = float + entity = Firm + label = "Firm annual investment allowance on new special-rate plant" + documentation = ( + "Annual investment allowance claimed on new special-rate plant and machinery. The allowance goes " + "first to second-hand special-rate spend, then to new special-rate " + "spend where no special-rate first-year allowance is available, then " + "to second-hand main-rate spend. It then goes to new special-rate " + "spend that has the special-rate first-year allowance and to new " + "main-rate spend not fully expensed (in practice plant for leasing), " + "taking first whichever has the lower first-year allowance rate; on " + "a tie the special-rate spend goes first. This order gives the most " + "relief in the year." + ) + definition_period = YEAR + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/2001/2/section/51A" + + def formula(firm, period, parameters): + p = parameters( + period + ).gov.hmrc.corporation_tax.capital_allowances.first_year_allowances + limit = firm("firm_annual_investment_allowance_limit", period) + after_special_used = limit - firm("firm_aia_special_rate_used", period) + after_main_used = after_special_used - firm("firm_aia_main_pool_used", period) + # Where the main-rate first-year allowance is lower, new main-rate + # spend not fully expensed takes the allowance first. + main_first = p.main_rate < p.special_rate + after_main_new = ( + after_main_used - firm("firm_aia_main_pool_new", period) + if main_first + else after_main_used + ) + remaining = where( + firm("firm_special_rate_first_year_allowance_available", period), + after_main_new, + after_special_used, + ) + return min_(firm("firm_capex_special_rate_new", period), max_(remaining, 0)) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_aia_special_rate_used.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_aia_special_rate_used.py new file mode 100644 index 0000000000..2702ad5994 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_aia_special_rate_used.py @@ -0,0 +1,25 @@ +from policyengine_uk.model_api import * + + +class firm_aia_special_rate_used(Variable): + value_type = float + entity = Firm + label = "Firm annual investment allowance on second-hand special-rate plant" + documentation = ( + "Annual investment allowance claimed on second-hand special-rate plant and machinery. The allowance goes " + "first to second-hand special-rate spend, then to new special-rate " + "spend where no special-rate first-year allowance is available, then " + "to second-hand main-rate spend. It then goes to new special-rate " + "spend that has the special-rate first-year allowance and to new " + "main-rate spend not fully expensed (in practice plant for leasing), " + "taking first whichever has the lower first-year allowance rate; on " + "a tie the special-rate spend goes first. This order gives the most " + "relief in the year." + ) + definition_period = YEAR + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/2001/2/section/51A" + + def formula(firm, period, parameters): + limit = firm("firm_annual_investment_allowance_limit", period) + return min_(firm("firm_capex_special_rate_used", period), limit) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_annual_investment_allowance.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_annual_investment_allowance.py new file mode 100644 index 0000000000..e3546ba428 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_annual_investment_allowance.py @@ -0,0 +1,17 @@ +from policyengine_uk.model_api import * + + +class firm_annual_investment_allowance(Variable): + value_type = float + entity = Firm + label = "Firm annual investment allowance" + documentation = "Annual investment allowance claimed on plant and machinery expenditure in the year." + definition_period = YEAR + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/2001/2/section/51A" + adds = [ + "firm_aia_special_rate_used", + "firm_aia_main_pool_used", + "firm_aia_special_rate_new", + "firm_aia_main_pool_new", + ] diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_annual_investment_allowance_limit.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_annual_investment_allowance_limit.py new file mode 100644 index 0000000000..9db5dfb0ec --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_annual_investment_allowance_limit.py @@ -0,0 +1,21 @@ +from policyengine_uk.model_api import * + + +class firm_annual_investment_allowance_limit(Variable): + value_type = float + entity = Firm + label = "Firm annual investment allowance limit" + documentation = ( + "The annual investment allowance limit available to the firm: the " + "statutory maximum times the firm's share of a limit shared with group " + "companies or related businesses." + ) + definition_period = YEAR + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/2001/2/section/51A" + + def formula(firm, period, parameters): + limit = parameters( + period + ).gov.hmrc.corporation_tax.capital_allowances.annual_investment_allowance.limit + return limit * firm("firm_aia_share", period) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_capital_allowances.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_capital_allowances.py new file mode 100644 index 0000000000..e9812a6074 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_capital_allowances.py @@ -0,0 +1,31 @@ +from policyengine_uk.model_api import * + + +class firm_capital_allowances(Variable): + value_type = float + entity = Firm + label = "Firm capital allowances" + documentation = ( + "Capital allowances claimed in the year, net of balancing charges: " + "first-year allowances, the annual investment allowance, writing-down " + "allowances and the structures and buildings allowance, less the main " + "pool balancing charge and the balancing charge on disposals of fully " + "expensed plant. Negative where the balancing charges exceed the " + "allowances; deduct from trading profit." + ) + definition_period = YEAR + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/2001/2/contents" + adds = [ + "firm_full_expensing_allowance", + "firm_special_rate_first_year_allowance", + "firm_main_rate_first_year_allowance", + "firm_annual_investment_allowance", + "firm_main_pool_writing_down_allowance", + "firm_special_rate_pool_writing_down_allowance", + "firm_structures_and_buildings_allowance", + ] + subtracts = [ + "firm_main_pool_balancing_charge", + "firm_full_expensing_balancing_charge", + ] diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_full_expensing_allowance.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_full_expensing_allowance.py new file mode 100644 index 0000000000..ed41f097ae --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_full_expensing_allowance.py @@ -0,0 +1,29 @@ +from policyengine_uk.model_api import * + + +class firm_full_expensing_allowance(Variable): + value_type = float + entity = Firm + label = "Firm full expensing allowance" + documentation = ( + "First-year allowance a company claims on new main-rate plant and " + "machinery: full expensing at 100% from April 2023, and the 130% " + "super-deduction from April 2021 to March 2023. Companies only." + ) + definition_period = YEAR + unit = GBP + reference = ( + "https://www.legislation.gov.uk/ukpga/2001/2/section/45S", + "https://www.legislation.gov.uk/ukpga/2021/26/section/9", + ) + + def formula(firm, period, parameters): + rate = parameters( + period + ).gov.hmrc.corporation_tax.capital_allowances.first_year_allowances.full_expensing_rate + is_company = ( + firm("firm_legal_form", period) + == firm("firm_legal_form", period).possible_values.COMPANY + ) + spend = firm("firm_capex_main_pool_new", period) + return where(is_company, rate * spend, 0) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_full_expensing_balancing_charge.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_full_expensing_balancing_charge.py new file mode 100644 index 0000000000..0ee97130e2 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_full_expensing_balancing_charge.py @@ -0,0 +1,35 @@ +from policyengine_uk.model_api import * + + +class firm_full_expensing_balancing_charge(Variable): + value_type = float + entity = Firm + label = "Firm full expensing balancing charge" + documentation = ( + "Balancing charge on a company's disposal of main-rate plant and " + "machinery on which it claimed full expensing: the relevant " + "proportion of the disposal value, charged in the year of disposal " + "outside the main pool and in addition to any pool balancing charge " + "(section 59A of the Capital Allowances Act 2001). Capped at the main " + "pool disposal proceeds, which include these proceeds. Companies " + "only, in years when full expensing is available." + ) + definition_period = YEAR + unit = GBP + reference = ( + "https://www.legislation.gov.uk/ukpga/2001/2/section/59A", + "https://www.legislation.gov.uk/ukpga/2001/2/section/45S", + ) + + def formula(firm, period, parameters): + rate = parameters( + period + ).gov.hmrc.corporation_tax.capital_allowances.first_year_allowances.full_expensing_rate + legal_form = firm("firm_legal_form", period) + is_company = legal_form == legal_form.possible_values.COMPANY + # The proceeds are part of the main pool disposal proceeds. + proceeds = min_( + max_(firm("firm_disposal_proceeds_full_expensing", period), 0), + max_(firm("firm_disposal_proceeds_main_pool", period), 0), + ) + return where(is_company & (rate > 0), proceeds, 0) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_main_pool_balance.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_main_pool_balance.py new file mode 100644 index 0000000000..4dd4885bee --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_main_pool_balance.py @@ -0,0 +1,48 @@ +from policyengine_uk.model_api import * + + +class firm_main_pool_balance(Variable): + value_type = float + entity = Firm + label = "Firm main pool balance before writing-down allowance" + documentation = ( + "Available qualifying expenditure in the main pool less disposal " + "receipts (AQE less TDR): the balance brought forward plus main-rate " + "spend that no first-year allowance covers, less disposal proceeds. " + "Disposal receipts are reduced by the full expensing balancing charge " + "(section 59A), so a disposal of fully expensed plant does not reduce " + "the pool. " + "Spend on which a first-year allowance is claimed joins the pool only " + "next year (section 58(5) of the Capital Allowances Act 2001). " + "Negative where disposals exceed the pool." + ) + definition_period = YEAR + unit = GBP + reference = ( + "https://www.legislation.gov.uk/ukpga/2001/2/section/55", + "https://www.legislation.gov.uk/ukpga/2001/2/section/58", + "https://www.legislation.gov.uk/ukpga/2001/2/section/59A", + ) + + def formula(firm, period, parameters): + p = parameters( + period + ).gov.hmrc.corporation_tax.capital_allowances.first_year_allowances + used_unrelieved = firm("firm_capex_main_pool_used", period) - firm( + "firm_aia_main_pool_used", period + ) + new_unrelieved = firm( + "firm_main_pool_new_expenditure_after_full_expensing", period + ) - firm("firm_aia_main_pool_new", period) + new_pooled = new_unrelieved if p.main_rate == 0 else 0 + disposals = max_( + firm("firm_disposal_proceeds_main_pool", period) + - firm("firm_full_expensing_balancing_charge", period), + 0, + ) + return ( + firm("firm_main_pool_brought_forward", period) + + used_unrelieved + + new_pooled + - disposals + ) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_main_pool_balancing_charge.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_main_pool_balancing_charge.py new file mode 100644 index 0000000000..cdb7afa621 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_main_pool_balancing_charge.py @@ -0,0 +1,18 @@ +from policyengine_uk.model_api import * + + +class firm_main_pool_balancing_charge(Variable): + value_type = float + entity = Firm + label = "Firm main pool balancing charge" + documentation = ( + "Balancing charge where disposal receipts in the main pool exceed its " + "available qualifying expenditure (section 55(2) of the Capital " + "Allowances Act 2001)." + ) + definition_period = YEAR + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/2001/2/section/55" + + def formula(firm, period, parameters): + return max_(-firm("firm_main_pool_balance", period), 0) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_main_pool_carried_forward.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_main_pool_carried_forward.py new file mode 100644 index 0000000000..78bc796083 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_main_pool_carried_forward.py @@ -0,0 +1,40 @@ +from policyengine_uk.model_api import * + + +class firm_main_pool_carried_forward(Variable): + value_type = float + entity = Firm + label = "Firm main pool carried forward" + documentation = ( + "Tax written-down value of the main pool carried to next year: the " + "pool balance less the writing-down allowance (zero after a balancing " + "charge), plus the part of this year's first-year allowance spend not " + "relieved by the allowance, which joins the pool next year." + ) + definition_period = YEAR + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/2001/2/section/58" + + def formula(firm, period, parameters): + p = parameters( + period + ).gov.hmrc.corporation_tax.capital_allowances.first_year_allowances + balance = max_(firm("firm_main_pool_balance", period), 0) + written_down = balance - firm("firm_main_pool_writing_down_allowance", period) + fully_expensed = add( + firm, + period, + ["firm_capex_main_pool_new", "firm_capex_main_pool_new_for_leasing"], + ) - firm("firm_main_pool_new_expenditure_after_full_expensing", period) + full_expensing_balance = max_( + fully_expensed - firm("firm_full_expensing_allowance", period), 0 + ) + fya_spend = firm( + "firm_main_pool_new_expenditure_after_full_expensing", period + ) - firm("firm_aia_main_pool_new", period) + fya_balance = ( + fya_spend - firm("firm_main_rate_first_year_allowance", period) + if p.main_rate > 0 + else 0 + ) + return written_down + full_expensing_balance + fya_balance diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_main_pool_new_expenditure_after_full_expensing.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_main_pool_new_expenditure_after_full_expensing.py new file mode 100644 index 0000000000..309bc1139d --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_main_pool_new_expenditure_after_full_expensing.py @@ -0,0 +1,32 @@ +from policyengine_uk.model_api import * + + +class firm_main_pool_new_expenditure_after_full_expensing(Variable): + value_type = float + entity = Firm + label = "Firm new main-rate expenditure not claimed under full expensing" + documentation = ( + "New main-rate plant and machinery expenditure left for the annual " + "investment allowance or the main-rate first-year allowance: plant " + "for leasing, which general exclusion 6 bars from full expensing, " + "plus other new main-rate spend for an unincorporated business, or " + "for a company when full expensing is not available." + ) + definition_period = YEAR + unit = GBP + reference = ( + "https://www.legislation.gov.uk/ukpga/2001/2/section/45S", + "https://www.legislation.gov.uk/ukpga/2001/2/section/46", + ) + + def formula(firm, period, parameters): + rate = parameters( + period + ).gov.hmrc.corporation_tax.capital_allowances.first_year_allowances.full_expensing_rate + is_company = ( + firm("firm_legal_form", period) + == firm("firm_legal_form", period).possible_values.COMPANY + ) + spend = firm("firm_capex_main_pool_new", period) + for_leasing = firm("firm_capex_main_pool_new_for_leasing", period) + return where(is_company & (rate > 0), 0, spend) + for_leasing diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_main_pool_writing_down_allowance.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_main_pool_writing_down_allowance.py new file mode 100644 index 0000000000..236c06a526 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_main_pool_writing_down_allowance.py @@ -0,0 +1,24 @@ +from policyengine_uk.model_api import * + + +class firm_main_pool_writing_down_allowance(Variable): + value_type = float + entity = Firm + label = "Firm main pool writing-down allowance" + documentation = ( + "Writing-down allowance on the main pool of plant and machinery at the main rate. A pool of no more than the small pool limit is written off in " + "full (section 56A of the Capital Allowances Act 2001)." + ) + definition_period = YEAR + unit = GBP + reference = ( + "https://www.legislation.gov.uk/ukpga/2001/2/section/56", + "https://www.legislation.gov.uk/ukpga/2001/2/section/56A", + ) + + def formula(firm, period, parameters): + p = parameters( + period + ).gov.hmrc.corporation_tax.capital_allowances.writing_down_allowance + balance = max_(firm("firm_main_pool_balance", period), 0) + return where(balance <= p.small_pool_limit, balance, p.main_rate * balance) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_main_rate_first_year_allowance.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_main_rate_first_year_allowance.py new file mode 100644 index 0000000000..dccf398521 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_main_rate_first_year_allowance.py @@ -0,0 +1,27 @@ +from policyengine_uk.model_api import * + + +class firm_main_rate_first_year_allowance(Variable): + value_type = float + entity = Firm + label = "Firm main-rate first-year allowance" + documentation = ( + "First-year allowance under section 45U of the Capital Allowances Act " + "2001 on new main-rate plant and machinery that neither full expensing " + "nor the annual investment allowance covers. Companies and " + "unincorporated businesses can claim it." + ) + definition_period = YEAR + unit = GBP + reference = ( + "https://www.legislation.gov.uk/ukpga/2001/2/section/45U", + "https://www.legislation.gov.uk/ukpga/2001/2/section/52", + ) + + def formula(firm, period, parameters): + rate = parameters( + period + ).gov.hmrc.corporation_tax.capital_allowances.first_year_allowances.main_rate + spend = firm("firm_main_pool_new_expenditure_after_full_expensing", period) + remaining = spend - firm("firm_aia_main_pool_new", period) + return rate * remaining diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_special_rate_first_year_allowance.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_special_rate_first_year_allowance.py new file mode 100644 index 0000000000..83d407ba24 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_special_rate_first_year_allowance.py @@ -0,0 +1,29 @@ +from policyengine_uk.model_api import * + + +class firm_special_rate_first_year_allowance(Variable): + value_type = float + entity = Firm + label = "Firm special-rate first-year allowance" + documentation = ( + "First-year allowance a company claims on new special-rate plant and " + "machinery that the annual investment allowance does not cover: 50% " + "under section 45S of the Capital Allowances Act 2001, and the SR " + "allowance from April 2021 to March 2023. Companies only." + ) + definition_period = YEAR + unit = GBP + reference = ( + "https://www.legislation.gov.uk/ukpga/2001/2/section/45S", + "https://www.legislation.gov.uk/ukpga/2001/2/section/52", + ) + + def formula(firm, period, parameters): + rate = parameters( + period + ).gov.hmrc.corporation_tax.capital_allowances.first_year_allowances.special_rate + available = firm("firm_special_rate_first_year_allowance_available", period) + remaining = firm("firm_capex_special_rate_new", period) - firm( + "firm_aia_special_rate_new", period + ) + return where(available, rate * remaining, 0) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_special_rate_first_year_allowance_available.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_special_rate_first_year_allowance_available.py new file mode 100644 index 0000000000..96171dc79e --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_special_rate_first_year_allowance_available.py @@ -0,0 +1,21 @@ +from policyengine_uk.model_api import * + + +class firm_special_rate_first_year_allowance_available(Variable): + value_type = bool + entity = Firm + label = "Firm can claim the special-rate first-year allowance" + documentation = ( + "Whether the firm is a company and a first-year allowance on new " + "special-rate plant and machinery is in force." + ) + definition_period = YEAR + reference = "https://www.legislation.gov.uk/ukpga/2001/2/section/45S" + + def formula(firm, period, parameters): + rate = parameters( + period + ).gov.hmrc.corporation_tax.capital_allowances.first_year_allowances.special_rate + legal_form = firm("firm_legal_form", period) + is_company = legal_form == legal_form.possible_values.COMPANY + return is_company & (rate > 0) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_special_rate_pool_balance.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_special_rate_pool_balance.py new file mode 100644 index 0000000000..54ef8e9d7d --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_special_rate_pool_balance.py @@ -0,0 +1,35 @@ +from policyengine_uk.model_api import * + + +class firm_special_rate_pool_balance(Variable): + value_type = float + entity = Firm + label = "Firm special rate pool balance before writing-down allowance" + documentation = ( + "Available qualifying expenditure in the special rate pool: the " + "balance brought forward plus special-rate spend that neither the " + "annual investment allowance nor a first-year allowance covers. Spend " + "on which a first-year allowance is claimed joins the pool only next " + "year. Disposals from the special rate pool are not modelled." + ) + definition_period = YEAR + unit = GBP + reference = ( + "https://www.legislation.gov.uk/ukpga/2001/2/section/104D", + "https://www.legislation.gov.uk/ukpga/2001/2/section/58", + ) + + def formula(firm, period, parameters): + available = firm("firm_special_rate_first_year_allowance_available", period) + used_unrelieved = firm("firm_capex_special_rate_used", period) - firm( + "firm_aia_special_rate_used", period + ) + new_unrelieved = firm("firm_capex_special_rate_new", period) - firm( + "firm_aia_special_rate_new", period + ) + new_pooled = where(available, 0, new_unrelieved) + return ( + firm("firm_special_rate_pool_brought_forward", period) + + used_unrelieved + + new_pooled + ) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_special_rate_pool_carried_forward.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_special_rate_pool_carried_forward.py new file mode 100644 index 0000000000..6e8d3e7951 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_special_rate_pool_carried_forward.py @@ -0,0 +1,31 @@ +from policyengine_uk.model_api import * + + +class firm_special_rate_pool_carried_forward(Variable): + value_type = float + entity = Firm + label = "Firm special rate pool carried forward" + documentation = ( + "Tax written-down value of the special rate pool carried to next year: " + "the pool balance less the writing-down allowance, plus the part of " + "this year's first-year allowance spend not relieved by the allowance, " + "which joins the pool next year." + ) + definition_period = YEAR + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/2001/2/section/58" + + def formula(firm, period, parameters): + available = firm("firm_special_rate_first_year_allowance_available", period) + written_down = firm("firm_special_rate_pool_balance", period) - firm( + "firm_special_rate_pool_writing_down_allowance", period + ) + fya_spend = firm("firm_capex_special_rate_new", period) - firm( + "firm_aia_special_rate_new", period + ) + fya_balance = where( + available, + fya_spend - firm("firm_special_rate_first_year_allowance", period), + 0, + ) + return written_down + fya_balance diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_special_rate_pool_writing_down_allowance.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_special_rate_pool_writing_down_allowance.py new file mode 100644 index 0000000000..738d374f32 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_special_rate_pool_writing_down_allowance.py @@ -0,0 +1,24 @@ +from policyengine_uk.model_api import * + + +class firm_special_rate_pool_writing_down_allowance(Variable): + value_type = float + entity = Firm + label = "Firm special rate pool writing-down allowance" + documentation = ( + "Writing-down allowance on the special rate pool of plant and machinery at the special rate. A pool of no more than the small pool limit is written off in " + "full (section 56A of the Capital Allowances Act 2001)." + ) + definition_period = YEAR + unit = GBP + reference = ( + "https://www.legislation.gov.uk/ukpga/2001/2/section/104D", + "https://www.legislation.gov.uk/ukpga/2001/2/section/56A", + ) + + def formula(firm, period, parameters): + p = parameters( + period + ).gov.hmrc.corporation_tax.capital_allowances.writing_down_allowance + balance = max_(firm("firm_special_rate_pool_balance", period), 0) + return where(balance <= p.small_pool_limit, balance, p.special_rate * balance) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_structures_and_buildings_allowance.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_structures_and_buildings_allowance.py new file mode 100644 index 0000000000..cd2c845cc5 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/capital_allowances/firm_structures_and_buildings_allowance.py @@ -0,0 +1,27 @@ +from policyengine_uk.model_api import * + + +class firm_structures_and_buildings_allowance(Variable): + value_type = float + entity = Firm + label = "Firm structures and buildings allowance" + documentation = ( + "Straight-line structures and buildings allowance on the qualifying " + "cost of non-residential structures in qualifying use, a full year's " + "allowance on this year's and earlier years' cost. The enhanced rate " + "on special tax sites is not modelled." + ) + definition_period = YEAR + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/2001/2/section/270AA" + + def formula(firm, period, parameters): + rate = parameters( + period + ).gov.hmrc.corporation_tax.capital_allowances.structures_and_buildings_allowance.rate + cost = add( + firm, + period, + ["firm_capex_structures", "firm_sba_qualifying_cost_brought_forward"], + ) + return rate * cost diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/corporation_tax.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/corporation_tax.py new file mode 100644 index 0000000000..e933117f98 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/corporation_tax.py @@ -0,0 +1,23 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class corporation_tax(Variable): + value_type = float + entity = Firm + label = "Corporation tax" + documentation = ( + "Corporation tax after setting the R&D expenditure credit against it. " + "The part of the credit paid out, after the notional tax deduction, is " + "firm_rdec_excess_payable. " + "The bank surcharge is a separate variable." + ) + definition_period = YEAR + unit = GBP + defined_for = "firm_liable_to_corporation_tax" + reference = "https://www.legislation.gov.uk/ukpga/2009/4/section/1042I" + + def formula(firm, period, parameters): + tax = firm("corporation_tax_before_credits", period) + credit = firm("firm_rd_expenditure_credit", period) + return max_(tax - credit, 0) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/corporation_tax_before_credits.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/corporation_tax_before_credits.py new file mode 100644 index 0000000000..5ad9ce2618 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/corporation_tax_before_credits.py @@ -0,0 +1,46 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class corporation_tax_before_credits(Variable): + value_type = float + entity = Firm + label = "Corporation tax before credits" + documentation = ( + "Corporation tax on taxable total profits: the small profits rate " + "where augmented profits do not exceed the lower limit, otherwise the " + "main rate less marginal relief. A close investment-holding company " + "or a non-UK-resident company (firm_small_profits_rate_excluded) " + "pays the main rate throughout. Each firm is treated as having an " + "April-to-March accounting period, so no apportionment between " + "financial years is needed." + ) + definition_period = YEAR + unit = GBP + defined_for = "firm_liable_to_corporation_tax" + reference = ( + "https://www.legislation.gov.uk/ukpga/2010/4/section/3", + "https://www.legislation.gov.uk/ukpga/2010/4/section/18A", + "https://www.legislation.gov.uk/ukpga/2010/4/section/18B", + "https://www.legislation.gov.uk/ukpga/2010/4/section/18N", + ) + + def formula(firm, period, parameters): + p = parameters(period).gov.hmrc.corporation_tax + taxable = firm("firm_taxable_profit", period) + main_rate_tax = taxable * p.main_rate + if not p.small_profits_rate_applies: + return main_rate_tax + augmented = firm("firm_augmented_profits", period) + lower = firm("firm_corporation_tax_lower_limit", period) + marginal_relief = firm("firm_marginal_relief", period) + excluded = firm("firm_small_profits_rate_excluded", period) + return where( + excluded, + main_rate_tax, + where( + augmented <= lower, + taxable * p.small_profits_rate, + main_rate_tax - marginal_relief, + ), + ) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_augmented_profits.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_augmented_profits.py new file mode 100644 index 0000000000..286089e655 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_augmented_profits.py @@ -0,0 +1,17 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class firm_augmented_profits(Variable): + value_type = float + entity = Firm + label = "Firm augmented profits" + documentation = ( + "Taxable total profits plus exempt distributions from non-group " + "companies, compared with the lower and upper limits." + ) + definition_period = YEAR + unit = GBP + defined_for = "firm_liable_to_corporation_tax" + reference = "https://www.legislation.gov.uk/ukpga/2010/4/section/18L" + adds = ["firm_taxable_profit", "firm_exempt_distributions"] diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_corporation_tax_lower_limit.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_corporation_tax_lower_limit.py new file mode 100644 index 0000000000..e03927d353 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_corporation_tax_lower_limit.py @@ -0,0 +1,21 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class firm_corporation_tax_lower_limit(Variable): + value_type = float + entity = Firm + label = "Firm corporation tax lower limit" + documentation = ( + "The lower limit divided by one plus the number of associated " + "companies. Short accounting periods are not modelled." + ) + definition_period = YEAR + unit = GBP + defined_for = "firm_liable_to_corporation_tax" + reference = "https://www.legislation.gov.uk/ukpga/2010/4/section/18D" + + def formula(firm, period, parameters): + p = parameters(period).gov.hmrc.corporation_tax.marginal_relief + associates = firm("firm_n_associated_companies", period) + return p.lower_limit / (1 + associates) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_corporation_tax_upper_limit.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_corporation_tax_upper_limit.py new file mode 100644 index 0000000000..aa69b8b1f3 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_corporation_tax_upper_limit.py @@ -0,0 +1,21 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class firm_corporation_tax_upper_limit(Variable): + value_type = float + entity = Firm + label = "Firm corporation tax upper limit" + documentation = ( + "The upper limit divided by one plus the number of associated " + "companies. Short accounting periods are not modelled." + ) + definition_period = YEAR + unit = GBP + defined_for = "firm_liable_to_corporation_tax" + reference = "https://www.legislation.gov.uk/ukpga/2010/4/section/18D" + + def formula(firm, period, parameters): + p = parameters(period).gov.hmrc.corporation_tax.marginal_relief + associates = firm("firm_n_associated_companies", period) + return p.upper_limit / (1 + associates) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_group_relief.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_group_relief.py new file mode 100644 index 0000000000..0de6e6bebb --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_group_relief.py @@ -0,0 +1,32 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class firm_group_relief(Variable): + value_type = float + entity = Firm + label = "Firm group relief" + documentation = ( + "Group relief deducted from the firm's total profits under CTA 2010 " + "Part 5: firm_group_relief_claimed, floored at zero and capped at " + "the firm's total profits (s.138(b) and s.140(7)). It is deducted " + "after all other deductions except carried-forward losses and Part " + "5A relief (s.137(4)-(5)), so it also reduces the profits against " + "which carried-forward losses are restricted (s.269ZFA). Consortium " + "limits, overlapping periods and the surrenderer's matching " + "surrender are not modelled." + ) + definition_period = YEAR + unit = GBP + defined_for = "firm_liable_to_corporation_tax" + reference = ( + "https://www.legislation.gov.uk/ukpga/2010/4/section/137", + "https://www.legislation.gov.uk/ukpga/2010/4/section/138", + "https://www.legislation.gov.uk/ukpga/2010/4/section/140", + "https://www.legislation.gov.uk/ukpga/2010/4/section/269ZFA", + ) + + def formula(firm, period, parameters): + claimed = max_(firm("firm_group_relief_claimed", period), 0) + profits = max_(firm("firm_profits_before_losses", period), 0) + return min_(claimed, profits) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_group_relief_for_carried_forward_losses.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_group_relief_for_carried_forward_losses.py new file mode 100644 index 0000000000..5dd1034383 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_group_relief_for_carried_forward_losses.py @@ -0,0 +1,47 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class firm_group_relief_for_carried_forward_losses(Variable): + value_type = float + entity = Firm + label = "Firm group relief for carried-forward losses" + documentation = ( + "Group relief for carried-forward losses under CTA 2010 Part 5A, from " + "1 April 2017: firm_group_relief_for_carried_forward_losses_claimed, " + "floored at zero and limited to the firm's relevant maximum (the " + "deductions allowance plus 50% of profits above it) less its own " + "carried-forward losses used (ss.188DB, 188DD and 269ZD(3)(j)). It is " + "not given while the firm's own carried-forward losses are not all " + "used (s.188CD)." + ) + definition_period = YEAR + unit = GBP + defined_for = "firm_liable_to_corporation_tax" + reference = ( + "https://www.legislation.gov.uk/ukpga/2010/4/section/188CD", + "https://www.legislation.gov.uk/ukpga/2010/4/section/188DB", + "https://www.legislation.gov.uk/ukpga/2010/4/section/188DD", + "https://www.legislation.gov.uk/ukpga/2010/4/section/269ZD", + ) + + def formula(firm, period, parameters): + p = parameters(period).gov.hmrc.corporation_tax.losses + if not p.group_relief_for_carried_forward_losses_applies: + return np.zeros(firm.count) + profits = max_( + firm("firm_profits_before_losses", period) + - firm("firm_group_relief", period), + 0, + ) + allowance = p.deductions_allowance * firm( + "firm_deductions_allowance_share", period + ) + relevant_maximum = allowance + p.restriction_rate * max_(profits - allowance, 0) + losses_used = firm("firm_losses_used", period) + own_fully_used = firm("firm_losses_brought_forward", period) <= losses_used + room = max_(min_(relevant_maximum, profits) - losses_used, 0) + claimed = max_( + firm("firm_group_relief_for_carried_forward_losses_claimed", period), 0 + ) + return where(own_fully_used, min_(claimed, room), 0) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_liable_to_corporation_tax.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_liable_to_corporation_tax.py new file mode 100644 index 0000000000..71f5141573 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_liable_to_corporation_tax.py @@ -0,0 +1,18 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class firm_liable_to_corporation_tax(Variable): + value_type = bool + entity = Firm + label = "Firm is liable to corporation tax" + documentation = ( + "Companies pay corporation tax. Sole traders and partnerships pay " + "income tax on their profits instead." + ) + definition_period = YEAR + reference = "https://www.legislation.gov.uk/ukpga/2010/4/section/2" + + def formula(firm, period, parameters): + legal_form = firm("firm_legal_form", period) + return legal_form == legal_form.possible_values.COMPANY diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_losses_used.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_losses_used.py new file mode 100644 index 0000000000..d7976652e2 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_losses_used.py @@ -0,0 +1,38 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class firm_losses_used(Variable): + value_type = float + entity = Firm + label = "Firm losses brought forward used" + documentation = ( + "Carried-forward losses set against the year's profits, up to the " + "deductions allowance plus 50% of profits above it. Losses are treated " + "as one pool against total profits; the separate trading and " + "non-trading caps are not distinguished. Profits are taken after " + "Part 5 group relief (firm_group_relief), which comes first." + ) + definition_period = YEAR + unit = GBP + defined_for = "firm_liable_to_corporation_tax" + reference = ( + "https://www.legislation.gov.uk/ukpga/2010/4/section/269ZD", + "https://www.legislation.gov.uk/ukpga/2010/4/section/269ZFA", + "https://www.legislation.gov.uk/ukpga/2010/4/section/269ZR", + ) + + def formula(firm, period, parameters): + p = parameters(period).gov.hmrc.corporation_tax.losses + # Part 5 group relief is deducted first (CTA 2010 s.137(4)-(5)). + profits = max_( + firm("firm_profits_before_losses", period) + - firm("firm_group_relief", period), + 0, + ) + allowance = p.deductions_allowance * firm( + "firm_deductions_allowance_share", period + ) + relevant_maximum = allowance + p.restriction_rate * max_(profits - allowance, 0) + losses = firm("firm_losses_brought_forward", period) + return min_(losses, min_(relevant_maximum, profits)) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_marginal_relief.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_marginal_relief.py new file mode 100644 index 0000000000..e65c323689 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_marginal_relief.py @@ -0,0 +1,43 @@ +import numpy as np + +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class firm_marginal_relief(Variable): + value_type = float + entity = Firm + label = "Firm corporation tax marginal relief" + documentation = ( + "Marginal relief for companies with augmented profits above the lower " + "limit and not above the upper limit: the standard fraction times the " + "upper limit less augmented profits, times taxable total profits over " + "augmented profits. None for a close investment-holding company or a " + "non-UK-resident company (firm_small_profits_rate_excluded)." + ) + definition_period = YEAR + unit = GBP + defined_for = "firm_liable_to_corporation_tax" + reference = ( + "https://www.legislation.gov.uk/ukpga/2010/4/section/18B", + "https://www.legislation.gov.uk/ukpga/2010/4/section/18N", + ) + + def formula(firm, period, parameters): + p = parameters(period).gov.hmrc.corporation_tax + if not p.small_profits_rate_applies: + return 0 + augmented = firm("firm_augmented_profits", period) + taxable = firm("firm_taxable_profit", period) + lower = firm("firm_corporation_tax_lower_limit", period) + upper = firm("firm_corporation_tax_upper_limit", period) + excluded = firm("firm_small_profits_rate_excluded", period) + in_band = (augmented > lower) & (augmented <= upper) & ~excluded + profit_ratio = np.divide( + taxable, + augmented, + out=np.zeros_like(taxable), + where=augmented > 0, + ) + relief = p.marginal_relief.fraction * (upper - augmented) * profit_ratio + return where(in_band, relief, 0) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_profits_before_losses.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_profits_before_losses.py new file mode 100644 index 0000000000..daecee78d9 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_profits_before_losses.py @@ -0,0 +1,23 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class firm_profits_before_losses(Variable): + value_type = float + entity = Firm + label = "Firm profits before losses brought forward" + documentation = ( + "Taxable trading profit less capital allowances and the R&D " + "additional deduction, plus the taxable R&D expenditure credit and " + "non-trading profits, less the Patent Box deduction. Negative when the " + "firm makes a loss in the year." + ) + definition_period = YEAR + unit = GBP + defined_for = "firm_liable_to_corporation_tax" + reference = "https://www.legislation.gov.uk/ukpga/2010/4/section/4" + + def formula(firm, period, parameters): + return firm("firm_profits_before_patent_box", period) - firm( + "firm_patent_box_deduction", period + ) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_rdec_excess_payable.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_rdec_excess_payable.py new file mode 100644 index 0000000000..249fc01401 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_rdec_excess_payable.py @@ -0,0 +1,92 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class firm_rdec_excess_payable(Variable): + value_type = float + entity = Firm + label = "Firm R&D expenditure credit in excess of corporation tax" + documentation = ( + "R&D expenditure credit treated as paid to the company for the year. " + "Step 1 sets the credit against the year's corporation tax. Step 2 " + "removes the notional tax deduction: what is left may not exceed the " + "credit less corporation tax on the credit. Under the merged scheme " + "(section 1042K) the rate is the main rate where the company has " + "profits chargeable at the main rate ignoring the credit and the " + "small profits rate otherwise; before April 2024 (section 104N) it is " + "always the main rate. A company in the " + "marginal relief band counts as charged at the main rate, as does a " + "company barred from the small profits rate " + "(firm_small_profits_rate_excluded) with profits ignoring the credit; " + "with none, it gets the small profits rate (section 1042K(5)(b)). Profits " + "ignoring the credit are taxable total profits less the credit, " + "with no recalculation of the carried-forward loss restriction. The " + "notional tax deduction is not paid: it is set against later " + "corporation tax or surrendered (section 1042L), which is not " + "modelled. Step 3 caps what is left by reference to PAYE and NIC: " + "under the merged scheme at £20,000 plus three times the company's " + "relevant PAYE and NIC liabilities (section 1112B, input " + "firm_relevant_paye_nic_liabilities); before April 2024 at the " + "company's PAYE and NIC on R&D staff (section 104P, input " + "firm_rd_staff_paye_nic). The cap applies only when " + "firm_rdec_paye_nic_cap_supplied is true; with the flag true and the " + "input left at 0, the payable amount is nil before April 2024 and " + "£20,000 under the merged scheme. The excess over the cap is not paid but " + "added to the next period's credit (section 1042J, before April 2024 " + "section 104N step 3), which is not modelled. Not modelled either: " + "the reduction of the cap by any Chapter 2 credit (section 1112B(4)), " + "the proportionate reduction of the £20,000 for a period under 12 " + "months, the section 1112E exemption for companies creating or " + "managing intellectual property (leave the input unset), set-off " + "against other periods and liabilities and group surrender." + ) + definition_period = YEAR + unit = GBP + defined_for = "firm_liable_to_corporation_tax" + reference = ( + "https://www.legislation.gov.uk/ukpga/2009/4/section/104N/2024-03-31", + "https://www.legislation.gov.uk/ukpga/2009/4/section/1042I", + "https://www.legislation.gov.uk/ukpga/2009/4/section/1042K", + "https://www.legislation.gov.uk/ukpga/2009/4/section/1042L", + "https://www.legislation.gov.uk/ukpga/2009/4/section/1112B", + "https://www.legislation.gov.uk/ukpga/2009/4/section/104P/2024-03-31", + ) + + def formula(firm, period, parameters): + p = parameters(period).gov.hmrc.corporation_tax + tax = firm("corporation_tax_before_credits", period) + credit = firm("firm_rd_expenditure_credit", period) + # Step 1: set the credit against the year's corporation tax. + after_step_1 = max_(credit - tax, 0) + # Step 2 (s.1042K, before April 2024 s.104N): the notional tax + # deduction is the excess of the step 1 amount over the credit less + # notional tax on the credit. s.104N uses the main rate throughout. + merged = p.rd_relief.merged_scheme_in_effect + if not (merged and p.small_profits_rate_applies): + rate = p.main_rate + else: + taxable = firm("firm_taxable_profit", period) + taxable_ex_credit = max_(taxable - credit, 0) + augmented_ex_credit = firm("firm_augmented_profits", period) - ( + taxable - taxable_ex_credit + ) + lower = firm("firm_corporation_tax_lower_limit", period) + # A company barred from the small profits rate has all its + # profits chargeable at the main rate. + excluded = firm("firm_small_profits_rate_excluded", period) + main_rate_profits = (taxable_ex_credit > 0) & ( + (augmented_ex_credit > lower) | excluded + ) + rate = where(main_rate_profits, p.main_rate, p.small_profits_rate) + after_step_2 = min_(after_step_1, credit * (1 - rate)) + # Step 3 (s.1042I with s.1112B; before April 2024 s.104N with + # s.104P): cap by reference to PAYE and NIC liabilities. + if merged: + cap_p = p.rd_relief.paye_nic_cap + cap = cap_p.amount + cap_p.multiplier * firm( + "firm_relevant_paye_nic_liabilities", period + ) + else: + cap = firm("firm_rd_staff_paye_nic", period) + supplied = firm("firm_rdec_paye_nic_cap_supplied", period) + return where(supplied, min_(after_step_2, cap), after_step_2) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_taxable_profit.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_taxable_profit.py new file mode 100644 index 0000000000..040bca5e68 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/firm_taxable_profit.py @@ -0,0 +1,30 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class firm_taxable_profit(Variable): + value_type = float + entity = Firm + label = "Firm taxable total profits" + documentation = ( + "Profits chargeable to corporation tax: total profits less Part 5 " + "group relief, then carried-forward losses, then Part 5A group " + "relief for carried-forward losses (CTA 2010 s.137(4)-(5))." + ) + definition_period = YEAR + unit = GBP + defined_for = "firm_liable_to_corporation_tax" + reference = "https://www.legislation.gov.uk/ukpga/2010/4/section/4" + + def formula(firm, period, parameters): + profits = firm("firm_profits_before_losses", period) + deductions = add( + firm, + period, + [ + "firm_group_relief", + "firm_losses_used", + "firm_group_relief_for_carried_forward_losses", + ], + ) + return max_(profits - deductions, 0) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/patent_box/firm_patent_box_applicable_rate.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/patent_box/firm_patent_box_applicable_rate.py new file mode 100644 index 0000000000..8338b12f05 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/patent_box/firm_patent_box_applicable_rate.py @@ -0,0 +1,40 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class firm_patent_box_applicable_rate(Variable): + value_type = float + entity = Firm + label = "Firm Patent Box applicable rate" + documentation = ( + "The rate in the Patent Box formula: the main rate before 1 April " + "2023 (MR), and from then the small profits rate where the company " + "is charged at it and the main rate otherwise (AR, F(No.2)A 2023 " + "s.11). Following HMRC's CIRD201020, the small profits test uses " + "profits before the Patent Box deduction. As a model simplification, " + "not HMRC's, it also ignores group relief and carried-forward losses " + "(firm_profits_before_patent_box plus exempt distributions), so a " + "company brought under the lower limit only by those reliefs takes " + "the main rate and its deduction is overstated (15/25 instead of " + "9/19 of relevant IP profits)." + ) + definition_period = YEAR + unit = "/1" + defined_for = "firm_liable_to_corporation_tax" + reference = ( + "https://www.legislation.gov.uk/ukpga/2010/4/section/357A", + "https://www.legislation.gov.uk/ukpga/2023/30/section/11", + "https://www.gov.uk/hmrc-internal-manuals/corporate-intangibles-research-and-development-manual/cird201020", + ) + + def formula(firm, period, parameters): + p = parameters(period).gov.hmrc.corporation_tax + if not p.small_profits_rate_applies: + return np.full(firm.count, p.main_rate) + augmented = max_(firm("firm_profits_before_patent_box", period), 0) + firm( + "firm_exempt_distributions", period + ) + small = (augmented <= firm("firm_corporation_tax_lower_limit", period)) & ~firm( + "firm_small_profits_rate_excluded", period + ) + return where(small, p.small_profits_rate, p.main_rate) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/patent_box/firm_patent_box_deduction.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/patent_box/firm_patent_box_deduction.py new file mode 100644 index 0000000000..9b4c21db7f --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/patent_box/firm_patent_box_deduction.py @@ -0,0 +1,47 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class firm_patent_box_deduction(Variable): + value_type = float + entity = Firm + label = "Firm Patent Box deduction" + documentation = ( + "The Patent Box deduction from trading profits (CTA 2010 s.357A): " + "relevant IP profits times (applicable rate less the special IP " + "rate) over the applicable rate, so that the profits are taxed at " + "the special IP rate of 10%. Relevant IP profits are brought in at " + "60% in the financial year 2013, rising to 100% from 1 April 2017 " + "(FA 2012 Sch 2 para 8). As a model guard, not statute, they are " + "capped at the positive trading profit after capital allowances and " + "the R&D additional deduction. Relevant IP losses and the " + "set-off of losses between periods (ss.357E-357EF) are not modelled." + ) + definition_period = YEAR + unit = GBP + defined_for = "firm_liable_to_corporation_tax" + reference = ( + "https://www.legislation.gov.uk/ukpga/2010/4/section/357A", + "https://www.legislation.gov.uk/ukpga/2012/14/schedule/2/paragraph/8", + ) + + def formula(firm, period, parameters): + p = parameters(period).gov.hmrc.corporation_tax.patent_box + share = p.relevant_ip_profits_share + if share == 0: + return np.zeros(firm.count) + trading = max_( + firm("firm_taxable_trading_profit", period) + - firm("firm_capital_allowances", period) + - firm("firm_rd_additional_deduction", period), + 0, + ) + relevant = min_(max_(firm("firm_relevant_ip_profits", period), 0), trading) + rate = firm("firm_patent_box_applicable_rate", period) + fraction = np.divide( + max_(rate - p.special_ip_rate, 0), + rate, + out=np.zeros_like(rate), + where=rate > 0, + ) + return share * relevant * fraction diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/patent_box/firm_profits_before_patent_box.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/patent_box/firm_profits_before_patent_box.py new file mode 100644 index 0000000000..6ad76ace1b --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/patent_box/firm_profits_before_patent_box.py @@ -0,0 +1,35 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class firm_profits_before_patent_box(Variable): + value_type = float + entity = Firm + label = "Firm profits before the Patent Box deduction" + documentation = ( + "Taxable trading profit less capital allowances and the R&D " + "additional deduction, plus the taxable R&D expenditure credit and " + "non-trading profits, before the Patent Box deduction. Negative when " + "the firm makes a loss in the year." + ) + definition_period = YEAR + unit = GBP + defined_for = "firm_liable_to_corporation_tax" + reference = "https://www.legislation.gov.uk/ukpga/2010/4/section/4" + + def formula(firm, period, parameters): + additions = add( + firm, + period, + [ + "firm_taxable_trading_profit", + "firm_rd_expenditure_credit", + "firm_non_trading_profits", + ], + ) + deductions = add( + firm, + period, + ["firm_capital_allowances", "firm_rd_additional_deduction"], + ) + return additions - deductions diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/rd_relief/firm_claims_rd_sme_relief.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/rd_relief/firm_claims_rd_sme_relief.py new file mode 100644 index 0000000000..2dd045f763 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/rd_relief/firm_claims_rd_sme_relief.py @@ -0,0 +1,43 @@ +from policyengine_uk.model_api import * + + +class firm_claims_rd_sme_relief(Variable): + value_type = bool + entity = Firm + label = "Firm claims SME R&D relief" + documentation = ( + "Whether the firm claims R&D relief under Chapter 2 of Part 13 of the " + "Corporation Tax Act 2009 rather than the R&D expenditure credit. " + "Before April 2024 every SME company with qualifying expenditure did. " + "From April 2024 only an SME company that is R&D intensive and makes a " + "trading loss before the additional deduction (enhanced R&D intensive " + "support) does. The trading loss is trading profit less capital " + "allowances." + ) + definition_period = YEAR + reference = ( + "https://www.legislation.gov.uk/ukpga/2009/4/section/1044", + "https://www.gov.uk/hmrc-internal-manuals/corporate-intangibles-research-and-development-manual/cird121000", + ) + + def formula(firm, period, parameters): + p = parameters(period).gov.hmrc.corporation_tax.rd_relief + is_company = ( + firm("firm_legal_form", period) + == firm("firm_legal_form", period).possible_values.COMPANY + ) + sme_with_rd = ( + is_company + & firm("firm_is_sme", period) + & (firm("firm_qualifying_rd_expenditure", period) > 0) + ) + if not p.merged_scheme_in_effect: + return sme_with_rd + profit_before_deduction = firm("firm_taxable_trading_profit", period) - firm( + "firm_capital_allowances", period + ) + return ( + sme_with_rd + & firm("firm_is_rd_intensive", period) + & (profit_before_deduction < 0) + ) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/rd_relief/firm_is_rd_intensive.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/rd_relief/firm_is_rd_intensive.py new file mode 100644 index 0000000000..6de449f9a0 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/rd_relief/firm_is_rd_intensive.py @@ -0,0 +1,19 @@ +from policyengine_uk.model_api import * + + +class firm_is_rd_intensive(Variable): + value_type = bool + entity = Firm + label = "Firm is R&D intensive" + documentation = ( + "Whether the firm's R&D intensity meets the threshold for the R&D " + "intensive regime (section 1045ZA of the Corporation Tax Act 2009). " + "The grace period for a firm that met the test the year before is not " + "modelled." + ) + definition_period = YEAR + reference = "https://www.legislation.gov.uk/ukpga/2009/4/part/13/chapter/2" + + def formula(firm, period, parameters): + p = parameters(period).gov.hmrc.corporation_tax.rd_relief.sme + return firm("firm_rd_intensity", period) >= p.intensity_threshold diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/rd_relief/firm_rd_additional_deduction.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/rd_relief/firm_rd_additional_deduction.py new file mode 100644 index 0000000000..c3e3becb24 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/rd_relief/firm_rd_additional_deduction.py @@ -0,0 +1,23 @@ +from policyengine_uk.model_api import * + + +class firm_rd_additional_deduction(Variable): + value_type = float + entity = Firm + label = "Firm R&D additional deduction" + documentation = ( + "Additional deduction in computing trading profits for qualifying R&D " + "expenditure under section 1044 of the Corporation Tax Act 2009: the " + "SME scheme before April 2024 and enhanced R&D intensive support from " + "then. Deduct from trading profit on top of the expenditure itself." + ) + definition_period = YEAR + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/2009/4/section/1044" + defined_for = "firm_claims_rd_sme_relief" + + def formula(firm, period, parameters): + rate = parameters( + period + ).gov.hmrc.corporation_tax.rd_relief.sme.additional_deduction_rate + return rate * firm("firm_qualifying_rd_expenditure", period) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/rd_relief/firm_rd_expenditure_credit.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/rd_relief/firm_rd_expenditure_credit.py new file mode 100644 index 0000000000..83a1026d0b --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/rd_relief/firm_rd_expenditure_credit.py @@ -0,0 +1,32 @@ +from policyengine_uk.model_api import * + + +class firm_rd_expenditure_credit(Variable): + value_type = float + entity = Firm + label = "Firm R&D expenditure credit" + documentation = ( + "R&D expenditure credit on qualifying expenditure for a company that " + "does not claim SME relief: the merged scheme credit from April 2024 " + "and the large-company credit before. The credit is a taxable receipt " + "of the trade and is set against corporation tax; " + "firm_rdec_excess_payable gives the part paid out after the notional " + "tax deduction." + ) + definition_period = YEAR + unit = GBP + reference = ( + "https://www.legislation.gov.uk/ukpga/2009/4/section/1042G", + "https://www.legislation.gov.uk/ukpga/2009/4/section/104M", + ) + + def formula(firm, period, parameters): + rate = parameters( + period + ).gov.hmrc.corporation_tax.rd_relief.expenditure_credit.rate + is_company = ( + firm("firm_legal_form", period) + == firm("firm_legal_form", period).possible_values.COMPANY + ) + eligible = is_company & ~firm("firm_claims_rd_sme_relief", period) + return where(eligible, rate * firm("firm_qualifying_rd_expenditure", period), 0) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/rd_relief/firm_rd_intensity.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/rd_relief/firm_rd_intensity.py new file mode 100644 index 0000000000..d5e8f22406 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/rd_relief/firm_rd_intensity.py @@ -0,0 +1,19 @@ +from policyengine_uk.model_api import * + + +class firm_rd_intensity(Variable): + value_type = float + entity = Firm + label = "Firm R&D intensity" + documentation = ( + "Qualifying research and development expenditure as a share of total " + "relevant expenditure. Zero where relevant expenditure is zero." + ) + definition_period = YEAR + unit = "/1" + reference = "https://www.legislation.gov.uk/ukpga/2009/4/part/13/chapter/2" + + def formula(firm, period, parameters): + rd = firm("firm_qualifying_rd_expenditure", period) + total = firm("firm_total_relevant_expenditure", period) + return np.divide(rd, total, out=np.zeros_like(rd), where=total > 0) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/rd_relief/firm_rd_payable_credit.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/rd_relief/firm_rd_payable_credit.py new file mode 100644 index 0000000000..5272a22950 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/rd_relief/firm_rd_payable_credit.py @@ -0,0 +1,53 @@ +from policyengine_uk.model_api import * + + +class firm_rd_payable_credit(Variable): + value_type = float + entity = Firm + label = "Firm R&D payable tax credit" + documentation = ( + "Payable R&D tax credit for surrendering the surrenderable loss under " + "section 1058 of the Corporation Tax Act 2009, at the R&D intensive " + "rate for an R&D intensive SME and the general SME rate otherwise. " + "Assumes every eligible company surrenders its whole surrenderable " + "loss. For accounting periods beginning on or after 1 April 2021 the " + "credit is the lesser of that amount and the cap by reference to PAYE " + "and NIC liabilities: £20,000 plus three times the company's relevant " + "expenditure on workers (section 1058(1A) and sections 1058A to " + "1058C) and, from April 2024, its relevant PAYE and NIC liabilities " + "(section 1112B). Both are PAYE income tax and Class 1 National " + "Insurance on all employees, adjusted for workers provided by " + "connected companies; supply them as " + "firm_relevant_paye_nic_liabilities. The cap applies only when " + "firm_rdec_paye_nic_cap_supplied is true; with the flag true and the " + "input left at 0 the credit is at most £20,000. Leave the flag false " + "for a company exempt from the cap because it creates or manages its " + "own intellectual property (section 1058D, from April 2024 section " + "1112E), which the model does not test. The proportionate reduction " + "of the £20,000 for a period under 12 months is not modelled." + ) + definition_period = YEAR + unit = GBP + reference = ( + "https://www.legislation.gov.uk/ukpga/2009/4/section/1058", + "https://www.legislation.gov.uk/ukpga/2009/4/section/1058/2022-04-01", + "https://www.legislation.gov.uk/ukpga/2009/4/section/1058A/2022-04-01", + "https://www.legislation.gov.uk/ukpga/2009/4/section/1112B", + ) + defined_for = "firm_claims_rd_sme_relief" + + def formula(firm, period, parameters): + p = parameters(period).gov.hmrc.corporation_tax.rd_relief + rate = where( + firm("firm_is_rd_intensive", period), + p.sme.intensive_payable_credit_rate, + p.sme.payable_credit_rate, + ) + credit = rate * firm("firm_rd_surrenderable_loss", period) + if not p.sme.payable_credit_paye_nic_cap_applies: + return credit + cap = p.paye_nic_cap.amount + p.paye_nic_cap.multiplier * firm( + "firm_relevant_paye_nic_liabilities", period + ) + supplied = firm("firm_rdec_paye_nic_cap_supplied", period) + return where(supplied, min_(credit, cap), credit) diff --git a/policyengine_uk/variables/gov/hmrc/corporation_tax/rd_relief/firm_rd_surrenderable_loss.py b/policyengine_uk/variables/gov/hmrc/corporation_tax/rd_relief/firm_rd_surrenderable_loss.py new file mode 100644 index 0000000000..d082d19438 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/corporation_tax/rd_relief/firm_rd_surrenderable_loss.py @@ -0,0 +1,47 @@ +from policyengine_uk.model_api import * + + +class firm_rd_surrenderable_loss(Variable): + value_type = float + entity = Firm + label = "Firm R&D surrenderable loss" + documentation = ( + "Trading loss a company claiming SME R&D relief can surrender for a " + "payable credit (section 1055 of the Corporation Tax Act 2009): the " + "unrelieved trading loss after capital allowances and the additional " + "deduction, capped at the qualifying expenditure plus the additional " + "deduction. The loss is unrelieved after the relief that was or could " + "have been obtained against total profits of the same accounting " + "period under section 37(3)(a) of the Corporation Tax Act 2010 " + "(section 1056(2)(a)), so the loss is reduced by the company's " + "positive non-trading profits, against which firm_profits_before_losses " + "already sets it. Losses brought forward are ignored, as section " + "1056(3) requires. The loss is also reduced by any " + "loss surrendered as group relief (section 1056(2)(c), " + "firm_trading_loss_surrendered). Carry-back (section 1056(2)(b)) is " + "not modelled." + ) + definition_period = YEAR + unit = GBP + reference = ( + "https://www.legislation.gov.uk/ukpga/2009/4/section/1055", + "https://www.legislation.gov.uk/ukpga/2009/4/section/1056", + ) + defined_for = "firm_claims_rd_sme_relief" + + def formula(firm, period, parameters): + deduction = firm("firm_rd_additional_deduction", period) + trading_profit = ( + firm("firm_taxable_trading_profit", period) + - firm("firm_capital_allowances", period) + - deduction + ) + trading_loss = max_(-trading_profit, 0) + # s.1056(2)(a): relief against total profits of the same period, + # whether or not claimed, reduces the loss. + same_period_relief = max_(firm("firm_non_trading_profits", period), 0) + # s.1056(2)(c): loss surrendered as group relief. + surrendered = max_(firm("firm_trading_loss_surrendered", period), 0) + unrelieved = max_(trading_loss - same_period_relief - surrendered, 0) + cap = firm("firm_qualifying_rd_expenditure", period) + deduction + return min_(unrelieved, cap) diff --git a/policyengine_uk/variables/gov/hmrc/digital_services_tax/digital_services_tax.py b/policyengine_uk/variables/gov/hmrc/digital_services_tax/digital_services_tax.py new file mode 100644 index 0000000000..accef2f9d0 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/digital_services_tax/digital_services_tax.py @@ -0,0 +1,38 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class digital_services_tax(Variable): + value_type = float + entity = Firm + label = "Digital services tax" + documentation = ( + "Digital services tax from 1 April 2020 (Finance Act 2020 Part 2): " + "where the group's worldwide digital services revenues exceed £500 " + "million and its UK digital services revenues exceed £25 million " + "(s.46), 2% of the group's UK revenues above £25 million, shared " + "between members by their UK revenues (s.47). The group totals " + "default to the firm's own UK revenues. Not modelled: the " + "alternative charge for loss-making services (s.48) and the " + "relief for cross-border marketplace transactions." + ) + definition_period = YEAR + unit = GBP + reference = ( + "https://www.legislation.gov.uk/ukpga/2020/14/section/46", + "https://www.legislation.gov.uk/ukpga/2020/14/section/47", + ) + + def formula(firm, period, parameters): + p = parameters(period).gov.hmrc.digital_services_tax + own = max_(firm("firm_uk_digital_services_revenues", period), 0) + group_uk = max_(firm("firm_group_uk_digital_services_revenues", period), own) + group_world = max_( + firm("firm_group_digital_services_revenues", period), group_uk + ) + liable = (group_world > p.threshold.worldwide_revenues) & ( + group_uk > p.threshold.uk_revenues + ) + share = np.divide(own, group_uk, out=np.zeros_like(own), where=group_uk > 0) + tax = p.rate * max_(group_uk - p.allowance, 0) * share + return where(liable, tax, 0) diff --git a/policyengine_uk/variables/gov/hmrc/energy_profits_levy/energy_profits_levy.py b/policyengine_uk/variables/gov/hmrc/energy_profits_levy/energy_profits_levy.py new file mode 100644 index 0000000000..788fe9b5d5 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/energy_profits_levy/energy_profits_levy.py @@ -0,0 +1,32 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class energy_profits_levy(Variable): + value_type = float + entity = Firm + label = "Energy profits levy" + documentation = ( + "Energy profits levy on a company's levy profits (Energy (Oil and " + "Gas) Profits Levy Act 2022), supplied as firm_epl_profits after the " + "investment and decarbonisation allowances and levy loss relief: " + "25% from 26 May 2022, 35% from 1 January 2023 and 38% from 1 " + "November 2024, to 31 March 2030. The rate is day-weighted over 6 " + "April to 5 April. Companies only. Not modelled: the allowances and " + "levy loss relief (they are in the input), ring fence corporation " + "tax and the supplementary charge, the energy security investment " + "mechanism (price floor) and exact apportionment of straddling " + "periods." + ) + definition_period = YEAR + unit = GBP + defined_for = "firm_liable_to_corporation_tax" + reference = ( + "https://www.legislation.gov.uk/ukpga/2022/40/section/1", + "https://www.legislation.gov.uk/ukpga/2025/8/section/15", + "https://www.legislation.gov.uk/ukpga/2025/8/section/17", + ) + + def formula(firm, period, parameters): + p = parameters(period).gov.hmrc.energy_profits_levy + return p.rate * max_(firm("firm_epl_profits", period), 0) diff --git a/policyengine_uk/variables/gov/hmrc/minimum_wage/firm/firm_minimum_wage_cost.py b/policyengine_uk/variables/gov/hmrc/minimum_wage/firm/firm_minimum_wage_cost.py new file mode 100644 index 0000000000..3886c3ed66 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/minimum_wage/firm/firm_minimum_wage_cost.py @@ -0,0 +1,46 @@ +from policyengine_uk.model_api import * + + +class firm_minimum_wage_cost(Variable): + value_type = float + entity = Firm + label = "Firm cost of meeting the minimum wage" + documentation = ( + "The extra pay the firm needs to bring its low-paid workers up to the " + "adult minimum wage (the national living wage): the hourly rate times " + "firm_low_paid_hours, less firm_low_paid_paybill, floored at zero. " + "It is a cost to the firm, not a tax. It raises the paybill in " + "firm_paybill_after_minimum_wage, through which the apprenticeship " + "levy and the default employer National Insurance and auto-enrolment " + "approximations rise. The rate is the top age band of " + "gov.hmrc.minimum_wage.non_apprentice read at 30 April, the rate for " + "the fiscal year that starts that April. The block is treated as " + "paid its average hourly wage, so the cost is understated where pay " + "within it varies: hours paid above the rate offset hours paid " + "below it. Negative inputs count as 0. The rates in the model start " + "in October 2010, so the cost is 0 for 2010 and earlier. The " + "younger-worker and apprentice rates are not modelled." + ) + definition_period = YEAR + unit = GBP + reference = [ + dict( + title="National Minimum Wage Act 1998 s.1", + href="https://www.legislation.gov.uk/ukpga/1998/39/section/1", + ), + dict( + title="National Minimum Wage Regulations 2015 reg. 4", + href="https://www.legislation.gov.uk/uksi/2015/621/regulation/4", + ), + ] + + def formula(firm, period, parameters): + # The compiled scale orders brackets by age, so its last amount is + # the adult rate, as in esa_exempt_work_higher_earnings_limit. + # The rates start in October 2010, so at 30 April of 2010 and + # earlier the scale is empty and the floor does not apply. + amounts = parameters(period).gov.hmrc.minimum_wage.non_apprentice.amounts + adult_rate = amounts[-1] if len(amounts) else 0 + hours = max_(firm("firm_low_paid_hours", period), 0) + paybill = max_(firm("firm_low_paid_paybill", period), 0) + return max_(adult_rate * hours - paybill, 0) diff --git a/policyengine_uk/variables/gov/hmrc/minimum_wage/firm/firm_paybill_after_minimum_wage.py b/policyengine_uk/variables/gov/hmrc/minimum_wage/firm/firm_paybill_after_minimum_wage.py new file mode 100644 index 0000000000..722701affa --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/minimum_wage/firm/firm_paybill_after_minimum_wage.py @@ -0,0 +1,17 @@ +from policyengine_uk.model_api import * + + +class firm_paybill_after_minimum_wage(Variable): + value_type = float + entity = Firm + label = "Firm paybill after the minimum wage" + documentation = ( + "firm_paybill plus firm_minimum_wage_cost: the paybill once the " + "low-paid workers are paid at least the adult minimum wage. The " + "apprenticeship levy and the default employer National Insurance " + "and auto-enrolment approximations read it. Where the pay data " + "already comply, it equals firm_paybill." + ) + definition_period = YEAR + unit = GBP + adds = ["firm_paybill", "firm_minimum_wage_cost"] diff --git a/policyengine_uk/variables/gov/hmrc/national_insurance/employer/firm/firm_class_1_earnings_above_secondary_threshold.py b/policyengine_uk/variables/gov/hmrc/national_insurance/employer/firm/firm_class_1_earnings_above_secondary_threshold.py new file mode 100644 index 0000000000..96ca860c08 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/national_insurance/employer/firm/firm_class_1_earnings_above_secondary_threshold.py @@ -0,0 +1,59 @@ +from policyengine_uk.model_api import * + + +class firm_class_1_earnings_above_secondary_threshold(Variable): + value_type = float + entity = Firm + label = "Firm Class 1 earnings above the secondary threshold" + documentation = ( + "Total of each employee's Class 1 earnings above the secondary " + "threshold (SSCBA 1992 s.9). Supply it as an input where per-employee " + "pay is known. Otherwise the formula removes any employees supplied " + "as paid at or below the annual secondary threshold " + "(firm_employees_below_secondary_threshold and " + "firm_paybill_below_secondary_threshold), then assumes the rest are " + "paid above the threshold: the remaining paybill less the " + "remaining headcount times the threshold, floored at zero. This is " + "exact when every remaining employee earns above the threshold. With " + "no split supplied (both 0) it is the plain average-pay " + "approximation, which understates the base where some staff earn " + "below the threshold, since their unused threshold is netted against " + "others' pay. The threshold is applied annually rather than per " + "earnings period. Inconsistent inputs are clipped silently: the " + "headcount at or below the threshold is floored at zero and capped " + "at firm_employees, and their paybill is floored at zero and capped " + "at the lower of the paybill and that headcount times the threshold. " + "The paybill is firm_paybill_after_minimum_wage, firm_paybill plus " + "any pay needed to meet the minimum wage; with a pay split supplied, " + "that extra pay all falls in the remaining group, which overstates " + "the base if the low-paid staff are at or below the threshold." + ) + definition_period = YEAR + unit = GBP + reference = [ + dict( + title="Social Security Contributions and Benefits Act 1992 s.9", + href="https://www.legislation.gov.uk/ukpga/1992/4/section/9", + ), + ] + + def formula(firm, period, parameters): + class_1 = parameters(period).gov.hmrc.national_insurance.class_1 + secondary_threshold = ( + class_1.employer_scale.components[1].threshold * WEEKS_IN_YEAR + ) + paybill = firm("firm_paybill_after_minimum_wage", period) + employees = firm("firm_employees", period) + employees_below = min_( + max_(firm("firm_employees_below_secondary_threshold", period), 0), + employees, + ) + paybill_below = min_( + max_(firm("firm_paybill_below_secondary_threshold", period), 0), + min_(paybill, employees_below * secondary_threshold), + ) + return max_( + (paybill - paybill_below) + - (employees - employees_below) * secondary_threshold, + 0, + ) diff --git a/policyengine_uk/variables/gov/hmrc/national_insurance/employer/firm/firm_class_1a_ni.py b/policyengine_uk/variables/gov/hmrc/national_insurance/employer/firm/firm_class_1a_ni.py new file mode 100644 index 0000000000..df22f2e1f2 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/national_insurance/employer/firm/firm_class_1a_ni.py @@ -0,0 +1,39 @@ +from policyengine_uk.model_api import * + + +class firm_class_1a_ni(Variable): + value_type = float + entity = Firm + label = "Firm Class 1A National Insurance" + documentation = ( + "Class 1A contributions the firm pays on the cash equivalent of the " + "taxable benefits in kind it provides to employees (SSCBA 1992 " + "s.10(1)). The Class 1A percentage equals the secondary Class 1 " + "percentage for the year (s.10(5)), read at 30 April like other " + "annual rates, except in 2022-23, when the Health and Social Care " + "Levy (Repeal) Act 2022 fixes it at 14.53%. It has no threshold, and " + "the Employment Allowance cannot be set against it. It belongs in " + "firm_tax but not in firm_only_tax, because the household side " + "already has Class 1A (ni_class_1a, part of ni_employer)." + ) + definition_period = YEAR + unit = GBP + reference = [ + dict( + title="Social Security Contributions and Benefits Act 1992 s.10", + href="https://www.legislation.gov.uk/ukpga/1992/4/section/10", + ), + dict( + title="Health and Social Care Levy (Repeal) Act 2022 Schedule paragraph 1", + href="https://www.legislation.gov.uk/ukpga/2022/43/schedule/paragraph/1/enacted", + ), + ] + + def formula(firm, period, parameters): + ni = parameters(period).gov.hmrc.national_insurance + fixed = ni.class_1a.percentage_2022_23 + if fixed.in_effect: + rate = fixed.rate + else: + rate = ni.class_1.employer_scale.components[1].rate + return rate * firm("firm_class_1a_benefits", period) diff --git a/policyengine_uk/variables/gov/hmrc/national_insurance/employer/firm/firm_class_1b_ni.py b/policyengine_uk/variables/gov/hmrc/national_insurance/employer/firm/firm_class_1b_ni.py new file mode 100644 index 0000000000..5d13b8cf66 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/national_insurance/employer/firm/firm_class_1b_ni.py @@ -0,0 +1,40 @@ +from policyengine_uk.model_api import * + + +class firm_class_1b_ni(Variable): + value_type = float + entity = Firm + label = "Firm Class 1B National Insurance" + documentation = ( + "Class 1B contributions on the firm's PAYE settlement agreements " + "(SSCBA 1992 s.10A): the Class 1B percentage of the chargeable " + "earnings included in the agreements plus the income tax the firm " + "is accountable for under them. The percentage equals the secondary " + "Class 1 percentage, read at 30 April (s.10A(6)), except 14.53% in " + "2022-23 (Health and Social Care Levy (Repeal) Act 2022 Schedule " + "para 3). There is no threshold, and the Employment Allowance cannot " + "be set against it." + ) + definition_period = YEAR + unit = GBP + reference = [ + dict( + title="Social Security Contributions and Benefits Act 1992 s.10A", + href="https://www.legislation.gov.uk/ukpga/1992/4/section/10A", + ), + dict( + title="Health and Social Care Levy (Repeal) Act 2022 Schedule paragraph 3", + href="https://www.legislation.gov.uk/ukpga/2022/43/schedule/paragraph/3/enacted", + ), + ] + + def formula(firm, period, parameters): + ni = parameters(period).gov.hmrc.national_insurance + fixed = ni.class_1b.percentage_2022_23 + if fixed.in_effect: + rate = fixed.rate + else: + rate = ni.class_1.employer_scale.components[1].rate + earnings = max_(firm("firm_psa_chargeable_earnings", period), 0) + tax = max_(firm("firm_psa_income_tax", period), 0) + return rate * (earnings + tax) diff --git a/policyengine_uk/variables/gov/hmrc/national_insurance/employer/firm/firm_employer_ni.py b/policyengine_uk/variables/gov/hmrc/national_insurance/employer/firm/firm_employer_ni.py new file mode 100644 index 0000000000..ea0f9fdce9 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/national_insurance/employer/firm/firm_employer_ni.py @@ -0,0 +1,20 @@ +from policyengine_uk.model_api import * + + +class firm_employer_ni(Variable): + label = "Firm employer National Insurance" + documentation = ( + "Secondary Class 1 contributions the firm pays after the Employment Allowance." + ) + entity = Firm + definition_period = YEAR + value_type = float + unit = GBP + reference = [ + dict( + title="National Insurance Contributions Act 2014 s.1", + href="https://www.legislation.gov.uk/ukpga/2014/7/section/1", + ), + ] + adds = ["firm_employer_ni_before_allowance"] + subtracts = ["employment_allowance"] diff --git a/policyengine_uk/variables/gov/hmrc/national_insurance/employer/firm/firm_employer_ni_before_allowance.py b/policyengine_uk/variables/gov/hmrc/national_insurance/employer/firm/firm_employer_ni_before_allowance.py new file mode 100644 index 0000000000..9d05344d9a --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/national_insurance/employer/firm/firm_employer_ni_before_allowance.py @@ -0,0 +1,45 @@ +from policyengine_uk.model_api import * + + +class firm_employer_ni_before_allowance(Variable): + value_type = float + entity = Firm + label = "Firm employer National Insurance before the Employment Allowance" + documentation = ( + "Secondary Class 1 contributions on the firm's employees: the " + "secondary percentage on earnings above the secondary threshold, " + "less the earnings zero-rated for earners under 21, relevant " + "apprentices under 25 and freeport or investment zone employees, " + "before the Employment Allowance. Computed at firm level from " + "aggregate earnings, as the model has no links between firms and " + "the people they employ." + ) + definition_period = YEAR + unit = GBP + reference = [ + dict( + title="Social Security Contributions and Benefits Act 1992 s.9", + href="https://www.legislation.gov.uk/ukpga/1992/4/section/9", + ), + dict( + title="Social Security Contributions and Benefits Act 1992 s.9A", + href="https://www.legislation.gov.uk/ukpga/1992/4/section/9A", + ), + dict( + title="Social Security Contributions and Benefits Act 1992 s.9B", + href="https://www.legislation.gov.uk/ukpga/1992/4/section/9B", + ), + dict( + title="National Insurance Contributions Act 2022 s.1", + href="https://www.legislation.gov.uk/ukpga/2022/9/section/1", + ), + ] + + def formula(firm, period, parameters): + class_1 = parameters(period).gov.hmrc.national_insurance.class_1 + rate = class_1.employer_scale.components[1].rate + above_threshold = firm( + "firm_class_1_earnings_above_secondary_threshold", period + ) + zero_rated = firm("firm_zero_rated_class_1_earnings", period) + return rate * max_(above_threshold - zero_rated, 0) diff --git a/policyengine_uk/variables/gov/hmrc/national_insurance/employer/firm/firm_off_payroll_employer_ni.py b/policyengine_uk/variables/gov/hmrc/national_insurance/employer/firm/firm_off_payroll_employer_ni.py new file mode 100644 index 0000000000..8ce6c61ea5 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/national_insurance/employer/firm/firm_off_payroll_employer_ni.py @@ -0,0 +1,44 @@ +from policyengine_uk.model_api import * + + +class firm_off_payroll_employer_ni(Variable): + value_type = float + entity = Firm + label = "Firm off-payroll employer National Insurance" + documentation = ( + "Secondary Class 1 contributions the firm pays as the fee-payer on " + "deemed direct payments under the off-payroll working rules (SI " + "2000/727 regs 14 and 18(2)(d)): the secondary percentage on the " + "payments above the secondary threshold for each deemed worker. The " + "rules apply to public authority clients from 6 April 2017 and to " + "other clients from 6 April 2021. The Employment Allowance cannot be " + "set against these contributions (NICA 2014 ss.1(2)(b) and 2(4)), so " + "they are kept out of firm_employer_ni_before_allowance and the " + "prior-year limit. The payments count in the apprenticeship levy pay " + "bill. Like the average-pay approximation, the threshold for " + "several workers is netted across them." + ) + definition_period = YEAR + unit = GBP + reference = [ + dict( + title="Social Security Contributions (Intermediaries) Regulations 2000 reg 14", + href="https://www.legislation.gov.uk/uksi/2000/727/regulation/14", + ), + dict( + title="Social Security Contributions (Intermediaries) Regulations 2000 reg 18", + href="https://www.legislation.gov.uk/uksi/2000/727/regulation/18", + ), + dict( + title="National Insurance Contributions Act 2014 s.2(4)", + href="https://www.legislation.gov.uk/ukpga/2014/7/section/2", + ), + ] + + def formula(firm, period, parameters): + class_1 = parameters(period).gov.hmrc.national_insurance.class_1 + secondary = class_1.employer_scale.components[1] + threshold = secondary.threshold * WEEKS_IN_YEAR + payments = firm("firm_off_payroll_levy_earnings", period) + workers = max_(firm("firm_off_payroll_deemed_workers", period), 0) + return secondary.rate * max_(payments - workers * threshold, 0) diff --git a/policyengine_uk/variables/gov/hmrc/national_insurance/employer/firm/firm_off_payroll_levy_earnings.py b/policyengine_uk/variables/gov/hmrc/national_insurance/employer/firm/firm_off_payroll_levy_earnings.py new file mode 100644 index 0000000000..cf2203aa78 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/national_insurance/employer/firm/firm_off_payroll_levy_earnings.py @@ -0,0 +1,35 @@ +from policyengine_uk.model_api import * + + +class firm_off_payroll_levy_earnings(Variable): + value_type = float + entity = Firm + label = "Firm off-payroll deemed payments within the rules" + documentation = ( + "firm_off_payroll_deemed_payments, floored at zero, in years and for " + "clients the off-payroll working rules cover: public authorities " + "from 6 April 2017 and other clients from 6 April 2021. They are " + "earnings on which the firm incurs secondary Class 1 liabilities, so " + "they count in its apprenticeship levy pay bill (Finance Act 2016 " + "s.100)." + ) + definition_period = YEAR + unit = GBP + reference = [ + dict( + title="Social Security Contributions (Intermediaries) Regulations 2000 reg 14", + href="https://www.legislation.gov.uk/uksi/2000/727/regulation/14", + ), + dict( + title="Finance Act 2016 s.100", + href="https://www.legislation.gov.uk/ukpga/2016/24/section/100", + ), + ] + + def formula(firm, period, parameters): + p = parameters(period).gov.hmrc.national_insurance.class_1.off_payroll + payments = max_(firm("firm_off_payroll_deemed_payments", period), 0) + covered = p.in_effect & ( + firm("firm_is_public_body", period) | p.applies_to_non_public_clients + ) + return where(covered, payments, 0) diff --git a/policyengine_uk/variables/gov/hmrc/national_insurance/employer/firm/firm_termination_award_class_1a_ni.py b/policyengine_uk/variables/gov/hmrc/national_insurance/employer/firm/firm_termination_award_class_1a_ni.py new file mode 100644 index 0000000000..666f54a37e --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/national_insurance/employer/firm/firm_termination_award_class_1a_ni.py @@ -0,0 +1,45 @@ +from policyengine_uk.model_api import * + + +class firm_termination_award_class_1a_ni(Variable): + value_type = float + entity = Firm + label = "Firm Class 1A National Insurance on termination awards" + documentation = ( + "Class 1A contributions on the part of each employee's termination " + "awards above the £30,000 threshold that counts as employment " + "income under ITEPA 2003 s.403 (SSCBA 1992 s.10(1A)-(1C)), from 6 " + "April 2020. The Class 1A percentage equals the secondary Class 1 " + "percentage, read at 30 April, so 2022-23 uses 15.05%: the fixed " + "14.53% for that year does not apply to termination awards (Health " + "and Social Care Levy (Repeal) Act 2022 Schedule paras 1(1) and " + "2(2)), and awards paid from 6 November 2022 at 13.8% are not " + "separated. The Employment Allowance cannot be set against it. With " + "several recipients the threshold is netted across them." + ) + definition_period = YEAR + unit = GBP + reference = [ + dict( + title="Social Security Contributions and Benefits Act 1992 s.10", + href="https://www.legislation.gov.uk/ukpga/1992/4/section/10", + ), + dict( + title="Income Tax (Earnings and Pensions) Act 2003 s.403", + href="https://www.legislation.gov.uk/ukpga/2003/1/section/403", + ), + dict( + title="Health and Social Care Levy (Repeal) Act 2022 Schedule", + href="https://www.legislation.gov.uk/ukpga/2022/43/schedule/enacted", + ), + ] + + def formula(firm, period, parameters): + ni = parameters(period).gov.hmrc.national_insurance + p = ni.class_1a.termination_awards + if not p.in_effect: + return np.zeros(firm.count) + rate = ni.class_1.employer_scale.components[1].rate + awards = max_(firm("firm_termination_awards", period), 0) + recipients = max_(firm("firm_termination_award_recipients", period), 0) + return rate * max_(awards - recipients * p.threshold, 0) diff --git a/policyengine_uk/variables/gov/hmrc/national_insurance/employment_allowance/employment_allowance.py b/policyengine_uk/variables/gov/hmrc/national_insurance/employment_allowance/employment_allowance.py new file mode 100644 index 0000000000..0e99c5dbf3 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/national_insurance/employment_allowance/employment_allowance.py @@ -0,0 +1,26 @@ +from policyengine_uk.model_api import * + + +class employment_allowance(Variable): + value_type = float + entity = Firm + label = "Employment Allowance" + documentation = ( + "Reduction in the firm's secondary Class 1 contributions for the " + "tax year: the maximum allowance or, if less, the firm's secondary " + "Class 1 liabilities." + ) + definition_period = YEAR + unit = GBP + defined_for = "employment_allowance_eligible" + reference = [ + dict( + title="National Insurance Contributions Act 2014 s.1", + href="https://www.legislation.gov.uk/ukpga/2014/7/section/1", + ), + ] + + def formula(firm, period, parameters): + p = parameters(period).gov.hmrc.national_insurance.employment_allowance + liabilities = firm("firm_employer_ni_before_allowance", period) + return min_(p.amount, liabilities) diff --git a/policyengine_uk/variables/gov/hmrc/national_insurance/employment_allowance/employment_allowance_eligible.py b/policyengine_uk/variables/gov/hmrc/national_insurance/employment_allowance/employment_allowance_eligible.py new file mode 100644 index 0000000000..45a7228cc9 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/national_insurance/employment_allowance/employment_allowance_eligible.py @@ -0,0 +1,52 @@ +from policyengine_uk.model_api import * + + +class employment_allowance_eligible(Variable): + value_type = bool + entity = Firm + label = "Eligible for the Employment Allowance" + documentation = ( + "Whether the firm can claim the Employment Allowance. It cannot if it " + "is a public authority that is not a charity (s.2(1)), a company " + "whose only employee paid Class 1 earnings is a director (s.2(4A), " + "from 2016-17), a connected company or charity other than the one " + "its group chooses to claim (s.3), or, from 2020-21 to 2024-25, an " + "employer whose previous-year secondary Class 1 liabilities were " + "£100,000 or more (s.2(4B)), tested on " + "firm_prior_year_secondary_class_1_liabilities. The de minimis " + "state aid test (s.2(4F)) and the exclusions for care workers and " + "transferred businesses are not modelled." + ) + definition_period = YEAR + reference = [ + dict( + title="National Insurance Contributions Act 2014 s.2", + href="https://www.legislation.gov.uk/ukpga/2014/7/section/2", + ), + dict( + title="National Insurance Contributions Act 2014 s.3", + href="https://www.legislation.gov.uk/ukpga/2014/7/section/3", + ), + ] + + def formula(firm, period, parameters): + p = parameters(period).gov.hmrc.national_insurance.employment_allowance + excluded_public_body = firm("firm_is_public_body", period) & ~firm( + "firm_is_charity", period + ) + excluded_single_director = ( + firm("firm_is_single_director_company", period) + & p.excludes_single_director_companies + ) + prior_year_liabilities = firm( + "firm_prior_year_secondary_class_1_liabilities", period + ) + excluded_by_prior_year_liabilities = ( + prior_year_liabilities >= p.prior_year_liabilities_limit + ) + return ( + firm("firm_claims_employment_allowance", period) + & ~excluded_public_body + & ~excluded_single_director + & ~excluded_by_prior_year_liabilities + ) diff --git a/policyengine_uk/variables/gov/hmrc/national_insurance/employment_allowance/firm_prior_year_secondary_class_1_liabilities.py b/policyengine_uk/variables/gov/hmrc/national_insurance/employment_allowance/firm_prior_year_secondary_class_1_liabilities.py new file mode 100644 index 0000000000..51f2c95e4a --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/national_insurance/employment_allowance/firm_prior_year_secondary_class_1_liabilities.py @@ -0,0 +1,27 @@ +from policyengine_uk.model_api import * + + +class firm_prior_year_secondary_class_1_liabilities(Variable): + value_type = float + entity = Firm + label = "Firm secondary Class 1 liabilities in the previous tax year" + documentation = ( + "Qualifying secondary Class 1 National Insurance liabilities of the " + "firm and its connected companies or charities for the previous tax " + "year, before the Employment Allowance. From 2020-21 to 2024-25 an " + "employer with £100,000 or more could not claim the allowance. " + "Supply it as an input where known. Otherwise the formula takes the " + "firm's own liabilities for the current year, which ignores growth " + "between years and the liabilities of connected companies." + ) + definition_period = YEAR + unit = GBP + reference = [ + dict( + title="National Insurance Contributions Act 2014 s.2(4B)-(4E), as at 6 April 2020", + href="https://www.legislation.gov.uk/ukpga/2014/7/section/2/2020-04-06", + ), + ] + + def formula(firm, period, parameters): + return firm("firm_employer_ni_before_allowance", period) diff --git a/policyengine_uk/variables/gov/hmrc/plastic_packaging_tax/plastic_packaging_tax.py b/policyengine_uk/variables/gov/hmrc/plastic_packaging_tax/plastic_packaging_tax.py new file mode 100644 index 0000000000..a962be080e --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/plastic_packaging_tax/plastic_packaging_tax.py @@ -0,0 +1,43 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class plastic_packaging_tax(Variable): + value_type = float + entity = Firm + label = "Plastic packaging tax" + documentation = ( + "Plastic packaging tax on the firm's chargeable plastic packaging " + "components, those with less than 30% recycled plastic: the rate " + "per tonne, part tonnes pro rata (Finance Act 2021 ss.43 and 45), " + "from 1 April 2022. A firm neither registered nor liable to " + "register pays nothing (s.43(2A)); it is liable to register where " + "its finished components, whatever their recycled content, reach " + "10 tonnes (s.55), applied here to the year. The rate is read at 30 " + "April, so the rate from 1 April applies to the whole year. Not " + "modelled: the exemptions in s.52, the credits for exported or " + "converted packaging, and the mass balance approach." + ) + definition_period = YEAR + unit = GBP + reference = [ + dict( + title="Finance Act 2021 Part 2", + href="https://www.legislation.gov.uk/ukpga/2021/26/part/2", + ), + dict( + title="Finance Act 2021 s.43", + href="https://www.legislation.gov.uk/ukpga/2021/26/section/43", + ), + dict( + title="Finance Act 2021 s.55", + href="https://www.legislation.gov.uk/ukpga/2021/26/section/55", + ), + ] + + def formula(firm, period, parameters): + p = parameters(period).gov.hmrc.plastic_packaging_tax + chargeable = max_(firm("firm_plastic_packaging_tonnes_chargeable", period), 0) + total = max_(firm("firm_plastic_packaging_tonnes_total", period), chargeable) + liable = total >= p.registration_threshold + return where(liable, chargeable * p.rate, 0) diff --git a/policyengine_uk/variables/gov/hmrc/residential_property_developer_tax/residential_property_developer_tax.py b/policyengine_uk/variables/gov/hmrc/residential_property_developer_tax/residential_property_developer_tax.py new file mode 100644 index 0000000000..7b7771fff7 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/residential_property_developer_tax/residential_property_developer_tax.py @@ -0,0 +1,31 @@ +from policyengine_uk.entities import Firm +from policyengine_uk.model_api import * + + +class residential_property_developer_tax(Variable): + value_type = float + entity = Firm + label = "Residential property developer tax" + documentation = ( + "Residential property developer tax: 4% of the company's RPD " + "profits so far as they exceed its share of the £25 million " + "allowance (Finance Act 2022 ss.33 and 43), for accounting periods " + "beginning on or after 1 April 2022. Companies only. It is not deductible for " + "corporation tax (Sch 9 para 1), so corporation tax is unchanged. " + "Not modelled: the derivation of RPD profits, RPDT reliefs, joint " + "ventures and the exit charge for non-profit housing companies." + ) + definition_period = YEAR + unit = GBP + defined_for = "firm_liable_to_corporation_tax" + reference = ( + "https://www.legislation.gov.uk/ukpga/2022/3/section/33", + "https://www.legislation.gov.uk/ukpga/2022/3/section/43", + "https://www.legislation.gov.uk/ukpga/2022/3/schedule/9", + ) + + def formula(firm, period, parameters): + p = parameters(period).gov.hmrc.residential_property_developer_tax + profits = firm("firm_rpd_profits", period) + share = clip(firm("firm_rpdt_allowance_share", period), 0, 1) + return p.rate * max_(profits - p.allowance * share, 0) diff --git a/policyengine_uk/variables/gov/hmrc/soft_drinks_industry_levy/soft_drinks_industry_levy.py b/policyengine_uk/variables/gov/hmrc/soft_drinks_industry_levy/soft_drinks_industry_levy.py new file mode 100644 index 0000000000..715494d785 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/soft_drinks_industry_levy/soft_drinks_industry_levy.py @@ -0,0 +1,46 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class soft_drinks_industry_levy(Variable): + value_type = float + entity = Firm + label = "Soft drinks industry levy" + documentation = ( + "Soft drinks industry levy on the firm's chargeable soft drinks: " + "the higher rate per litre on drinks with 8 grams or more of sugar " + "per 100 millilitres and the lower rate on those with at least 5 " + "grams (Finance Act 2017 s.30), from 6 April 2018. A small producer, " + "whose and whose connected persons' chargeable drinks do not exceed " + "1 million litres in the year, is exempt (ss.37-38); the test is " + "applied to the firm's year. Rates are read at 30 April, so the " + "rates from 1 April apply to the whole year. Not modelled: the " + "milk-based drinks exemption and the reliefs for exports and " + "dilution." + ) + definition_period = YEAR + unit = GBP + reference = [ + dict( + title="Finance Act 2017 Part 2", + href="https://www.legislation.gov.uk/ukpga/2017/10/part/2", + ), + dict( + title="Finance Act 2025 s.79", + href="https://www.legislation.gov.uk/ukpga/2025/8/section/79", + ), + dict( + title="Finance Act 2026 s.108", + href="https://www.legislation.gov.uk/ukpga/2026/11/section/108", + ), + ] + + def formula(firm, period, parameters): + p = parameters(period).gov.hmrc.soft_drinks_industry_levy + higher = max_(firm("firm_sdil_litres_higher_rate", period), 0) + lower = max_(firm("firm_sdil_litres_lower_rate", period), 0) + # A supplied 0 (for example a zero-filled column) means not supplied. + supplied = firm("firm_sdil_annual_production_litres", period) + production = where(supplied > 0, supplied, higher + lower) + levy = higher * p.rate.higher + lower * p.rate.lower + return where(production <= p.small_producer_threshold, 0, levy) diff --git a/policyengine_uk/variables/gov/hmrc/vat/firm/firm_flat_rate_percentage.py b/policyengine_uk/variables/gov/hmrc/vat/firm/firm_flat_rate_percentage.py new file mode 100644 index 0000000000..a95469a2cc --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/vat/firm/firm_flat_rate_percentage.py @@ -0,0 +1,22 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_flat_rate_percentage(Variable): + label = "VAT flat rate percentage" + documentation = ( + "Flat rate percentage the firm applies: the limited cost trader rate " + "if it is a limited cost trader, otherwise its sector percentage. The " + "1-point discount in the first year of registration is not modelled." + ) + entity = Firm + definition_period = YEAR + value_type = float + unit = "/1" + reference = "https://www.legislation.gov.uk/uksi/2017/295/made" + + def formula(firm, period, parameters): + p = parameters(period).gov.hmrc.vat.flat_rate + limited_cost = firm("firm_is_limited_cost_trader", period) + sector = firm("firm_flat_rate_sector_percentage", period) + return where(limited_cost, p.limited_cost_trader_rate, sector) diff --git a/policyengine_uk/variables/gov/hmrc/vat/firm/firm_flat_rate_scheme_eligible.py b/policyengine_uk/variables/gov/hmrc/vat/firm/firm_flat_rate_scheme_eligible.py new file mode 100644 index 0000000000..f5799c589a --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/vat/firm/firm_flat_rate_scheme_eligible.py @@ -0,0 +1,21 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_flat_rate_scheme_eligible(Variable): + label = "Eligible for the VAT flat rate scheme" + documentation = ( + "Whether the firm's taxable turnover, excluding VAT, is within the " + "flat rate scheme joining limit. The joining test is applied to the " + "year's turnover; the leaving test on VAT-inclusive turnover is not " + "modelled." + ) + entity = Firm + definition_period = YEAR + value_type = bool + reference = "https://www.legislation.gov.uk/uksi/1995/2518/regulation/55L" + + def formula(firm, period, parameters): + p = parameters(period).gov.hmrc.vat.flat_rate + turnover = firm("firm_vat_taxable_turnover", period) + return turnover <= p.join_threshold diff --git a/policyengine_uk/variables/gov/hmrc/vat/firm/firm_flat_rate_sector_percentage.py b/policyengine_uk/variables/gov/hmrc/vat/firm/firm_flat_rate_sector_percentage.py new file mode 100644 index 0000000000..243af37c50 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/vat/firm/firm_flat_rate_sector_percentage.py @@ -0,0 +1,20 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_flat_rate_sector_percentage(Variable): + label = "VAT flat rate sector percentage" + documentation = ( + "Flat rate percentage for the firm's business category, as a share " + "(0.12 for 12%). Defaults to the rate for any other activity not " + "listed elsewhere; supply a value to use another category." + ) + entity = Firm + definition_period = YEAR + value_type = float + unit = "/1" + reference = "https://www.gov.uk/vat-flat-rate-scheme/how-much-you-pay" + + def formula(firm, period, parameters): + p = parameters(period).gov.hmrc.vat.flat_rate + return np.full(firm.count, p.default_sector_rate) diff --git a/policyengine_uk/variables/gov/hmrc/vat/firm/firm_flat_rate_turnover.py b/policyengine_uk/variables/gov/hmrc/vat/firm/firm_flat_rate_turnover.py new file mode 100644 index 0000000000..a61fa89a37 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/vat/firm/firm_flat_rate_turnover.py @@ -0,0 +1,23 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_flat_rate_turnover(Variable): + label = "VAT flat rate turnover" + documentation = ( + "All of the firm's supplies including VAT: standard- and " + "reduced-rated supplies grossed up by their rates, plus zero-rated " + "and exempt supplies." + ) + entity = Firm + definition_period = YEAR + value_type = float + unit = GBP + reference = "https://www.gov.uk/guidance/flat-rate-scheme-for-small-businesses-vat-notice-733--2" + adds = [ + "firm_standard_rated_supplies", + "firm_reduced_rated_supplies", + "firm_zero_rated_supplies", + "firm_exempt_supplies", + "firm_output_vat", + ] diff --git a/policyengine_uk/variables/gov/hmrc/vat/firm/firm_output_vat.py b/policyengine_uk/variables/gov/hmrc/vat/firm/firm_output_vat.py new file mode 100644 index 0000000000..65d0333436 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/vat/firm/firm_output_vat.py @@ -0,0 +1,21 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_output_vat(Variable): + label = "Output VAT" + documentation = ( + "VAT due on the firm's standard- and reduced-rated supplies. " + "Zero-rated and exempt supplies carry no output VAT." + ) + entity = Firm + definition_period = YEAR + value_type = float + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/1994/23/section/2" + + def formula(firm, period, parameters): + p = parameters(period).gov.hmrc.vat + standard = firm("firm_standard_rated_supplies", period) + reduced = firm("firm_reduced_rated_supplies", period) + return standard * p.standard_rate + reduced * p.reduced_rate diff --git a/policyengine_uk/variables/gov/hmrc/vat/firm/firm_partial_exemption_recovery_share.py b/policyengine_uk/variables/gov/hmrc/vat/firm/firm_partial_exemption_recovery_share.py new file mode 100644 index 0000000000..554d41aa44 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/vat/firm/firm_partial_exemption_recovery_share.py @@ -0,0 +1,56 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_partial_exemption_recovery_share(Variable): + label = "Share of input VAT recoverable" + documentation = ( + "Share of the firm's input VAT it can recover under the partial " + "exemption standard method: taxable supplies over taxable plus exempt " + "supplies, expressed as a percentage and rounded up (SI 1995/2518 reg " + "101(4)-(5)): to the next whole percent where input tax averages no " + "more than £400,000 a month, otherwise to two decimal places. A firm " + "with no supplies recovers all of its input VAT. The ratio is applied " + "to residual input tax, which is all input VAT unless parts are " + "supplied as directly attributable to taxable or exempt supplies, " + "and the £400,000 test reads residual input tax (reg 101(5)). The " + "de minimis tests are in firm_recoverable_input_vat. Special methods " + "are not modelled; supply a value to override the default. " + "Supplies are stored in single precision, so above about £16.7m a " + "ratio that is a whole percentage can round one point high." + ) + entity = Firm + definition_period = YEAR + value_type = float + unit = "/1" + reference = "https://www.legislation.gov.uk/uksi/1995/2518/regulation/101" + + def formula(firm, period, parameters): + # Work in float64 so the rounding below is not disturbed by float32 + # error in the stored inputs' ratio. + taxable = firm("firm_vat_taxable_turnover", period).astype(float) + exempt = firm("firm_exempt_supplies", period).astype(float) + total = taxable + exempt + has_supplies = total > 0 + share = np.ones_like(total, dtype=float) + share[has_supplies] = taxable[has_supplies] / total[has_supplies] + # Round the percentage up to a whole number, or to two decimal places + # above the monthly threshold. Subtract a small tolerance first so a + # ratio that is a whole percentage in exact arithmetic is not pushed + # up by float error. + p = parameters(period).gov.hmrc.vat.partial_exemption + input_vat = firm("firm_input_vat", period) + taxable_direct = min_( + max_(firm("firm_input_vat_attributable_to_taxable_supplies", period), 0), + max_(input_vat, 0), + ) + exempt_direct = min_( + max_(firm("firm_input_vat_attributable_to_exempt_supplies", period), 0), + max_(input_vat - taxable_direct, 0), + ) + residual = input_vat - taxable_direct - exempt_direct + monthly_input_vat = residual / MONTHS_IN_YEAR + scale = where(monthly_input_vat > p.rounding_threshold, 1e4, 1e2) + rounded = np.ceil(share * scale - 1e-6) / scale + # Adding 0 turns the -0.0 from ceil(-1e-6) into 0. + return np.clip(rounded, 0, 1) + 0.0 diff --git a/policyengine_uk/variables/gov/hmrc/vat/firm/firm_recoverable_input_vat.py b/policyengine_uk/variables/gov/hmrc/vat/firm/firm_recoverable_input_vat.py new file mode 100644 index 0000000000..a73359d215 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/vat/firm/firm_recoverable_input_vat.py @@ -0,0 +1,72 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_recoverable_input_vat(Variable): + label = "Recoverable input VAT" + documentation = ( + "Input VAT the firm can deduct from output VAT after the partial " + "exemption restriction (SI 1995/2518 reg 101(2)): input VAT directly " + "attributable to taxable supplies in full, none of that directly " + "attributable to exempt supplies, and the residual input VAT at " + "firm_partial_exemption_recovery_share. With the attribution inputs " + "at their default of 0, all input VAT is residual. Where " + "firm_applies_partial_exemption_de_minimis is true and either de " + "minimis test is met over the year, all input VAT is recoverable: " + "the reg 106 test (exempt input tax at most £625 a month on average " + "and at most half of all input tax) or, from 1 April 2010, the reg " + "105A simplified test (input tax less that used exclusively for " + "taxable supplies at most £625 a month on average, with exempt " + "supplies at most half of all supplies). Exempt input tax is the " + "directly attributable exempt part plus the unrecovered share of " + "residual input tax. The tests are applied to the whole year, as in " + "the annual adjustment (reg 107); the provisional reg 106ZA " + "annual test is not modelled, since it does not change the year's " + "liability. Boundaries are inclusive. The tests are not applied " + "where input VAT is zero or negative." + ) + entity = Firm + definition_period = YEAR + value_type = float + unit = GBP + reference = [ + "https://www.legislation.gov.uk/ukpga/1994/23/section/26", + "https://www.legislation.gov.uk/uksi/1995/2518/regulation/101", + "https://www.legislation.gov.uk/uksi/1995/2518/regulation/105A", + "https://www.legislation.gov.uk/uksi/1995/2518/regulation/106", + "https://www.legislation.gov.uk/uksi/1995/2518/regulation/107", + ] + + def formula(firm, period, parameters): + input_vat = firm("firm_input_vat", period) + taxable_direct = min_( + max_(firm("firm_input_vat_attributable_to_taxable_supplies", period), 0), + max_(input_vat, 0), + ) + exempt_direct = min_( + max_(firm("firm_input_vat_attributable_to_exempt_supplies", period), 0), + max_(input_vat - taxable_direct, 0), + ) + residual = input_vat - taxable_direct - exempt_direct + share = firm("firm_partial_exemption_recovery_share", period) + standard_method = taxable_direct + residual * share + p = parameters(period).gov.hmrc.vat.partial_exemption.de_minimis + exempt_input = exempt_direct + residual * (1 - share) + original_test = (exempt_input <= p.monthly_limit * MONTHS_IN_YEAR) & ( + exempt_input <= p.input_tax_share * input_vat + ) + simplified = p.simplified + if simplified.in_effect: + exempt_supplies = firm("firm_exempt_supplies", period) + all_supplies = firm("firm_vat_taxable_turnover", period) + exempt_supplies + simplified_test = ( + input_vat - taxable_direct <= simplified.monthly_limit * MONTHS_IN_YEAR + ) & (exempt_supplies <= simplified.exempt_supplies_share * all_supplies) + else: + simplified_test = np.zeros(firm.count, dtype=bool) + de_minimis = ( + firm("firm_applies_partial_exemption_de_minimis", period) + & (input_vat > 0) + & (original_test | simplified_test) + ) + return where(de_minimis, input_vat, standard_method) diff --git a/policyengine_uk/variables/gov/hmrc/vat/firm/firm_vat.py b/policyengine_uk/variables/gov/hmrc/vat/firm/firm_vat.py new file mode 100644 index 0000000000..945f8e5196 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/vat/firm/firm_vat.py @@ -0,0 +1,22 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_vat(Variable): + label = "Firm VAT" + documentation = ( + "Net VAT the firm pays to HMRC in the year; negative for a repayment. " + "Zero for a firm that is not registered." + ) + entity = Firm + definition_period = YEAR + value_type = float + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/1994/23/section/25" + + def formula(firm, period, parameters): + # Keep in step with _vat_under_reform_rules_at_baseline_rates in + # policyengine_uk/variables/contrib/policyengine/firm/firm_tax_change_total.py. + registered = firm("firm_vat_registered", period) + liability = firm("firm_vat_liability_if_registered", period) + return where(registered, liability, 0) diff --git a/policyengine_uk/variables/gov/hmrc/vat/firm/firm_vat_flat_rate_liability.py b/policyengine_uk/variables/gov/hmrc/vat/firm/firm_vat_flat_rate_liability.py new file mode 100644 index 0000000000..042bd50f8f --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/vat/firm/firm_vat_flat_rate_liability.py @@ -0,0 +1,21 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_vat_flat_rate_liability(Variable): + label = "VAT liability under the flat rate scheme" + documentation = ( + "Flat rate percentage times VAT-inclusive flat rate turnover. Input " + "VAT is not recovered; recovery on capital goods over £2,000 is not " + "modelled." + ) + entity = Firm + definition_period = YEAR + value_type = float + unit = GBP + reference = "https://www.legislation.gov.uk/uksi/1995/2518/regulation/55K" + + def formula(firm, period, parameters): + rate = firm("firm_flat_rate_percentage", period) + turnover = firm("firm_flat_rate_turnover", period) + return rate * turnover diff --git a/policyengine_uk/variables/gov/hmrc/vat/firm/firm_vat_liability_if_registered.py b/policyengine_uk/variables/gov/hmrc/vat/firm/firm_vat_liability_if_registered.py new file mode 100644 index 0000000000..d7ec3a584a --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/vat/firm/firm_vat_liability_if_registered.py @@ -0,0 +1,24 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_vat_liability_if_registered(Variable): + label = "VAT liability if registered" + documentation = ( + "VAT the firm would owe if registered: the flat rate liability if it " + "elects the flat rate scheme and is eligible, otherwise output VAT " + "less recoverable input VAT." + ) + entity = Firm + definition_period = YEAR + value_type = float + unit = GBP + + def formula(firm, period, parameters): + # Keep in step with _vat_under_reform_rules_at_baseline_rates in + # policyengine_uk/variables/contrib/policyengine/firm/firm_tax_change_total.py. + uses_frs = firm("firm_uses_flat_rate_scheme", period) + eligible = firm("firm_flat_rate_scheme_eligible", period) + flat_rate = firm("firm_vat_flat_rate_liability", period) + normal = firm("firm_vat_normal_liability", period) + return where(uses_frs & eligible, flat_rate, normal) diff --git a/policyengine_uk/variables/gov/hmrc/vat/firm/firm_vat_normal_liability.py b/policyengine_uk/variables/gov/hmrc/vat/firm/firm_vat_normal_liability.py new file mode 100644 index 0000000000..b7eaf583f4 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/vat/firm/firm_vat_normal_liability.py @@ -0,0 +1,17 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_vat_normal_liability(Variable): + label = "VAT liability under normal accounting" + documentation = ( + "Output VAT less recoverable input VAT. A negative value is a " + "repayment from HMRC." + ) + entity = Firm + definition_period = YEAR + value_type = float + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/1994/23/section/25" + adds = ["firm_output_vat"] + subtracts = ["firm_recoverable_input_vat"] diff --git a/policyengine_uk/variables/gov/hmrc/vat/firm/firm_vat_registered.py b/policyengine_uk/variables/gov/hmrc/vat/firm/firm_vat_registered.py new file mode 100644 index 0000000000..566c609b1a --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/vat/firm/firm_vat_registered.py @@ -0,0 +1,23 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_vat_registered(Variable): + label = "Registered for VAT" + documentation = ( + "Whether the firm is registered for VAT: its taxable turnover in the " + "year exceeds the registration threshold, or it registers voluntarily. " + "The test uses the year's turnover and the threshold in force on 30 " + "April of the year (so 2024 uses the £90,000 threshold from 1 April " + "2024), not a rolling 12-month look-back." + ) + entity = Firm + definition_period = YEAR + value_type = bool + reference = "https://www.legislation.gov.uk/ukpga/1994/23/schedule/1/paragraph/1" + + def formula(firm, period, parameters): + p = parameters(period).gov.hmrc.vat.registration + turnover = firm("firm_vat_taxable_turnover", period) + voluntary = firm("firm_vat_voluntarily_registered", period) + return (turnover > p.threshold) | voluntary diff --git a/policyengine_uk/variables/gov/hmrc/vat/firm/firm_vat_taxable_turnover.py b/policyengine_uk/variables/gov/hmrc/vat/firm/firm_vat_taxable_turnover.py new file mode 100644 index 0000000000..8c412d5051 --- /dev/null +++ b/policyengine_uk/variables/gov/hmrc/vat/firm/firm_vat_taxable_turnover.py @@ -0,0 +1,21 @@ +from policyengine_uk.model_api import * +from policyengine_uk.entities import Firm + + +class firm_vat_taxable_turnover(Variable): + label = "VAT taxable turnover" + documentation = ( + "Value of the firm's taxable supplies in the year, excluding VAT: " + "standard-, reduced- and zero-rated supplies. Exempt supplies are not " + "taxable supplies." + ) + entity = Firm + definition_period = YEAR + value_type = float + unit = GBP + reference = "https://www.legislation.gov.uk/ukpga/1994/23/section/4" + adds = [ + "firm_standard_rated_supplies", + "firm_reduced_rated_supplies", + "firm_zero_rated_supplies", + ] diff --git a/pyproject.toml b/pyproject.toml index ae3a039d17..ace604c5b6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ classifiers = [ ] requires-python = ">=3.11" dependencies = [ - "policyengine-core>=3.34.9", + "policyengine-core>=3.34.9,<3.38", "microdf-python>=1.2.1", "pydantic>=2.11.7", "tables>=3.10.2", diff --git a/uv.lock b/uv.lock index cea5a171f3..a1730430fe 100644 --- a/uv.lock +++ b/uv.lock @@ -2259,7 +2259,7 @@ requires-dist = [ { name = "hypothesis", marker = "extra == 'dev'" }, { name = "jupyter-book", marker = "extra == 'dev'", specifier = ">=2.0.0a0" }, { name = "microdf-python", specifier = ">=1.2.1" }, - { name = "policyengine-core", specifier = ">=3.34.9" }, + { name = "policyengine-core", specifier = ">=3.34.9,<3.38" }, { name = "pydantic", specifier = ">=2.11.7" }, { name = "pytest-cov", marker = "extra == 'dev'" }, { name = "pytest-xdist", marker = "extra == 'dev'" },