summaryrefslogtreecommitdiff
path: root/src/administration_writer.cpp
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrik@mailbox.org>2026-01-11 12:48:05 +0100
committerAldrik Ramaekers <aldrik@mailbox.org>2026-01-11 12:48:05 +0100
commit08d42688d851eb134da496be721e234f53ff8d0b (patch)
tree5c8a448a42cd8ec4dc35c55edef85f0063b9a50a /src/administration_writer.cpp
parentccbc6a8f0836583fabd59919bd7930d7cfe1473e (diff)
fix warnings
Diffstat (limited to 'src/administration_writer.cpp')
-rw-r--r--src/administration_writer.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/src/administration_writer.cpp b/src/administration_writer.cpp
index ee0ccdb..ad6f200 100644
--- a/src/administration_writer.cpp
+++ b/src/administration_writer.cpp
@@ -337,7 +337,7 @@ static const char* get_eas_id_for_contact(contact *contact)
}
// https://docs.peppol.eu/poacc/billing/3.0/codelist/eas/
- char* country_code = contact->address.country_code;
+ char* country_code = contact->addr.country_code;
// Countries using tax identification numbers.
if (strops::equals(country_code, "AT")) return contact->taxid; // Austria
@@ -379,7 +379,7 @@ static const char* get_eas_scheme_for_contact(contact contact)
return "0203"; // @Hack
}
- address addr = contact.address;
+ address addr = contact.addr;
// https://docs.peppol.eu/poacc/billing/3.0/codelist/eas/
char* country_code = addr.country_code;
@@ -469,7 +469,7 @@ static const char* _get_file_extension(const char *path) {
static void _add_document_to_zip(invoice* inv)
{
- document* doc = &inv->document;
+ document* doc = &inv->orig_document;
if (strops::empty(doc->copy_path) && !strops::empty(doc->original_path))
{
@@ -552,8 +552,8 @@ bool administration_writer::save_invoice_blocking(invoice inv)
strops::replace(file_content, buf_length, "{{CURRENCY}}", inv.currency);
strops::replace(file_content, buf_length, "{{PROJECT_ID}}", inv.project_id);
strops::replace(file_content, buf_length, "{{COST_CENTER_ID}}", inv.cost_center_id);
- strops::replace(file_content, buf_length, "{{INVOICE_DOCUMENT_COPY}}", inv.document.copy_path);
- strops::replace(file_content, buf_length, "{{INVOICE_DOCUMENT_ORIG}}", inv.document.original_path);
+ strops::replace(file_content, buf_length, "{{INVOICE_DOCUMENT_COPY}}", inv.orig_document.copy_path);
+ strops::replace(file_content, buf_length, "{{INVOICE_DOCUMENT_ORIG}}", inv.orig_document.original_path);
//strops::replace_int32(file_content, buf_length, "{{INVOICE_STATUS}}", (s32)inv.status);
// Supplier data
@@ -561,12 +561,12 @@ bool administration_writer::save_invoice_blocking(invoice inv)
strops::replace(file_content, buf_length, "{{SUPPLIER_ENDPOINT_ID}}", get_eas_id_for_contact(&inv.supplier));
strops::replace(file_content, buf_length, "{{SUPPLIER_ID}}", inv.supplier.id);
strops::replace(file_content, buf_length, "{{SUPPLIER_NAME}}", inv.supplier.name);
- strops::replace(file_content, buf_length, "{{SUPPLIER_STREET}}", inv.supplier.address.address1);
- strops::replace(file_content, buf_length, "{{SUPPLIER_STREET2}}", inv.supplier.address.address2);
- strops::replace(file_content, buf_length, "{{SUPPLIER_CITY}}", inv.supplier.address.city);
- strops::replace(file_content, buf_length, "{{SUPPLIER_POSTAL}}", inv.supplier.address.postal);
- strops::replace(file_content, buf_length, "{{SUPPLIER_REGION}}", inv.supplier.address.region);
- strops::replace(file_content, buf_length, "{{SUPPLIER_COUNTRY}}", inv.supplier.address.country_code);
+ strops::replace(file_content, buf_length, "{{SUPPLIER_STREET}}", inv.supplier.addr.address1);
+ strops::replace(file_content, buf_length, "{{SUPPLIER_STREET2}}", inv.supplier.addr.address2);
+ strops::replace(file_content, buf_length, "{{SUPPLIER_CITY}}", inv.supplier.addr.city);
+ strops::replace(file_content, buf_length, "{{SUPPLIER_POSTAL}}", inv.supplier.addr.postal);
+ strops::replace(file_content, buf_length, "{{SUPPLIER_REGION}}", inv.supplier.addr.region);
+ strops::replace(file_content, buf_length, "{{SUPPLIER_COUNTRY}}", inv.supplier.addr.country_code);
strops::replace(file_content, buf_length, "{{SUPPLIER_VAT_ID}}", inv.supplier.taxid);
strops::replace(file_content, buf_length, "{{SUPPLIER_LEGAL_NAME}}", inv.supplier.name);
strops::replace(file_content, buf_length, "{{SUPPLIER_BUSINESS_ID}}", inv.supplier.businessid);
@@ -578,12 +578,12 @@ bool administration_writer::save_invoice_blocking(invoice inv)
strops::replace(file_content, buf_length, "{{CUSTOMER_ENDPOINT_ID}}", get_eas_id_for_contact(&inv.customer));
strops::replace(file_content, buf_length, "{{CUSTOMER_ID}}", inv.customer.id);
strops::replace(file_content, buf_length, "{{CUSTOMER_NAME}}", inv.customer.name);
- strops::replace(file_content, buf_length, "{{CUSTOMER_STREET}}", inv.customer.address.address1);
- strops::replace(file_content, buf_length, "{{CUSTOMER_STREET2}}", inv.customer.address.address2);
- strops::replace(file_content, buf_length, "{{CUSTOMER_CITY}}", inv.customer.address.city);
- strops::replace(file_content, buf_length, "{{CUSTOMER_POSTAL}}", inv.customer.address.postal);
- strops::replace(file_content, buf_length, "{{CUSTOMER_REGION}}", inv.customer.address.region);
- strops::replace(file_content, buf_length, "{{CUSTOMER_COUNTRY}}", inv.customer.address.country_code);
+ strops::replace(file_content, buf_length, "{{CUSTOMER_STREET}}", inv.customer.addr.address1);
+ strops::replace(file_content, buf_length, "{{CUSTOMER_STREET2}}", inv.customer.addr.address2);
+ strops::replace(file_content, buf_length, "{{CUSTOMER_CITY}}", inv.customer.addr.city);
+ strops::replace(file_content, buf_length, "{{CUSTOMER_POSTAL}}", inv.customer.addr.postal);
+ strops::replace(file_content, buf_length, "{{CUSTOMER_REGION}}", inv.customer.addr.region);
+ strops::replace(file_content, buf_length, "{{CUSTOMER_COUNTRY}}", inv.customer.addr.country_code);
strops::replace(file_content, buf_length, "{{CUSTOMER_VAT_ID}}", inv.customer.taxid);
strops::replace(file_content, buf_length, "{{CUSTOMER_LEGAL_NAME}}", inv.customer.name);
strops::replace(file_content, buf_length, "{{CUSTOMER_BUSINESS_ID}}", inv.customer.businessid);
@@ -595,15 +595,15 @@ bool administration_writer::save_invoice_blocking(invoice inv)
strftime(date_buffer, sizeof(date_buffer), "%Y-%m-%d", tm_info);
strops::replace(file_content, buf_length, "{{DELIVERY_DATE}}", date_buffer);
strops::replace(file_content, buf_length, "{{DELIVERY_NAME}}", inv.addressee.name);
- strops::replace(file_content, buf_length, "{{DELIVERY_STREET}}", inv.addressee.address.address1);
- strops::replace(file_content, buf_length, "{{DELIVERY_STREET2}}", inv.addressee.address.address2);
- strops::replace(file_content, buf_length, "{{DELIVERY_CITY}}", inv.addressee.address.city);
- strops::replace(file_content, buf_length, "{{DELIVERY_POSTAL}}", inv.addressee.address.postal);
- strops::replace(file_content, buf_length, "{{DELIVERY_REGION}}", inv.addressee.address.region);
- strops::replace(file_content, buf_length, "{{DELIVERY_COUNTRY}}", inv.addressee.address.country_code);
+ strops::replace(file_content, buf_length, "{{DELIVERY_STREET}}", inv.addressee.addr.address1);
+ strops::replace(file_content, buf_length, "{{DELIVERY_STREET2}}", inv.addressee.addr.address2);
+ strops::replace(file_content, buf_length, "{{DELIVERY_CITY}}", inv.addressee.addr.city);
+ strops::replace(file_content, buf_length, "{{DELIVERY_POSTAL}}", inv.addressee.addr.postal);
+ strops::replace(file_content, buf_length, "{{DELIVERY_REGION}}", inv.addressee.addr.region);
+ strops::replace(file_content, buf_length, "{{DELIVERY_COUNTRY}}", inv.addressee.addr.country_code);
// Payment means
- strops::replace_int32(file_content, buf_length, "{{PAYMENT_TYPE}}", inv.payment_means.payment_method);
+ strops::replace_int32(file_content, buf_length, "{{PAYMENT_TYPE}}", inv.payment_means.method);
strops::replace(file_content, buf_length, "{{RECIPIENT_IBAN}}", inv.payment_means.payee_bank_account);
strops::replace(file_content, buf_length, "{{RECIPIENT_NAME}}", inv.payment_means.payee_account_name);
strops::replace(file_content, buf_length, "{{RECIPIENT_BIC}}", inv.payment_means.service_provider_id);
@@ -884,12 +884,12 @@ bool administration_writer::save_contact_blocking(contact c)
strops::replace(file_content, buf_length, "{{CONTACT_EMAIL}}", c.email);
strops::replace(file_content, buf_length, "{{CONTACT_PHONENUMBER}}", c.phone_number);
strops::replace(file_content, buf_length, "{{CONTACT_BANKACCOUNT}}", c.bank_account);
- strops::replace(file_content, buf_length, "{{CONTACT_ADDRESS1}}", c.address.address1);
- strops::replace(file_content, buf_length, "{{CONTACT_ADDRESS2}}", c.address.address2);
- strops::replace(file_content, buf_length, "{{CONTACT_COUNTRY}}", c.address.country_code);
- strops::replace(file_content, buf_length, "{{CONTACT_CITY}}", c.address.city);
- strops::replace(file_content, buf_length, "{{CONTACT_POSTAL}}", c.address.postal);
- strops::replace(file_content, buf_length, "{{CONTACT_REGION}}", c.address.region);
+ strops::replace(file_content, buf_length, "{{CONTACT_ADDRESS1}}", c.addr.address1);
+ strops::replace(file_content, buf_length, "{{CONTACT_ADDRESS2}}", c.addr.address2);
+ strops::replace(file_content, buf_length, "{{CONTACT_COUNTRY}}", c.addr.country_code);
+ strops::replace(file_content, buf_length, "{{CONTACT_CITY}}", c.addr.city);
+ strops::replace(file_content, buf_length, "{{CONTACT_POSTAL}}", c.addr.postal);
+ strops::replace(file_content, buf_length, "{{CONTACT_REGION}}", c.addr.region);
char final_path[50];
strops::format(final_path, 50, "%s.xml", c.id);