Index: KPRIJSAX.mac.rou =================================================================== diff -u -r50299 -r50904 --- KPRIJSAX.mac.rou (.../KPRIJSAX.mac.rou) (revision 50299) +++ KPRIJSAX.mac.rou (.../KPRIJSAX.mac.rou) (revision 50904) @@ -90,11 +90,9 @@ Set KlantID = ##class(DOM.DomeinContext).Instance().GeefLegacyPartijAPI().GeefKlantPartijID(KLNr) Set Klant = ##class(DOM.DomeinContext).Instance().GeefVerkoopAPI().GeefKlant(KlantID) Set BusinessType = Klant.GeefBusinessType() + Do KKORTING, CALC - // VHIP907: Verkoopprijzen - // VHIP907->MVI: voorlopig laat ik alles invullen in fase 2a en overschrijf ik enkel de waarden die ax teruggeeft - If $$IsAX(KLNr,PRNr) { Kill ^AXPrijsCache Set CacheMinuten=$LG($G(^AXPrijsCache(KLNr,PRNr,$S($G(SimPPL):SimPPL,1:"*"),$S($G(Aantal):Aantal,1:"*"))),1) @@ -106,19 +104,18 @@ Set PriceUnit=$LI(lb,4) Set InclBTW=$LI(lb,5) } Else { - Try - { - New SalesPriceService, Result,PriceUnit,InclBTW - Set SalesPriceService = ##class(AXimpl.Admin.VKP.SalesPriceService).%New() - #Dim Result as AXif.Dynamics.SalesPriceIn.MessageParts.ADUSalesPriceLineOutputDC - Set Result = SalesPriceService.GeefPrijs(KLNr, PRNr, $S($G(SimPPL):SimPPL,1:""),.Aantal) - Set VkpEURAX = Result.Price - Set LijstEURAX = Result.GrossPrice - Set PriceUnit=+Result.PriceUnit - Set InclBTW=SalesPriceService.PrijzenInclBTW() + Try { + New SalesPriceService, Result, ResultLine - Set it=SalesPriceService.GeefRequestIterator() - + #dim SalesPriceService As AXimpl.Admin.VKP.SalesPriceService = ##class(AXimpl.Admin.VKP.SalesPriceService).%New() + #dim Result As AXif.Dynamics.SalesPriceIn.MessageParts.ADUSalesPriceHeaderOutputDC = SalesPriceService.GeefPrijs(KLNr, PRNr, $select($get(SimPPL):SimPPL,1:""),.Aantal) + #dim ResultLine As AXif.Dynamics.SalesPriceIn.MessageParts.ADUSalesPriceLineOutputDC = Result.Lines.GetAt(1) + + Set VkpEURAX = ResultLine.Price + Set LijstEURAX = ResultLine.GrossPrice + Set PriceUnit = +ResultLine.PriceUnit + Set InclBTW = Result.InclVAT + Set ^AXPrijsCache(KLNr,PRNr,$S($G(SimPPL):SimPPL,1:"*"),$S($G(Aantal):Aantal,1:"*"))=$LB($$GeefMinuten($H),VkpEUR,LijstEUR,PriceUnit,InclBTW) } Catch { Set (VkpEURAX,LijstEURAX)=99999 @@ -149,10 +146,10 @@ Set Korting2=0 If +LijstEUR=0 { Set Korting1=0 - } else { + } Else { Set Korting1=(1-(VkpEUR/LijstEUR))*100 } - } + } Else { Write "**** Prijs is NUL ****"