This document outlines the implementation of complex tax scenarios in our MSP Professional Services Automation (PSA) tool, including composite taxes, threshold-based tax rates, and tax holidays.
- Composite Taxes: Ability to create tax rates composed of multiple components, which can be compound or simple.
- Threshold-Based Tax Rates: Support for tax rates that change based on the amount being taxed.
- Tax Holidays: Capability to define periods where certain taxes are not applied.
- Reverse Charge Mechanism: Option to apply reverse charge for specific scenarios.
The following tables have been added or modified to support these features:
tax_rates
: Extended to includeis_composite
and other relevant fields.tax_components
: Stores individual components of composite taxes.composite_tax_mappings
: Links composite taxes to their components.tax_rate_thresholds
: Defines thresholds for variable tax rates.tax_holidays
: Stores information about tax holiday periods.
- Navigate to the Company Details page.
- Click on the "Tax Settings" tab.
- Here you can:
- Select the applicable tax rate
- Configure composite tax components
- Set up threshold-based rates
- Define tax holidays
- Toggle reverse charge applicability
To create a composite tax:
- Select a tax rate marked as composite.
- Add components using the "Add Component" button.
- For each component, specify:
- Name
- Rate
- Whether it's compound (applied on top of previous components)
To set up threshold-based rates:
- Add thresholds using the "Add Threshold" button.
- For each threshold, specify:
- Minimum amount
- Maximum amount (optional, leave blank for no upper limit)
- Rate for this threshold
To define a tax holiday:
- Add a holiday period using the "Add Holiday" button.
- Specify:
- Start date
- End date
- Description (optional)
- The
TaxService
class (server/src/lib/services/taxService.ts
) handles the complex tax calculations. - Tax settings are managed through the
TaxSettingsForm
component (server/src/components/TaxSettingsForm.tsx
). - The
invoiceActions.ts
file has been updated to use the new tax calculation logic when generating invoices.
The following API endpoints have been added or updated:
GET /api/tax-settings/:companyId
: Retrieve tax settings for a companyPUT /api/tax-settings/:companyId
: Update tax settings for a companyGET /api/tax-rates
: Retrieve all available tax rates
Ensure to test the following scenarios:
- Creating and applying composite taxes
- Applying threshold-based rates
- Correct application of tax holidays
- Reverse charge mechanism
- Combination of multiple tax features
To run the TaxService tests:
npm run test -- src/test/services/taxService.test.ts
- Always ensure that company tax settings are up to date before generating invoices.
- Regularly review and update tax rates to comply with changing regulations.
- Be cautious when applying reverse charge mechanisms and ensure they are used correctly according to local tax laws.
- When setting up composite taxes, consider the order of components and whether they should be compound or not.
- For threshold-based rates, ensure that thresholds cover all possible amounts without gaps.
- When defining tax holidays, make sure they don't overlap with other holidays for the same tax component.
- Add support for jurisdiction-specific tax rules
- Implement automatic tax rate updates based on legal changes
- Develop a tax reporting module for easier compliance
- Integrate with external tax calculation services for more complex scenarios
For any questions or issues related to the international tax support features, please contact the development team.