TECH.RegisteredObject %Date 1 AXimpl.Admin.STAT.Invoice.LineIterator 1 vhLib.Logger 1 DOM.PM.ProductAPI 1 TECH.DateTime.DateTimeAPI 1 StatistiekMaand:%Date,InvoiceLineIterator:AXimpl.Admin.STAT.Invoice.LineIterator,Logger:vhLib.Logger,ProductApi:DOM.PM.ProductAPI,DateTimeApi:TECH.DateTime.DateTimeAPI 1 1 %Status 1 In ...InfoRec()-methods) If $$$Not(KlantNr = VorigeKlantNr) { Do ..KillSubscript("KlantMaandRec", KlantNr,, Maand) If $$$Not(ProductBestaatNiet) { Do ..KillSubscript("KlantProductMaandRec", KlantNr, ProductId, Maand) } } If ($$$Not(ProductId = VorigProductId) && $$$Not(ProductBestaatNiet)) { Do ..KillSubscript("KlantProductMaandRec", KlantNr, ProductId, Maand) If $$$Not($Data(mdProductId(ProductId))) { Do ..KillSubscript("ProductMaandRec",, ProductId, Maand) Set mdProductId(ProductId)="" If $$$Not($Data(mdKlantNr(KlantNr))) { Do ..KillSubscript("ProductKlantMaandRec", KlantNr, ProductId, Maand) Set mdKlantNr(KlantNr)="" } } } // SETTERS Do ..ProcessKlantLastInfoRec(Line, KlantNr) If $$$Not(ProductBestaatNiet) { Do ..ProcessKlantProductLastInfoRec(Line, KlantNr, ProductId) // Ook ProductKlantLastInfoRec Do ..ProcessKlantProductMaandRec(Line, KlantNr, ProductId, Maand) // Ook ProductMaandRec EN ProductKlantMaandRec Do ..ProcessProductLastInfoRec(Line, ProductId) } Do ..SetLastProcessedRecord(Line.RecId) Set VorigeKlantNr = KlantNr Set VorigProductId = ProductId } } ]]> Variatie:%String,KlantNr:%Integer=0,ProductId:%Integer=0,Maand:%String="" 1 Line:AXimpl.Admin.STAT.Invoice.Line,KlantNr:%Integer 1 = DatumKlantLastInfoRec If EditNodigKlantLastInfoRec { Do ..KillSubscript("KlantLastInfoRec", KlantNr) Set KlantLastInfoRec = $Get(^KSTKL(KlantNr,0,0),"") Set $Piece(KlantLastInfoRec,"\",1) = ConvertedInvoiceDateLine Set ^KSTKL(KlantNr,0,0) = KlantLastInfoRec } } ]]> Line:AXimpl.Admin.STAT.Invoice.Line,ProductId:%Integer 1 = DatumProductLastInfoRec If EditNodigProductLastInfoRec { Do ..KillSubscript("ProductLastInfoRec",, ProductId) Set ProductLastInfoRec = $Get(^KSTPR(ProductId,0,0),"") Set $Piece(ProductLastInfoRec,"\",1) = ConvertedInvoiceDateLine Set ^KSTPR(ProductId,0,0) = ProductLastInfoRec } } ]]> Line:AXimpl.Admin.STAT.Invoice.Line,KlantNr:%Integer,ProductId:%Integer 1 = DatumKlantProductLastInfoRec If EditNodigKlantProductLastInfoRec { Do ..KillSubscript("KlantProductLastInfoRec", KlantNr, ProductId) Set KlantProductLastInfoRec = $Get(^KSTKL(KlantNr,ProductId,0),"") Set $Piece(KlantProductLastInfoRec,"\",1) = ConvertedInvoiceDateLine Set $Piece(KlantProductLastInfoRec,"\",2) = Line.LineAmount Set $Piece(KlantProductLastInfoRec,"\",3) = VerkoopEenheid Set $Piece(KlantProductLastInfoRec,"\",4) = "EUR" Set $Piece(KlantProductLastInfoRec,"\",5) = 1 Set ^KSTKL(KlantNr,ProductId,0) = KlantProductLastInfoRec } } #dim BestaatProductKlantLastInfoRec As %Boolean = $Data(^KSTPR(ProductId,KlantNr,0)) #dim ProductKlantLastInfoRec As %String = $Get(^KSTPR(ProductId,KlantNr,0),"") If $$$Not(BestaatProductKlantLastInfoRec) { Set $Piece(ProductKlantLastInfoRec,"\",1) = ConvertedInvoiceDateLine Set $Piece(ProductKlantLastInfoRec,"\",2) = Line.LineAmount Set $Piece(ProductKlantLastInfoRec,"\",3) = VerkoopEenheid Set $Piece(ProductKlantLastInfoRec,"\",4) = "EUR" Set $Piece(ProductKlantLastInfoRec,"\",5) = 1 Set ^KSTPR(ProductId,KlantNr,0) = ProductKlantLastInfoRec } Else { #dim DatumProductKlantLastInfoRec As %Date = ##class(TECH.DateTime).TextToDate($Piece(ProductKlantLastInfoRec,"\",1)) #dim EditNodigProductKlantLastInfoRec As %Boolean = DatumLine >= DatumProductKlantLastInfoRec If EditNodigProductKlantLastInfoRec { Do ..KillSubscript("ProductKlantLastInfoRec", KlantNr, ProductId) Set ProductKlantLastInfoRec = $Get(^KSTPR(ProductId,KlantNr,0),"") Set $Piece(ProductKlantLastInfoRec,"\",1) = ConvertedInvoiceDateLine Set $Piece(ProductKlantLastInfoRec,"\",2) = Line.LineAmount Set $Piece(ProductKlantLastInfoRec,"\",3) = VerkoopEenheid Set $Piece(ProductKlantLastInfoRec,"\",4) = "EUR" Set $Piece(ProductKlantLastInfoRec,"\",5) = 1 Set ^KSTPR(ProductId,KlantNr,0) = ProductKlantLastInfoRec } } ]]> Line:AXimpl.Admin.STAT.Invoice.Line,KlantNr:%Integer,ProductId:%Integer,Maand:%String 1 PriceUnit:%Integer 1 %String Line:AXimpl.Admin.STAT.Invoice.Line,ProductId:%Integer,AantalStuks:%Integer,Omzet:%Decimal 1 %Numeric Line:AXimpl.Admin.STAT.Invoice.Line 1 %Integer 1 %Integer RecId:%Integer 1 1 %String Line:AXimpl.Admin.STAT.Invoice.Line,KlantNr:%Integer,ProductId:%Integer 1 KlantNr:%String 1 %Boolean