Index: APPS/BD/CarbonFootprint/impl/AfstandBepaler.cls.xml =================================================================== diff -u -r34388 -r34389 --- APPS/BD/CarbonFootprint/impl/AfstandBepaler.cls.xml (.../AfstandBepaler.cls.xml) (revision 34388) +++ APPS/BD/CarbonFootprint/impl/AfstandBepaler.cls.xml (.../AfstandBepaler.cls.xml) (revision 34389) @@ -2,7 +2,6 @@ -TODO : HTTPS implementeren in Cache (zie congifurator voor SSL/TSL configuratie) MOMENTEEL KUNNEN ER MAAR 1000 NIEUWE AANVRAGEN BEREKEND WORDEN (LIMIET GOOGLE) %RegisteredObject @@ -47,20 +46,27 @@ s bl=##class(APPS.BD.CarbonFootprint.impl.AfstandBepaler).%New() -w bl.BepaalAfstandTot("Geel","Belgie").Afstand +w bl.BepaalAfstandTot("Höchst","AT").Afstand +w bl.BerekenAfstandEnTijdpaalAfstandTot("Geel","BE").Afstand TotGemeente:%String,TotLand:%String + +String:%String + + + VanGemeente:%String,VanLand:%String,TotGemeente:%String,TotLand:%String Afstand:APPS.BD.CarbonFootprint.impl.AfstandTussenGemeenten +1 %Boolean VanGemeente:%String,VanLand:%String,TotGemeente:%String,TotLand:%String -1 + VanGemeente:%String,VanLand:%String,TotGemeente:%String,TotLand:%String +1 Afstand:APPS.BD.CarbonFootprint.impl.AfstandTussenGemeenten @@ -126,15 +136,16 @@ ;voorbeeld URL : http://maps.googleapis.com/maps/api/distancematrix/xml?origins=Sint-Niklaas,Belgie&destinations=Olen,Belgie&language=nl-BE Set httprequest=##class(%Net.HttpRequest).%New() - ;Set httprequest.Https=1 - ;Set httprequest.SSLConfiguration="???" + Set httprequest.Https=1 + Set httprequest.SSLConfiguration="GoogleAPI" Set httprequest.Server="maps.googleapis.com" Do httprequest.SetParam("origins",VanGemeente_","_VanLand) Do httprequest.SetParam("destinations",TotGemeente_","_TotLand) Do httprequest.SetParam("language","nl-BE") - ;Do httprequest.SetParam("key","AIzaSyCEXxwESaVF8KPfUrA26ZBfTyAgx_yiS9w") - Do httprequest.Get("/maps/api/distancematrix/xml") + Do httprequest.SetParam("key","AIzaSyCK-xrNAAE2vncS4pWxW8JAPnjI2bDPv-g") ;d DumpObject^%apiOBJ(httprequest) + ;w httprequest.ReturnParams() + Do httprequest.Get("/maps/api/distancematrix/xml") ;d DumpObject^%apiOBJ(httprequest.HttpResponse) ;d httprequest.HttpResponse.OutputToDevice() Set XMLData=..GetResponseData(httprequest.HttpResponse) @@ -144,6 +155,7 @@ httpResponse:%Net.HttpResponse +1 0 Set Data=httpResponse.Data.Read() @@ -156,6 +168,7 @@ XMLData:%String,Afstand:APPS.BD.CarbonFootprint.impl.AfstandTussenGemeenten +1 ",2),"",2) Set Afstand.Duur=+$P($P(XMLData,"",2),"",2) Index: APPS/BD/CarbonFootprint/impl/VerpakkingLevering.cls.xml =================================================================== diff -u --- APPS/BD/CarbonFootprint/impl/VerpakkingLevering.cls.xml (revision 0) +++ APPS/BD/CarbonFootprint/impl/VerpakkingLevering.cls.xml (revision 34389) @@ -0,0 +1,256 @@ + + + + +APPS.BD.OrderStat.impl.OrderIntake,APPS.BD.OrderStat.impl.OrderGeleverd +vhLib.Macro,Prod.Product,BL.Derde.LevSpecifiek +1 +%RegisteredObject + + +%Date +1 + + + +%Date +1 + + + +%Integer +1 + + + +%Integer +1 + + + +%String +1 + + + +APPS.BD.CarbonFootprint.impl.AfstandBepaler +1 + + + +Van:%Date,Tot:%Date +1 +1 +%Status + + + + + + D ##class(APPS.BD.CarbonFootprint.impl.VerpakkingLevering).%New().BouwEnFile() + + + + + + + + + + + + + + + + + + + + + + +HFPRNr:%String,BSKey:%String + + + + +HFPRNr:%String +%Boolean + + + + +HFPRNr:%String +%Boolean + + + + + + + + + + + + +..TotDatum) +]]> + + + + + Index: APPS/BD/CarbonFootprint/impl/Leveringen.cls.xml =================================================================== diff -u -r34388 -r34389 --- APPS/BD/CarbonFootprint/impl/Leveringen.cls.xml (.../Leveringen.cls.xml) (revision 34388) +++ APPS/BD/CarbonFootprint/impl/Leveringen.cls.xml (.../Leveringen.cls.xml) (revision 34389) @@ -17,6 +17,7 @@ Set ..TotDatum=+$G(Tot) Set:..VanDatum=0 ..VanDatum=$$CALCDATE^vhLib.DataTypes($H,"BJ",-1,"FD") Set:..TotDatum=0 ..TotDatum=$$CALCDATE^vhLib.DataTypes($H,"BJ",-1,"LD") + Set ..AfstandBepaler=##class(APPS.BD.CarbonFootprint.impl.AfstandBepaler).%New() Quit $$$OK ]]> @@ -26,12 +27,8 @@ D ##class(APPS.BD.CarbonFootprint.impl.Leveringen).%New().BouwEnFile() Index: APPS/BD/OrderStat/impl/Extract2IntakeEnGeleverd.cls.xml =================================================================== diff -u -r31827 -r34389 --- APPS/BD/OrderStat/impl/Extract2IntakeEnGeleverd.cls.xml (.../Extract2IntakeEnGeleverd.cls.xml) (revision 31827) +++ APPS/BD/OrderStat/impl/Extract2IntakeEnGeleverd.cls.xml (.../Extract2IntakeEnGeleverd.cls.xml) (revision 34389) @@ -82,6 +82,31 @@ 1 + +%String +1 + + + +%String +1 + + + +%String +1 + + + +%String +1 + + + +%Float +1 + + %Date 1 @@ -92,6 +117,11 @@ 1 + +APPS.BD.CarbonFootprint.impl.AfstandBepaler +1 + + Van:%Date,Tot:%Date 1 @@ -101,8 +131,8 @@ Set ..VanDatum=+$G(Van) Set ..TotDatum=+$G(Tot) Set:..VanDatum=0 ..VanDatum=$$CALCDATE^vhLib.DataTypes($H,"BJ",-1,"FD") - Set:..TotDatum=0 ..TotDatum=$$CALCDATE^vhLib.DataTypes($H,"BJ",-1,"LD") - ;Set:..TotDatum=0 ..TotDatum=+$H-1 ;$$CALCDATE^vhLib.DataTypes($H,"M",0,"LD") + Set:..TotDatum=0 ..TotDatum=$$CALCDATE^vhLib.DataTypes($H,"BJ",-1,"LD") + Set ..AfstandBepaler=##class(APPS.BD.CarbonFootprint.impl.AfstandBepaler).%New() Quit $$$OK ]]> @@ -112,16 +142,20 @@ D ##class(APPS.BD.OrderStat.impl.Extract2IntakeEnGeleverd).%New().BouwEnFile() (-..VanDatum) + While ..MinDatum'="" ;'>(-..VanDatum) { ;w !," mindatum",..MinDatum Set ..FAKNr=$O(^KFA1(..Node,..KLNr,..MinDatum,"")) @@ -166,6 +200,8 @@ { Set ..BONNr=$E(BONNr,2,99) Do ..ExtractLeverDatum(^KFA(..Node,..FAKNr,BONNr,1)) + Do ..ExtractLeverAdres(^KFA(..Node,..FAKNr,BONNr,3)) + Set LNr=$O(^KFA(..Node,..FAKNr,BONNr,99)) While LNr { @@ -183,7 +219,7 @@ Set VerwachteLeverDatum=$P(Rec,"\",29) Set OmzetVerkoop=$P(Rec,"\",34) Set OmzetAankoop=$P(Rec,"\",33) - Do ..AddIntake(PRNr,Qty,OmzetVerkoop,OmzetAankoop) + Do ..AddIntake(PRNr,Qty,BevestigdeLeverDatum,VerwachteLeverDatum,OmzetVerkoop,OmzetAankoop) Do ..AddGeleverd(PRNr,Qty,BevestigdeLeverDatum,VerwachteLeverDatum,OmzetVerkoop,OmzetAankoop) } Set LNr=$O(^KFA(..Node,..FAKNr,BONNr,LNr)) @@ -202,12 +238,12 @@ While ..KLNr'="" { Set ..MinDatum=$O(^KFAP1(..Node,..KLNr,"")) - While ..MinDatum'>(-..VanDatum) + While ..MinDatum'="" { Set ..FAKNr=$O(^KFAP1(..Node,..KLNr,..MinDatum,"")) While ..FAKNr'="" { - Do ..HerbouwOrderVanuitKFALijnen() + Do ..HerbouwOrderVanuitKFAPLijnen() Set ..FAKNr=$O(^KFAP1(..Node,..KLNr,..MinDatum,..FAKNr)) } Set ..MinDatum=$O(^KFAP1(..Node,..KLNr,..MinDatum)) @@ -224,6 +260,7 @@ { Set ..BONNr=$E(BONNr,2,99) Do ..ExtractLeverDatum(^KFAP(..Node,..FAKNr,BONNr,1)) + Do ..ExtractLeverAdres(^KFAP(..Node,..FAKNr,BONNr,3)) Set LNr=$O(^KFAP(..Node,..FAKNr,BONNr,99)) While LNr @@ -241,7 +278,7 @@ Set VerwachteLeverDatum=$P(Rec,"\",29) Set OmzetVerkoop=$P(Rec,"\",34) Set OmzetAankoop=$P(Rec,"\",33) - Do ..AddIntake(PRNr,Qty,OmzetVerkoop,OmzetAankoop) + Do ..AddIntake(PRNr,Qty,BevestigdeLeverDatum,VerwachteLeverDatum,OmzetVerkoop,OmzetAankoop) Do ..AddGeleverd(PRNr,Qty,BevestigdeLeverDatum,VerwachteLeverDatum,OmzetVerkoop,OmzetAankoop) } Set LNr=$O(^KFAP(..Node,..FAKNr,BONNr,LNr)) @@ -278,6 +315,7 @@ -Rec +Rec:%String + +AdresRec:%String + + + -Rec +Rec:%String -Rec +Rec:%String -PRNr:%Integer,Qty:%Integer,OmzetVerkoop:%Float,OmzetAankoop:%Float +PRNr:%String,Qty:%Integer,BevestigdeLeverDatum:%Date,VerwachteLeverDatum:%Date,OmzetVerkoop:%Float,OmzetAankoop:%Float -PRNr:%Integer,Qty:%Integer,BevestigdeLeverDatum:%Date,VerwachteLeverDatum:%Date,OmzetVerkoop:%Float,OmzetAankoop:%Float +PRNr:%String,Qty:%Integer,BevestigdeLeverDatum:%Date,VerwachteLeverDatum:%Date,OmzetVerkoop:%Float,OmzetAankoop:%Float 1 -PRNr +PRNr:%String 1 -PRNr +PRNr:%String 0 -Datum +Datum:%Date ..TotDatum) ]]> Index: APPS/BD/CarbonFootprint/impl/Toeleveringen.cls.xml =================================================================== diff -u -r34388 -r34389 --- APPS/BD/CarbonFootprint/impl/Toeleveringen.cls.xml (.../Toeleveringen.cls.xml) (revision 34388) +++ APPS/BD/CarbonFootprint/impl/Toeleveringen.cls.xml (.../Toeleveringen.cls.xml) (revision 34389) @@ -3,7 +3,7 @@ APPS.BD.OrderStat.impl.OrderIntake,APPS.BD.OrderStat.impl.OrderGeleverd -vhLib.Macro,Prod.Product +vhLib.Macro,Prod.Product,BL.Derde.LevSpecifiek 1 %RegisteredObject @@ -33,7 +33,7 @@ -APPS.BD.CarbonFootprint.impl.Afstandbepaler +APPS.BD.CarbonFootprint.impl.AfstandBepaler 1 @@ -47,7 +47,7 @@ Set ..TotDatum=+$G(Tot) Set:..VanDatum=0 ..VanDatum=$$CALCDATE^vhLib.DataTypes($H,"BJ",-1,"FD") Set:..TotDatum=0 ..TotDatum=$$CALCDATE^vhLib.DataTypes($H,"BJ",-1,"LD") - Set ..AfstandBepaler=##class(APPS.BD.CarbonFootprint.impl.Afstandbepaler).%New() + Set ..AfstandBepaler=##class(APPS.BD.CarbonFootprint.impl.AfstandBepaler).%New() Quit $$$OK ]]> @@ -104,17 +104,34 @@ Set Gemeente=$P(^KLE(^KL1(LEVNr),0),"\",7) Set LandKode=$$LAND^vhRtn1(LEVNr,"L",1) Set IsRecuPak=$D(^HISTPAK("P",..PRNr)) - Set Afstand=..AfstandBepaler.BepaalAfstand(Gemeente,LandKode) + Set Afstand=..AfstandBepaler.BepaalAfstandTot(Gemeente,LandKode) + + Set RecuPackPRNr=$$$ProductGet(..PRNr,$$$VerpakkingsProduct) + Set RecuPackProd=$S(RecuPackPRNr:$P($G(^KPR(RecuPackPRNr,0),"***"_RecuPackPRNr_"***"),"\",1),1:"") + Set GenTyp=$$GENTYP^HAD(..PRNr) + If ($P(GenTyp,"\")="TBX")||($P(GenTyp,"\")="LBX") + { + Set Verpak=$$GeefVerpakking^HATBXLeanLijst(..PRNr) + Set:(Verpak="VHoss") RecuPackProd=Verpak + } + Set (BrutoGewicht, NettoGewicht)="" + If LEVNr=$$$LevBlum { + Set BLID="0"_$TR($E($$$ProductGet(..PRNr,$$$IdentNummer),2,99),".","") + Set BLRec=$G(^BLProd("D",BLID)) + Set BrutoGewicht=$P(BLRec,"\",9) + Set NettoGewicht=$P(BLRec,"\",26) + } Write ..PRNr,*9,$$$ProductGet(..PRNr,$$$KortTekst),*9,IsRecuPak - Write *9,LEVNr,*9,LEVNm,*9,Straat,*9,PostKode,*9,Gemeente,*9,LandKode,*9,$$$ExcelNum(Afstand) + Write *9,LEVNr,*9,LEVNm,*9,Straat,*9,PostKode,*9,Gemeente,*9,LandKode,*9,$$$ExcelNum(Afstand.Afstand) Write *9,TOENr,*9,RCPNr,*9,$$$ExcelDat(Datum),*9,$S('RCPNr:"D"_$$$ExcelDat(Datum),1:RCPNr),*9,$$$ExcelNum(Aantal),*9,$$$ExcelNum(Aantal*Gewicht),*9,Actie,*9,Magazijn + Write *9,$$$ExcelNum(NettoGewicht*Aantal),*9,$$$ExcelNum(BrutoGewicht*Aantal),*9,RecuPackProd Write ! ]]>