Index: AX/Uitgaand/VKP/KlantAdres/impl/KlantAdresIterator.cls.xml =================================================================== diff -u -r47678 -r47696 --- AX/Uitgaand/VKP/KlantAdres/impl/KlantAdresIterator.cls.xml (.../KlantAdresIterator.cls.xml) (revision 47678) +++ AX/Uitgaand/VKP/KlantAdres/impl/KlantAdresIterator.cls.xml (.../KlantAdresIterator.cls.xml) (revision 47696) @@ -3,6 +3,11 @@ TECH.RegisteredObject,TECH.Iterator + +AXimpl.Crm.CustomerAddressOut.Converter.LeveradresRepository +1 + + AX.Uitgaand.VKP.KlantAdres.impl.KlantAdres 1 @@ -18,26 +23,39 @@ 1 + +TECH.GlobalIndexIterator +1 + + AX.Uitgaand.VKP.KlantAdres.impl.KlantAdresDixfConverter 1 + +DOM.VKP.VerkoopAPI +1 + + %Boolean 0 1 +VerkoopAPI:DOM.VKP.VerkoopAPI,LeveradresRepository:AXimpl.Crm.CustomerAddressOut.Converter.LeveradresRepository 1 1 %Status 1 @@ -49,10 +67,11 @@ #dim HeeftVolgendeKlant, VolgendAdres As %Boolean = $$$False If (..IsBezoekAdres) { + Set VolgendAdres = $$$True + Set ..IsBezoekAdres = $$$False + Set ..AdresObject.Adres = ..Klant.GeefBezoekAdres() Set ..AdresObject.Type = "Real location" - Set ..IsBezoekAdres = $$$False - Set VolgendAdres = $$$True } ElseIf (..KlantIterator.HasNext() > 0) { Set HeeftVolgendeKlant = $$$True Set ..IsBezoekAdres = $$$False @@ -63,9 +82,22 @@ Set ..AdresObject.Adres = ..Klant.GeefAdres() Set ..AdresObject.Type = "Business" - If $IsObject(..Klant.GeefBezoekAdres()){ - Set ..IsBezoekAdres = $$$True + If $IsObject(..Klant.GeefBezoekAdres()) { + Set ..IsBezoekAdres = $$$False // $$$True } + } ElseIf (..GlobalIterator.HasNext() > 0) { + Set VolgendAdres = $$$True + + #dim Continue As %Boolean = $$$True + While Continue { + #dim NextUniekId As %String = ..GlobalIterator.Next() + #dim KlantId As %String = $Piece(##class(TECH.ListUtils).ListbuildToPieces(^KKL.AdresI("KlantId_AdresVolgNr",NextUniekId),","),",",1) + Set ..Klant = ..VerkoopAPI.GeefKlant(KlantId) + Set ..AdresObject.Klant = ..Klant + Set ..AdresObject.Adres = ..LeveradresRepository.GeefViaID(NextUniekId) + Set ..AdresObject.Type = $$$If(..AdresObject.Adres.GeefType()="B","Real location","Delivery") + Set Continue = (..Klant.GeefRegio() = 98) || (..Klant.GeefRegio() = 99) + } } Quit (HeeftVolgendeKlant || VolgendAdres)