summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/administration.hpp6
-rw-r--r--include/file_templates.hpp42
2 files changed, 27 insertions, 21 deletions
diff --git a/include/administration.hpp b/include/administration.hpp
index 5e6f0c1..015b1c3 100644
--- a/include/administration.hpp
+++ b/include/administration.hpp
@@ -27,7 +27,7 @@ typedef struct
char id[MAX_LEN_ID]; // T/[id]
char country_code[MAX_LEN_COUNTRY_CODE]; // 2 letter country code
float rate; // 0-100%
- char description[MAX_LEN_SHORT_DESC];
+ char category_code[MAX_LEN_CODE]; // Category code. https://docs.peppol.eu/poacc/billing/3.0/codelist/UNCL5305/
} country_tax_bracket;
typedef struct
@@ -107,6 +107,7 @@ typedef struct
float net_per_item;
float discount;
bool discount_is_percentage;
+ float allowance; // Total discount.
float net;
char currency[MAX_LEN_CURRENCY]; // 3 letter code
char tax_bracket_id[MAX_LEN_ID]; // T/[id]
@@ -222,6 +223,7 @@ typedef struct
float total;
float tax;
float net;
+ float allowance;
} tax_subtotal;
typedef struct
@@ -243,6 +245,7 @@ typedef struct
float total;
float tax;
float net;
+ float allowance;
char currency[MAX_LEN_CURRENCY]; // 3 letter code
bool is_triangulation; // True if addressee != customer
@@ -328,6 +331,7 @@ u32 administration_tax_bracket_count();
bool administration_tax_bracket_add(country_tax_bracket data);
bool administration_tax_bracket_update(country_tax_bracket data);
+bool administration_tax_bracket_get_by_id(char* id, country_tax_bracket* buffer);
u32 administration_tax_bracket_get_all(country_tax_bracket* buffer);
u32 administration_tax_bracket_get_by_country(country_tax_bracket* buffer, char* country_code);
diff --git a/include/file_templates.hpp b/include/file_templates.hpp
index 3559fbe..de3f509 100644
--- a/include/file_templates.hpp
+++ b/include/file_templates.hpp
@@ -19,7 +19,7 @@ const char* taxbracket_save_template =
" <Id>{{TAXBRACKET_ID}}</Id>\n"
" <CountryCode>{{TAXBRACKET_COUNTRY}}</CountryCode>\n"
" <Rate>{{TAXBRACKET_RATE}}</Rate>\n"
-" <Description>{{TAXBRACKET_DESCRIPTION}}</Description>\n"
+" <Description>{{TAXBRACKET_CATEGORY}}</Description>\n"
"</CountryTaxBracket>\n";
const char* contact_save_template =
@@ -62,6 +62,26 @@ const char* peppol_invoice_tax_subtotal_template =
" </cac:TaxCategory>\n"
" </cac:TaxSubtotal>\n";
+const char* peppol_invoice_line_template =
+" <cac:InvoiceLine>\n"
+" <cbc:ID>{{LINE_ID}}</cbc:ID>\n"
+" <cbc:InvoicedQuantity unitCode=\"{{UNIT_CODE}}\">{{QUANTITY}}</cbc:InvoicedQuantity>\n"
+" <cbc:LineExtensionAmount currencyID=\"{{CURRENCY}}\">{{LINE_AMOUNT}}</cbc:LineExtensionAmount>\n"
+" <cac:Item>\n"
+" <cbc:Name>{{ITEM_NAME}}</cbc:Name>\n"
+" <cac:ClassifiedTaxCategory>\n"
+" <cbc:ID>{{LINE_TAX_CATEGORY}}</cbc:ID>\n"
+" <cbc:Percent>{{LINE_TAX_PERCENT}}</cbc:Percent>\n"
+" <cac:TaxScheme>\n"
+" <cbc:ID>VAT</cbc:ID>\n"
+" </cac:TaxScheme>\n"
+" </cac:ClassifiedTaxCategory>\n"
+" </cac:Item>\n"
+" <cac:Price>\n"
+" <cbc:PriceAmount currencyID=\"{{CURRENCY}}\">{{UNIT_PRICE}}</cbc:PriceAmount>\n"
+" </cac:Price>\n"
+" </cac:InvoiceLine>\n";
+
const char *peppol_invoice_template =
/*"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"*/
"<Invoice xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\"\n"
@@ -151,24 +171,6 @@ const char *peppol_invoice_template =
" <cbc:PayableAmount currencyID=\"{{CURRENCY}}\">{{PAYABLE_AMOUNT}}</cbc:PayableAmount>\n"
" </cac:LegalMonetaryTotal>\n"
"\n"
-" <cac:InvoiceLine>\n"
-" <cbc:ID>{{LINE_ID}}</cbc:ID>\n"
-" <cbc:InvoicedQuantity unitCode=\"{{UNIT_CODE}}\">{{QUANTITY}}</cbc:InvoicedQuantity>\n"
-" <cbc:LineExtensionAmount currencyID=\"{{CURRENCY}}\">{{LINE_AMOUNT}}</cbc:LineExtensionAmount>\n"
-" <cac:Item>\n"
-" <cbc:Description>{{ITEM_DESCRIPTION}}</cbc:Description>\n"
-" <cbc:Name>{{ITEM_NAME}}</cbc:Name>\n"
-" <cac:ClassifiedTaxCategory>\n"
-" <cbc:ID>{{LINE_TAX_CATEGORY}}</cbc:ID>\n"
-" <cbc:Percent>{{LINE_TAX_PERCENT}}</cbc:Percent>\n"
-" <cac:TaxScheme>\n"
-" <cbc:ID>VAT</cbc:ID>\n"
-" </cac:TaxScheme>\n"
-" </cac:ClassifiedTaxCategory>\n"
-" </cac:Item>\n"
-" <cac:Price>\n"
-" <cbc:PriceAmount currencyID=\"{{CURRENCY}}\">{{UNIT_PRICE}}</cbc:PriceAmount>\n"
-" </cac:Price>\n"
-" </cac:InvoiceLine>\n"
+" {{INVOICE_LINE_LIST}}"
"\n"
"</Invoice>\n";