summaryrefslogtreecommitdiff
path: root/src/administration_writer.cpp
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrikboy@gmail.com>2025-10-19 19:36:36 +0200
committerAldrik Ramaekers <aldrikboy@gmail.com>2025-10-19 19:36:36 +0200
commit7aea21f2a30e0aa3bc75a579bd01ff9746470c05 (patch)
treee0897a6d4c0414be48cbdfcf565c813572d2ddfd /src/administration_writer.cpp
parentb34be3482e4a322a1198873f4ba3265d8a82e58d (diff)
replace strcmp with strops function
Diffstat (limited to 'src/administration_writer.cpp')
-rw-r--r--src/administration_writer.cpp108
1 files changed, 54 insertions, 54 deletions
diff --git a/src/administration_writer.cpp b/src/administration_writer.cpp
index aae264b..f3f090f 100644
--- a/src/administration_writer.cpp
+++ b/src/administration_writer.cpp
@@ -165,35 +165,35 @@ static char* get_eas_id_for_contact(contact contact)
char* country_code = contact.address.country_code;
// Countries using tax identification numbers.
- if (strcmp(country_code, "AT") == 0) return contact.taxid; // Austria
- if (strcmp(country_code, "BE") == 0) return contact.taxid; // Belgium
- if (strcmp(country_code, "BG") == 0) return contact.taxid; // Bulgaria
- if (strcmp(country_code, "CY") == 0) return contact.taxid; // Cyprus
- if (strcmp(country_code, "CZ") == 0) return contact.taxid; // Czech Republic
- if (strcmp(country_code, "DE") == 0) return contact.taxid; // Germany
- if (strcmp(country_code, "EE") == 0) return contact.taxid; // Estonia
- if (strcmp(country_code, "FR") == 0) return contact.taxid; // France
- if (strcmp(country_code, "GR") == 0) return contact.taxid; // Greece
- if (strcmp(country_code, "HR") == 0) return contact.taxid; // Croatia
- if (strcmp(country_code, "HU") == 0) return contact.taxid; // Hungary
- if (strcmp(country_code, "IE") == 0) return contact.taxid; // Ireland
- if (strcmp(country_code, "LU") == 0) return contact.taxid; // Luxembourg
- if (strcmp(country_code, "LV") == 0) return contact.taxid; // Latvia
- if (strcmp(country_code, "MT") == 0) return contact.taxid; // Malta
- if (strcmp(country_code, "PL") == 0) return contact.taxid; // Poland
- if (strcmp(country_code, "PT") == 0) return contact.taxid; // Portugal
- if (strcmp(country_code, "RO") == 0) return contact.taxid; // Romania
- if (strcmp(country_code, "SI") == 0) return contact.taxid; // Slovenia
- if (strcmp(country_code, "SK") == 0) return contact.taxid; // Slovakia
- if (strcmp(country_code, "ES") == 0) return contact.taxid; // Spain
+ if (strops::equals(country_code, "AT")) return contact.taxid; // Austria
+ if (strops::equals(country_code, "BE")) return contact.taxid; // Belgium
+ if (strops::equals(country_code, "BG")) return contact.taxid; // Bulgaria
+ if (strops::equals(country_code, "CY")) return contact.taxid; // Cyprus
+ if (strops::equals(country_code, "CZ")) return contact.taxid; // Czech Republic
+ if (strops::equals(country_code, "DE")) return contact.taxid; // Germany
+ if (strops::equals(country_code, "EE")) return contact.taxid; // Estonia
+ if (strops::equals(country_code, "FR")) return contact.taxid; // France
+ if (strops::equals(country_code, "GR")) return contact.taxid; // Greece
+ if (strops::equals(country_code, "HR")) return contact.taxid; // Croatia
+ if (strops::equals(country_code, "HU")) return contact.taxid; // Hungary
+ if (strops::equals(country_code, "IE")) return contact.taxid; // Ireland
+ if (strops::equals(country_code, "LU")) return contact.taxid; // Luxembourg
+ if (strops::equals(country_code, "LV")) return contact.taxid; // Latvia
+ if (strops::equals(country_code, "MT")) return contact.taxid; // Malta
+ if (strops::equals(country_code, "PL")) return contact.taxid; // Poland
+ if (strops::equals(country_code, "PT")) return contact.taxid; // Portugal
+ if (strops::equals(country_code, "RO")) return contact.taxid; // Romania
+ if (strops::equals(country_code, "SI")) return contact.taxid; // Slovenia
+ if (strops::equals(country_code, "SK")) return contact.taxid; // Slovakia
+ if (strops::equals(country_code, "ES")) return contact.taxid; // Spain
// Countries using business identification numbers.
- if (strcmp(country_code, "NL") == 0) return contact.businessid; // Netherlands
- if (strcmp(country_code, "SE") == 0) return contact.businessid; // Sweden
- if (strcmp(country_code, "LT") == 0) return contact.businessid; // Lithuania
- if (strcmp(country_code, "IT") == 0) return contact.businessid; // Italy
- if (strcmp(country_code, "FI") == 0) return contact.businessid; // Finland
- if (strcmp(country_code, "DK") == 0) return contact.businessid; // Denmark
+ if (strops::equals(country_code, "NL")) return contact.businessid; // Netherlands
+ if (strops::equals(country_code, "SE")) return contact.businessid; // Sweden
+ if (strops::equals(country_code, "LT")) return contact.businessid; // Lithuania
+ if (strops::equals(country_code, "IT")) return contact.businessid; // Italy
+ if (strops::equals(country_code, "FI")) return contact.businessid; // Finland
+ if (strops::equals(country_code, "DK")) return contact.businessid; // Denmark
return NULL; // Unknown country code
}
@@ -207,33 +207,33 @@ static char* get_eas_scheme_for_contact(contact contact)
// https://docs.peppol.eu/poacc/billing/3.0/codelist/eas/
char* country_code = addr.country_code;
- if (strcmp(country_code, "AT") == 0) return "9914"; // Austria
- if (strcmp(country_code, "BE") == 0) return "9925"; // Belgium
- if (strcmp(country_code, "BG") == 0) return "9926"; // Bulgaria
- if (strcmp(country_code, "CY") == 0) return "9928"; // Cyprus
- if (strcmp(country_code, "CZ") == 0) return "9929"; // Czech Republic
- if (strcmp(country_code, "DE") == 0) return "9930"; // Germany
- if (strcmp(country_code, "DK") == 0) return "0096"; // Denmark
- if (strcmp(country_code, "EE") == 0) return "9931"; // Estonia
- if (strcmp(country_code, "FR") == 0) return "9957"; // France
- if (strcmp(country_code, "GR") == 0) return "9933"; // Greece
- if (strcmp(country_code, "HR") == 0) return "9934"; // Croatia
- if (strcmp(country_code, "HU") == 0) return "9910"; // Hungary
- if (strcmp(country_code, "IE") == 0) return "9935"; // Ireland
- if (strcmp(country_code, "FI") == 0) return "0212"; // Finland
- if (strcmp(country_code, "IT") == 0) return "0208"; // Italy
- if (strcmp(country_code, "LT") == 0) return "0200"; // Lithuania
- if (strcmp(country_code, "LU") == 0) return "9938"; // Luxembourg
- if (strcmp(country_code, "LV") == 0) return "9939"; // Latvia
- if (strcmp(country_code, "MT") == 0) return "9943"; // Malta
- if (strcmp(country_code, "NL") == 0) return "0106"; // Netherlands
- if (strcmp(country_code, "PL") == 0) return "9945"; // Poland
- if (strcmp(country_code, "PT") == 0) return "9946"; // Portugal
- if (strcmp(country_code, "RO") == 0) return "9947"; // Romania
- if (strcmp(country_code, "SE") == 0) return "0007"; // Sweden
- if (strcmp(country_code, "SI") == 0) return "9949"; // Slovenia
- if (strcmp(country_code, "SK") == 0) return "9950"; // Slovakia
- if (strcmp(country_code, "ES") == 0) return "9920"; // Spain
+ if (strops::equals(country_code, "AT")) return "9914"; // Austria
+ if (strops::equals(country_code, "BE")) return "9925"; // Belgium
+ if (strops::equals(country_code, "BG")) return "9926"; // Bulgaria
+ if (strops::equals(country_code, "CY")) return "9928"; // Cyprus
+ if (strops::equals(country_code, "CZ")) return "9929"; // Czech Republic
+ if (strops::equals(country_code, "DE")) return "9930"; // Germany
+ if (strops::equals(country_code, "DK")) return "0096"; // Denmark
+ if (strops::equals(country_code, "EE")) return "9931"; // Estonia
+ if (strops::equals(country_code, "FR")) return "9957"; // France
+ if (strops::equals(country_code, "GR")) return "9933"; // Greece
+ if (strops::equals(country_code, "HR")) return "9934"; // Croatia
+ if (strops::equals(country_code, "HU")) return "9910"; // Hungary
+ if (strops::equals(country_code, "IE")) return "9935"; // Ireland
+ if (strops::equals(country_code, "FI")) return "0212"; // Finland
+ if (strops::equals(country_code, "IT")) return "0208"; // Italy
+ if (strops::equals(country_code, "LT")) return "0200"; // Lithuania
+ if (strops::equals(country_code, "LU")) return "9938"; // Luxembourg
+ if (strops::equals(country_code, "LV")) return "9939"; // Latvia
+ if (strops::equals(country_code, "MT")) return "9943"; // Malta
+ if (strops::equals(country_code, "NL")) return "0106"; // Netherlands
+ if (strops::equals(country_code, "PL")) return "9945"; // Poland
+ if (strops::equals(country_code, "PT")) return "9946"; // Portugal
+ if (strops::equals(country_code, "RO")) return "9947"; // Romania
+ if (strops::equals(country_code, "SE")) return "0007"; // Sweden
+ if (strops::equals(country_code, "SI")) return "9949"; // Slovenia
+ if (strops::equals(country_code, "SK")) return "9950"; // Slovakia
+ if (strops::equals(country_code, "ES")) return "9920"; // Spain
return NULL; // Unknown country code
}