---
id: object/codeunit/7010
type: object
title: Codeunit 7010 "Purch. Price Calc. Mgt."
summary: Codeunit 7010 "Purch. Price Calc. Mgt." in Base Application (Microsoft.Purchases.Pricing). 29 public procedures, 56 events. Present since at least BC23, still in BC30, changed in BC24-26, BC28.
tier: official
language: en
tags:
  - codeunit
  - base application
versions:
  introduced: null
  last_changed: "28"
  deprecated: null
review:
  state: derived
  by: null
  at: null
  flags: []
generated:
  at: "2026-10-11T00:31:51.816Z"
  pipeline: 0.2.0
  prompts: {}
  input_hash: a4f011bdf4cb0a393535041b7127ed4faab806aa19cad4c55b260f0641d04bd1
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Purchases/Pricing/PurchPriceCalcMgt.Codeunit.al
    title: src/Layers/W1/BaseApp/Purchases/Pricing/PurchPriceCalcMgt.Codeunit.al (releases/29.x)
    date: null
    commit: ea08af5ef2d6a9b5c5af4a029288abbe2c883220
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes:
    - change/bcapps/9448
object_type: codeunit
object_id: 7010
name: Purch. Price Calc. Mgt.
namespace: Microsoft.Purchases.Pricing
app: Base Application
extends: null
first_version: "23"
last_version: "30"
present_in:
  - "23"
  - "24"
  - "25"
  - "26"
  - "27"
  - "28"
  - "29"
  - "30"
changed_in:
  - "24"
  - "25"
  - "26"
  - "28"
source_major: "29"
obsolete: null
countries: []
ms_search_form_ids: []
counts:
  fields: 0
  procedures: 91
  events: 56
  subscribers: 0
relations:
  out: 0
  referenced_by: 0
  pages: 0
  extended_by: 0
  event_subscribers: 0
  calls: 3
  called_by: 1
  implements: 0
---

# Codeunit 7010 "Purch. Price Calc. Mgt."

> Codeunit 7010 "Purch. Price Calc. Mgt." in Base Application (Microsoft.Purchases.Pricing). 29 public procedures, 56 events. Present since at least BC23, still in BC30, changed in BC24-26, BC28.

