codeunitPurchasing & Payablesofficial - Microsoftderived - from the source, no model text

Codeunit 70 "Purch.-Calc.Discount"

Base Application · Microsoft.Purchases.Document

Across versions

  1. BC23-30present

Neighbourhood 18 connected objects and pages

Table 39 "Purchase Line" (relates to)Purchase LineCodeunit 5497 "Graph Mgt - Purch Order Buffer" (event subscribers)Graph Mgt - Purch Order BufferCodeunit 5511 "Graph Mgt - Purch. Cr. Memo" (event subscribers)Graph Mgt - Purch. Cr. MemoCodeunit 5529 "Purch. Inv. Aggregator" (event subscribers)Purch. Inv. AggregatorCodeunit 66 "Purch - Calc Disc. By Type" (calls, 2 links)Purch - Calc Disc. By TypeCodeunit 1372 "Purchase Batch Post Mgt." (calls)Purchase Batch Post Mgt.Codeunit 228 "Test Report-Print" (calls)Test Report-PrintCodeunit 229 "Document-Print" (calls)Codeunit 415 "Release Purchase Document" (calls)Release Purchase DocumentCodeunit 57 "Document Totals" (calls)Document TotalsCodeunit 65 "Discount Notification Mgt." (calls)Discount Notification Mgt.Codeunit 71 "Purch.-Disc. (Yes/No)" (calls)Purch.-Disc. (Yes/No)Codeunit 74 "Purch.-Get Receipt" (calls)Codeunit 90 "Purch.-Post" (calls)Purch.-PostCodeunit 99000813 "Carry Out Action" (calls)Carry Out ActionPage 98 "Purch. Cr. Memo Subform" (calls)Purch. Cr. Memo SubformTable 38 "Purchase Header" (calls)https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/devenv-test-application-example-purchase-invoice-discounts (Learn pages)

Open in the neighbourhood explorer

One hop out, from the extracted relations and call graph. Up to 40 shown; the sections below list them all.

Base Application · Microsoft.Purchases.Document · BC23-30 · source at 4e6a307c · facts from BC29

Properties

Property Value
TableNo Purchase Line
Permissions tabledata “Purchase Header” = rm, tabledata “Purchase Line” = rm

Events published

  • OnBeforeCalcPurchaseDiscount(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean; var PurchaseLine: Record "Purchase Line"; UpdateHeader: Boolean; var GlobalPurchaseLine: Record "Purchase Line") (integration)
  • OnAfterCalcPurchaseDiscount(var PurchaseHeader: Record "Purchase Header") (integration)
  • OnBeforeGetVendInvDisc(var PurchaseHeader: Record "Purchase Header"; CurrencyDate: Date; ChargeBase: Decimal; InvDiscBase: Decimal; BaseAmount: Decimal; var IsHandled: Boolean; var VendInvDisc: Record "Vendor Invoice Disc.") (integration)
  • OnCalculateInvoiceDiscountOnAfterPurchLine2ValidateQuantity(var PurchHeader: Record "Purchase Header"; var PurchLine2: Record "Purchase Line"; var VendInvDisc: Record "Vendor Invoice Disc.") (integration)
  • OnCalculateInvoiceDiscountOnBeforeCurrencyInitialize(var VendorPostingGroup: record "Vendor Posting Group") (integration)
  • OnCalculateInvoiceDiscountOnBeforeCheckVendInvDiscServiceCharge(var VendorInvoiceDisc: Record "Vendor Invoice Disc."; var PurchaseHeader: Record "Purchase Header"; CurrencyDate: Date; ChargeBase: Decimal) (integration)
  • OnCalculateInvoiceDiscountOnbeforePurchLineInsert(var PurchaseLine: Record "Purchase Line"; PurchHeader: Record "Purchase Header") (integration)
  • OnCalculateIncDiscForHeaderOnBeforeCalculateInvoiceDiscount(var PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; UpdateHeader: Boolean; var IsHandled: Boolean) (integration)
  • OnCalculateInvoiceDiscountOnBeforeFindForCalcVATAmountLines(var PurchHeader: Record "Purchase Header"; var PurchLine2: Record "Purchase Line"; UpdateHeader: Boolean) (integration)
  • OnCalculateInvoiceDiscountOnBeforeDeletePurchaseLine(UpdateHeader: Boolean; var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean) (integration)
  • OnOnRunOnBeforeUpdateHeader(var PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line") (integration)

Procedures

  • CalculateInvoiceDiscount(var PurchHeader: Record "Purchase Header"; var PurchLine2: Record "Purchase Line")
  • CalculateIncDiscForHeader(var PurchHeader: Record "Purchase Header")
  • CalculateInvoiceDiscountOnLine(var PurchLineToUpdate: Record "Purchase Line")

Plus 3 local procedures.

Triggers

OnRun

Relations

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.

Called by

Recent changes

Countries that replace it

ES

Documented on Microsoft Learn

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.-Calc.Discount"), then bcatlas_get_procedure_body or bcatlas_get_neighbors on the returned id.

Evidence 1 sources