KVSKBASalesLinesMinProfitCheck
Events
OnBeforeCalcProfitFields(Record Sales Header, Record Sales Line, Decimal, Decimal, Decimal, Decimal, Decimal, Decimal, Text[100], Text[100], Boolean) :
Summary: Event that is raised before calculating the profit fields for a sales line.
[IntegrationEvent(false, false)]
local procedure OnBeforeCalcProfitFields(SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line"; var LineAmtLCY: Decimal; var LineAmtLCYExclVAT: Decimal; var UnitCostAmtLCY: Decimal; var ProfitAmtLCY: Decimal; var ProfitPerCent: Decimal; var MinimumProfitPercent: Decimal; var MinimumProfitDeviationText: Text[100]; var ReleasedText: Text[100]; var Handled: Boolean):
Parameters:
SalesHeader: The sales header record associated with the sales line.SalesLine: The sales line record for which the profit fields are being calculated.LineAmtLCY: The line amount in local currency, which can be calculated in the event handler.LineAmtLCYExclVAT: The line amount excluding VAT in local currency, which can be calculated in the event handler.UnitCostAmtLCY: The unit cost amount in local currency, which can be calculated in the event handler.ProfitAmtLCY: The profit amount in local currency, which can be calculated in the event handler.ProfitPerCent: The profit percentage, which can be calculated in the event handler.MinimumProfitPercent: The minimum profit percentage, which can be calculated in the event handler.MinimumProfitDeviationText: The text describing the minimum profit deviation, which can be set in the event handler.ReleasedText: The text indicating whether the unfavorable variance has been approved, which can be set in the event handler.Handled: A boolean variable that can be set to true in the event handler to indicate that the profit fields have been calculated and the default calculation should be skipped.
Remarks: Subscribers can use this event to provide custom logic for calculating the profit fields for a sales line. If the subscriber sets the Handled parameter to true, the default calculation logic will be skipped.