KVSKBAPriceInfoLinePrice
Implements #437dbf0e84ff417a965ded2bb9650972#"Line With Price" .
Procedures
GetTableNo() : Integer
Summary: Returns the table number of the price information record used by this implementation.
procedure GetTableNo(): Integer
Returns: The database table number for KVSKBAPriceInformation.
SetLine(Enum Price Type, Variant) :
procedure SetLine(PriceType: Enum "Price Type"; Line: Variant):
SetLine(Enum Price Type, Variant, Variant) :
procedure SetLine(PriceType: Enum "Price Type"; Header: Variant; Line: Variant):
SetSources(Codeunit Price Source List) :
procedure SetSources(var NewPriceSourceList: Codeunit "Price Source List"):
GetLine(Variant) :
Summary: Returns the current price information record as a Variant.
procedure GetLine(var Line: Variant):
Parameters:
Line: Receives the KVSKBAPriceInformation record.
GetLine(Variant, Variant) :
Summary: Returns the current price information record as a Variant, without a header.
procedure GetLine(var Header: Variant; var Line: Variant):
Parameters:
Header: Not used; included for interface compatibility.Line: Receives the KVSKBAPriceInformation record.
GetPriceType() : Enum
Summary: Returns the current price type assigned to this implementation instance.
procedure GetPriceType(): Enum Price Type
Returns: The current Price Type (Sale or Purchase).
IsPriceUpdateNeeded(Enum Price Amount Type, Boolean, Integer) : Boolean
procedure IsPriceUpdateNeeded(AmountType: Enum "Price Amount Type"; FoundPrice: Boolean; CalledByFieldNo: Integer): Boolean
IsDiscountAllowed() : Boolean
Summary: Determines whether a line discount may be applied to the current price information record.
procedure IsDiscountAllowed(): Boolean
Returns: True if a line discount is allowed; false otherwise.
Remarks: Returns true when the Allow Line Disc. flag is set on the record, or when no price has been calculated yet. Raises OnAfterIsDiscountAllowed to allow subscribers to override the result.
Verify() :
Summary: Validates mandatory fields on the price information record before price calculation.
procedure Verify():
Remarks: Tests that Qty. per Unit of Measure is populated, and that Currency Factor is present when a Currency Code is set. Raises OnBeforeVerify (IsHandled pattern) to allow subscribers to skip the default validation.
SetAssetSourceForSetup(Record Dtld. Price Calculation Setup) : Boolean
Summary: Fills the detailed price calculation setup record with asset source information from the current price information record.
procedure SetAssetSourceForSetup(var DtldPriceCalculationSetup: Record "Dtld. Price Calculation Setup"): Boolean
Parameters:
DtldPriceCalculationSetup: The setup record to populate with type, method, asset type, and asset number.
Returns: True if a matching price source group was found; false otherwise.
Remarks: Called by the price calculation framework to resolve the applicable calculation method.
GetAssetType() : Enum
Summary: Returns the price asset type corresponding to the type on the current price information record.
procedure GetAssetType(): Enum Price Asset Type
Returns: The Price Asset Type (e.g. Item) derived from the price information type.
Remarks: Currently maps Type::Item to AssetType::Item; all other types map to AssetType::" ". Raises OnAfterGetAssetType to allow subscribers to override the returned asset type.
CopyToBuffer(Codeunit Price Calculation Buffer Mgt.) : Boolean
procedure CopyToBuffer(var PriceCalculationBufferMgt: Codeunit "Price Calculation Buffer Mgt."): Boolean
SetPrice(Enum Price Amount Type, Record Price List Line) :
procedure SetPrice(AmountType: Enum "Price Amount Type"; PriceListLine: Record "Price List Line"):
ValidatePrice(Enum Price Amount Type) :
procedure ValidatePrice(AmountType: Enum "Price Amount Type"):
Update(Enum Price Amount Type) :
procedure Update(AmountType: Enum "Price Amount Type"):
AddActivatedCampaignsAsSource() :
Summary: Adds all activated campaigns as price sources to the global price source list.
procedure AddActivatedCampaignsAsSource():
Remarks: Iterates over all campaign target group entries returned by FindActivatedCampaign and adds each as a Campaign price source.
Events
OnAfterGetAssetType(Record KVSKBAPriceInformation, Enum Price Asset Type) :
[IntegrationEvent(false, false)]
local procedure OnAfterGetAssetType(KVSKBAPriceInformation: Record "KVSKBAPriceInformation"; var AssetType: Enum "Price Asset Type"):
OnAfterAddSources(Record KVSKBAPriceInformation, Enum Price Type, Codeunit Price Source List) :
[IntegrationEvent(false, false)]
local procedure OnAfterAddSources(KVSKBAPriceInformation: Record "KVSKBAPriceInformation"; PriceType: Enum "Price Type"; var PriceSourceList: Codeunit "Price Source List"):
OnAfterFillBuffer(Record Price Calculation Buffer, Record KVSKBAPriceInformation) :
Summary: Event is raised after the price calculation buffer has been filled from the price information record.
[IntegrationEvent(false, false)]
local procedure OnAfterFillBuffer(var PriceCalculationBuffer: Record "Price Calculation Buffer"; KVSKBAPriceInformation: Record "KVSKBAPriceInformation"):
Parameters:
PriceCalculationBuffer: The price calculation buffer that was populated.KVSKBAPriceInformation: The source price information record.
Remarks: Subscribe to this event to set additional fields on the price calculation buffer.
OnAfterGetDocumentDate(Date, Record KVSKBAPriceInformation) :
Summary: Event is raised after the document date has been determined for price calculation.
[IntegrationEvent(false, false)]
local procedure OnAfterGetDocumentDate(var DocumentDate: Date; KVSKBAPriceInformation: Record "KVSKBAPriceInformation"):
Parameters:
DocumentDate: The resolved document date; can be overridden by subscribers.KVSKBAPriceInformation: The price information record.
Remarks: Subscribe to this event to provide a custom document date for price lookups.
OnAfterUpdate(Record KVSKBAPriceInformation, Enum Price Type, Enum Price Amount Type) :
[IntegrationEvent(false, false)]
local procedure OnAfterUpdate(var PriceInformation: Record "KVSKBAPriceInformation"; CurrPriceType: Enum "Price Type"; AmountType: Enum "Price Amount Type"):
OnAfterSetPrice(Record KVSKBAPriceInformation, Record Price List Line, Enum Price Amount Type) :
[IntegrationEvent(false, false)]
local procedure OnAfterSetPrice(var KVSKBAPriceInformation: Record "KVSKBAPriceInformation"; PriceListLine: Record "Price List Line"; AmountType: Enum "Price Amount Type"):
OnBeforeSetPrice(Record KVSKBAPriceInformation, Record Price List Line, Enum Price Amount Type, Boolean, Enum Price Type) :
[IntegrationEvent(false, false)]
local procedure OnBeforeSetPrice(var PriceInformation: Record "KVSKBAPriceInformation"; PriceListLine: Record "Price List Line"; AmountType: Enum "Price Amount Type"; var IsHandled: Boolean; CurrPriceType: Enum "Price Type"):
OnBeforeVerify(Record KVSKBAPriceInformation, Boolean) :
Summary: Event is raised before the mandatory field validation on the price information record.
[IntegrationEvent(false, false)]
local procedure OnBeforeVerify(PriceInformation: Record "KVSKBAPriceInformation"; var IsHandled: Boolean):
Parameters:
PriceInformation: The price information record to be validated.IsHandled: Set to true to skip the default validation.
Remarks: Set IsHandled to true to prevent the default Qty. per Unit of Measure and Currency Factor checks from executing.
OnCopyToBufferOnAfterPriceCalculationBufferMgtSet(Codeunit Price Calculation Buffer Mgt., Record Price Calculation Buffer, Codeunit Price Source List) :
[IntegrationEvent(false, false)]
local procedure OnCopyToBufferOnAfterPriceCalculationBufferMgtSet(var PriceCalculationBufferMgt: Codeunit "Price Calculation Buffer Mgt."; PriceCalculationBuffer: Record "Price Calculation Buffer"; var PriceSourceList: Codeunit "Price Source List"):
OnAfterIsDiscountAllowed(Record KVSKBAPriceInformation, Boolean, Boolean) :
Summary: Event is raised after determining whether a line discount is allowed on the price information record.
[IntegrationEvent(false, false)]
local procedure OnAfterIsDiscountAllowed(KVSKBAPriceInformation: Record "KVSKBAPriceInformation"; PriceCalculated: Boolean; var Result: Boolean):
Parameters:
KVSKBAPriceInformation: The price information record being evaluated.PriceCalculated: True if a price has already been calculated for this record.Result: The determined result; set to override whether discounts are allowed.
Remarks: Subscribe to this event to override the default discount-allowed logic.
OnAfterValidatePrice(Record KVSKBAPriceInformation, Enum Price Type, Enum Price Amount Type) :
[IntegrationEvent(false, false)]
local procedure OnAfterValidatePrice(var PriceInformation: Record "KVSKBAPriceInformation"; CurrPriceType: Enum "Price Type"; AmountType: Enum "Price Amount Type"):
OnAfterIsPriceUpdateNeeded(Enum Price Amount Type, Boolean, Integer, Boolean, Record KVSKBAPriceInformation) :
[IntegrationEvent(false, false)]
local procedure OnAfterIsPriceUpdateNeeded(AmountType: Enum "Price Amount Type"; FoundPrice: Boolean; CalledByFieldNo: Integer; var Result: Boolean; PriceInformation: Record "KVSKBAPriceInformation"):
OnAfterFindContactCompanyCampaigns(Code[20], Record Campaign Target Group, Boolean) :
Summary: Event is raised after searching for activated campaigns linked to a contact's company.
[IntegrationEvent(false, false)]
local procedure OnAfterFindContactCompanyCampaigns(ContactNo: Code[20]; var TempCampaignTargetGr: Record "Campaign Target Group" temporary; var Found: Boolean):
Parameters:
ContactNo: The contact number used to find the company campaigns.TempCampaignTargetGr: Temporary Campaign Target Group records found; can be extended by subscribers.Found: True if at least one campaign target group was found; can be overridden.
Remarks: Subscribe to this event to add additional campaigns or modify the found result.
OnAfterFindCustomerCampaigns(Code[20], Record Campaign Target Group, Boolean) :
Summary: Event is raised after searching for activated campaigns linked to a customer.
[IntegrationEvent(false, false)]
local procedure OnAfterFindCustomerCampaigns(CustomerNo: Code[20]; var TempCampaignTargetGr: Record "Campaign Target Group" temporary; var Found: Boolean):
Parameters:
CustomerNo: The customer number used to find campaigns.TempCampaignTargetGr: Temporary Campaign Target Group records found; can be extended by subscribers.Found: True if at least one campaign target group was found; can be overridden.
Remarks: Subscribe to this event to add additional campaigns or modify the found result.
OnAfterKVSKBACheckOtherNotBillable(Record KVSKBAPriceInformation, Code[20]) :
Summary: Event is raised after checking other sources (sales order type, item variant, item) for a Not Billable code.
[IntegrationEvent(false, false)]
local procedure OnAfterKVSKBACheckOtherNotBillable(PriceInformation: Record "KVSKBAPriceInformation"; var NotBillable: Code[20]):
Parameters:
PriceInformation: The price information record being evaluated.NotBillable: The Not Billable code resolved so far; set to override with a custom value.
Remarks: Subscribe to this event to provide a custom Not Billable code from additional sources.
OnGetCustomerNoForPriceInformation(Record KVSKBAPriceInformation, Code[20]) :
Summary: Event is raised when the customer number is being resolved for price calculation on a price information record.
[IntegrationEvent(false, false)]
local procedure OnGetCustomerNoForPriceInformation(PriceInformation: Record "KVSKBAPriceInformation"; var CustomerNo: Code[20]):
Parameters:
PriceInformation: The price information record for which the customer number is needed.CustomerNo: The resolved customer number; set to override with a custom value.
Remarks: Subscribe to this event to provide a custom customer number for price source resolution.