Index: APPS/EC/impl/HaefeleDEVerzendwijzeBepaler.cls.xml =================================================================== diff -u -r62774 -r63827 --- APPS/EC/impl/HaefeleDEVerzendwijzeBepaler.cls.xml (.../HaefeleDEVerzendwijzeBepaler.cls.xml) (revision 62774) +++ APPS/EC/impl/HaefeleDEVerzendwijzeBepaler.cls.xml (.../HaefeleDEVerzendwijzeBepaler.cls.xml) (revision 63827) @@ -11,7 +11,7 @@ #dim Verzendwijze as %String = "" #dim NumPostcode as %Integer = +Postcode - if ((LandCode = "DE") & ($$$HasLength(Postcode)) & (##class(TECH.StringUtils).RemoveAllWhitespaces(##class(TECH.StringUtils).StripAllNumeric(Postcode))="")) { + if ((LandCode = "DE") && ($$$HasLength(Postcode)) & (##class(TECH.StringUtils).RemoveAllWhitespaces(##class(TECH.StringUtils).StripAllNumeric(Postcode))="")) { if (((NumPostcode >= 0) & (NumPostcode < 20000))||((NumPostcode >=20000) & (NumPostcode < 28000))) { Set Verzendwijze = "HD3" } elseif (((NumPostcode >=28000) & (NumPostcode <67000)) || ((NumPostcode >=80000) & (NumPostcode < 100000))) { @@ -21,10 +21,30 @@ } } - if ((LandCode = "LU") & ($$$HasLength(Postcode)) & (##class(TECH.StringUtils).RemoveAllWhitespaces(##class(TECH.StringUtils).StripAllNumeric(Postcode))="")) { + if ((LandCode = "LU") && ($$$HasLength(Postcode)) & (##class(TECH.StringUtils).RemoveAllWhitespaces(##class(TECH.StringUtils).StripAllNumeric(Postcode))="")) { Set Verzendwijze = "HD2" } + + if ((LandCode = "SE") && ($$$HasLength(Postcode)) & (##class(TECH.StringUtils).RemoveAllWhitespaces(##class(TECH.StringUtils).StripAllNumeric(Postcode))="")) { + #dim Regio as %Integer = +$Extract(Postcode,1,2) + If (Regio < 78) { + Set Verzendwijze = "DA4" + } Elseif ((Regio > 77) && (Regio < 90)) { + Set Verzendwijze = "DA5" + } Else { + Set Verzendwijze = "DA6" + } + } + if ((LandCode = "FI") && ($$$HasLength(Postcode)) & (##class(TECH.StringUtils).RemoveAllWhitespaces(##class(TECH.StringUtils).StripAllNumeric(Postcode))="")) { + Set Regio = +$Extract(Postcode,1,2) + If (Regio < 16) { + Set Verzendwijze = "DA4" + } Else { + Set Verzendwijze = "DA6" + } + } + if $$$Not($$$HasLength(Verzendwijze)){ Do ##class(TECH.ExceptionHandler).Throw(##class(TECH.Exceptions.InvalidInputException).%New("Ongeldige landcode ("_LandCode_") / postcode ("_Postcode_") combinatie voor Haefele DE")) }