Codeunit 18004267 EOS037 Sales Handler
Codeunit 18004267 EOS037 Sales Handler
Methods
CustInvDiscGetRec
procedure CustInvDiscGetRec(var CustInvDisc: Record "Cust. Invoice Disc."; NewCode: Code[20]; CurrencyCode: Code[10]; CurrencyDate: Date; BaseAmount: Decimal)
Parameters / Return Value
CustInvDisc
Record "Cust. Invoice Disc."
NewCode
Code[20]
CurrencyCode
Code[10]
CurrencyDate
Date
BaseAmount
Decimal
Events
OnAfterGetBaseAmount
local procedure OnAfterGetBaseAmount(SalesLine: Record "Sales Line"; QtyToHandle: Decimal; var BaseAmount: Decimal; var Handled: Boolean)
Parameters / Return Value
SalesLine
Record "Sales Line"
QtyToHandle
Decimal
BaseAmount
Decimal
Handled
Boolean
OnBeforeCalcTotalDiscountPercentage
local procedure OnBeforeCalcTotalDiscountPercentage(var SalesLine: Record "Sales Line"; xSalesLine: Record "Sales Line"; var IsHandled: Boolean)
Fired before calculating Line Discount Amount and Line Discount %.
Parameters / Return Value
SalesLine
Record "Sales Line"
Current record.
xSalesLine
Record "Sales Line"
Previous version of the current record.
IsHandled
Boolean
Set to true to skip the business logic.
OnAfterCalcTotalDiscountPercentage
local procedure OnAfterCalcTotalDiscountPercentage(var SalesLine: Record "Sales Line"; xSalesLine: Record "Sales Line")
Fired after calculating Line Discount Amount and Line Discount %.
Parameters / Return Value
SalesLine
Record "Sales Line"
Current record.
xSalesLine
Record "Sales Line"
Previous version of the current record.
OnBeforeCustInvDisc_GetRec
local procedure OnBeforeCustInvDisc_GetRec(SalesHeader: Record "Sales Header";#pragma warning disable AL0432var TmpVatAmountLine: Record "VAT Amount Line" temporary;#pragma warning restore AL0432var IsHandled: Boolean;var CustInvDisc: Record "Cust. Invoice Disc.")
Fired before calling the function GetRec of the CustomerInvDisc. Allows to use a custom function to retreive the CustInvDisc parameter.
Parameters / Return Value
SalesHeader
Record "Sales Header"
The current SalesHeader.
TmpVatAmountLine
Record "VAT Amount Line"
The TmpVatAmountLine.“Line Amount” has the amount to check if the invoice is eligible for a discount.
IsHandled
Boolean
IsHandled parameter to skip standard GetRec function.
CustInvDisc
Record "Cust. Invoice Disc."
The CustInvDisc got with the custom function. When the event is raised it’s empty.
OnBeforeDeleteDiscountsConfirmDialog
local procedure OnBeforeDeleteDiscountsConfirmDialog(var SkipConfirm: Boolean)
Raised before the Header Discounts deletion confirmation dialog is shown, allowing to skip it
Parameters / Return Value
SkipConfirm
Boolean
Boolean field that if set to “true” skips the confirmation dialog
OnAfterGetPaymentTermsAsDiscountSource
local procedure OnAfterGetPaymentTermsAsDiscountSource(SalesHeader: Record "Sales Header"; var PaymentTerms: Record "Payment Terms"; var CanApply: Enum "EOS066 TriState Boolean")
Raised after the payment terms have been retrieved for updating the header discount set of the document. If this event returns “False”, any already existing discounts for this source will NOT be removed. If you want to delete the discount for this source, return “True” and set the source discount ID to an empty GUID.
Parameters / Return Value
SalesHeader
Record "Sales Header"
The purchase header.
PaymentTerms
Record "Payment Terms"
The payment terms record.
CanApply
Enum "EOS066 TriState Boolean"
Gets or sets if the discount can be applied. Set this to “False” to avoid application.
OnAfterGetShipmentMethodAsDiscountSource
local procedure OnAfterGetShipmentMethodAsDiscountSource(SalesHeader: Record "Sales Header"; var ShipmentMethod: Record "Shipment Method"; var CanApply: Enum "EOS066 TriState Boolean")
Raised after the shipment method has been retrieved for updating the header discount set of the document. If this event returns “False”, any already existing discounts for this source will NOT be removed. If you want to delete the discount for this source, return “True” and set the source discount ID to an empty GUID.
Parameters / Return Value
SalesHeader
Record "Sales Header"
The sales header.
ShipmentMethod
Record "Shipment Method"
The shipment method record.
CanApply
Enum "EOS066 TriState Boolean"
Gets or sets if the discount can be applied. Set this to “False” to avoid application.
OnBeforeGetUniqueDiscSetHash
local procedure OnBeforeGetUniqueDiscSetHash(var DiscountSetId: Guid; var isHandled: Boolean)
Event raised before the unique discount set hash is calculated. Allows to return a custom discount setID for ECS grouping, leave it with default value for standard behavior.
Parameters / Return Value
DiscountSetId
Guid
The discount set ID.
isHandled
Boolean
Set to true to skip the business logic.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.