Add tax data for Germany, Spain, and Sweden for 2024-2026; implement tax reserve calculations#245
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tax_reserves.pyto calculate VAT and income tax reserves for freelancers, including functions for computing spendable income and quarterly VAT breakdowns.test_tax.pyto cover new tax data and reserve calculations, ensuring accuracy across different countries and years.