Codeunit 66 Purch - Calc Disc. By Type

Base Application, Microsoft.Purchases.Document

Source AL, 245 lines

src/Layers/W1/BaseApp/Purchases/Document/PurchCalcDiscByType.Codeunit.allines 13 to 28 of 245, Copyright (c) Microsoft Corporation. MIT

codeunit 66 "Purch - Calc Disc. By Type"{    TableNo = "Purchase Line";    trigger OnRun()    var        PurchHeader: Record "Purchase Header";        PurchLine: Record "Purchase Line";    begin        PurchLine.Copy(Rec);        if PurchHeader.Get(Rec."Document Type", Rec."Document No.") then begin            ApplyDefaultInvoiceDiscount(PurchHeader."Invoice Discount Value", PurchHeader);            // on new order might be no line            if Rec.Get(PurchLine."Document Type", PurchLine."Document No.", PurchLine."Line No.") then;        end;

All 245 lines

Events 5 in 29

[IntegrationEvent] OnAfterResetRecalculateInvoiceDisc(var PurchaseHeader: Record "Purchase Header")17-29
[IntegrationEvent] OnBeforeApplyDefaultInvoiceDiscount(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean; InvoiceDiscountAmount: Decimal)17-29
[IntegrationEvent] OnBeforeShouldRedistributeInvoiceDiscountAmount(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)17-29
[IntegrationEvent] OnAfterInvoiceDiscIsAllowed(InvDiscCode: Code[20]; var Result: Boolean)new in 20
[IntegrationEvent] OnResetRecalculateInvoiceDiscOnAfterSetLoadFields(var PurchaseLine: Record "Purchase Line")new in 22

Public procedures 6 in 29

ApplyDefaultInvoiceDiscount(InvoiceDiscountAmount: Decimal; var PurchHeader: Record "Purchase Header")17-29
ApplyInvDiscBasedOnAmt(InvoiceDiscountAmount: Decimal; var PurchHeader: Record "Purchase Header")17-29
GetVendInvoiceDiscountPct(PurchLine: Record "Purchase Line"): Decimal17-29
ShouldRedistributeInvoiceDiscountAmount(PurchHeader: Record "Purchase Header"): Boolean17-29
ResetRecalculateInvoiceDisc(PurchHeader: Record "Purchase Header")17-29
InvoiceDiscIsAllowed(InvDiscCode: Code[20]): Boolean17-29

Changes 1 in 22

List17181920212223242526272829
Events11
[IntegrationEvent] OnResetRecalculateInvoiceDiscOnAfterSetLoadFields(var PurchaseLine: Record "Purchase Line")new in 22
added

All 2 changes in 17-29