{"title":"Codeunit 5895 Inventory Adjustment, extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/5895-inventory-adjustment/points/","author":"JOP-AL","license":"Metadata from Microsoft's symbol packages. AL source MIT, Copyright (c) Microsoft Corporation. Selection and wording © 2026 JOP-AL. https://jonas-paprotka.de/licenses/","subject":"Microsoft Dynamics 365 Business Central","checked":"2026-11-20","changed":"2026-11-14","object":{"type":"codeunit","id":5895,"name":"Inventory Adjustment","app":"Base Application","url":"https://jonas-paprotka.de/ref/codeunit/5895-inventory-adjustment/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/5895-inventory-adjustment/source/","path":"src/Layers/W1/BaseApp/Inventory/Costing/InventoryAdjustment.Codeunit.al","commit":"4303e5e584d3aa5d9e98cbc615525a5396ad6ed7","lines":"a line is <source url>#L<line>"},"steps":{"event":"[line, \"event\", name, handled]: raises an event of this object; handled 1 when it has an IsHandled parameter","call":"[line, \"call\", name, arguments]: calls a procedure of this object","ext":"[line, \"ext\", type, id, name, arguments]: calls a procedure of another object, through a variable declared with that type","write":"[line, \"write\", table id, method, 1 when called with true]: Insert, Modify, ModifyAll, Delete, DeleteAll or Rename","validate":"[line, \"validate\", table id, field name]","run":"[line, \"run\", type, id]: Codeunit.Run, Page.Run, Report.Run and their kin"},"objects":{"codeunit:5824":{"name":"Cost Adjustment Params Mgt.","url":"https://jonas-paprotka.de/ref/codeunit/5824-cost-adjustment-params-mgt/"},"codeunit:22":{"name":"Item Jnl.-Post Line","url":"https://jonas-paprotka.de/ref/codeunit/22-item-jnl-post-line/"},"table:313":{"name":"Inventory Setup","url":"https://jonas-paprotka.de/ref/table/313-inventory-setup/"},"codeunit:8703":{"name":"Feature Telemetry","url":"https://jonas-paprotka.de/ref/codeunit/8703-feature-telemetry/"},"table:98":{"name":"General Ledger Setup","url":"https://jonas-paprotka.de/ref/table/98-general-ledger-setup/"},"codeunit:5804":{"name":"ItemCostManagement","url":"https://jonas-paprotka.de/ref/codeunit/5804-itemcostmanagement/"},"table:5810":{"name":"Rounding Residual Buffer","url":"https://jonas-paprotka.de/ref/table/5810-rounding-residual-buffer/"},"table:5812":{"name":"Item Application Trace","url":"https://jonas-paprotka.de/ref/table/5812-item-application-trace/"},"table:4":{"name":"Currency","url":"https://jonas-paprotka.de/ref/table/4-currency/"},"table:27":{"name":"Item","url":"https://jonas-paprotka.de/ref/table/27-item/"},"table:5802":{"name":"Value Entry","url":"https://jonas-paprotka.de/ref/table/5802-value-entry/"},"table:32":{"name":"Item Ledger Entry","url":"https://jonas-paprotka.de/ref/table/32-item-ledger-entry/"},"table:5895":{"name":"Inventory Adjustment Buffer","url":"https://jonas-paprotka.de/ref/table/5895-inventory-adjustment-buffer/"},"table:339":{"name":"Item Application Entry","url":"https://jonas-paprotka.de/ref/table/339-item-application-entry/"},"table:5820":{"name":"Cost Element Buffer","url":"https://jonas-paprotka.de/ref/table/5820-cost-element-buffer/"},"table:5804":{"name":"Avg. Cost Adjmt. Entry Point","url":"https://jonas-paprotka.de/ref/table/5804-avg-cost-adjmt-entry-point/"},"table:2000000026":{"name":"Integer","url":"https://jonas-paprotka.de/ref/table/2000000026-integer/"},"codeunit:5896":{"name":"Calc. Inventory Adjmt. - Order","url":"https://jonas-paprotka.de/ref/codeunit/5896-calc-inventory-adjmt-order/"},"table:5896":{"name":"Inventory Adjmt. Entry (Order)","url":"https://jonas-paprotka.de/ref/table/5896-inventory-adjmt-entry-order/"},"table:5814":{"name":"Inventory Period","url":"https://jonas-paprotka.de/ref/table/5814-inventory-period/"},"report:1095":{"name":"Update Job Item Cost","url":"https://jonas-paprotka.de/ref/report/1095-update-job-item-cost/"},"codeunit:362":{"name":"PeriodPageManagement","url":"https://jonas-paprotka.de/ref/codeunit/362-periodpagemanagement/"}},"procs":[{"name":"MakeMultiLevelAdjmt","line":121,"kind":"procedure","params":1,"steps":[[126,"ext","codeunit",5824,"GetParameters",1],[132,"ext","codeunit",5824,"GetInventoryAdjmtEntryOrder",1],[133,"ext","codeunit",5824,"GetAvgCostAdjmtEntryPoint",1],[134,"ext","codeunit",5824,"GetItemsToAdjust",1],[135,"event","OnBeforeMakeMultiLevejAdjmtOnAfterGetParameters",0]]},{"name":"MakeMultiLevelAdjmt","line":140,"kind":"procedure","params":0,"steps":[[149,"event","OnBeforeMakeMultiLevelAdjmt",1],[153,"call","InitializeAdjmt",0],[156,"call","InvtToAdjustExist",1],[158,"call","MakeSingleLevelAdjmt",2],[161,"call","AssemblyToAdjustExists",1],[162,"call","MakeAssemblyAdjmt",2],[165,"call","WIPToAdjustExist",1],[166,"call","MakeWIPAdjmt",2],[168,"event","OnMakeMultiLevelAdjmtOnAfterMakeAdjmt",0],[174,"call","SetAppliedEntryToAdjustFromBuf",0],[176,"call","FinalizeAdjmt",0],[177,"call","RunUpdateJobItemCost",0],[179,"event","OnAfterMakeMultiLevelAdjmt",0]]},{"name":"InitializeAdjmt","line":182,"kind":"procedure","access":"local","params":0,"steps":[[191,"call","OpenWindow",0],[194,"ext","codeunit",22,"SetCalledFromAdjustment",2],[200,"ext","table",313,"AutomaticCostAdjmtRequired",0],[201,"ext","codeunit",8703,"LogUsage",3],[205,"ext","table",98,"FirstAllowedPostingDate",0],[206,"event","OnInitializeAdjmtOnAfterGetPostingDate",0],[208,"call","GetAddReportingCurrency",0],[213,"ext","codeunit",5804,"SetProperties",2]]},{"name":"FinalizeAdjmt","line":217,"kind":"procedure","access":"local","params":0,"steps":[[222,"write",5810,"DeleteAll"],[225,"write",5812,"DeleteAll"]]},{"name":"GetAddReportingCurrency","line":231,"kind":"procedure","access":"local","params":0,"steps":[[235,"ext","table",4,"CheckAmountRoundingPrecision",0]]},{"name":"InvtToAdjustExist","line":239,"kind":"procedure","access":"local","params":1,"steps":[[251,"call","FindLastDate",1],[253,"event","OnInvtToAdjustExistOnBeforeCopyItemToItem",0],[254,"call","CopyItemToItem",2]]},{"name":"MakeSingleLevelAdjmt","line":259,"kind":"procedure","access":"local","params":2,"steps":[[266,"event","OnBeforeMakeSingleLevelAdjmt",1],[271,"call","FindLastDate",0],[275,"call","UpDateWindow",6],[281,"event","OnBeforeAdjustItem",0],[283,"ext","table",27,"SetBaseLoadFields",0],[285,"call","UpDateWindow",6],[287,"call","PushCurrentItem",1],[290,"event","OnBeforeCollectItemLedgerEntryTypesUsed",1],[292,"call","CollectItemLedgerEntryTypesUsed",1],[294,"event","OnMakeSingleLevelAdjmtOnBeforeCollectAvgCostAdjmtEntryPointToUpdate",0],[295,"call","CollectAvgCostAdjmtEntryPointToUpdate",2],[296,"call","AppliedEntryToAdjustBufExists",1],[301,"event","OnMakeSingleLevelAdjmtOnAfterLevelExceeded",0],[302,"call","AdjustItemAppliedCost",0],[306,"call","AdjustItemAvgCost",0],[310,"event","OnMakeSingleLevelAdjmtOnBeforePostAdjmtBuf2",1],[312,"call","PostAdjmtBuf",1],[315,"call","UpdateItemUnitCost",2],[316,"event","OnMakeSingleLevelAdjmtOnAfterUpdateItemUnitCost",0],[318,"call","PopCurrentItem",1],[319,"call","CheckAndCommit",0],[321,"event","OnAfterAdjustItem",0]]},{"name":"AdjustItemAppliedCost","line":330,"kind":"procedure","access":"local","params":0,"steps":[[336,"call","UpDateWindow",6],[339,"write",5802,"DeleteAll"],[349,"event","OnBeforeCopyILEToILE",0],[351,"call","UpDateWindow",6],[353,"event","OnAdjustItemAppliedCostForItemLedgerEntry",0],[355,"ext","table",5810,"AddAdjustedCost",4],[356,"call","ForwardAppliedCost",2],[358,"call","EliminateRndgResidual",2]]},{"name":"ForwardAppliedCost","line":363,"kind":"procedure","access":"local","params":2,"steps":[[374,"ext","table",32,"SetAppliedEntryToAdjust",1],[380,"event","OnForwardAppliedCostOnBeforeUpdateWindow",0],[381,"call","UpDateWindow",6],[383,"call","ForwardCostToOutbndEntries",3],[384,"event","OnForwardAppliedCostOnAfterSetAppliedQty",0],[387,"call","ForwardCostToInbndTransEntries",2],[389,"call","ForwardCostToInbndEntries",1],[391,"call","ShouldSetAppliedEntryToAdjustForForwardAppliedCost",2],[394,"ext","table",32,"IsOutbndConsump",0],[395,"call","UpdateAppliedEntryToAdjustBuf",2],[397,"ext","table",32,"SetAppliedEntryToAdjust",1]]},{"name":"ShouldSetAppliedEntryToAdjustForForwardAppliedCost","line":400,"kind":"procedure","access":"local","params":2,"steps":[[405,"call","OutboundSalesEntryToAdjust",1],[410,"call","InboundTransferEntryToAdjust",1]]},{"name":"ForwardAppliedCostRecursion","line":414,"kind":"procedure","access":"local","params":1,"steps":[[426,"call","ForwardAppliedCost",2],[428,"call","IsRndgAllowed",2],[429,"ext","table",5895,"CalcItemLedgEntryCost",2],[430,"ext","table",5802,"CalcItemLedgEntryCost",2],[431,"ext","table",5802,"AddCost",1],[435,"ext","table",339,"AppliedOutbndEntryExists",4],[437,"ext","table",5895,"CalcItemLedgEntryCost",2],[438,"ext","table",5802,"CalcItemLedgEntryCost",2],[439,"ext","table",5802,"AddCost",1],[447,"call","UpdateAppliedEntryToAdjustBuf",2]]},{"name":"ForwardCostToOutbndEntries","line":456,"kind":"procedure","access":"local","params":3,"steps":[[463,"ext","table",339,"AppliedOutbndEntryExists",4],[465,"call","AdjustAppliedOutbndEntries",3]]},{"name":"AdjustAppliedOutbndEntries","line":473,"kind":"procedure","access":"local","params":3,"steps":[[489,"event","OnAdjustAppliedOutbndEntry",0],[492,"call","UseStandardCostMirroring",1],[494,"call","CalcOutbndCost",4],[501,"call","LoadFields",1],[506,"call","ExpCostIsCompletelyInvoiced",2],[507,"event","OnAdjustAppliedOutbndEntriesOnBeforeAdjustEntry",0],[511,"call","CalcOutbndDocOldCost",3],[513,"ext","table",32,"IsExactCostReversingPurchase",0],[513,"ext","table",32,"IsExactCostReversingOutput",0],[515,"call","CalcCostPerUnit",3],[518,"ext","table",5820,"GetElement",1],[523,"call","CalcOutbndDocNewCost",4],[528,"ext","table",5820,"GetElement",1],[533,"ext","table",5820,"GetElement",1],[540,"call","CreateCostAdjmtBuf",4],[543,"call","CreateCostAdjmtBuf",4],[546,"event","OnAdjustAppliedOutbndEntriesOnBeforeCheckExpectedCost",0],[549,"call","CreateIndirectCostAdjmt",4],[551,"call","CreateIndirectCostAdjmt",4],[561,"call","IsUpdateCompletelyInvoiced",2],[564,"ext","table",32,"SetCompletelyInvoiced",0],[566,"call","ForwardAppliedCostRecursion",1],[568,"ext","table",339,"SetInboundToUpdated",1]]},{"name":"CalcCostPerUnit","line":574,"kind":"procedure","access":"local","params":3,"steps":[[581,"event","OnCalcCostPerUnitOnBeforeCalcCostPerUnit",0]]},{"name":"CalcOutbndCost","line":589,"kind":"procedure","access":"local","params":4,"steps":[[594,"write",5820,"DeleteAll"],[595,"write",5820,"DeleteAll"],[597,"call","RestoreValuesFromBuffers",3],[599,"call","ItemLedgerEntryTypeIsUsed",1],[607,"call","CalcInbndEntryAdjustedCost",6],[609,"ext","table",32,"IsExactCostReversingPurchase",0],[609,"ext","table",32,"IsExactCostReversingOutput",0],[622,"call","CalcInbndEntryAdjustedCost",6],[626,"ext","table",32,"IsExactCostReversingPurchase",0],[626,"ext","table",32,"IsExactCostReversingOutput",0],[631,"ext","table",5820,"GetElement",1],[640,"call","SaveValuesToBuffers",3]]},{"name":"CalcOutbndDocNewCost","line":643,"kind":"procedure","access":"local","params":4,"steps":[[648,"ext","table",5820,"GetElement",1],[652,"call","RoundCost",5],[655,"call","RoundCost",5],[659,"write",5820,"Insert"],[660,"write",5820,"Modify"]]},{"name":"CollectAvgCostAdjmtEntryPointToUpdate","line":663,"kind":"procedure","access":"local","params":2,"steps":[[672,"call","InsertEntryPointToUpdate",4]]},{"name":"CreateCostAdjmtBuf","line":677,"kind":"procedure","access":"local","params":4,"steps":[[679,"call","UpdateAdjmtBuf",5],[680,"call","UpdateAvgCostAdjmtEntryPoint",1]]},{"name":"CreateIndirectCostAdjmt","line":686,"kind":"procedure","access":"local","params":4,"steps":[[693,"ext","table",5820,"GetElement",1],[694,"ext","table",5820,"GetElement",1],[698,"call","HasNewCost",2],[699,"call","GetOrigValueEntry",3],[700,"call","InitAdjmtJnlLine",5],[702,"call","PostItemJnlLine",4],[704,"event","OnCreateIndirectCostAdjmtOnAfterPostItemJnlLine",0],[705,"call","UpdateAvgCostAdjmtEntryPoint",1]]},{"name":"ForwardCostToInbndTransEntries","line":712,"kind":"procedure","access":"local","params":2,"steps":[[717,"call","ItemLedgerEntryTypeIsUsed",1],[720,"ext","table",339,"AppliedInbndTransEntryExists",3],[722,"call","AdjustAppliedInbndTransEntries",2]]},{"name":"AdjustAppliedInbndTransEntries","line":726,"kind":"procedure","access":"local","params":2,"steps":[[736,"ext","table",32,"SetBaseLoadFields",0],[738,"event","OnAdjustAppliedInbndTransEntry",0],[741,"call","AdjustNotInvdRevaluation",2],[743,"call","CalcTransEntryOldCost",3],[745,"call","CalcInbndEntryAdjustedCost",6],[752,"ext","table",32,"SetCompletelyInvoiced",0],[756,"call","UpdateAdjmtBuf",5],[766,"call","ClearOutboundEntryCostBuffer",1],[767,"call","UpdateAvgCostAdjmtEntryPoint",1],[768,"call","ForwardAppliedCostRecursion",1]]},{"name":"CalcTransEntryOldCost","line":772,"kind":"procedure","access":"local","params":3,"steps":[[783,"call","LoadFields",1],[787,"event","OnCalcTransEntryOldCostOnBeforeProcessTransValueEntry",0],[790,"ext","table",5802,"AddCost",1]]},{"name":"ForwardCostToInbndEntries","line":799,"kind":"procedure","access":"local","params":1,"steps":[[804,"ext","table",339,"AppliedInbndEntryExists",3],[806,"call","AdjustAppliedInbndEntries",1]]},{"name":"AdjustAppliedInbndEntries","line":810,"kind":"procedure","access":"local","params":1,"steps":[[822,"call","CalcItemApplnEntryOldCost",3],[824,"ext","table",32,"SetBaseLoadFields",0],[826,"event","OnAdjustAppliedInbndEntry",0],[830,"event","OnAdjustAppliedInbndEntriesOnAfterSetFilter",0],[831,"call","LoadFields",1],[836,"call","ExpCostIsCompletelyInvoiced",2],[840,"call","CalcInbndDocOldCost",2],[843,"ext","table",5820,"GetElement",1],[848,"call","CalcInbndDocNewCost",4],[852,"call","CreateCostAdjmtBuf",4],[857,"write",5802,"DeleteAll"],[867,"call","IsUpdateCompletelyInvoiced",2],[870,"ext","table",32,"SetCompletelyInvoiced",0],[875,"call","UpdateAvgCostAdjmtEntryPoint",1],[876,"call","ForwardAppliedCostRecursion",1]]},{"name":"CalcItemApplnEntryOldCost","line":880,"kind":"procedure","access":"local","params":3,"steps":[[895,"ext","table",5802,"AddCost",1],[905,"ext","table",5820,"RoundActualCost",3]]},{"name":"CalcInbndDocOldCost","line":910,"kind":"procedure","access":"local","params":2,"steps":[[912,"write",5820,"DeleteAll"],[928,"ext","table",5802,"AddCost",1],[930,"ext","table",5820,"AddExpectedCostElement",2],[932,"ext","table",5820,"AddActualCostElement",2],[935,"write",5820,"Modify"],[936,"write",5820,"Insert"]]},{"name":"CalcInbndDocNewCost","line":943,"kind":"procedure","access":"local","params":4,"steps":[[945,"ext","table",5820,"RoundActualCost",3]]},{"name":"IsUpdateCompletelyInvoiced","line":957,"kind":"procedure","access":"local","params":2,"steps":[[962,"event","OnBeforeIsUpdateCompletelyInvoiced",1]]},{"name":"CalcInbndEntryAdjustedCost","line":972,"kind":"procedure","access":"local","params":6,"steps":[[981,"event","OnBeforeCalcInbndEntryAdjustedCost",1],[983,"write",5820,"DeleteAll"],[996,"call","ExpCostIsCompletelyInvoiced",2],[997,"call","IncludedInCostCalculation",2],[998,"event","OnCalcInbndEntryAdjustedCostOnBeforeAddCost",0],[1000,"ext","table",5802,"AddCost",1],[1002,"call","IsInterimRevaluation",1],[1005,"ext","table",5820,"AddActualCostElement",3],[1013,"ext","table",5820,"AddActualCostElement",3],[1021,"ext","table",5820,"AddActualCostElement",3],[1027,"ext","table",5820,"AddActualCostElement",2],[1029,"ext","table",5820,"AddActualCostElement",2],[1031,"ext","table",5820,"AddActualCostElement",2],[1037,"event","OnCalcInbndEntryAdjustedCostOnBeforeCalcNewAdjustedCost",1],[1039,"call","CalcNewAdjustedCost",2],[1041,"call","AdjustAppliedCostEntry",3],[1042,"ext","table",5810,"AddAdjustedCost",4],[1049,"event","OnAfterCalcInbndEntryAdjustedCost",0]]},{"name":"CalcNewAdjustedCost","line":1052,"kind":"procedure","access":"local","params":2,"steps":[[1056,"ext","table",5820,"RoundActualCost",3],[1057,"write",5820,"Modify"],[1061,"ext","table",5820,"AddActualCostElement",3]]},{"name":"IncludedInCostCalculation","line":1072,"kind":"procedure","params":2,"steps":[[1089,"ext","table",5802,"EntryNoHasSameSign",1],[1090,"ext","table",5802,"EntryNoHasSameSign",1],[1091,"ext","table",5802,"GetValuationDate",0]]},{"name":"CalcOutbndDocOldCost","line":1098,"kind":"procedure","access":"local","params":3,"steps":[[1102,"write",5820,"DeleteAll"],[1113,"ext","table",5802,"AddCost",1],[1114,"ext","table",5820,"AddExpectedCostElement",3],[1120,"ext","table",5820,"AddActualCostElement",2],[1123,"write",5820,"Modify"],[1124,"write",5820,"Insert"],[1128,"ext","table",5820,"AddActualCostElement",2],[1130,"ext","table",5820,"AddActualCostElement",2],[1135,"ext","table",5820,"AddActualCostElement",3]]},{"name":"EliminateRndgResidual","line":1138,"kind":"procedure","access":"local","params":2,"steps":[[1146,"call","IsRndgAllowed",2],[1147,"ext","table",5895,"CalcItemLedgEntryCost",2],[1148,"ext","table",5802,"CalcItemLedgEntryCost",2],[1149,"ext","table",5802,"AddCost",1],[1150,"event","OnEliminateRndgResidualOnAfterCalcInboundCost",0],[1161,"event","OnEliminateRndgResidualOnBeforeCheckHasNewCost",1],[1163,"call","HasNewCost",2],[1170,"ext","table",5802,"SetBaseLoadFields",0],[1172,"call","InitRndgResidualItemJnlLine",2],[1173,"call","PostItemJnlLine",4],[1179,"write",5810,"DeleteAll"]]},{"name":"InitRndgResidualItemJnlLine","line":1192,"kind":"procedure","access":"local","params":2,"steps":[[1200,"event","OnAfterInitRndgResidualItemJnlLine",0]]},{"name":"AdjustItemAvgCost","line":1203,"kind":"procedure","access":"local","params":0,"steps":[[1215,"call","IsAvgCostItem",0],[1218,"call","UpDateWindow",6],[1220,"call","DeleteAvgBuffers",2],[1223,"call","AvgCostAdjmtEntryPointExist",1],[1228,"event","OnBeforeAvgCostAdjmtEntryPoint",0],[1235,"ext","table",5804,"SetAvgCostAjmtFilter",1],[1236,"call","SetDateFilterUntilLastDate",1],[1237,"write",5804,"DeleteAll"],[1240,"ext","table",5804,"SetAvgCostAjmtFilter",1],[1241,"call","SetDateFilterUntilLastDate",1],[1242,"write",5804,"ModifyAll"],[1245,"event","OnAdjustItemAvgCostOnBeforeAdjustValueEntries",0],[1251,"call","FindOutboundEntriesToAdjust",3],[1259,"event","OnBeforeIteratingOverOutbndAvgEntries",0],[1261,"event","OnAdjustItemAvgCostOnBeforeUpdateWindow",0],[1262,"call","UpDateWindow",6],[1264,"call","AdjustOutbndAvgEntry",3],[1265,"call","UpdateConsumpAvgEntry",1],[1268,"ext","table",5804,"SetAvgCostAjmtFilter",1],[1269,"call","SetDateFilterUntilLastDate",1],[1271,"event","OnAdjustItemAvgCostOnAfterCalcRestart",0],[1275,"call","GetNextDate",1],[1280,"event","OnAdjustItemAvgCostOnAfterLastTempAvgCostAdjmtEntryPoint",1]]},{"name":"AvgCostAdjmtEntryPointExist","line":1286,"kind":"procedure","access":"local","params":1,"steps":[[1295,"call","CopyAvgCostAdjmtToAvgCostAdjmt",2]]},{"name":"FindOutboundEntriesToAdjust","line":1300,"kind":"procedure","access":"local","params":3,"steps":[[1306,"call","AvgValueEntriesToAdjustExist",4],[1310,"call","GetNextDate",1],[1311,"event","OnAvgValueEntriesToAdjustExistOnFindNextRangeOnBeforeAvgValueEntriesToAdjustExist",0]]},{"name":"AvgValueEntriesToAdjustExist","line":1317,"kind":"procedure","access":"local","params":4,"steps":[[1326,"call","ResetAvgBuffers",2],[1329,"ext","table",5804,"GetValuationPeriod",1],[1330,"event","OnAfterGetValuationPeriod",0],[1334,"ext","table",5804,"AvgCostCalcTypeIsChanged",1],[1335,"ext","table",5804,"GetAvgCostCalcTypeIsChgPeriod",2],[1336,"call","Min",2],[1338,"call","Min",2],[1340,"ext","table",5804,"IsAvgCostCalcTypeItem",1],[1345,"event","OnAvgValueEntriesToAdjustExistOnAfterSetAvgValueEntryFilters",0],[1354,"ext","table",5804,"GetValuationPeriod",1],[1357,"ext","table",5804,"ValuationExists",1],[1357,"ext","table",5804,"PrevValuationAdjusted",1],[1360,"ext","table",5804,"UpdateValuationDate",1],[1366,"event","OnAvgValueEntriesToAdjustExistOnAfterSetChildValueEntryFilters",0],[1375,"call","DeleteAvgBuffers",2],[1383,"ext","table",339,"AppliedFromEntryExists",1],[1386,"write",2000000026,"Insert"],[1387,"call","FillFixApplBuffer",1],[1393,"write",5802,"Insert"],[1397,"event","OnAvgValueEntriesToAdjustExistOnBeforeIsNotAdjustment",0],[1399,"call","IsAvgCostException",2],[1401,"write",2000000026,"Insert"],[1403,"write",2000000026,"Insert"],[1407,"write",5802,"Insert"],[1409,"call","FetchOpenOutboundItemEntriesToExclude",4]]},{"name":"AdjustOutbndAvgEntry","line":1422,"kind":"procedure","access":"local","params":3,"steps":[[1433,"call","ExpCostIsCompletelyInvoiced",2],[1436,"event","OnAdjustOutbndAvgEntry",0],[1438,"call","UpDateWindow",6],[1441,"ext","table",32,"SetAvgTransCompletelyInvoiced",0],[1443,"call","CalcAvgCost",4],[1444,"call","CalcOutbndDocOldCost",3],[1451,"event","OnAdjustOutbndAvgEntryOnNewCostElementBuf",0],[1453,"call","UpdateAdjmtBuf",5],[1463,"ext","table",32,"SetAppliedEntryToAdjust",1],[1465,"event","OnAdjustOutbndAvgEntryOnBeforeForwardAvgCostToInbndEntries",0],[1466,"call","ForwardAvgCostToInbndEntries",1]]},{"name":"CalcAvgCost","line":1475,"kind":"procedure","access":"local","params":4,"steps":[[1483,"ext","table",5802,"SumCostsTillValuationDate",1],[1485,"ext","table",5895,"SumCostsTillValuationDate",1],[1496,"event","OnCalcAvgCostOnAfterAssignRoundingError",0],[1498,"call","ExcludeAvgCostOnValuationDate",4],[1499,"ext","table",5820,"UpdateAvgCostBuffer",2],[1500,"call","GetLastValidValueEntry",1],[1502,"ext","table",5820,"UpdateCostElementBuffer",1],[1505,"call","ExcludeTransferFromAvgCostCalc",2],[1512,"call","RoundCost",5],[1516,"call","RoundCost",5],[1521,"ext","table",5820,"DeductOutbndValueEntryFromBuf",3]]},{"name":"ExcludeAvgCostOnValuationDate","line":1536,"kind":"procedure","access":"local","params":4,"steps":[[1551,"call","GetChainOfAppliedEntries",3],[1552,"ext","table",5812,"AddChain",2],[1553,"event","OnExcludeAvgCostOnValuationDateOnAfterGetItemApplicationTrace",0],[1558,"event","OnExcludeAvgCostOnValuationDate",0],[1564,"call","IsExcludeILEFromAvgCostCalc",4],[1573,"call","IsExcludeFromAvgCostForRevalPoint",2],[1574,"call","CalcRevalFixedApplnQty",1],[1578,"call","RoundAmt",2],[1580,"call","RoundAmt",2],[1582,"call","RoundAmt",2],[1584,"call","RoundAmt",2],[1593,"call","IsExcludeFromAvgCostForRevalPoint",2],[1598,"ext","table",5820,"ExcludeEntryFromAvgCostCalc",1],[1600,"ext","table",5820,"ExcludeBufFromAvgCostCalc",1]]},{"name":"IsExcludeILEFromAvgCostCalc","line":1605,"kind":"procedure","access":"local","params":4,"steps":[[1627,"call","IsItemLedgEntryPositive",1],[1631,"call","IsOutputWithSelfConsumption",3],[1647,"ext","table",5804,"IsAvgCostCalcTypeItem",1]]},{"name":"IsExcludeFromAvgCostForRevalPoint","line":1663,"kind":"procedure","access":"local","params":2,"steps":[[1671,"event","OnBeforeIsExcludeFromAvgCostForRevalPoint",0],[1689,"call","IncludedInCostCalculation",2]]},{"name":"CalcRevalFixedApplnQty","line":1696,"kind":"procedure","access":"local","params":1,"steps":[[1708,"call","IncludedInCostCalculation",2]]},{"name":"UpdateAvgCostAdjmtEntryPoint","line":1715,"kind":"procedure","access":"local","params":1,"steps":[[1719,"ext","table",5804,"UpdateValuationDate",1]]},{"name":"UpdateConsumpAvgEntry","line":1722,"kind":"procedure","access":"local","params":1,"steps":[[1730,"event","OnBeforeUpdateConsumpAvgEntry",1],[1742,"ext","table",5804,"IsAvgCostCalcTypeItem",1],[1747,"event","OnUpdateConsumpAvgEntryOnAfterSetItemLedgEntryFilters",0],[1750,"ext","table",32,"SetCompletelyInvoiced",0],[1751,"ext","table",32,"SetAppliedEntryToAdjust",1]]},{"name":"ForwardAvgCostToInbndEntries","line":1756,"kind":"procedure","access":"local","params":1,"steps":[[1761,"ext","table",339,"AppliedInbndEntryExists",3],[1764,"call","AdjustAppliedInbndEntries",1],[1768,"call","UpDateWindow",6],[1769,"call","AdjustItemAppliedCost",0],[1770,"call","UpDateWindow",6]]},{"name":"WIPToAdjustExist","line":1775,"kind":"procedure","access":"local","params":1,"steps":[[1787,"event","OnWIPToAdjustExistOnAfterInventoryAdjmtEntryOrderSetFilters",0],[1788,"call","CopyOrderAdmtEntryToOrderAdjmt",2]]},{"name":"MakeWIPAdjmt","line":1792,"kind":"procedure","access":"local","params":2,"steps":[[1799,"call","GetItem",1],[1800,"call","UpDateWindow",6],[1802,"event","OnMakeWIPAdjmt",0],[1805,"ext","codeunit",5896,"Calculate",2],[1806,"call","PostOutputAdjmtBuf",1],[1809,"ext","table",5896,"GetUnitCostsFromItem",0],[1814,"write",5896,"Modify"]]},{"name":"PostOutputAdjmtBuf","line":1818,"kind":"procedure","access":"local","params":1,"steps":[[1823,"call","PostOutput",2],[1825,"write",5895,"DeleteAll"]]},{"name":"PostOutput","line":1828,"kind":"procedure","access":"local","params":2,"steps":[[1837,"ext","table",5802,"SetBaseLoadFields",0],[1856,"event","OnPostOutputOnBeforePostItemJnlLine",1],[1858,"call","PostItemJnlLine",4],[1862,"ext","table",32,"SetCompletelyInvoiced",0],[1864,"call","InsertEntryPointToUpdate",4]]},{"name":"AssemblyToAdjustExists","line":1867,"kind":"procedure","access":"local","params":1,"steps":[[1878,"call","CopyOrderAdmtEntryToOrderAdjmt",2]]},{"name":"MakeAssemblyAdjmt","line":1882,"kind":"procedure","access":"local","params":2,"steps":[[1889,"call","GetItem",1],[1890,"call","UpDateWindow",6],[1892,"event","OnMakeAssemblyAdjmt",0],[1896,"ext","codeunit",5896,"Calculate",2],[1897,"call","PostOutputAdjmtBuf",1],[1901,"ext","table",5896,"GetUnitCostsFromItem",0],[1906,"write",5896,"Modify"]]},{"name":"UpdateAdjmtBuf","line":1910,"kind":"procedure","access":"local","params":5,"steps":[[1918,"event","OnBeforeUpdateAdjmtBuf",1],[1922,"call","HasNewCost",2],[1926,"ext","table",5810,"UpdRoundingCheck",5],[1933,"call","UpdateValuationPeriodHasOutput",1],[1935,"ext","table",5895,"AddActualCostBuf",4],[1936,"event","OnUpdateAdjmtBufOnAfterAddActualCostBuf",0],[1939,"call","GetOrigValueEntry",3],[1942,"write",5895,"Modify"],[1948,"call","CalcExpectedCostToBalance",3],[1950,"event","OnUpdateAdjmtBufOnBeforeHasNewCost",1],[1952,"call","HasNewCost",2],[1953,"ext","table",5895,"AddBalanceExpectedCostBuf",3],[1959,"ext","table",339,"SetOutboundsNotUpdated",1]]},{"name":"CalcExpectedCostToBalance","line":1964,"kind":"procedure","access":"local","params":3,"steps":[[1986,"call","RoundAmt",2],[1988,"call","RoundAmt",2]]},{"name":"PostAdjmtBuf","line":1993,"kind":"procedure","access":"local","params":1,"steps":[[2001,"ext","table",5802,"SetBaseLoadFields",0],[2003,"call","InsertEntryPointToUpdate",4],[2006,"call","HasNewCost",2],[2007,"call","InitAdjmtJnlLine",5],[2008,"call","PostItemJnlLine",4],[2010,"event","OnPostAdjmtBufOnAfterPostExpectedCost",0],[2013,"call","HasNewCost",2],[2014,"call","HasNewCost",2],[2015,"call","InitAdjmtJnlLine",5],[2016,"call","PostItemJnlLine",4],[2018,"call","InitAdjmtJnlLine",5],[2019,"event","OnPostAdjmtBufOnBeforePostNewCost",0],[2020,"call","PostItemJnlLine",4],[2022,"event","OnPostAdjmtBufOnAfterPostNewCost",0],[2025,"write",5895,"DeleteAll"]]},{"name":"InitAdjmtJnlLine","line":2029,"kind":"procedure","access":"local","params":5,"steps":[[2050,"event","OnAfterInitAdjmtJnlLine",0]]},{"name":"PostItemJnlLine","line":2053,"kind":"procedure","access":"local","params":4,"steps":[[2059,"event","OnBeforePostItemJnlLine",1],[2067,"ext","table",98,"IsPostingAllowed",1],[2067,"ext","table",5814,"IsValidDate",1],[2071,"event","OnPostItemJnlLineOnAfterSetPostingDate",0],[2097,"call","RoundAmt",2],[2099,"call","RoundAmt",2],[2107,"call","CopyJobToAdjustmentBuf",1],[2109,"event","OnPostItemJnlLineCopyFromValueEntry",0],[2110,"ext","codeunit",22,"RunWithCheck",1],[2111,"event","OnPostItemJnlLineOnAfterItemJnlPostLineRunWithCheck",0]]},{"name":"RoundCost","line":2114,"kind":"procedure","access":"local","params":5,"steps":[[2119,"call","RoundAmt",2]]},{"name":"GetOrigValueEntry","line":2130,"kind":"procedure","access":"local","params":3,"steps":[[2138,"ext","table",5802,"SetBaseLoadFields",0],[2148,"event","OnGetOrigValueEntryOnAfterOrigValueEntryFound",0],[2157,"call","GetOrigVarianceType",1]]},{"name":"SetAppliedEntryToAdjustFromBuf","line":2184,"kind":"procedure","access":"local","params":1,"steps":[[2198,"ext","table",32,"SetAppliedEntryToAdjust",1],[2205,"ext","table",32,"SetAppliedEntryToAdjust",1]]},{"name":"UpdateItemUnitCost","line":2214,"kind":"procedure","access":"local","params":2,"steps":[[2221,"event","OnBeforeUpdateItemUnitCost2",1],[2227,"event","OnUpdateItemUnitCostOnAfterItemGet",0],[2232,"call","IsAvgCostItem",0],[2235,"write",5804,"ModifyAll"],[2238,"call","IsAvgCostItem",0],[2239,"call","AppliedEntryToAdjustBufExists",1],[2240,"call","SetAppliedEntryToAdjustFromBuf",1],[2248,"ext","codeunit",5804,"UpdateUnitCost",9],[2252,"write",27,"Modify"],[2254,"event","OnUpdateItemUnitCostOnBeforeModifyItemNotStandardCostingMethod",0],[2255,"write",27,"Modify"],[2256,"event","OnUpdateItemUnitCostOnAfterModifyItemNotStandardCostingMethod",0],[2260,"write",5804,"DeleteAll"]]},{"name":"IsAvgCostItem","line":2269,"kind":"procedure","access":"local","params":0,"steps":[[2273,"event","OnAfterIsAvgCostItem",0]]},{"name":"OpenWindow","line":2281,"kind":"procedure","access":"local","params":0,"steps":[[2286,"event","OnBeforeOpenWindow",1]]},{"name":"UpDateWindow","line":2304,"kind":"procedure","access":"local","params":6,"steps":[[2320,"event","OnBeforeUpdateWindow",1],[2327,"call","IsTimeForUpdate",0],[2329,"call","OpenWindow",0],[2332,"event","OnUpdateWindowOnAfterOpenWindow",1]]},{"name":"CopyItemToItem","line":2354,"kind":"procedure","access":"local","params":2,"steps":[[2359,"event","OnBeforeCopyItemToItem",1],[2364,"write",27,"DeleteAll"],[2375,"write",27,"Insert"]]},{"name":"CopyAvgCostAdjmtToAvgCostAdjmt","line":2380,"kind":"procedure","access":"local","params":2,"steps":[[2383,"write",5804,"DeleteAll"],[2387,"write",5804,"Insert"],[2388,"event","OnCopyAvgCostAdjmtToAvgCostAdjmtOnAfterInsert",0]]},{"name":"CopyOrderAdmtEntryToOrderAdjmt","line":2392,"kind":"procedure","access":"local","params":2,"steps":[[2395,"write",5896,"DeleteAll"],[2399,"call","CanAdjustInventoryAdjmtEntryOrder",1],[2401,"write",5896,"Insert"]]},{"name":"AdjustNotInvdRevaluation","line":2429,"kind":"procedure","access":"local","params":2,"steps":[[2436,"ext","table",5802,"NotInvdRevaluationExists",1],[2437,"call","GetOrigPosItemLedgEntryNo",1],[2441,"call","CalcTransEntryNewRevAmt",3],[2442,"call","CalcTransEntryOldRevAmt",2],[2444,"call","UpdateAdjmtBuf",5]]},{"name":"CalcTransEntryNewRevAmt","line":2464,"kind":"procedure","access":"local","params":3,"steps":[[2480,"ext","table",5802,"EntryNoHasSameSign",1],[2481,"ext","table",5802,"EntryNoHasSameSign",1],[2489,"ext","table",5802,"AddCost",1]]},{"name":"CalcTransEntryOldRevAmt","line":2497,"kind":"procedure","access":"local","params":2,"steps":[[2508,"ext","table",5802,"AddCost",1]]},{"name":"OutboundSalesEntryToAdjust","line":2521,"kind":"procedure","access":"local","params":1,"steps":[[2526,"ext","table",32,"IsOutbndSale",0]]},{"name":"FillFixApplBuffer","line":2578,"kind":"procedure","access":"local","params":1,"steps":[[2584,"ext","table",339,"AppliedOutbndEntryExists",4]]},{"name":"RunUpdateJobItemCost","line":2593,"kind":"procedure","access":"local","params":0,"steps":[[2600,"event","OnBeforeRunUpdateJobItemCost",0],[2610,"ext","report",1095,"SetProperties",1]]},{"name":"FetchOpenOutboundItemEntriesToExclude","line":2615,"kind":"procedure","access":"local","params":4,"steps":[[2622,"call","OpenOutbndItemLedgEntriesExist",3],[2624,"call","CopyOpenItemLedgEntryToBuf",4],[2625,"call","GetChainOfAppliedEntries",3],[2627,"call","CopyOpenItemLedgEntryToBuf",4]]},{"name":"OpenOutbndItemLedgEntriesExist","line":2633,"kind":"procedure","access":"local","params":3,"steps":[[2640,"ext","table",5804,"IsAvgCostCalcTypeItem",1],[2644,"event","OnOpenOutbndItemLedgEntriesExistOnAfterSetOpenItemLedgEntryFilters",0],[2645,"ext","table",32,"SetBaseLoadFields",0]]},{"name":"ResetAvgBuffers","line":2649,"kind":"procedure","access":"local","params":2,"steps":[[2656,"ext","table",5820,"Initialize",1]]},{"name":"DeleteAvgBuffers","line":2659,"kind":"procedure","access":"local","params":2,"steps":[[2661,"call","ResetAvgBuffers",2],[2662,"ext","table",5820,"Initialize",1],[2663,"write",5802,"DeleteAll"],[2664,"write",5802,"DeleteAll"],[2665,"write",2000000026,"DeleteAll"],[2666,"write",2000000026,"DeleteAll"],[2667,"write",5802,"DeleteAll"]]},{"name":"InsertEntryPointToUpdate","line":2671,"kind":"procedure","access":"local","params":4,"steps":[[2677,"write",5804,"Insert"]]},{"name":"UpdateValuationPeriodHasOutput","line":2680,"kind":"procedure","access":"local","params":1,"steps":[[2690,"ext","table",5804,"ValuationExists",1],[2697,"ext","table",5804,"GetValuationPeriod",1]]},{"name":"CopyOpenItemLedgEntryToBuf","line":2712,"kind":"procedure","access":"local","params":4,"steps":[[2714,"call","CollectOpenValueEntries",3]]},{"name":"CollectOpenValueEntries","line":2719,"kind":"procedure","access":"local","params":3,"steps":[[2730,"write",5802,"Insert"]]},{"name":"IsOutputWithSelfConsumption","line":2769,"kind":"procedure","access":"local","params":3,"steps":[[2788,"ext","table",5804,"ValuationExists",1],[2792,"ext","table",5804,"GetValuationPeriod",1],[2805,"ext","table",5804,"IsAvgCostCalcTypeItem",1],[2809,"event","OnIsOutputWithSelfConsumptionOnAfterSetConsumpValueEntryFilters",0],[2813,"ext","table",32,"SetBaseLoadFields",0],[2815,"call","GetChainOfAppliedEntries",3],[2816,"event","OnIsOutputWithSelfConsumptionOnAfterGetItemApplicationTrace",0],[2820,"ext","table",5812,"AddChain",2]]},{"name":"RestoreValuesFromBuffers","line":2828,"kind":"procedure","access":"local","params":3,"steps":[[2836,"call","CopyValueEntryBufToCostElementBuf",2],[2840,"call","CopyValueEntryBufToCostElementBuf",2]]},{"name":"SaveValuesToBuffers","line":2846,"kind":"procedure","access":"local","params":3,"steps":[[2851,"call","CopyCostElementBufToValueEntryBuf",3],[2854,"call","CopyCostElementBufToValueEntryBuf",3]]},{"name":"CopyCostElementBufToValueEntryBuf","line":2858,"kind":"procedure","access":"local","params":3,"steps":[[2880,"event","OnCopyCostElementBufToValueEntryBufOnBeforeValueEntryBufInsert",0],[2881,"write",5802,"Insert"]]},{"name":"CopyValueEntryBufToCostElementBuf","line":2884,"kind":"procedure","access":"local","params":2,"steps":[[2898,"event","OnCopyValueEntryBufToCostElementBufOnBeforeCostElementBufferInsert",0],[2899,"write",5820,"Insert"]]},{"name":"ClearOutboundEntryCostBuffer","line":2902,"kind":"procedure","access":"local","params":1,"steps":[[2907,"ext","table",339,"AppliedOutbndEntryExists",4],[2912,"write",5802,"DeleteAll"]]},{"name":"GetChainOfAppliedEntries","line":2916,"kind":"procedure","access":"local","params":3,"steps":[[2924,"ext","table",339,"GetVisitedEntries",3],[2925,"ext","table",5812,"CreateChain",2]]},{"name":"IsAvgCostException","line":2932,"kind":"procedure","access":"local","params":2,"steps":[[2954,"call","GetChainOfAppliedEntries",3]]},{"name":"CollectItemLedgerEntryTypesUsed","line":2980,"kind":"procedure","access":"local","params":1,"steps":[[2984,"ext","table",32,"CollectItemLedgerEntryTypesUsed",2]]},{"name":"CheckAndCommit","line":3010,"kind":"procedure","access":"local","params":0,"steps":[[3018,"ext","codeunit",22,"ResetGLPostingState",0],[3019,"call","EmitCheckAndCommitTelemetry",0],[3024,"write",5812,"DeleteAll"]]},{"name":"EmitCheckAndCommitTelemetry","line":3027,"kind":"procedure","access":"local","params":0,"steps":[[3035,"ext","codeunit",8703,"LogUsage",4]]},{"name":"FindLastDate","line":3038,"kind":"procedure","access":"local","params":1,"steps":[[3044,"ext","codeunit",362,"EndOfPeriod",0]]},{"name":"SetDateFilterUntilLastDate","line":3052,"kind":"procedure","access":"local","params":1,"steps":[[3058,"ext","codeunit",362,"EndOfPeriod",0]]},{"name":"CallInitializeAdjmt","line":3091,"kind":"procedure","params":0,"steps":[[3093,"call","InitializeAdjmt",0]]},{"name":"CallFinalizeAdjmt","line":3096,"kind":"procedure","params":0,"steps":[[3098,"call","FinalizeAdjmt",0]]},{"name":"CallInvtToAdjustExist","line":3101,"kind":"procedure","params":1,"steps":[[3103,"call","InvtToAdjustExist",1]]},{"name":"CallMakeSingleLevelAdjmt","line":3106,"kind":"procedure","params":2,"steps":[[3108,"call","MakeSingleLevelAdjmt",2]]},{"name":"CallWIPToAdjustExist","line":3111,"kind":"procedure","params":1,"steps":[[3113,"call","WIPToAdjustExist",1]]},{"name":"CallMakeWIPAdjmt","line":3116,"kind":"procedure","params":2,"steps":[[3118,"call","MakeWIPAdjmt",2]]},{"name":"CallAssemblyToAdjustExists","line":3121,"kind":"procedure","params":1,"steps":[[3123,"call","AssemblyToAdjustExists",1]]},{"name":"CallMakeAssemblyAdjmt","line":3126,"kind":"procedure","params":2,"steps":[[3128,"call","MakeAssemblyAdjmt",2]]},{"name":"CallUpdateAdjmtBuf","line":3131,"kind":"procedure","params":5,"steps":[[3133,"call","UpdateAdjmtBuf",5]]},{"name":"CallPostAdjmtBuf","line":3136,"kind":"procedure","params":1,"steps":[[3138,"call","PostAdjmtBuf",1]]},{"name":"CallPostOutputAdjmtBuf","line":3141,"kind":"procedure","params":1,"steps":[[3143,"call","PostOutputAdjmtBuf",1]]},{"name":"CallSetAppliedEntryToAdjustFromBuf","line":3146,"kind":"procedure","params":1,"steps":[[3148,"call","SetAppliedEntryToAdjustFromBuf",1]]},{"name":"CallAppliedEntryToAdjustBufExists","line":3151,"kind":"procedure","params":1,"steps":[[3153,"call","AppliedEntryToAdjustBufExists",1]]},{"name":"CallUpdateJobItemCost","line":3156,"kind":"procedure","params":0,"steps":[[3158,"call","RunUpdateJobItemCost",0]]}]}