codeunitSales & Receivablesofficial - Microsoftderived - from the source, no model text

Codeunit 60 "Sales-Calc. Discount"

Base Application · Microsoft.Sales.Document

Across versions

  1. BC23-27present
  2. BC281 events added, 1 events removed
  3. BC29-30unchanged

Neighbourhood 24 connected objects and pages

Table 37 "Sales Line" (relates to)Sales LineCodeunit 5477 "Sales Invoice Aggregator" (event subscribers)Sales Invoice AggregatorCodeunit 5496 "Graph Mgt - Sales Order Buffer" (event subscribers)Graph Mgt - Sales Order BufferCodeunit 5506 "Graph Mgt - Sales Quote Buffer" (event subscribers)Graph Mgt - Sales Quote BufferCodeunit 5508 "Graph Mgt - Sal. Cr. Memo Buf." (event subscribers)Graph Mgt - Sal. Cr. Memo Buf.Codeunit 56 "Sales - Calc Discount By Type" (calls, 3 links)Sales - Calc Discount By TypeCodeunit 1002 "Job Create-Invoice" (calls)Job Create-InvoiceCodeunit 1371 "Sales Batch Post Mgt." (calls)Sales Batch Post Mgt.Codeunit 228 "Test Report-Print" (calls)Codeunit 229 "Document-Print" (calls)Document-PrintCodeunit 414 "Release Sales Document" (calls)Release Sales DocumentCodeunit 57 "Document Totals" (calls)Document TotalsCodeunit 61 "Sales-Disc. (Yes/No)" (calls)Sales-Disc. (Yes/No)Codeunit 64 "Sales-Get Shipment" (calls)Sales-Get ShipmentCodeunit 65 "Discount Notification Mgt." (calls)Discount Notification Mgt.Codeunit 80 "Sales-Post" (calls)Page 46 "Sales Order Subform" (calls)Page 47 "Sales Invoice Subform" (calls)Page 6631 "Sales Return Order Subform" (calls)Page 95 "Sales Quote Subform" (calls)Page 96 "Sales Cr. Memo Subform" (calls)Report 295 "Combine Shipments" (calls)Report 6653 "Combine Return Receipts" (calls)Table 36 "Sales Header" (calls)

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.Sales.Document · BC23-30 · source at ea08af5e · facts from BC29

Properties

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

Events published

  • OnBeforeCalcSalesDiscount(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean; var SalesLine: Record "Sales Line"; var UpdateHeader: Boolean) (integration)
  • OnAfterCalcSalesDiscount(var SalesHeader: Record "Sales Header"; var TempVATAmountLine: Record "VAT Amount Line" temporary; var SalesLine2: Record "Sales Line") (integration)
  • OnAfterCustInvDiscRecExists(var SalesHeader: Record "Sales Header"; var CustInvDisc: Record "Cust. Invoice Disc."; InvDiscBase: Decimal; ChargeBase: Decimal; var ShouldGetCustInvDisc: Boolean) (integration)
  • OnAfterValidateSalesLine2Quantity(SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; CustInvoiceDisc: Record "Cust. Invoice Disc.") (integration)
  • OnBeforeCalculateIncDiscForHeader(var TempSalesHeader: Record "Sales Header" temporary; var IsHandled: Boolean; var SalesLine: Record "Sales Line"; var TempSalesLine: Record "Sales Line" temporary; var UpdateHeader: Boolean) (integration)
  • OnBeforeSetSalesLineServiceCharge(SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; CustInvoiceDisc: Record "Cust. Invoice Disc."; var IsHandled: Boolean) (integration)
  • OnBeforeUpdateSalesHeaderInvoiceDiscount(var CustInvoiceDisc: Record "Cust. Invoice Disc."; var SalesHeader: Record "Sales Header"; var TempVATAmountLine: Record "VAT Amount Line" temporary; var UpdateHeader: Boolean; var IsHandled: Boolean) (integration)
  • OnCalculateInvoiceDiscountOnBeforeCurrencyInitialize(var CustomerPostingGroup: Record "Customer Posting Group") (integration)
  • OnCalculateInvoiceDiscountOnBeforeCheckCustInvDiscServiceCharge(var CustInvoiceDisc: Record "Cust. Invoice Disc."; var SalesHeader: Record "Sales Header"; CurrencyDate: Date; ChargeBase: Decimal; var CustInvDiscFound: Boolean) + BC28 − BC28 (integration)
  • OnCalculateInvoiceDiscountOnBeforeCustInvDiscRecExists(var SalesHeader: Record "Sales Header"; var SalesLine2: Record "Sales Line"; var UpdateHeader: Boolean; var InvDiscBase: Decimal; var ChargeBase: Decimal; var TempVATAmountLine: Record "VAT Amount Line" temporary; var IsHandled: Boolean) (integration)
  • OnCalculateInvoiceDiscountOnBeforeSalesLine2FindFirst(var SalesLine2: Record "Sales Line") (integration)
  • OnCalculateInvoiceDiscountOnBeforeSalesLineInsert(var SalesLine: Record "Sales Line"; SalesHeader: Record "Sales Header") (integration)
  • OnBeforeCalculateWithSalesHeader(var SalesLine: Record "Sales Line"; var TempSalesHeader: Record "Sales Header" temporary; var TempSalesLine: Record "Sales Line"; var UpdateHeader: Boolean; var IsHandled: Boolean) (integration)
  • OnCalculateInvoiceDiscountOnBeforeSalesLine2DeleteTrue(UpdateHeader: Boolean; var SalesLine2: Record "Sales Line"; var IsHandled: Boolean) (integration)
  • OnRunOnBeforeCalculateInvoiceDiscount(var SalesLine: Record "Sales Line"; var TempSalesHeader: Record "Sales Header" temporary; var TempSalesLine: Record "Sales Line" temporary; var UpdateHeader: Boolean; var IsHandled: Boolean) (integration)
  • OnCalculateInvoiceDiscountOnBeforeUpdateSalesLine2(var SalesHeader: Record "Sales Header"; var SalesLine2: Record "Sales Line"; UpdateHeader: Boolean; CustInvDisc: Record "Cust. Invoice Disc."; var IsHandled: Boolean) (integration)
  • OnBeforeCustInvDiscRecExists(InvDiscCode: Code[20]; var Result: Boolean; var IsHandled: Boolean) (integration)
  • OnBeforeCalculateInvoiceDiscount(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; var UpdateHeader: Boolean) (integration)

Procedures

  • CustInvDiscRecExists(InvDiscCode: Code[20]): Boolean: Checks whether a customer invoice discount record exists for the specified code.
  • CalculateWithSalesHeader(var TempSalesHeader: Record "Sales Header"; var TempSalesLine: Record "Sales Line"): Calculates invoice discount using the provided sales header without updating it.
  • CalculateInvoiceDiscountOnLine(var SalesLineToUpdate: Record "Sales Line"): Calculates and applies invoice discount to a single sales line.
  • CalculateIncDiscForHeader(var TempSalesHeader: Record "Sales Header"): Calculates invoice discount for a sales header if automatic calculation is enabled.
  • UpdatePrepmtLineAmount(SalesHeader: Record "Sales Header"): Updates prepayment line amounts when invoice discount would exceed remaining non-prepaid amount.

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

Countries that replace it

ES

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

Evidence 1 sources