From e62861a25b15e7773d79636cbda52e4302b41067 Mon Sep 17 00:00:00 2001 From: Elias Fierke Date: Mon, 8 Jun 2026 11:35:28 +0200 Subject: [PATCH] [fix:] international postcodes were trimmed as if they are german --- Tasks/AddressCreation.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Tasks/AddressCreation.cs b/Tasks/AddressCreation.cs index 668433c..f3aa2b0 100644 --- a/Tasks/AddressCreation.cs +++ b/Tasks/AddressCreation.cs @@ -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++;