From 83a9739b3aff75cf767db687bd531fa5283e0e72 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Sat, 3 Jan 2026 11:03:50 +0100 Subject: move invoice status to invoice extras struct. implement r/w --- include/administration.hpp | 10 ++++++++-- include/administration_reader.hpp | 4 +++- include/file_templates.hpp | 13 +++++++++---- 3 files changed, 20 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/administration.hpp b/include/administration.hpp index fede22a..d899987 100644 --- a/include/administration.hpp +++ b/include/administration.hpp @@ -278,6 +278,11 @@ typedef struct char copy_path[MAX_LEN_PATH]; } document; +typedef struct +{ + invoice_status status; +} invoice_extras; + typedef struct { char id[MAX_LEN_ID]; // I/[id] @@ -298,13 +303,14 @@ typedef struct char currency[MAX_LEN_CURRENCY]; // 3 letter code bool is_triangulation; // True if addressee != customer - invoice_status status; bool is_outgoing; // Outgoing or incomming invoice. payment_information payment_means; - + contact supplier; contact customer; delivery_info addressee; + + invoice_extras extras; // Stored outside of invoice file. } invoice; typedef struct diff --git a/include/administration_reader.hpp b/include/administration_reader.hpp index b2311af..bb9ba29 100644 --- a/include/administration_reader.hpp +++ b/include/administration_reader.hpp @@ -16,6 +16,8 @@ #pragma once +#include + namespace administration_reader { bool open_new(); @@ -26,7 +28,7 @@ namespace administration_reader { bool import_cost_center(char* buffer, size_t buffer_size); bool import_project(char* buffer, size_t buffer_size); bool import_contact(char* buffer, size_t buffer_size); - bool import_invoice(char* buffer, size_t buffer_size); + bool import_invoice(zip_t* zip, char* buffer, size_t buffer_size); bool read_invoice_from_xml(invoice* result, char* buffer, size_t buffer_size); } \ No newline at end of file diff --git a/include/file_templates.hpp b/include/file_templates.hpp index c5e0191..5404270 100644 --- a/include/file_templates.hpp +++ b/include/file_templates.hpp @@ -126,6 +126,11 @@ namespace file_template { " \n" " \n"; + static const char *invoice_extras_template = + "\n" + " {{INVOICE_STATUS}}\n" + "\n"; + static const char *peppol_invoice_template = /*"\n"*/ "380\n" " {{CURRENCY}}\n" "\n" - " \n" - " {{INVOICE_STATUS}}\n" - " \n" - "\n" + // " \n" + // " {{INVOICE_STATUS}}\n" + // " \n" + // "\n" " \n" " {{INVOICE_DOCUMENT_COPY}}\n" " {{INVOICE_DOCUMENT_ORIG}}\n" -- cgit v1.2.3-70-g09d2