Codeunit "Purch - Calc Disc. By Type"

ID 66
Namespace: Microsoft.Purchases.Document

Properties

Name Value
TableNo Table Microsoft.Purchases.Document."Purchase Line"

Methods

ApplyDefaultInvoiceDiscount

procedure ApplyDefaultInvoiceDiscount(InvoiceDiscountAmount: Decimal, var PurchHeader: Record "Purchase Header")

Parameters

Name Type Description
InvoiceDiscountAmount Decimal
PurchHeader Table Microsoft.Purchases.Document."Purchase Header"

ApplyInvDiscBasedOnAmt

procedure ApplyInvDiscBasedOnAmt(InvoiceDiscountAmount: Decimal, var PurchHeader: Record "Purchase Header")

Parameters

Name Type Description
InvoiceDiscountAmount Decimal
PurchHeader Table Microsoft.Purchases.Document."Purchase Header"

GetVendInvoiceDiscountPct

procedure GetVendInvoiceDiscountPct(PurchLine: Record "Purchase Line"): Decimal

Parameters

Name Type Description
PurchLine Table Microsoft.Purchases.Document."Purchase Line"

Returns

Type Description
Decimal

ShouldRedistributeInvoiceDiscountAmount

procedure ShouldRedistributeInvoiceDiscountAmount(PurchHeader: Record "Purchase Header"): Boolean

Parameters

Name Type Description
PurchHeader Table Microsoft.Purchases.Document."Purchase Header"

Returns

Type Description
Boolean

ResetRecalculateInvoiceDisc

procedure ResetRecalculateInvoiceDisc(PurchHeader: Record "Purchase Header")

Parameters

Name Type Description
PurchHeader Table Microsoft.Purchases.Document."Purchase Header"

InvoiceDiscIsAllowed

procedure InvoiceDiscIsAllowed(InvDiscCode: Code[20]): Boolean

Parameters

Name Type Description
InvDiscCode Code[20]

Returns

Type Description
Boolean

Events

OnAfterInvoiceDiscIsAllowed

[IntegrationEvent(False,False)]
local procedure OnAfterInvoiceDiscIsAllowed(InvDiscCode: Code[20], var Result: Boolean)

Parameters

Name Type Description
InvDiscCode Code[20]
Result Boolean

OnAfterResetRecalculateInvoiceDisc

[IntegrationEvent(False,False)]
local procedure OnAfterResetRecalculateInvoiceDisc(var PurchaseHeader: Record "Purchase Header")

Parameters

Name Type Description
PurchaseHeader Table Microsoft.Purchases.Document."Purchase Header"

OnBeforeApplyDefaultInvoiceDiscount

[IntegrationEvent(False,False)]
local procedure OnBeforeApplyDefaultInvoiceDiscount(var PurchaseHeader: Record "Purchase Header", var IsHandled: Boolean, InvoiceDiscountAmount: Decimal)

Parameters

Name Type Description
PurchaseHeader Table Microsoft.Purchases.Document."Purchase Header"
IsHandled Boolean
InvoiceDiscountAmount Decimal

OnBeforeShouldRedistributeInvoiceDiscountAmount

[IntegrationEvent(False,False)]
local procedure OnBeforeShouldRedistributeInvoiceDiscountAmount(var PurchaseHeader: Record "Purchase Header", var IsHandled: Boolean)

Parameters

Name Type Description
PurchaseHeader Table Microsoft.Purchases.Document."Purchase Header"
IsHandled Boolean

OnResetRecalculateInvoiceDiscOnAfterSetLoadFields

[IntegrationEvent(False,False)]
local procedure OnResetRecalculateInvoiceDiscOnAfterSetLoadFields(var PurchaseLine: Record "Purchase Line")

Parameters

Name Type Description
PurchaseLine Table Microsoft.Purchases.Document."Purchase Line"

See also