Master data management Β· features 286-305
πŸ›’οΈ SQL Server Β· MasterDataLabDB
🧾

300Tax Rates

VAT and withholding tax rates with the dates they are valid.

Try it

Tax calculator

The rate valid on the chosen date is used (try DEMO before and after 1 Jan 2027)
VAT standard rate Β· 7% Base 1,000.00 Tax 70.00 Total including tax 1,070.00

tax = 1000 Γ— 7 Γ· 100

RateValid fromValid to
7% 2020-01-01 open
# Code Name Type Rate % Valid from Valid to Status
7 DEMO Demo rate that changes on 1 Jan 2027 Value added tax 7 2020-01-01 2026-12-31 Active ✏️
8 DEMO Demo rate that changes on 1 Jan 2027 Value added tax 8 2027-01-01 β€” Active ✏️
2 VAT0 VAT zero rate (export) Value added tax 0 2020-01-01 β€” Active ✏️
1 VAT7 VAT standard rate Value added tax 7 2020-01-01 β€” Active ✏️
3 WHT1 WHT - transport Withholding tax 1 2020-01-01 β€” Active ✏️
4 WHT2 WHT - advertising Withholding tax 2 2020-01-01 β€” Active ✏️
5 WHT3 WHT - services Withholding tax 3 2020-01-01 β€” Active ✏️
6 WHT5 WHT - rent Withholding tax 5 2020-01-01 β€” Active ✏️
Showing 1–8 of 8
πŸŽ“ Learn: how this master is built table tax_rate
  • Effective dating: a new rate is a new row, old documents keep the old rate.
  • TaxService.validate() rejects overlapping date ranges for the same code.
  • CHECK constraint ck_tax_rate_range (0-100) in SQL Server as a last guard.
Entity
domain/TaxRate.java
Repository
repo/TaxRateRepository.java
Definition
MasterRegistry: "tax-rates"
Page / form
web/MasterController.java
Try-it panel
templates/tools/tax-calc.html
REST API
GET /api/tax/calculate?code=VAT7&amount=1000&inclusive=false
DECLARE @d DATE = '2027-02-01';
SELECT * FROM tax_rate
WHERE code = 'DEMO' AND effective_from <= @d AND (effective_to IS NULL OR effective_to >= @d);