Skip to content

Add tax data for Germany, Spain, and Sweden for 2024-2026; implement tax reserve calculations#245

Merged
clstaudt merged 7 commits intomainfrom
tax
Mar 13, 2026
Merged

Add tax data for Germany, Spain, and Sweden for 2024-2026; implement tax reserve calculations#245
clstaudt merged 7 commits intomainfrom
tax

Conversation

@clstaudt
Copy link
Contributor

  • Introduced new JSON files for income tax, solidarity surcharge, and VAT rates for Germany (2026), Spain (2024-2026), and Sweden (2024-2026).
  • Implemented tax_reserves.py to calculate VAT and income tax reserves for freelancers, including functions for computing spendable income and quarterly VAT breakdowns.
  • Expanded test suite in test_tax.py to cover new tax data and reserve calculations, ensuring accuracy across different countries and years.

…tax reserve calculations

- Introduced new JSON files for income tax, solidarity surcharge, and VAT rates for Germany (2026), Spain (2024-2026), and Sweden (2024-2026).
- Implemented `tax_reserves.py` to calculate VAT and income tax reserves for freelancers, including functions for computing spendable income and quarterly VAT breakdowns.
- Expanded test suite in `test_tax.py` to cover new tax data and reserve calculations, ensuring accuracy across different countries and years.
…lculations

- Added `operating_country` field to the User model to specify the tax jurisdiction for freelancers.
- Enhanced tax calculations by integrating the operating country to derive the appropriate currency for tax systems.
- Updated various components to utilize the new currency handling, including KPI calculations, tax reserves, and dashboard views.
- Refactored currency formatting functions to support dynamic currency display based on user settings.
- Introduced new migrations for database schema updates related to the operating country.
…out consistency

- Adjusted padding and margin values in `views.py` and `view.py` to enhance visual alignment.
- Updated dimension constants in `dimens.py` to refine spacing and sizing for UI elements.
- Modified font sizes in `fonts.py` to ensure better readability and hierarchy in text presentation.
…hboard

- Introduced `monthly_spendable_breakdown` function to estimate spendable income after VAT and income tax adjustments.
- Updated `DashboardIntent` to include methods for fetching monthly spendable income and combined revenue/spendable data.
- Enhanced `DashboardView` to display monthly spendable income alongside revenue in charts using `flet-charts`.
- Added tests for the new spendable breakdown functionality to ensure accuracy in calculations and data handling.
- Introduced a `ProgressRing` to indicate data loading status in the dashboard.
- Updated the layout to include a spinner while data is being fetched, enhancing responsiveness.
- Modified visibility of content sections based on loading state to provide clearer feedback to users.
- Introduced new test cases for tax reserves, ensuring proper population and validation of VAT and income tax reserves.
- Added tests to verify that spendable income is less than gross revenue and that empty data scenarios return zero reserves.
- Implemented tests for monthly revenue and spendable breakdowns, including checks for cancelled invoices and sorting of months.
- Enhanced test coverage for different countries, ensuring accurate calculations for Spain and handling of non-current year months.
…nt testing

- Introduced a minimal `_StubContractIntent` class to simulate the behavior of `ContractIntent` in tests.
- Updated `TestContractSidePanel` to utilize the stub for intent handling, improving test isolation and reliability.
@clstaudt clstaudt merged commit 8d5d65c into main Mar 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant