{"title":"Codeunit 7010 Purch. Price Calc. Mgt., extension points 29","url":"https://jonas-paprotka.de/ref/codeunit/7010-purch-price-calc-mgt/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-10-05","object":{"type":"codeunit","id":7010,"name":"Purch. Price Calc. Mgt.","app":"Base Application","url":"https://jonas-paprotka.de/ref/codeunit/7010-purch-price-calc-mgt/"},"major":29,"source":{"url":"https://jonas-paprotka.de/ref/codeunit/7010-purch-price-calc-mgt/source/","path":"src/Layers/W1/BaseApp/Purchases/Pricing/PurchPriceCalcMgt.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":{"table:39":{"name":"Purchase Line","url":"https://jonas-paprotka.de/ref/table/39-purchase-line/"},"codeunit:220":{"name":"Resource-Find Cost","url":"https://jonas-paprotka.de/ref/codeunit/220-resource-find-cost/"},"table:7012":{"name":"Purchase Price","url":"https://jonas-paprotka.de/ref/table/7012-purchase-price/"},"table:7014":{"name":"Purchase Line Discount","url":"https://jonas-paprotka.de/ref/table/7014-purchase-line-discount/"},"table:330":{"name":"Currency Exchange Rate","url":"https://jonas-paprotka.de/ref/table/330-currency-exchange-rate/"},"table:1003":{"name":"Job Planning Line","url":"https://jonas-paprotka.de/ref/table/1003-job-planning-line/"},"table:210":{"name":"Job Journal Line","url":"https://jonas-paprotka.de/ref/table/210-job-journal-line/"},"page:7190":{"name":"Get Purchase Price","url":"https://jonas-paprotka.de/ref/page/7190-get-purchase-price/"},"page:7189":{"name":"Get Purchase Line Disc.","url":"https://jonas-paprotka.de/ref/page/7189-get-purchase-line-disc/"},"table:207":{"name":"Res. Journal Line","url":"https://jonas-paprotka.de/ref/table/207-res-journal-line/"},"table:37":{"name":"Sales Line","url":"https://jonas-paprotka.de/ref/table/37-sales-line/"}},"procs":[{"name":"FindPurchLinePrice","line":59,"kind":"procedure","params":3,"steps":[[64,"event","OnBeforeFindPurchLinePrice",1],[68,"call","SetCurrency",3],[68,"call","PurchHeaderExchDate",1],[69,"call","SetVAT",3],[69,"ext","table",39,"GetVATPct",0],[70,"call","SetUoM",2],[71,"call","SetLineDisc",1],[85,"call","PurchLinePriceExists",3],[86,"call","CalcBestDirectUnitCost",1],[100,"event","OnFindPurchLinePriceOnBeforeRunResourceFindCost",0],[101,"run","codeunit",220],[102,"call","ConvertPriceLCYToFCY",2],[107,"event","OnAfterFindPurchLinePrice",0]]},{"name":"FindItemJnlLinePrice","line":110,"kind":"procedure","params":2,"steps":[[115,"event","OnBeforeFindItemJnlLinePrice",1],[120,"call","SetCurrency",3],[121,"call","SetVAT",3],[122,"call","SetUoM",2],[127,"call","FindPurchPrice",8],[131,"event","OnFindItemJnlLinePriceOnBeforeCalcBestDirectUnitCost",0],[132,"call","CalcBestDirectUnitCost",1]]},{"name":"FindReqLinePrice","line":141,"kind":"procedure","params":2,"steps":[[147,"event","OnBeforeFindReqLinePriceOnBeforeWith",1],[163,"call","SetCurrency",3],[164,"call","SetVAT",3],[165,"call","SetUoM",2],[175,"event","OnBeforeFindReqLinePrice",1],[177,"call","FindPurchPrice",8],[180,"call","CalcBestDirectUnitCost",1],[189,"event","OnAfterFindReqLinePrice",0]]},{"name":"FindInvtDocLinePrice","line":192,"kind":"procedure","params":2,"steps":[[195,"call","SetCurrency",3],[196,"call","SetVAT",3],[197,"call","SetUoM",2],[202,"call","FindPurchPrice",8],[205,"call","CalcBestDirectUnitCost",1]]},{"name":"FindPurchLineLineDisc","line":214,"kind":"procedure","params":2,"steps":[[219,"event","OnBeforeFindPurchLineLineDisc",1],[223,"call","SetCurrency",3],[224,"call","SetUoM",2],[229,"call","PurchLineLineDiscExists",3],[230,"call","CalcBestLineDisc",1],[235,"event","OnAfterFindPurchLineLineDisc",0]]},{"name":"FindStdItemJnlLinePrice","line":238,"kind":"procedure","params":2,"steps":[[243,"event","OnBeforeFindStdItemJnlLinePrice",1],[248,"call","SetCurrency",3],[249,"call","SetVAT",3],[250,"call","SetUoM",2],[255,"call","FindPurchPrice",8],[258,"call","CalcBestDirectUnitCost",1]]},{"name":"FindReqLineDisc","line":267,"kind":"procedure","params":1,"steps":[[272,"event","OnBeforeFindReqLineDiscOnBeforeWith",1],[276,"call","SetCurrency",3],[277,"call","SetUoM",2],[283,"event","OnBeforeFindReqLineDisc",1],[285,"call","FindPurchLineDisc",10],[289,"event","OnAfterFindReqLineDisc",0],[290,"call","CalcBestLineDisc",1]]},{"name":"CalcBestDirectUnitCost","line":296,"kind":"procedure","params":1,"steps":[[304,"event","OnBeforeCalcBestDirectUnitCost",1],[311,"call","IsInMinQty",2],[312,"event","OnCalcBestDirectUnitCostOnAfterIsInMinQty",0],[314,"event","OnCalcBestDirectUnitCostOnBeforeConvertPriceToVAT",0],[315,"call","ConvertPriceToVAT",4],[318,"call","ConvertPriceToUoM",2],[319,"call","ConvertPriceLCYToFCY",2],[322,"event","OnCalcBestDirectUnitCostOnBeforeCaseStatement",1],[334,"call","CalcLineAmount",1],[334,"call","CalcLineAmount",1],[343,"event","OnAfterCalcBestDirectUnitCostFound",1],[350,"event","OnCalcBestDirectUnitCostOnBeforeNoPriceFound",1],[358,"call","ConvertPriceToVAT",4],[359,"call","ConvertPriceToUoM",2],[360,"call","ConvertPriceLCYToFCY",2],[361,"event","OnCalcBestDirectUnitCostOnAfterSetUnitCost",0]]},{"name":"CalcBestLineDisc","line":367,"kind":"procedure","params":1,"steps":[[373,"event","OnBeforeCalcBestLineDisc",1],[379,"call","IsInMinQty",2],[391,"event","OnAfterCalcBestLineDisc",0]]},{"name":"FindPurchPrice","line":395,"kind":"procedure","params":8,"steps":[[399,"event","OnBeforeFindPurchPrice",0],[413,"write",7012,"DeleteAll"],[417,"write",7012,"Insert"],[420,"event","OnAfterFindPurchPrice",0]]},{"name":"FindPurchLineDisc","line":424,"kind":"procedure","params":10,"steps":[[428,"event","OnBeforeFindPurchLineDsic",0],[433,"event","OnFindPurchLineDiscOnAfterSetFilters",0],[441,"write",7014,"DeleteAll"],[446,"write",7014,"Insert"],[449,"event","OnAfterFindPurchLineDisc",0]]},{"name":"SetCurrency","line":452,"kind":"procedure","params":3,"steps":[[462,"event","OnAfterSetCurrency",0]]},{"name":"IsInMinQty","line":483,"kind":"procedure","access":"local","params":2,"steps":[[488,"event","OnBeforeIsInMinQty",1]]},{"name":"ConvertPriceToVAT","line":497,"kind":"procedure","access":"local","params":4,"steps":[[507,"event","OnBeforeConvertPriceToVAT",1]]},{"name":"ConvertPriceLCYToFCY","line":527,"kind":"procedure","params":2,"steps":[[534,"ext","table",330,"ExchangeAmtLCYToFCY",4]]},{"name":"CalcLineAmount","line":540,"kind":"procedure","access":"local","params":1,"steps":[[545,"event","OnBeforeCalcLineAmount",1]]},{"name":"PurchLinePriceExists","line":553,"kind":"procedure","params":3,"steps":[[559,"event","OnBeforePurchLinePriceExists",1],[561,"call","FindPurchPrice",8],[563,"call","PurchHeaderStartDate",2],[564,"event","OnAfterPurchLinePriceExists",0]]},{"name":"PurchLineLineDiscExists","line":571,"kind":"procedure","params":3,"steps":[[577,"event","OnBeforePurchLineLineDiscExists",1],[579,"call","FindPurchLineDisc",10],[581,"call","PurchHeaderStartDate",2],[583,"event","OnAfterPurchLineLineDiscExists",0]]},{"name":"PurchHeaderStartDate","line":596,"kind":"procedure","access":"local","params":2,"steps":[[601,"event","OnBeforePurchHeaderStartDate",1]]},{"name":"FindJobPlanningLinePrice","line":614,"kind":"procedure","params":2,"steps":[[620,"event","OnBeforeFindJobPlanningLinePrice",1],[622,"call","SetCurrency",3],[623,"call","SetVAT",3],[624,"call","SetUoM",2],[635,"call","FindPurchPrice",8],[639,"call","CalcBestDirectUnitCost",1],[640,"call","SetCurrency",3],[653,"event","OnFindJobPlanningLinePriceOnBeforeResourceFindCost",0],[654,"run","codeunit",220],[655,"ext","table",1003,"AfterResourceFindCost",1],[656,"event","OnAfterJobPlanningLineFindResCost",0],[657,"call","ConvertPriceLCYToFCY",2],[660,"validate",1003,"Unit Cost (LCY)"],[664,"validate",1003,"Direct Unit Cost (LCY)"],[666,"event","OnAfterFindJobPlanningLinePrice",0]]},{"name":"FindJobJnlLinePrice","line":669,"kind":"procedure","params":2,"steps":[[675,"event","OnBeforeFindJobJnlLinePrice",1],[679,"call","SetCurrency",3],[680,"call","SetVAT",3],[681,"call","SetUoM",2],[692,"call","FindPurchPrice",8],[697,"event","OnFindJobJnlLinePriceOnBeforeCalcBestDirectUnitCost",0],[698,"call","CalcBestDirectUnitCost",1],[699,"call","SetCurrency",3],[706,"event","OnAfterFindJobJnlLinePriceItem",0],[713,"event","OnFindJobJnlLinePriceOnBeforeResourceFindCost",0],[714,"run","codeunit",220],[715,"ext","table",210,"AfterResourceFindCost",1],[716,"event","OnAfterJobJnlLineFindResCost",0],[717,"call","ConvertPriceLCYToFCY",2],[720,"validate",210,"Unit Cost (LCY)"],[722,"event","OnAfterFindJobJnlLinePriceResource",0],[725,"event","OnAfterFindJobJnlLinePrice",1],[727,"validate",210,"Direct Unit Cost (LCY)"]]},{"name":"NoOfPurchLinePrice","line":730,"kind":"procedure","params":3,"steps":[[735,"event","OnBeforeNoOfPurchLinePrice",1],[739,"call","PurchLinePriceExists",3]]},{"name":"NoOfPurchLineLineDisc","line":743,"kind":"procedure","params":3,"steps":[[748,"event","OnBeforeNoOfPurchLineLineDisc",1],[752,"call","PurchLineLineDiscExists",3]]},{"name":"GetPurchLinePrice","line":756,"kind":"procedure","params":2,"steps":[[761,"event","OnBeforeGetPurchLinePrice",1],[765,"call","PurchLinePriceExists",3],[767,"run","page",7190],[768,"call","SetVAT",3],[769,"call","SetUoM",2],[770,"call","SetCurrency",3],[770,"call","PurchHeaderExchDate",1],[771,"event","OnGetPurchLinePriceOnAfterLookup",0],[773,"call","IsInMinQty",2],[791,"call","PurchHeaderStartDate",2],[798,"call","ConvertPriceToVAT",4],[801,"call","ConvertPriceToUoM",2],[802,"call","ConvertPriceLCYToFCY",2],[804,"validate",39,"Direct Unit Cost"],[807,"event","OnAfterGetPurchLinePrice",0]]},{"name":"GetPurchLineLineDisc","line":810,"kind":"procedure","params":2,"steps":[[815,"event","OnBeforeGetPurchLineDisc",1],[819,"call","PurchLineLineDiscExists",3],[821,"run","page",7189],[822,"call","SetCurrency",3],[823,"call","SetUoM",2],[824,"event","OnGetPurchLineLineDiscOnAfterLookup",0],[826,"call","IsInMinQty",2],[843,"call","PurchHeaderStartDate",2],[850,"validate",39,"Line Discount %"],[853,"event","OnAfterGetPurchLineLineDisc",0]]},{"name":"FindResUnitCost","line":866,"kind":"procedure","params":1,"steps":[[872,"ext","table",207,"AfterInitResourceCost",1],[873,"run","codeunit",220],[874,"ext","table",207,"AfterFindResUnitCost",1],[879,"validate",207,"Unit Cost"]]},{"name":"FindResUnitCost","line":882,"kind":"procedure","params":1,"steps":[[885,"ext","table",37,"FindResUnitCostOnAfterInitResCost",1],[888,"run","codeunit",220],[889,"ext","table",37,"AfterFindResUnitCost",1],[890,"validate",37,"Unit Cost (LCY)"]]}]}