Index: AXimpl/Admin/STAT/Invoice/Processor.cls.xml =================================================================== diff -u -r53708 -r53928 --- AXimpl/Admin/STAT/Invoice/Processor.cls.xml (.../Processor.cls.xml) (revision 53708) +++ AXimpl/Admin/STAT/Invoice/Processor.cls.xml (.../Processor.cls.xml) (revision 53928) @@ -1,6 +1,7 @@ +Prod.Product TECH.RegisteredObject @@ -23,6 +24,11 @@ 1 + +AX.Uitgaand.EC.DataAX.impl.Translator +1 + + TECH.DateTime.DateTimeAPI 1 @@ -46,6 +52,7 @@ Set ..InvoiceLineIterator = $$$Inject(InvoiceLineIterator, ##class(AXimpl.Admin.STAT.Invoice.LineIterator).%New(,..InvoiceDate)) Set ..ProductApi = $$$Inject(ProductApi, ##class(DOM.DomeinContext).Instance().GeefProductAPI()) Set ..DateTimeApi = $$$Inject(DateTimeApi, ##class(TECH.Context).Instance().GeefDateTimeAPI()) + Set ..Translator = ##class(AX.Uitgaand.EC.DataAX.impl.Translator).%New() Set ..Logger = $$$Inject(Logger, ##class(vhLib.Logger).%New()) Quit $$$OK ]]> @@ -63,6 +70,7 @@ If $$$Not(..IsNietMeeTeNemenKlant(KlantNr)) { Do ..ProcessKlantLastInfoRec(Line, KlantNr) If $$$Not(ProductBestaatNiet) { + Do ..CorrigeerLineCost(Line,ProductId) Do ..ProcessKlantProductLastInfoRec(Line, KlantNr, ProductId) // Ook ProductKlantLastInfoRec Do ..ProcessKlantProductMaandRec(Line, KlantNr, ProductId, Maand) // Ook ProductMaandRec EN ProductKlantMaandRec Do ..ProcessProductLastInfoRec(Line, ProductId) @@ -317,6 +325,51 @@ + + + +TIJDELIJK : Correctie van de kost berekend door AX dit voor de maanden juni 2018 tot dat ADU de kost corrigeert en geen gebruik maakt van de gemiddelde kost die voor de voorraadberekening wordt gebruikt. +Line:AXimpl.Admin.STAT.Invoice.Line,PRNr:%String + kost=omzet + { + Set Line.LineCost=Line.LineAmount + } + Else + { + try + { + If Line.AdminProductNummer?4.10N + { + Set PRNr=Line.AdminProductNummer + } + Else + { + Set PRNr=..Translator.GeefPRNrForAdminInclSOPR(Line.ItemId,Line.InvoiceAccount) + } + + If $$$PRGet($$$GenProduct)'?.N ; Generisch moeder product -> kost=omzet + { + Set Line.LineCost=Line.LineAmount + } + Else + { + Set CifPPL=$$$PRGet($$$CifPPLEUR) + Set Line.LineCost=+$J(CifPPL*Line.InventQty,0,4) + } + } + catch + { + } + } +]]> +