KVSKBAServiceLinePrice
Implements [#437dbf0e84ff417a965ded2bb9650972#Shipment Method ](https://github.com/search?q=Table+%5b%23437dbf0e84ff417a965ded2bb9650972%23Shipment+Method+%3aocticons-mark-github-16%3a%5d(https%3a%2f%2fgithub.com%2fsearch%3fq%3dTable%2b%2523437dbf0e84ff417a965ded2bb9650972%2523Shipment%2bMethod%2brepo%253AStefanMaron%252FMSDyn365BC.Code.History%26type%3dCode)+repo%3AStefanMaron%2FMSDyn365BC.Code.History&type=Code).
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"):
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"):
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"):
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"):
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):
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"):
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"):
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"):
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):
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"):
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]):
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]):
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"):
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"):
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"):