KVSKBAServiceLinePrice#
Procedures#
GetTableNo() : Integer#
Summary: Returns the table number for the Service Line table.
procedure GetTableNo(): Integer
Returns: Integer representing the Service Line table ID
Remarks: Used by the price calculation framework to identify the source table
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: Retrieves the current Service Line record.
procedure GetLine(var Line: Variant):
Parameters:
Line: Variable to store the Service Line record
Remarks: Returns only the line record without header information
GetLine(Variant, Variant) :#
Summary: Retrieves both Service Header and Service Line records.
procedure GetLine(var Header: Variant; var Line: Variant):
Parameters:
Header: Variable to store the Service Header recordLine: Variable to store the Service Line record
Remarks: Returns both header and line records used in the price calculation
GetPriceType() : Enum#
Summary: Returns the current price type being calculated.
procedure GetPriceType(): Enum Price Type
Returns: The price type enum (Sale or Purchase)
Remarks: Used to determine which type of price calculation is currently active
IsPriceUpdateNeeded(Enum Price Amount Type, Boolean, Integer) : Boolean#
procedure IsPriceUpdateNeeded(AmountType: Enum "Price Amount Type"; FoundPrice: Boolean; CalledByFieldNo: Integer): Boolean
IsDiscountAllowed() : Boolean#
Summary: Checks if line discounts are allowed for the current service line.
procedure IsDiscountAllowed(): Boolean
Returns: Boolean indicating if discounts are allowed
Remarks: Considers both the Allow Line Disc. field and whether price has been calculated
Verify() :#
Summary: Verifies the integrity of the service line and header data.
procedure Verify():
Remarks: Ensures required fields are properly filled before price calculation
SetAssetSourceForSetup(Record Dtld. Price Calculation Setup) : Boolean#
Summary: Sets up the asset source for price calculation setup.
procedure SetAssetSourceForSetup(var DtldPriceCalculationSetup: Record "Dtld. Price Calculation Setup"): Boolean
Parameters:
DtldPriceCalculationSetup: The detailed price calculation setup record to populate
Returns: Boolean indicating if the setup was successful
Remarks: Configures the asset information needed for price calculation setup
GetAssetType() : Enum#
Summary: Returns the asset type for the current service line.
procedure GetAssetType(): Enum Price Asset Type
Returns: The price asset type enum
Remarks: Maps the service line type to the corresponding price asset type, including Service Cost
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"):
Events#
OnAfterAddSources(Record Service Header, Record Service Line, Enum Price Type, Codeunit Price Source List) :#
[IntegrationEvent(false, false)]
local procedure OnAfterAddSources(ServiceHeader: Record "Service Header"; ServiceLine: Record "Service Line"; PriceType: Enum "Price Type"; var PriceSourceList: Codeunit "Price Source List"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAServiceLinePrice", 'OnAfterAddSources', '', false, false)]
local procedure DoSomethingOnAfterAddSources(ServiceHeader: Record "Service Header"; ServiceLine: Record "Service Line"; PriceType: Enum "Price Type"; var PriceSourceList: Codeunit "Price Source List")
begin
end;
OnAfterFillBuffer(Record Price Calculation Buffer, Record Service Header, Record Service Line) :#
Summary: Integration event raised after filling the price calculation buffer.
[IntegrationEvent(false, false)]
local procedure OnAfterFillBuffer(var PriceCalculationBuffer: Record "Price Calculation Buffer"; ServiceHeader: Record "Service Header"; ServiceLine: Record "Service Line"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAServiceLinePrice", 'OnAfterFillBuffer', '', false, false)]
local procedure DoSomethingOnAfterFillBuffer(var PriceCalculationBuffer: Record "Price Calculation Buffer"; ServiceHeader: Record "Service Header"; ServiceLine: Record "Service Line")
begin
end;
Parameters:
PriceCalculationBuffer: The buffer record that can be modifiedServiceHeader: The source service headerServiceLine: The source service line
Remarks: Allows customization of the buffer data before service price calculation
OnAfterGetAssetType(Record Service Line, Enum Price Asset Type) :#
[IntegrationEvent(false, false)]
local procedure OnAfterGetAssetType(ServiceLine: Record "Service Line"; var AssetType: Enum "Price Asset Type"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAServiceLinePrice", 'OnAfterGetAssetType', '', false, false)]
local procedure DoSomethingOnAfterGetAssetType(ServiceLine: Record "Service Line"; var AssetType: Enum "Price Asset Type")
begin
end;
OnAfterGetDocumentDate(Date, Record Service Header, Record Service Line) :#
Summary: Integration event raised after determining the document date for price calculation.
[IntegrationEvent(false, false)]
local procedure OnAfterGetDocumentDate(var DocumentDate: Date; ServiceHeader: Record "Service Header"; ServiceLine: Record "Service Line"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAServiceLinePrice", 'OnAfterGetDocumentDate', '', false, false)]
local procedure DoSomethingOnAfterGetDocumentDate(var DocumentDate: Date; ServiceHeader: Record "Service Header"; ServiceLine: Record "Service Line")
begin
end;
Parameters:
DocumentDate: The determined document date that can be modifiedServiceHeader: The service header providing contextServiceLine: The service line providing context
Remarks: Allows customization of the date used for service price calculations
OnAfterIsPriceUpdateNeeded(Enum Price Amount Type, Boolean, Integer, Record Service Line, Boolean) :#
[IntegrationEvent(false, false)]
local procedure OnAfterIsPriceUpdateNeeded(AmountType: Enum "Price Amount Type"; FoundPrice: Boolean; CalledByFieldNo: Integer; ServiceLine: Record "Service Line"; var Result: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAServiceLinePrice", 'OnAfterIsPriceUpdateNeeded', '', false, false)]
local procedure DoSomethingOnAfterIsPriceUpdateNeeded(AmountType: Enum "Price Amount Type"; FoundPrice: Boolean; CalledByFieldNo: Integer; ServiceLine: Record "Service Line"; var Result: Boolean)
begin
end;
OnAfterSetPrice(Record Service Line, Record Price List Line, Enum Price Amount Type) :#
[IntegrationEvent(false, false)]
local procedure OnAfterSetPrice(var ServiceLine: Record "Service Line"; PriceListLine: Record "Price List Line"; AmountType: Enum "Price Amount Type"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAServiceLinePrice", 'OnAfterSetPrice', '', false, false)]
local procedure DoSomethingOnAfterSetPrice(var ServiceLine: Record "Service Line"; PriceListLine: Record "Price List Line"; AmountType: Enum "Price Amount Type")
begin
end;
OnAfterValidatePrice(Record Service Line, Enum Price Type, Enum Price Amount Type, Record Service Header) :#
[IntegrationEvent(false, false)]
local procedure OnAfterValidatePrice(var ServiceLine: Record "Service Line"; CurrPriceType: Enum "Price Type"; AmountType: Enum "Price Amount Type"; var ServiceHeader: Record "Service Header"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAServiceLinePrice", 'OnAfterValidatePrice', '', false, false)]
local procedure DoSomethingOnAfterValidatePrice(var ServiceLine: Record "Service Line"; CurrPriceType: Enum "Price Type"; AmountType: Enum "Price Amount Type"; var ServiceHeader: Record "Service Header")
begin
end;
OnAfterUpdate(Record Service Line, Enum Price Type, Enum Price Amount Type, Record Service Header) :#
[IntegrationEvent(false, false)]
local procedure OnAfterUpdate(var ServiceLine: Record "Service Line"; CurrPriceType: Enum "Price Type"; AmountType: Enum "Price Amount Type"; var ServiceHeader: Record "Service Header"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAServiceLinePrice", 'OnAfterUpdate', '', false, false)]
local procedure DoSomethingOnAfterUpdate(var ServiceLine: Record "Service Line"; CurrPriceType: Enum "Price Type"; AmountType: Enum "Price Amount Type"; var ServiceHeader: Record "Service Header")
begin
end;
OnAfterIsDiscountAllowed(Record Service Line, Boolean, Boolean) :#
Summary: Integration event raised after determining if discounts are allowed.
[IntegrationEvent(false, false)]
local procedure OnAfterIsDiscountAllowed(ServiceLine: Record "Service Line"; PriceCalculated: Boolean; var Result: Boolean):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAServiceLinePrice", 'OnAfterIsDiscountAllowed', '', false, false)]
local procedure DoSomethingOnAfterIsDiscountAllowed(ServiceLine: Record "Service Line"; PriceCalculated: Boolean; var Result: Boolean)
begin
end;
Parameters:
ServiceLine: The service line being evaluatedPriceCalculated: Whether price calculation has been performedResult: The discount allowance result that can be modified
Remarks: Allows customization of service discount allowance logic
OnBeforeSetPrice(Record Service Line, Record Price List Line, Enum Price Amount Type, Boolean, Record Service Header) :#
[IntegrationEvent(false, false)]
local procedure OnBeforeSetPrice(var ServiceLine: Record "Service Line"; PriceListLine: Record "Price List Line"; AmountType: Enum "Price Amount Type"; var IsHandled: Boolean; var ServiceHeader: Record "Service Header"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAServiceLinePrice", 'OnBeforeSetPrice', '', false, false)]
local procedure DoSomethingOnBeforeSetPrice(var ServiceLine: Record "Service Line"; PriceListLine: Record "Price List Line"; AmountType: Enum "Price Amount Type"; var IsHandled: Boolean; var ServiceHeader: Record "Service Header")
begin
end;
OnGetCustNoForServiceHeader(Record Service Header, Code[20]) :#
Summary: Integration event raised when getting the customer number for service header.
[IntegrationEvent(false, false)]
local procedure OnGetCustNoForServiceHeader(var ServiceHeader: Record "Service Header"; var CustomerNo: Code[20]):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAServiceLinePrice", 'OnGetCustNoForServiceHeader', '', false, false)]
local procedure DoSomethingOnGetCustNoForServiceHeader(var ServiceHeader: Record "Service Header"; var CustomerNo: Code[20])
begin
end;
Parameters:
ServiceHeader: The service header being processedCustomerNo: The customer number that can be modified
Remarks: Allows customization of customer number determination logic for service price calculations
OnGetContactNoForServiceHeader(Record Service Header, Code[20]) :#
Summary: Integration event raised when getting the contact number for service header.
[IntegrationEvent(false, false)]
local procedure OnGetContactNoForServiceHeader(var ServiceHeader: Record "Service Header"; var ContactNo: Code[20]):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAServiceLinePrice", 'OnGetContactNoForServiceHeader', '', false, false)]
local procedure DoSomethingOnGetContactNoForServiceHeader(var ServiceHeader: Record "Service Header"; var ContactNo: Code[20])
begin
end;
Parameters:
ServiceHeader: The service header being processedContactNo: The contact number that can be modified
Remarks: Allows customization of contact number determination logic for service price calculations
OnSetDiscountOriginFromPriceListLineOnBeforePriceListLineTypeCaseElse(Record Service Line, Record Price List Line, Enum Price Amount Type) :#
[IntegrationEvent(false, false)]
local procedure OnSetDiscountOriginFromPriceListLineOnBeforePriceListLineTypeCaseElse(var ServiceLine: Record "Service Line"; PriceListLine: Record "Price List Line"; AmountType: Enum "Price Amount Type"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAServiceLinePrice", 'OnSetDiscountOriginFromPriceListLineOnBeforePriceListLineTypeCaseElse', '', false, false)]
local procedure DoSomethingOnSetDiscountOriginFromPriceListLineOnBeforePriceListLineTypeCaseElse(var ServiceLine: Record "Service Line"; PriceListLine: Record "Price List Line"; AmountType: Enum "Price Amount Type")
begin
end;
OnSetPriceOriginFromPriceListLineOnBeforePriceListLineTypeCaseElse(Record Service Line, Record Price List Line, Enum Price Amount Type) :#
[IntegrationEvent(false, false)]
local procedure OnSetPriceOriginFromPriceListLineOnBeforePriceListLineTypeCaseElse(var ServiceLine: Record "Service Line"; PriceListLine: Record "Price List Line"; AmountType: Enum "Price Amount Type"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAServiceLinePrice", 'OnSetPriceOriginFromPriceListLineOnBeforePriceListLineTypeCaseElse', '', false, false)]
local procedure DoSomethingOnSetPriceOriginFromPriceListLineOnBeforePriceListLineTypeCaseElse(var ServiceLine: Record "Service Line"; PriceListLine: Record "Price List Line"; AmountType: Enum "Price Amount Type")
begin
end;
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"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAServiceLinePrice", 'OnCopyToBufferOnAfterPriceCalculationBufferMgtSet', '', false, false)]
local procedure DoSomethingOnCopyToBufferOnAfterPriceCalculationBufferMgtSet(var PriceCalculationBufferMgt: Codeunit "Price Calculation Buffer Mgt."; PriceCalculationBuffer: Record "Price Calculation Buffer"; var PriceSourceList: Codeunit "Price Source List")
begin
end;