Skip to content

Implement UK tax calculations #62

@MaxGhenis

Description

@MaxGhenis

Summary

Create UK-specific tax calculation functions similar to US calculate_donation_effects().

Implementation

Create givecalc/uk/tax.py with:

  • calculate_uk_donation_effects() - Calculate tax impact across donation range
  • calculate_uk_donation_metrics() - Calculate metrics at specific donation amount
  • create_uk_donation_dataframe() - Build DataFrame with analysis results

Key UK Tax Variables

  • income_tax: Total income tax liability
  • household_benefits: Total benefits received
  • household_net_income: Market income + benefits - taxes
  • gift_aid: Charitable donations via Gift Aid

UK Gift Aid Mechanics

Gift Aid provides tax relief in two ways:

  1. Charity reclaim: Charity claims 25p per £1 donated (basic rate relief)
  2. Donor relief: Higher/additional rate taxpayers claim additional relief

For a £100 donation by a 40% taxpayer:

  • Charity receives: £100 + £25 (basic rate reclaim) = £125
  • Donor claims: £25 (difference between 40% and 20% on £125 gross)
  • Net cost to donor: £100 - £25 = £75
  • Total charity benefit: £125
  • Total government subsidy: £50 (£25 to charity + £25 to donor)

Acceptance Criteria

  • TDD: Tests written first
  • Correctly calculates UK income tax for various income levels
  • Gift Aid donations reduce taxable income appropriately
  • Marginal savings rate calculated correctly
  • Higher rate relief shown for 40%+ taxpayers

Part of #59

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions