[fix:] international postcodes were trimmed as if they are german

This commit is contained in:
2026-06-08 11:35:28 +02:00
parent e3cdb61932
commit e62861a25b
+8 -7
View File
@@ -64,12 +64,8 @@ public static class AddressCreator
// let's get started: we start from the bottom // let's get started: we start from the bottom
// if the country is not Germany, set it; try to map via Global countries alternatives -> translation // if the country is not Germany, set it; try to map via Global countries alternatives -> translation
var trimmedLand = (address.land ?? "").Trim(); var trimmedLand = (address.land ?? "").Trim();
var trimmedLowerLand = trimmedLand.ToLower();
var isGermany = trimmedLowerLand == "germany" || trimmedLowerLand == "ger" ||
trimmedLowerLand == "" || trimmedLowerLand == "de" ||
trimmedLowerLand == "deutschland";
if (!isGermany) if (!address.IsGermany())
{ {
var countryToShow = trimmedLand; // default: use raw land value var countryToShow = trimmedLand; // default: use raw land value
@@ -104,7 +100,9 @@ public static class AddressCreator
// Alternative A: pplz valid and city existing // Alternative A: pplz valid and city existing
if (!string.IsNullOrEmpty(address.ort) && CheckPLZ(address.pplz, address.land)) if (!string.IsNullOrEmpty(address.ort) && CheckPLZ(address.pplz, address.land))
{ {
string pplz = NormalizeGermanPLZ(address.pplz); string pplz = address.pplz;
if (address.IsGermany()) pplz = NormalizeGermanPLZ(address.pplz);
KasPerson.SetUsedPLZ(id, pplz); KasPerson.SetUsedPLZ(id, pplz);
string_address = pplz + " " + address.ort + "\n" + string_address; string_address = pplz + " " + address.ort + "\n" + string_address;
address_line_count++; address_line_count++;
@@ -152,7 +150,10 @@ public static class AddressCreator
} // Alternative B: plz valid and city existing } // Alternative B: plz valid and city existing
else if (!string.IsNullOrEmpty(address.ort) && CheckPLZ(address.plz, address.land)) else if (!string.IsNullOrEmpty(address.ort) && CheckPLZ(address.plz, address.land))
{ {
string plz = NormalizeGermanPLZ(address.plz); string plz = address.plz;
if (address.IsGermany()) plz = NormalizeGermanPLZ(address.plz);
KasPerson.SetUsedPLZ(id, plz); KasPerson.SetUsedPLZ(id, plz);
string_address = plz + " " + address.ort + "\n" + string_address; string_address = plz + " " + address.ort + "\n" + string_address;
address_line_count++; address_line_count++;