From 1c53bd3ac83cc7a985983ac656bc2599276808a4 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Sun, 5 Oct 2025 20:28:18 +0200 Subject: country data, working on tax reports --- include/countries.hpp | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 include/countries.hpp (limited to 'include/countries.hpp') diff --git a/include/countries.hpp b/include/countries.hpp new file mode 100644 index 0000000..0849ed6 --- /dev/null +++ b/include/countries.hpp @@ -0,0 +1,42 @@ +/* +* Copyright (c) 2025 Aldrik Ramaekers +* +* Permission to use, copy, modify, and/or distribute this software for any +* purpose with or without fee is hereby granted, provided that the above +* copyright notice and this permission notice appear in all copies. +* +* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +#pragma once + +#include "administration.hpp" + +typedef struct +{ + char* country_code; + bool is_EU; + time_t (*get_default_invoice_expire_duration)(); + void (*fill_tax_report_with_categories)(tax_report* report); + char* (*get_tax_category_for_billing_item)(invoice* inv, billing_item* item); +} country_impl; + +namespace country { + + s32 get_count(); + char* get_code_by_index(s32 index); + + time_t get_default_invoice_expire_duration(char* country_code); + + bool is_EU(char* country_code); + bool tax_is_implemented(char* country_code); + void fill_tax_report_with_categories(char* country_code, tax_report* report); + char* get_tax_category_for_billing_item(char* country_code, invoice* inv, billing_item* item); + +} \ No newline at end of file -- cgit v1.2.3-70-g09d2