Base Application · Microsoft.Purchases.Pricing · BC23-30 · [source at ea08af5e](https://github.com/microsoft/BCApps/blob/ea08af5ef2d6a9b5c5af4a029288abbe2c883220/src/Layers/W1/BaseApp/Purchases/Pricing/PurchPriceCalcMgt.Codeunit.al) · facts from BC29

## Events published

- `OnAfterCalcBestDirectUnitCostFound(var PurchPrice: Record "Purchase Price"; var BestPurchPriceFound: Boolean; var IsHandled: Boolean)` (integration)
- `OnAfterCalcBestLineDisc(var PurchaLineDisc: Record "Purchase Line Discount"; var BestPurchLineDisc: Record "Purchase Line Discount")` (integration)
- `OnAfterFindJobJnlLinePrice(var JobJournalLine: Record "Job Journal Line"; var IsHandled: Boolean)` (integration)
- `OnAfterFindJobPlanningLinePrice(var JobPlanningLine: Record "Job Planning Line"; var ResourceCost: Record "Resource Cost")` (integration)
- `OnAfterFindJobJnlLinePriceItem(var JobJournalLine: Record "Job Journal Line")` (integration)
- `OnAfterFindJobJnlLinePriceResource(var JobJournalLine: Record "Job Journal Line"; var ResourceCost: Record "Resource Cost")` (integration)
- `OnAfterFindPurchPrice(var ToPurchPrice: Record "Purchase Price"; FromPurchasePrice: Record "Purchase Price"; VendorNo: Code[20]; ItemNo: Code[20]; VariantCode: Code[10]; UOM: Code[10]; CurrencyCode: Code[10]; StartingDate: Date; ShowAll: Boolean; Qty: Decimal; QtyPerUOM: Decimal)` (integration)
- `OnAfterFindPurchLinePrice(var PurchaseLine: Record "Purchase Line"; var PurchaseHeader: Record "Purchase Header"; var PurchasePrice: Record "Purchase Price"; CalledByFieldNo: Integer; PriceInSKU: Boolean; FoundPurchPrice: Boolean)` (integration)
- `OnAfterFindPurchLineDisc(var ToPurchaseLineDiscount: Record "Purchase Line Discount"; var FromPurchaseLineDiscount: Record "Purchase Line Discount"; ItemNo: Code[20]; QuantityPerUoM: Decimal; Quantity: Decimal; ShowAll: Boolean)` (integration)
- `OnAfterFindPurchLineLineDisc(var PurchaseLine: Record "Purchase Line"; var PurchaseHeader: Record "Purchase Header"; var TempPurchLineDisc: Record "Purchase Line Discount" temporary)` (integration)
- `OnAfterFindReqLinePrice(var ReqLine: Record "Requisition Line"; var TempPurchasePrice: Record "Purchase Price" temporary; CalledByFieldNo: Integer)` (integration)
- `OnAfterFindReqLineDisc(var ReqLine: Record "Requisition Line")` (integration)
- `OnAfterGetPurchLinePrice(var PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; var TempPurchasePrice: Record "Purchase Price" temporary; QtyPerUOM: Decimal)` (integration)
- `OnAfterGetPurchLineLineDisc(var PurchaseLine: Record "Purchase Line"; var TempPurchLineDisc: Record "Purchase Line Discount")` (integration)
- `OnAfterJobJnlLineFindResCost(var JobJournalLine: Record "Job Journal Line"; CalledByFieldNo: Integer; var ResourceCost: Record "Resource Cost")` (integration)
- `OnAfterJobPlanningLineFindResCost(var JobPlanningLine: Record "Job Planning Line"; CalledByFieldNo: Integer; var ResourceCost: Record "Resource Cost")` (integration)
- `OnAfterPurchLineLineDiscExists(var PurchaseLine: Record "Purchase Line")` (integration)
- `OnAfterPurchLinePriceExists(var PurchaseLine: Record "Purchase Line")` (integration)
- `OnAfterSetCurrency(var CurrencyFactor: Decimal; var ExchRateDate: Date; var PricesInCurrency: Boolean; var PricesInclVAT: Boolean; var VATPerCent: Decimal; var VATBusPostingGr: Code[20]; var DateCaption: Text[30]; var PriceInSKU: Boolean; var FoundPurchPrice: Boolean)` (integration)
- `OnBeforeCalcBestDirectUnitCost(var PurchPrice: Record "Purchase Price"; var BestPurchPrice: Record "Purchase Price"; var BestPurchPriceFound: Boolean; var IsHandled: Boolean; var StockkeepingUnit: Record "Stockkeeping Unit"; var Item: Record Item)` (integration)
- `OnBeforeCalcBestLineDisc(var PurchLineDisc: Record "Purchase Line Discount"; Item: Record Item; var IsHandled: Boolean; QtyPerUOM: Decimal; Qty: Decimal)` (integration)
- `OnBeforeCalcLineAmount(var PurchasePrice: Record "Purchase Price"; LineDiscPerCent: Decimal; var Result: Decimal; var IsHandled: Boolean)` (integration)
- `OnBeforeConvertPriceToVAT(var VATPostingSetup: Record "VAT Posting Setup"; VATBusPostingGr: Code[20]; FromVATBusPostingGr: Code[20]; UnitPrice: Decimal; PricesInclVAT: Boolean; var IsHandled: Boolean)` (integration)
- `OnBeforeFindItemJnlLinePrice(var ItemJournalLine: Record "Item Journal Line"; CalledByFieldNo: Integer; var IsHandled: Boolean)` (integration)
- `OnBeforeFindJobJnlLinePrice(var JobJnlLine: Record "Job Journal Line"; CalledByFieldNo: Integer; var IsHandled: Boolean)` (integration)
- `OnBeforeFindJobPlanningLinePrice(var JobPlanningLine: Record "Job Planning Line"; CalledByFieldNo: Integer; var IsHandled: Boolean)` (integration)
- `OnBeforeFindPurchLinePrice(var PurchaseLine: Record "Purchase Line"; var PurchaseHeader: Record "Purchase Header"; CalledByFieldNo: Integer; var IsHandled: Boolean)` (integration)
- `OnBeforeFindPurchLineDsic(var ToPurchLineDisc: Record "Purchase Line Discount"; var VendorNo: Code[20]; var ItemNo: Code[20]; var VariantCode: Code[10]; var UOM: Code[10]; var CurrencyCode: Code[10]; var StartingDate: Date; var ShowAll: Boolean; var QuantityPerUoM: Decimal; var Quantity: Decimal)` (integration)
- `OnBeforeFindPurchPrice(var ToPurchPrice: Record "Purchase Price"; var FromPurchasePrice: Record "Purchase Price"; var VendorNo: Code[20]; var ItemNo: Code[20]; var VariantCode: Code[10]; var UOM: Code[10]; var CurrencyCode: Code[10]; var StartingDate: Date; var ShowAll: Boolean; var Qty: Decimal; var QtyPerUOM: Decimal)` (integration)
- `OnBeforeFindReqLinePrice(var TempPurchasePrice: Record "Purchase Price" temporary; var ReqLine: Record "Requisition Line"; var IsHandled: Boolean)` (integration)
- `OnBeforeFindReqLinePriceOnBeforeWith(var RequisitionLine: Record "Requisition Line"; CalledByFieldNo: Integer; var IsHandled: Boolean)` (integration)
- `OnBeforeFindReqLineDisc(var ReqLine: Record "Requisition Line"; var TempPurchaseLineDiscount: Record "Purchase Line Discount" temporary; var IsHandled: Boolean)` (integration)
- `OnBeforeFindReqLineDiscOnBeforeWith(var RequisitionLine: Record "Requisition Line"; var IsHandled: Boolean)` (integration)
- `OnBeforeFindStdItemJnlLinePrice(var StandardItemJnlLine: Record "Standard Item Journal Line"; CalledByFieldNo: Integer; var IsHandled: Boolean)` (integration)
- `OnBeforeGetPurchLineDisc(var PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)` (integration)
- `OnBeforeGetPurchLinePrice(var PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)` (integration)
- `OnBeforeIsInMinQty(var Item: Record Item; UnitofMeasureCode: Code[10]; MinQty: Decimal; var Result: Boolean; var IsHandled: Boolean)` (integration)
- `OnBeforeNoOfPurchLineLineDisc(var PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; ShowAll: Boolean; var ReturnValue: Integer; var IsHandled: Boolean)` (integration)
- `OnBeforeNoOfPurchLinePrice(var PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; ShowAll: Boolean; var ReturnValue: Integer; var IsHandled: Boolean)` (integration)
- `OnBeforePurchLinePriceExists(var PurchaseLine: Record "Purchase Line"; var PurchaseHeader: Record "Purchase Header"; var TempPurchasePrice: Record "Purchase Price" temporary; ShowAll: Boolean; var IsHandled: Boolean; var DateCaption: Text[30])` (integration)
- `OnBeforePurchLineLineDiscExists(var PurchaseLine: Record "Purchase Line"; var PurchaseHeader: Record "Purchase Header"; var TempPurchLineDisc: Record "Purchase Line Discount" temporary; ShowAll: Boolean; var IsHandled: Boolean; var DateCaption: Text[30])` (integration)
- `OnBeforePurchHeaderStartDate(var PurchaseHeader: Record "Purchase Header"; var DateCaption: Text[30]; var StartDate: Date; var IsHandled: Boolean)` (integration)
- `OnBeforeFindPurchLineLineDisc(var PurchaseLine: Record "Purchase Line"; var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)` (integration)
- `OnCalcBestDirectUnitCostOnAfterSetUnitCost(var PurchasePrice: Record "Purchase Price")` (integration)
- `OnCalcBestDirectUnitCostOnBeforeConvertPriceToVAT(var PurchasePrice: Record "Purchase Price")` (integration)
- `OnCalcBestDirectUnitCostOnBeforeNoPriceFound(var PurchasePrice: Record "Purchase Price"; Item: Record Item; var IsHandled: Boolean; var PriceInSKU: Boolean; var StockkeepingUnit: Record "Stockkeeping Unit")` (integration)
- `OnCalcBestDirectUnitCostOnAfterIsInMinQty(var PurchasePrice: Record "Purchase Price"; QuantityPerUnitOfMeasure: Decimal; Quantity: Decimal; var InMinQty: Boolean)` (integration)
- `OnCalcBestDirectUnitCostOnBeforeCaseStatement(var PurchasePrice: Record "Purchase Price"; var BestPurchasePrice: Record "Purchase Price"; var BestPurchPriceFound: Boolean; var IsHandled: Boolean; LineDiscPerCent: Decimal)` (integration)
- `OnFindJobPlanningLinePriceOnBeforeResourceFindCost(JobPlanningLine: Record "Job Planning Line"; var ResCost: Record "Resource Cost")` (integration)
- `OnFindJobJnlLinePriceOnBeforeResourceFindCost(JobJournalLine: Record "Job Journal Line"; var ResCost: Record "Resource Cost")` (integration)
- `OnGetPurchLinePriceOnAfterLookup(PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; var TempPurchasePrice: Record "Purchase Price" temporary)` (integration)
- `OnGetPurchLineLineDiscOnAfterLookup(PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; var TempPurchaseLineDiscount: Record "Purchase Line Discount" temporary)` (integration)
- `OnFindItemJnlLinePriceOnBeforeCalcBestDirectUnitCost(var ItemJournalLine: Record "Item Journal Line"; var TempPurchasePrice: Record "Purchase Price" temporary)` (integration)
- `OnFindPurchLineDiscOnAfterSetFilters(var FromPurchLineDisc: Record "Purchase Line Discount")` (integration)
- `OnFindPurchLinePriceOnBeforeRunResourceFindCost(var ResCost: record "Resource cost")` (integration)
- `OnFindJobJnlLinePriceOnBeforeCalcBestDirectUnitCost(var JobJournalLine: Record "Job Journal Line"; var TempPurchasePrice: Record "Purchase Price" temporary)` (integration)

## Procedures

- `FindPurchLinePrice(var PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; CalledByFieldNo: Integer)`
- `FindItemJnlLinePrice(var ItemJnlLine: Record "Item Journal Line"; CalledByFieldNo: Integer)`
- `FindReqLinePrice(var ReqLine: Record "Requisition Line"; CalledByFieldNo: Integer)`
- `FindInvtDocLinePrice(var InvtDocLine: Record "Invt. Document Line"; CalledByFieldNo: Integer)`
- `FindPurchLineLineDisc(var PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line")`
- `FindStdItemJnlLinePrice(var StdItemJnlLine: Record "Standard Item Journal Line"; CalledByFieldNo: Integer)`
- `FindReqLineDisc(var ReqLine: Record "Requisition Line")`
- `CalcBestDirectUnitCost(var PurchPrice: Record "Purchase Price")`
- `CalcBestLineDisc(var PurchLineDisc: Record "Purchase Line Discount")`
- `FindPurchPrice(var ToPurchPrice: Record "Purchase Price"; VendorNo: Code[20]; ItemNo: Code[20]; VariantCode: Code[10]; UOM: Code[10]; CurrencyCode: Code[10]; StartingDate: Date; ShowAll: Boolean)`
- `FindPurchLineDisc(var ToPurchLineDisc: Record "Purchase Line Discount"; VendorNo: Code[20]; ItemNo: Code[20]; VariantCode: Code[10]; UOM: Code[10]; CurrencyCode: Code[10]; StartingDate: Date; ShowAll: Boolean; QuantityPerUoM: Decimal; Quantity: Decimal)`
- `SetCurrency(CurrencyCode2: Code[10]; CurrencyFactor2: Decimal; ExchRateDate2: Date)`
- `SetVAT(PriceInclVAT2: Boolean; VATPerCent2: Decimal; VATBusPostingGr2: Code[20])`
- `SetUoM(Qty2: Decimal; QtyPerUoM2: Decimal)`
- `SetLineDisc(LineDiscPerCent2: Decimal)`
- `ConvertPriceLCYToFCY(CurrencyCode: Code[10]; var UnitPrice: Decimal)`
- `PurchLinePriceExists(var PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; ShowAll: Boolean): Boolean`
- `PurchLineLineDiscExists(var PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; ShowAll: Boolean): Boolean`
- `FindJobPlanningLinePrice(var JobPlanningLine: Record "Job Planning Line"; CalledByFieldNo: Integer)`
- `FindJobJnlLinePrice(var JobJnlLine: Record "Job Journal Line"; CalledByFieldNo: Integer)`
- `NoOfPurchLinePrice(var PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; ShowAll: Boolean): Integer`
- `NoOfPurchLineLineDisc(var PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; ShowAll: Boolean): Integer`
- `GetPurchLinePrice(var PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line")`
- `GetPurchLineLineDisc(var PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line")`
- `SetItem(ItemNo: Code[20])`
- `SetVendor(VendorNo: Code[20])`
- `FindResUnitCost(var ResJournalLine: Record "Res. Journal Line")`
- `FindResUnitCost(var SalesLine: Record "Sales Line")`
- `FindResUnitCost(var ServiceLine: Record Microsoft.Service.Document."Service Line")` (obsolete 28.0: Moved to codeunit ServPriceCalcMgt)

Plus 6 local procedures.

## Triggers

OnRun

## Calls

From the extracted call graph of BC29 (graphify-al on the snapshot checkout): calls whose target is known from a declared type or an `Object::"Name"` argument. Interface dispatch and calls through events are not counted, so the list is not complete.

- [Codeunit 220 "Resource-Find Cost"](../codeunit/220.md) (4 calls: `FindJobJnlLinePrice → (object)`, `FindJobPlanningLinePrice → (object)`, `FindPurchLinePrice → (object)`, …)
- [Page 7189 "Get Purchase Line Disc."](../page/7189.md) (1 call: `GetPurchLineLineDisc → (object)`)
- [Page 7190 "Get Purchase Price"](../page/7190.md) (1 call: `GetPurchLinePrice → (object)`)

## Called by

- [Codeunit 7003 "Price Calculation - V15"](../codeunit/7003.md) (15 calls: `ApplyDiscountPurchHandler → FindPurchLineLineDisc`, `ApplyDiscountPurchHandler → FindReqLineDisc`, `ApplyPricePurchHandler → FindItemJnlLinePrice`, …)

## Recent changes

- 2026-07-30 [#9448 [Extensibility Request] issue 30264: add and extend events in CalcBestDirectUnitCost](../../changes/bcapps/9448.md) (main, BC30, feature)

## Across versions

- Present in: BC23-30
- Changed (declaration) in: BC24-26, BC28

## Deprecations

- procedure FindResUnitCost: Pending 28.0 (#if not CLEAN28), "Moved to codeunit ServPriceCalcMgt"

Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).

## Ask your agent

Procedure bodies are not stored here (D10). The call sections above are our own, per object, from the BC29 call graph. For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: `bcatlas_resolve_node(object_type: "codeunit", object_name: "Purch. Price Calc. Mgt.")`, then `bcatlas_get_procedure_body` or `bcatlas_get_neighbors` on the returned id.
