summaryrefslogtreecommitdiff
path: root/src/countries
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrikboy@gmail.com>2025-10-10 23:11:18 +0200
committerAldrik Ramaekers <aldrikboy@gmail.com>2025-10-10 23:11:18 +0200
commitcf5dfa405fa3d9b480794f7f2c32e325fdfd134c (patch)
tree7dbfdfe271a95ddc9bdcfc73e3c94bd0361ad012 /src/countries
parentd976c1227f367a4547a004597b8d360a8958eba9 (diff)
tax statement UI
Diffstat (limited to 'src/countries')
-rw-r--r--src/countries/nl.cpp50
1 files changed, 27 insertions, 23 deletions
diff --git a/src/countries/nl.cpp b/src/countries/nl.cpp
index 9c8a20b..bc45b59 100644
--- a/src/countries/nl.cpp
+++ b/src/countries/nl.cpp
@@ -26,25 +26,30 @@ time_t _nl_get_default_invoice_expire_duration()
void _nl_fill_tax_report_with_categories(tax_report* report)
{
- report->lines[report->line_count++] = tax_line {"1a", 0.0f, 0.0f};
- report->lines[report->line_count++] = tax_line {"1b", 0.0f, 0.0f};
- report->lines[report->line_count++] = tax_line {"1c", 0.0f, 0.0f};
- report->lines[report->line_count++] = tax_line {"1d", 0.0f, 0.0f};
- report->lines[report->line_count++] = tax_line {"1e", 0.0f, 0.0f};
-
- report->lines[report->line_count++] = tax_line {"2a", 0.0f, 0.0f};
-
- report->lines[report->line_count++] = tax_line {"3a", 0.0f, 0.0f};
- report->lines[report->line_count++] = tax_line {"3b", 0.0f, 0.0f};
- report->lines[report->line_count++] = tax_line {"3c", 0.0f, 0.0f};
-
- report->lines[report->line_count++] = tax_line {"4a", 0.0f, 0.0f};
- report->lines[report->line_count++] = tax_line {"4b", 0.0f, 0.0f};
-
- report->lines[report->line_count++] = tax_line {"5a", 0.0f, 0.0f};
- report->lines[report->line_count++] = tax_line {"5b", 0.0f, 0.0f};
-
- report->lines[report->line_count++] = tax_line {"Total", 0.0f, 0.0f};
+ report->lines[report->line_count++] = tax_line {"taxes.nl.1", "", 0.0f, 0.0f};
+ report->lines[report->line_count++] = tax_line {"taxes.nl.1a", "1a", 0.0f, 0.0f};
+ report->lines[report->line_count++] = tax_line {"taxes.nl.1b", "1b", 0.0f, 0.0f};
+ report->lines[report->line_count++] = tax_line {"taxes.nl.1c", "1c", 0.0f, 0.0f};
+ report->lines[report->line_count++] = tax_line {"taxes.nl.1d", "1d", 0.0f, 0.0f};
+ report->lines[report->line_count++] = tax_line {"taxes.nl.1e", "1e", 0.0f, 0.0f};
+
+ report->lines[report->line_count++] = tax_line {"taxes.nl.2", "", 0.0f, 0.0f};
+ report->lines[report->line_count++] = tax_line {"taxes.nl.2a", "2a", 0.0f, 0.0f};
+
+ report->lines[report->line_count++] = tax_line {"taxes.nl.3", "", 0.0f, 0.0f};
+ report->lines[report->line_count++] = tax_line {"taxes.nl.3a", "3a", 0.0f, 0.0f};
+ report->lines[report->line_count++] = tax_line {"taxes.nl.3b", "3b", 0.0f, 0.0f};
+ report->lines[report->line_count++] = tax_line {"taxes.nl.3c", "3c", 0.0f, 0.0f};
+
+ report->lines[report->line_count++] = tax_line {"taxes.nl.4", "", 0.0f, 0.0f};
+ report->lines[report->line_count++] = tax_line {"taxes.nl.4a", "4a", 0.0f, 0.0f};
+ report->lines[report->line_count++] = tax_line {"taxes.nl.4b", "4b", 0.0f, 0.0f};
+
+ report->lines[report->line_count++] = tax_line {"taxes.nl.5", "", 0.0f, 0.0f};
+ report->lines[report->line_count++] = tax_line {"taxes.nl.5a", "5a", 0.0f, 0.0f};
+ report->lines[report->line_count++] = tax_line {"taxes.nl.5b", "5b", 0.0f, 0.0f};
+
+ report->lines[report->line_count++] = tax_line {"taxes.total", "5c", 0.0f, 0.0f};
}
bool _nl_add_billing_item_to_tax_report(tax_report* report, invoice* inv, billing_item* item)
@@ -108,7 +113,7 @@ bool _nl_add_billing_item_to_tax_report(tax_report* report, invoice* inv, billin
tax_line* a5 = administration::get_tax_line_from_report(report, "5a"); // Total owed.
tax_line* b5 = administration::get_tax_line_from_report(report, "5b"); // Input tax.
- if (strops::equals(inv->customer.address.country_code, "NL")) {
+ if (strops::equals(inv->supplier.address.country_code, "NL")) {
if (strops::equals(rate.category_code, "AE")) { // NL reverse charge.
tax_line* tl = administration::get_tax_line_from_report(report, "2a");
@@ -123,8 +128,7 @@ bool _nl_add_billing_item_to_tax_report(tax_report* report, invoice* inv, billin
b5->total_tax += item->tax;
}
}
-
- if (!country::is_EU(inv->customer.address.country_code)) {
+ else if (!country::is_EU(inv->supplier.address.country_code)) {
tax_line* tl = administration::get_tax_line_from_report(report, "4a");
tl->total_net += item->net;
@@ -151,7 +155,7 @@ float _nl_calculate_tax_report_final(tax_report* report)
{
tax_line* a5 = administration::get_tax_line_from_report(report, "5a"); // Total owed.
tax_line* b5 = administration::get_tax_line_from_report(report, "5b"); // Input tax.
- tax_line* total = administration::get_tax_line_from_report(report, "Total");
+ tax_line* total = administration::get_tax_line_from_report(report, "5c");
total->total_tax = a5->total_tax - b5->total_tax;
return (float)ceil(total->total_tax);