Index: PVAX.mac.rou =================================================================== diff -u -r48137 -r48610 --- PVAX.mac.rou (.../PVAX.mac.rou) (revision 48137) +++ PVAX.mac.rou (.../PVAX.mac.rou) (revision 48610) @@ -1,8 +1,31 @@ #include BL.Derde.LevSpecifiek #include Prod.Product #include vhLib.Macro + + ;d PrijsOphalen^PVAX(4810 + PVAX - Set SalesPriceService=##class(AXimpl.Admin.VKP.SalesPriceService).%New() + ;Do PrijsOphalen(8365,1168275) + + Do PrijsOphalen(2252,225635,,3000) + + Do PrijsOphalen(2252,225635,,5000) + + ;Do PrijsOphalen(1614,860769) + + q + Do PrijsOphalen(3042,1529657) + + q + Do PrijsOphalen(1125,2001) + q + Do PrijsOphalen(1125,1529657) + + Do PrijsOphalen(1125,1174139,10) + Do PrijsOphalen(1125,858490,20) + Do PrijsOphalen(1125,1804877,30) + + Do PrijsOphalen(1125,249821) Do PrijsOphalen(4810,808099) Do PrijsOphalen(4810,3551) @@ -14,75 +37,127 @@ Do PrijsOphalen(14604,904305) Do PrijsOphalen(14604,794520,200) Do PrijsOphalen(19485,675436,500) + Quit -PrijsOphalen(KLNr,PRNr,CifPPL) +PrijsOphalen(KLNr,PRNr,CifPPL,Aantal) + Set SalesPriceService=##class(AXimpl.Admin.VKP.SalesPriceService).%New() + s x =$$$ProductGet(PRNr, $$$CifPPLEUR) Write !,KLNr," ",$P(^KKL(^KK1(KLNr),0),"\",2),! Write PRNr," ",$P(^KPR(PRNr,2),"\",25)," ",$P(^KPR(PRNr,0),"\"),! - Set Result=SalesPriceService.GeefPrijs(KLNr,PRNr,.CifPPL) + Set Result=SalesPriceService.GeefPrijs(KLNr,PRNr,.CifPPL,.Aantal) d DumpObject^%apiOBJ(Result) - Set PrijsRec=$$KLANTPR^KPRIJSADMIN(KLNr,PRNr,,.CifPPL) + Set:'$G(Aantal) PrijsRec=$$KLANTPR^KPRIJSADMIN(KLNr,PRNr,,.CifPPL) + Set:$G(Aantal) PrijsRec=$$KlantPrijs^KPRIJSADMIN(KLNr,PRNr,,,Aantal) Write !,"Admin prijs: ",$P(PrijsRec,"\")," lijstprijs : ",$P(PrijsRec,"\",4),! + Set:'$G(Aantal) PrijsRecAX=$$KLANTPR^KPRIJS(KLNr,PRNr,,.CifPPL) + Set:$G(Aantal) PrijsRecAX=$$KlantPrijs^KPRIJS(KLNr,PRNr,,,Aantal) + Write " AX prijs: ",$P(PrijsRecAX,"\")," AX lijstpr : ",$P(PrijsRecAX,"\",4),! + Write !,"Admin: ",PrijsRec,! + Write "AX : ",PrijsRecAX,! + q All - ;Do KlantCheck(4810) ; lobelle - ;Do KlantCheck(1736) ; dupont - Do KlantCheck(1614) ; Vossaert (B2C) - ;Do KlantCheck(3042) ; dovy - ;Do KlantCheck(23112) ; DKG + Do Klant(1938) ; roobrouck + + Do Klant(4810) ; lobelle + Do KlantCheck(1736) ; dupont + ;Do KlantCheck(1614) ; Vossaert (B2C) + Do KlantCheck(3042) ; dovy + Do KlantCheck(23112) ; DKG q -KlantCheck(KLNr) - w ^KK1(KLNr),! - Set TijdStipStartLog=$zH + +Klant(KLNr,DiffOnly) + Set Dev=$$OPEN^vhDEV("e:\AX","PrijsVGL AX "_KLNr_" - "_$TR($ZDT($H,8),":")_".txt","W") + Use Dev + + Write "GUID KLNr Nm PRNr ItemID KortTekst Codex Kat InclBTW AXPrice AXGO AdminPrice AdminGO Verschil ErrorTxt",! + Do KlantCheck(KLNr,.DiffOnly) + Do CLOSE^vhDEV(Dev) + Quit + +AlleKlanten + Set Dev=$$OPEN^vhDEV("e:\AX","PrijsVGL AX"_$TR($ZDT($H,8),":")_".txt","W") + Use Dev + + Write "GUID KLNr Nm PRNr ItemID KortTekst Codex Kat InclBTW AXPrice AXGO AdminPrice AdminGO Verschil ErrorTxt",! + Set TijdStipStartAll=$zH + Set itKlant = ##class(TECH.DynamicIterator).%New(##class(DOM.DomeinContext).Instance().GeefVerkoopAPI().GeefKlantIterator(),,"(Item.GeefRegio()'=98)&&(Item.GeefRegio()'=99)") + While itKlant.HasNext() + { + Set Klant=itKlant.Next() + Set KLNr=$P(Klant.GeefID(),"||",2) + Continue:(Klant.GeefBusinessType() = ##class(DOM.VKP.enu.BusinessType).B2C()) + + If $D(^KK1(KLNr)),($O(^KSTKL(KLNr,0,"2016.07 "))'=""),(KLNr?4.6N) + { + Set TijdStipStartLog=$zH + Do KlantCheck(KLNr,1) + Use 0 + Write KLNr," ",$ZH-TijdStipStartLog,! + Use Dev + } + Set KLNr=$O(^KSTKL(KLNr)) + } + Do CLOSE^vhDEV(Dev) + Write "ALL=",$ZH-TijdStipStartAll,! + q + +KlantCheck(KLNr,DiffOnly) Set SalesPriceService=##class(AXimpl.Admin.VKP.SalesPriceService).%New() Do SalesPriceService.Initialisatie(KLNr) Kill CacheID Set PRNr=$O(^KSTKL(KLNr,0)) Set Count=0 While PRNr { - Quit:$D(^KPR(PRNr,"J"_$$$LevHalux)) - Quit:$$$PRGet($$$GenProduct)'="" - Quit:$$$PRGet($$$NONAktief)=1 - If $D(^KPR(PRNr,"J"_$$$LevVanHoecke)) { - Set CifPPL=$$CifPPL^KPRIJS(PRNr) - } Else { - Set CifPPL="" + If ($O(^KSTKL(KLNr,PRNr,"2016.07 "))'="") && ('$D(^KPR(PRNr,"J"_$$$LevHalux))) && ($$$PRGet($$$GenProduct)="") && ($$$PRGet($$$NONAktief)'=1) && '$$IsOrgaluxOpMaat^PRODUKT2(PRNr) + { + If $D(^KPR(PRNr,"J"_$$$LevVanHoecke)) { + Set CifPPL=$$CifPPL^KPRIJS(PRNr) + } Else { + Set CifPPL="" + } + Set MessageId=SalesPriceService.VoegToeProduct(PRNr,CifPPL) + Set Count=Count+1 + Set CacheId(MessageId)=PRNr } - Set MessageId=SalesPriceService.VoegToeProduct(PRNr,CifPPL) - Set Count=Count+1 - Set CacheId(MessageId)=PRNr Set PRNr=$O(^KSTKL(KLNr,PRNr)) } - Set TijdOphalen=$ZH-TijdStipStartLog - Set TijdStipStartLog=$zH - Do SalesPriceService.VoerUit() - Set TijdWebservice=$ZH-TijdStipStartLog - Set TijdStipStartLog=$zH - Set it=SalesPriceService.GeefResultaatIterator() - Set Dev=$$OPEN^vhDEV("f:\AX.EC","PrijsVGL AX "_KLNr_".txt","W") - Use Dev - Write "GUID PRNr ItemID KortTekst InclBTW AXPrice AXGO AdminPrice AdminGO Verschil ErrorTxt",! - While it.HasNext() + If Count { - Set Result=it.Next() - Set MessageId="{"_$zcvt(Result.MessageId,"U")_"}" - Set PRNr=$G(CacheId(MessageId)) - Set PrijsRec=$$KLANTPR^KPRIJSADMIN(KLNr,PRNr) - write Result.MessageId,*9 - Write PRNr,*9,Result.ItemId,*9,$$$PRGet($$$KortTekst) - Write *9,SalesPriceService.PrijzenInclBTW(),*9,$$$ExcelNum(Result.Price),*9,Result.PriceUnit - Write *9,$$$ExcelNum($P(PrijsRec,"\",1)),*9,$P(PrijsRec,"\",11) - Write:'$L(Result.ErrorTxt) *9,$$$ExcelNum((Result.Price/Result.PriceUnit)-($P(PrijsRec,"\",1)/$P(PrijsRec,"\",11))) - Write:$L(Result.ErrorTxt) *9,"error" - Write *9,Result.ErrorTxt - Write ! - ;d DumpObject^%apiOBJ(Result) - + Do SalesPriceService.VoerUit() + Set it=SalesPriceService.GeefResultaatIterator() + ;Set Dev=$$OPEN^vhDEV("e:\AX","PrijsVGL AX "_KLNr_".txt","W") + ;Use Dev + While it.HasNext() + { + Set Result=it.Next() + Set MessageId="{"_$zcvt(Result.MessageId,"U")_"}" + Set PRNr=$G(CacheId(MessageId)) + Set PrijsRec=$$KLANTPR^KPRIJSADMIN(KLNr,PRNr) + Set:SalesPriceService.PrijzenInclBTW() $P(PrijsRec,"\",1)=$J($P(PrijsRec,"\",1)*1.21,0,2) + Set Diff="" + Set:'$L(Result.ErrorTxt) Diff=$$$ExcelNum((Result.Price/Result.PriceUnit)-($P(PrijsRec,"\",1)/$P(PrijsRec,"\",11))) + If '$G(DiffOnly)||((Diff>0.01)||(Diff<-0.01))||$L(Result.ErrorTxt) + { + write Result.MessageId,*9 + Write KLNr,*9,$P(^KKL(^KK1(KLNr),0),"\",2),*9 + Write PRNr,*9,Result.ItemId,*9,$$$PRGet($$$KortTekst) + Write *9,$P(PrijsRec,"\",7),*9,$P(PrijsRec,"\",8) + Write *9,SalesPriceService.PrijzenInclBTW(),*9,$$$ExcelNum(Result.Price),*9,Result.PriceUnit + Write *9,$$$ExcelNum($P(PrijsRec,"\",1)),*9,$P(PrijsRec,"\",11) + Write *9,Diff + Write *9,Result.ErrorTxt + Write ! + } + ;d DumpObject^%apiOBJ(Result) + + } } - Do CLOSE^vhDEV(Dev) - Write KLNr," #Prod:",Count," Ophalen:",TijdOphalen," Webservice:",TijdWebservice," Vgl: ",$ZH-TijdStipStartLog,! + ;Do CLOSE^vhDEV(Dev) + ;Write KLNr," #Prod:",Count," Ophalen:",TijdOphalen," Webservice:",TijdWebservice," Vgl: ",$ZH-TijdStipStartLog,! Quit Multi @@ -117,4 +192,7 @@ Do ##class(TECH.Config.ConfigMgr).Instance().SetString("VHIP907SalesPriceServiceUrl","http://ax-aos-dev:84/MicrosoftDynamicsAXAif60_ACCEPT/SalesPriceService/xppservice.svc") Do ##class(TECH.Config.ConfigMgr).Instance().SetString("VHIP907SalesPriceServiceUrl","http://ax_scan:81/MicrosoftDynamicsAXAif60_PROD/SalesPriceService/xppservice.svc") + Do ##class(TECH.Config.ConfigMgr).Instance().SetString("AX_SalesPriceOut_Fase","2A") + Do ##class(TECH.Config.ConfigMgr).Instance().SetBoolean("BevestigdAXOrderSluitenActief",1) + ;##class(TECH.Config.ConfigMgr).Instance().GetString("AX_SalesPriceOut_Fase") = "2A" q