From b970907ef53f1b8367285cbe7c2dc2a7fa47967f Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Sun, 31 Aug 2025 12:49:59 +0200 Subject: invoice templateing work --- include/administration.hpp | 4 ++ include/file_templates.hpp | 119 +++++++++++++++++++++++++++++++++++++++++++++ include/strops.hpp | 5 +- 3 files changed, 126 insertions(+), 2 deletions(-) create mode 100644 include/file_templates.hpp (limited to 'include') diff --git a/include/administration.hpp b/include/administration.hpp index e9ca22f..774faf8 100644 --- a/include/administration.hpp +++ b/include/administration.hpp @@ -41,6 +41,9 @@ typedef struct { char address1[MAX_LEN_ADDRESS]; char address2[MAX_LEN_ADDRESS]; + char city[MAX_LEN_ADDRESS]; + char postal[MAX_LEN_ADDRESS]; + char region[MAX_LEN_ADDRESS]; char country_code[MAX_LEN_COUNTRY_CODE]; // 2 letter country code } address; @@ -248,6 +251,7 @@ bool administration_invoice_is_valid(invoice* invoice); char* administration_invoice_get_status_string(invoice* invoice); u32 administration_invoice_get_partial_list_outgoing(u32 page_index, u32 page_size, invoice* buffer); u32 administration_invoice_get_partial_list_incomming(u32 page_index, u32 page_size, invoice* buffer); +u32 administration_invoice_get_all(invoice* buffer); // Billing item functions. // ======================= diff --git a/include/file_templates.hpp b/include/file_templates.hpp new file mode 100644 index 0000000..f267055 --- /dev/null +++ b/include/file_templates.hpp @@ -0,0 +1,119 @@ +const char *peppol_invoice_template = +/*"\n"*/ +"\n" +"\n" +" urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0\n" +" urn:fdc:peppol.eu:2017:poacc:billing:01:1.0\n" +"\n" +" {{INVOICE_ID}}\n" +" {{ISSUE_DATE}}\n" +" 380\n" +" {{CURRENCY}}\n" +"\n" +" \n" +" \n" +" {{SUPPLIER_ENDPOINT_ID}}\n" +" \n" +" {{SUPPLIER_NAME}}\n" +" \n" +" \n" +" {{SUPPLIER_STREET}}\n" +" {{SUPPLIER_STREET2}}\n" +" {{SUPPLIER_CITY}}\n" +" {{SUPPLIER_POSTAL}}\n" +" {{SUPPLIER_REGION}}\n" +" \n" +" {{SUPPLIER_COUNTRY}}\n" +" \n" +" \n" +" \n" +" {{SUPPLIER_VAT_ID}}\n" +" \n" +" VAT\n" +" \n" +" \n" +" \n" +" \n" +"\n" +" \n" +" \n" +" {{CUSTOMER_ENDPOINT_ID}}\n" +" \n" +" {{CUSTOMER_NAME}}\n" +" \n" +" \n" +" {{CUSTOMER_STREET}}\n" +" {{CUSTOMER_STREET2}}\n" +" {{CUSTOMER_CITY}}\n" +" {{CUSTOMER_POSTAL}}\n" +" {{CUSTOMER_REGION}}\n" +" \n" +" {{CUSTOMER_COUNTRY}}\n" +" \n" +" \n" +" \n" +" {{CUSTOMER_VAT_ID}}\n" +" \n" +" VAT\n" +" \n" +" \n" +" \n" +" \n" +"\n" +" \n" +" 31\n" +" \n" +" {{SUPPLIER_IBAN}}\n" +" \n" +" \n" +" {{SUPPLIER_BIC}}\n" +" \n" +" \n" +" \n" +" \n" +"\n" +" \n" +" {{TOTAL_TAX_AMOUNT}}\n" +" \n" +" {{TAXABLE_AMOUNT}}\n" +" {{TAX_AMOUNT}}\n" +" \n" +" {{TAX_CATEGORY}}\n" +" {{TAX_PERCENT}}\n" +" \n" +" VAT\n" +" \n" +" \n" +" \n" +" \n" +"\n" +" \n" +" {{LINE_EXTENSION_AMOUNT}}\n" +" {{TAX_EXCLUSIVE_AMOUNT}}\n" +" {{TAX_INCLUSIVE_AMOUNT}}\n" +" {{PAYABLE_AMOUNT}}\n" +" \n" +"\n" +" \n" +" {{LINE_ID}}\n" +" {{QUANTITY}}\n" +" {{LINE_AMOUNT}}\n" +" \n" +" {{ITEM_DESCRIPTION}}\n" +" {{ITEM_NAME}}\n" +" \n" +" {{LINE_TAX_CATEGORY}}\n" +" {{LINE_TAX_PERCENT}}\n" +" \n" +" VAT\n" +" \n" +" \n" +" \n" +" \n" +" {{UNIT_PRICE}}\n" +" \n" +" \n" +"\n" +"\n"; diff --git a/include/strops.hpp b/include/strops.hpp index 08dbd5a..4570a15 100644 --- a/include/strops.hpp +++ b/include/strops.hpp @@ -1,4 +1,5 @@ #pragma once -size_t strops_copy(char *dst, const char *src, size_t size); -char* strops_stristr(char* a, char* b); \ No newline at end of file +size_t strops_copy(char *dst, const char *src, size_t size); +char* strops_stristr(char* a, char* b); +void strops_replace(char *buf, size_t buf_size, const char *search, const char *replace); \ No newline at end of file -- cgit v1.2.3-70-g09d2