persistent %Persistent 1 1 Periode,KlantDtl,VolgNr 1 %Library.Integer 0 %Integer 0 %Integer 0 %Integer 0 %Integer 0 %Float 0 %Integer 0 F=Factuur;P=proforma,M=monster %String 0 DW.KlantDtl 0 %Float 0 %Float 0 %Float 0 %Float 0 %Float 0 %Float 0 %Float 0 %Integer 0 %Float 0 %Float 0 %Date 0 L=Levering, T=Terugname %String 0 %Float 0 %Float 0 %Float 0 %Date 0 FakturatieDatum %Library.Date 0 Prod.Product 0 DW.ProductDtl 0 %String 0 %Integer 0 %Float 0 %Float 0 %Float 0 %String 0 Uniek Volgnr %Library.Integer 0 code KLNr,Type,FAKNr,FAKDat,ULNr,ULRec,ULAdr,ORDRec,LNr,LRec,C code List,Point,Cnt,KostPlaatsKost code List,Point,Cnt,KostPlaatsKost d ##class(DW.OmzetKlantD).AddRecente() 1 code VanDatum:%Date code List,Point,Cnt,KostPlaatsKost code Debug code Grp,Key1,Key2 1 code TotDatum:%Date 1 code VanDatum:%Date 1 code Type:%String,KLNr:%Integer,StoreDatum:%Date,C:%String SDatum Do ; negatieve datum . Set FAKNr="" . For Set FAKNr=$O(@Index@("F",KLNr,Dat,FAKNr)) Quit:FAKNr="" Do . . Set ULRef="U" . . For Set ULRef=$O(@Data@("F",FAKNr,ULRef)) Quit:$E(ULRef)'="U" Do . . . Set ULNr=$E(ULRef,2,99) . . . Set ULRec=@Data@("F",FAKNr,ULRef,1) . . . Set ULAdr=@Data@("F",FAKNr,ULRef,3) . . . Set LNr=99 . . . Set ORDRec="" . . . For Set LNr=$O(@Data@("F",FAKNr,ULRef,LNr)) Quit:LNr="" Do . . . . Set LRec=@Data@("F",FAKNr,ULRef,LNr) . . . . If $P($P(LRec,D,17),"#")="KF5" Do ; OrderNr . . . . . Set ORDRec=LRec . . . . Else If $P(LRec,D,2)?4.7N Do ; Productlijn -> opslaan data . . . . . Set Obj=..%New() . . . . . Do Obj.AddData(KLNr,Type,FAKNr,-Dat,ULNr,ULRec,ULAdr,ORDRec,LNr,LRec,C) . . . . . Set Ok=Obj.%Save() . . . . . Write:'Ok "Save niet mogelijk voor product "_KLNr," ",FAKNr," ",ULNr," ",LNr_":"_$$ParseStatus^vhLib(Ok),! ]]> D ##class(DW.OmzetKlantD).Telling() 1 code Type:%String,KLNr:%Integer,PreFetchDatum:%Date,StoreDatum:%Date,C:%String PFDatum Do ; negatieve datum . Set FAKNr="" . For Set FAKNr=$O(@Index@("F",KLNr,Dat,FAKNr)) Quit:FAKNr="" Do . . Set ULRef="U" . . For Set ULRef=$O(@Data@("F",FAKNr,ULRef)) Quit:$E(ULRef)'="U" Do . . . Set ULNr=$E(ULRef,2,99) . . . Set ULDat=$P(@Data@("F",FAKNr,ULRef,1),D,2) . . . Set ULAdr=@Data@("F",FAKNr,ULRef,3) . . . Set LNr=99 . . . Set ORDNr="" . . . For Set LNr=$O(@Data@("F",FAKNr,ULRef,LNr)) Quit:LNr="" Do . . . . Set LRec=@Data@("F",FAKNr,ULRef,LNr) . . . . If $P($P(LRec,D,17),"#")="KF5" Do ; OrderNr . . . . . Set ORDNr=$P($P(LRec,D,5)," - ") . . . . Else If $P(LRec,D,2)?4.7N Do ; Productlijn -> tellingen opslaan . . . . . Set:ORDNr @C@("O",ORDNr)=$G(@C@("O",ORDNr))+1 . . . . . Quit:Dat>SDatum ; negatieve datum . . . . . Set @C@("U",ULNr)=$G(@C@("U",ULNr))+1 . . . . . Set @C@("DA",ULDat_D_$E($P(ULAdr,D,2,7),1,200))=$G(@C@("DA",ULDat_D_$E($P(ULAdr,D,2,7),1,200)))+1 . . . . . Set @C@("DA",ULDat_D_$E($P(ULAdr,D,2,7),1,200),FAKNr_D_ULNr_D_LNr)="" . . . . . Set @C@("F",FAKNr)=$G(@C@("F",FAKNr))+1 ]]> %SQLQuery TotDatum:%Date %SQLQuery VanDatum:%Date = :VanDatum) ]]> %Library.CacheStorage ^DW.OmzetKlantDD OmzetKlantDDefaultData ^DW.OmzetKlantDD ^DW.OmzetKlantDI ^DW.OmzetKlantDS %%CLASSNAME Aantal AantalKinderen AantalPickings BestelOrder Factuur FactuurCnt FactuurLijn FactuurType KostMatMA KostMatOV KostMatTP KostTijdMA KostTijdOV KostTijdTP Levering LeveringsBonCnt LeveringsCnt LeveringsDatum LeveringsType Marge Omzet OrderCnt OrderDatum Product ProductDtl StockAanpassing Stuks TijdMA TijdOV TijdTP VerzendWijze KostMonsters