[fix:] international postcodes were trimmed as if they are german
This commit is contained in:
@@ -64,12 +64,8 @@ public static class AddressCreator
|
||||
// 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
|
||||
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
|
||||
|
||||
@@ -104,7 +100,9 @@ public static class AddressCreator
|
||||
// Alternative A: pplz valid and city existing
|
||||
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);
|
||||
string_address = pplz + " " + address.ort + "\n" + string_address;
|
||||
address_line_count++;
|
||||
@@ -152,7 +150,10 @@ public static class AddressCreator
|
||||
} // Alternative B: plz valid and city existing
|
||||
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);
|
||||
string_address = plz + " " + address.ort + "\n" + string_address;
|
||||
address_line_count++;
|
||||
|
||||
Reference in New Issue
Block a user