diff options
| author | Aldrik Ramaekers <aldrikboy@gmail.com> | 2025-10-19 16:11:09 +0200 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrikboy@gmail.com> | 2025-10-19 16:11:09 +0200 |
| commit | 1bfeb2751bf07cdc81ea9344ec941e671cb216a8 (patch) | |
| tree | 6bc8c691eba2c6c34c3ad0d272aef9029256b616 /src/countries/nl.cpp | |
| parent | 7dc2a4d511a0f9e30a63be6bc8ecca0bea0b8c3f (diff) | |
update tests for new tax rates
Diffstat (limited to 'src/countries/nl.cpp')
| -rw-r--r-- | src/countries/nl.cpp | 44 |
1 files changed, 35 insertions, 9 deletions
diff --git a/src/countries/nl.cpp b/src/countries/nl.cpp index 22a4ee2..8fe3c7f 100644 --- a/src/countries/nl.cpp +++ b/src/countries/nl.cpp @@ -139,6 +139,31 @@ time_t _nl_get_invoice_date_to_use_for_tax_report(invoice* inv) return inv->issued_at; } +static tax_rate _create_tax_rate(tax_rate_type type, char* internal_code, char* category_code, float rate, ...) +{ + tax_rate result; + result.type = type; + result.tax_section_count = 0; + result.rate = rate; + strops::copy(result.internal_code, internal_code, sizeof(result.internal_code)); + strops::copy(result.category_code, category_code, sizeof(result.category_code)); + + va_list args; + va_start(args, rate); + + char* tax_category = 0; + do + { + tax_category = va_arg(args, char*); + if (tax_category) strops::copy(result.tax_sections[result.tax_section_count++], tax_category, MAX_LEN_SHORT_DESC); + else break; + } while (1); + + va_end(args); + + return result; +} + static tax_rate _create_tax_rate(tax_rate_type type, char* internal_code, float rate, ...) { tax_rate result; @@ -146,6 +171,7 @@ static tax_rate _create_tax_rate(tax_rate_type type, char* internal_code, float result.tax_section_count = 0; result.rate = rate; strops::copy(result.internal_code, internal_code, sizeof(result.internal_code)); + strops::copy(result.category_code, "S", sizeof(result.category_code)); va_list args; va_start(args, rate); @@ -171,15 +197,15 @@ u32 _nl_get_available_tax_rates(tax_rate* buffer, u32 buffer_size) #define ADD(_line) if (cc < buffer_size) buffer[cc++] = _line; else assert(0); // Outgoing - ADD(_create_tax_rate(tax_rate_type::TAX_RATE_OUTGOING_INVOICE, "NL/21", 21.00, "NL/1a", 0)); - ADD(_create_tax_rate(tax_rate_type::TAX_RATE_OUTGOING_INVOICE, "NL/9", 9.00, "NL/1b", 0)); - ADD(_create_tax_rate(tax_rate_type::TAX_RATE_OUTGOING_INVOICE, "NL/0", 0.00, "NL/1e", 0)); - ADD(_create_tax_rate(tax_rate_type::TAX_RATE_OUTGOING_INVOICE, "NL/BTV", 0.00, "", 0)); - ADD(_create_tax_rate(tax_rate_type::TAX_RATE_OUTGOING_INVOICE, "NL/BVB", 0.00, "NL/1e", 0)); - ADD(_create_tax_rate(tax_rate_type::TAX_RATE_OUTGOING_INVOICE, "NL/PBEU", 0.00, "NL/3a", 0)); - ADD(_create_tax_rate(tax_rate_type::TAX_RATE_OUTGOING_INVOICE, "NL/PIEU", 0.00, "NL/3b", 0)); - ADD(_create_tax_rate(tax_rate_type::TAX_RATE_OUTGOING_INVOICE, "NL/DIEU", 0.00, "NL/3b", 0)); - ADD(_create_tax_rate(tax_rate_type::TAX_RATE_OUTGOING_INVOICE, "NL/NBTW", 0.00, "", 0)); + ADD(_create_tax_rate(tax_rate_type::TAX_RATE_OUTGOING_INVOICE, "NL/21", "S", 21.00, "NL/1a", 0)); + ADD(_create_tax_rate(tax_rate_type::TAX_RATE_OUTGOING_INVOICE, "NL/9", "AA", 9.00, "NL/1b", 0)); + ADD(_create_tax_rate(tax_rate_type::TAX_RATE_OUTGOING_INVOICE, "NL/0", "Z", 0.00, "NL/1e", 0)); + ADD(_create_tax_rate(tax_rate_type::TAX_RATE_OUTGOING_INVOICE, "NL/BTV", "E", 0.00, "", 0)); + ADD(_create_tax_rate(tax_rate_type::TAX_RATE_OUTGOING_INVOICE, "NL/BVB", "AE", 0.00, "NL/1e", 0)); + ADD(_create_tax_rate(tax_rate_type::TAX_RATE_OUTGOING_INVOICE, "NL/PBEU", "G", 0.00, "NL/3a", 0)); + ADD(_create_tax_rate(tax_rate_type::TAX_RATE_OUTGOING_INVOICE, "NL/PIEU", "G", 0.00, "NL/3b", 0)); + ADD(_create_tax_rate(tax_rate_type::TAX_RATE_OUTGOING_INVOICE, "NL/DIEU", "G", 0.00, "NL/3b", 0)); + ADD(_create_tax_rate(tax_rate_type::TAX_RATE_OUTGOING_INVOICE, "NL/NBTW", "O", 0.00, "", 0)); // Unieregeling diensten ADD(_create_tax_rate(tax_rate_type::TAX_RATE_OUTGOING_INVOICE, "NL/MT/18/D", 18.00, "OBU", 0)); |
