From 38019a9693375ac6719ffec43bff63774e142387 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Sat, 13 Sep 2025 18:47:01 +0200 Subject: invoice peppol work --- include/administration.hpp | 12 +---- include/file_templates.hpp | 109 ++++++++++++++++++++++++++++++++++++++------- 2 files changed, 94 insertions(+), 27 deletions(-) (limited to 'include') diff --git a/include/administration.hpp b/include/administration.hpp index fe3d7b2..95d4622 100644 --- a/include/administration.hpp +++ b/include/administration.hpp @@ -109,18 +109,15 @@ typedef struct float amount; bool amount_is_percentage; char description[MAX_LEN_LONG_DESC]; - float net_per_item; + float net_per_item; // Net per item before discount. float discount; bool discount_is_percentage; float allowance; // Total discount. - float net; + float net; // Total net, with discount. char currency[MAX_LEN_CURRENCY]; // 3 letter code char tax_bracket_id[MAX_LEN_ID]; // T/[id] float tax; float total; - - // TODO uninplemented - char tax_section[MAX_LEN_TAX_SECTION]; } billing_item; /** @@ -257,11 +254,6 @@ typedef struct invoice_status status; bool is_outgoing; // Outgoing or incomming invoice. payment_information payment_means; - - bool is_intra_community; // TODO uninplemented - time_t payment_on_account_date; // TODO uninplemented - char tax_representative[MAX_LEN_LONG_DESC]; // TODO uninplemented - char corrected_sequential_number[MAX_LEN_ID]; // TODO uninplemented // Used for forms, not stored on disk. Filled when retrieved. contact supplier; diff --git a/include/file_templates.hpp b/include/file_templates.hpp index cb89050..af2f373 100644 --- a/include/file_templates.hpp +++ b/include/file_templates.hpp @@ -64,23 +64,37 @@ const char* peppol_invoice_tax_subtotal_template = " \n"; const char* peppol_invoice_line_template = -" \n" -" {{LINE_ID}}\n" -" {{QUANTITY}}\n" -" {{LINE_AMOUNT}}\n" -" \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" +" {{LINE_ID}}\n" +" {{QUANTITY}}\n" +" {{LINE_AMOUNT}}\n" + +" \n" +" {{TAX_BRACKET_ID}}\n" +" \n" + +" \n" +" false\n" +" Discount\n" +" {{ALLOWANCE_IS_PERCENTAGE}}\n" +" {{DISCOUNT_TOTAL}}\n" +" {{DISCOUNT_BASE_AMOUNT}}\n" +" \n" + +" \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"; const char *peppol_invoice_template = @@ -94,12 +108,25 @@ const char *peppol_invoice_template = "\n" " {{INVOICE_ID}}\n" " {{ISSUE_DATE}}\n" +" {{DUE_DATE}}\n" " 380\n" " {{CURRENCY}}\n" "\n" +" \n" +" {{INVOICE_DOCUMENT}}\n" +" \n" +"\n" +" \n" +" {{PROJECT_ID}}\n" +" \n" +" {{COST_CENTER_CODE}}\n" +"\n" " \n" " \n" " {{SUPPLIER_ENDPOINT_ID}}\n" +" \n" +" {{SUPPLIER_ID}}\n" +" \n" " \n" " {{SUPPLIER_NAME}}\n" " \n" @@ -119,12 +146,27 @@ const char *peppol_invoice_template = " VAT\n" " \n" " \n" +"\n" +" \n" +" {{SUPPLIER_LEGAL_NAME}}\n" +" {{SUPPLIER_BUSINESS_ID}}\n" +" \n" +"\n" +" \n" +" {{SUPPLIER_NAME}}\n" +" {{SUPPLIER_PHONE_NUMBER}}\n" +" {{SUPPLIER_EMAIL}}\n" +" \n" +"\n" " \n" " \n" "\n" " \n" " \n" " {{CUSTOMER_ENDPOINT_ID}}\n" +" \n" +" {{CUSTOMER_ID}}\n" +" \n" " \n" " {{CUSTOMER_NAME}}\n" " \n" @@ -144,9 +186,42 @@ const char *peppol_invoice_template = " VAT\n" " \n" " \n" +"\n" +" \n" +" {{CUSTOMER_LEGAL_NAME}}\n" +" {{CUSTOMER_BUSINESS_ID}}\n" +" \n" +"\n" +" \n" +" {{CUSTOMER_NAME}}\n" +" {{CUSTOMER_PHONE_NUMBER}}\n" +" {{CUSTOMER_EMAIL}}\n" +" \n" +"\n" " \n" " \n" "\n" +"\n" +" {{DELIVERY_DATE}}\n" +" \n" +" \n" +" {{DELIVERY_STREET}}\n" +" {{DELIVERY_STREET2}}\n" +" {{DELIVERY_CITY}}\n" +" {{DELIVERY_POSTAL}}\n" +" {{DELIVERY_REGION}}\n" +" \n" +" {{DELIVERY_COUNTRY}}\n" +" \n" +" \n" +" \n" +" \n" +" \n" +" {{DELIVERY_NAME}}\n" +" \n" +" \n" +"\n" +"\n" " \n" " {{PAYMENT_TYPE}}\n" " {{INVOICE_ID}}\n" -- cgit v1.2.3-70-g09d2