KVSKBAPriceCalcSingleInstance#
Procedures#
ClearAll() :#
Summary: Clear all global variables
procedure ClearAll():
Remarks: Deletes all temporary price and discount calculation lines for: - Sales prices and line discounts - Service prices and line discounts - Purchase prices and line discounts Used to reset SingleInstance codeunit state between calculations.
ClearSalesPriceTypeData() :#
Summary: Clears all Sales Price Type variables
procedure ClearSalesPriceTypeData():
Remarks: Deletes temporary price and discount calculation lines for Sales and Service only. Preserves Purchase-related data. Use when resetting sales context while maintaining purchase calculations.
ClearPurchasePriceTypeData() :#
Summary: Clears all Purchase Price Type variables
procedure ClearPurchasePriceTypeData():
Remarks: Deletes temporary price and discount calculation lines for Purchase only. Preserves Sales and Service-related data. Use when resetting purchase context while maintaining sales calculations.
KVSKBASetTempPurchasePriceDiscCalcLine(Record KVSKBAPurchaseConditionLine, Code[20], Integer, Option, Code[10]) :#
Summary: Inserts the KVSKBAPurchaseConditionLine into the global temporary KVSKBAPurchaseConditionLine
procedure KVSKBASetTempPurchasePriceDiscCalcLine(var KVSKBAPurchaseConditionLine: Record "KVSKBAPurchaseConditionLine"; CondNo: Code[20]; ReferenceNo: Integer; PriceDiscCalcLineType: Option; LanguageCode: Code[10]):
Parameters:
KVSKBAPurchaseConditionLine: KVSKBAPurchaseConditionLine to insertCondNo: Condition No. to filterReferenceNo: Reference No. to filterPriceDiscCalcLineType: Line Type to insertLanguageCode: Language Code to insert
Remarks: Populates the temporary purchase price/discount calculation line buffer: 1. Clears existing lines of the specified type 2. Retrieves purchase condition header 3. Filters condition lines by CondNo and ReferenceNo 4. Transfers fields to temporary buffer with sequential line numbers (0, 10000, 20000...) Used by KUMAVISION condition-based purchase pricing. Data persists in SingleInstance until cleared or replaced.
KVSKBASetTempSalesPriceDiscCalcLine(Record KVSKBASalesConditionLine, Code[20], Integer, Option, Code[10]) :#
Summary: Inserts the KVSKBASalesConditionLine into the global temporary KVSKBASalesConditionLine
procedure KVSKBASetTempSalesPriceDiscCalcLine(var KVSKBASalesConditionLine: Record "KVSKBASalesConditionLine"; CondNo: Code[20]; ReferenceNo: Integer; PriceDiscCalcLineType: Option; LanguageCode: Code[10]):
Parameters:
KVSKBASalesConditionLine: KVSKBASalesConditionLine to insertCondNo: Condition No. to filterReferenceNo: Reference No. to filterPriceDiscCalcLineType: Line Type to insertLanguageCode: Language Code to insert
Remarks: Populates the temporary sales price/discount calculation line buffer: 1. Clears existing lines of the specified type 2. Retrieves sales condition header 3. Filters condition lines by CondNo and ReferenceNo 4. Transfers fields to temporary buffer with sequential line numbers (0, 10000, 20000...) Used by KUMAVISION condition-based sales pricing. Data persists in SingleInstance until cleared or replaced. Raises OnAfterSetTempSalesPriceDiscCalcLine integration event.
KVSKBASetTempServicePriceDiscCalcLine(Record KVSKBASalesConditionLine, Code[20], Integer, Enum KVSKBAPriceDiscLineType, Code[10]) :#
Summary: Inserts the KVSKBASalesConditionLine into the global temporary ServicePriceDiscCalcLine
procedure KVSKBASetTempServicePriceDiscCalcLine(var KVSKBASalesConditionLine: Record "KVSKBASalesConditionLine"; CondNo: Code[20]; ReferenceNo: Integer; PriceDiscCalcLineType: Enum "KVSKBAPriceDiscLineType"; LanguageCode: Code[10]):
Parameters:
KVSKBASalesConditionLine: KVSKBASalesConditionLine to insertCondNo: Condition No. to filterReferenceNo: Reference No. to filterPriceDiscCalcLineType: Line Type to insertLanguageCode: Language Code to insert
Remarks: Populates the temporary service price/discount calculation line buffer: 1. Clears existing lines of the specified type 2. Retrieves sales condition header (service pricing uses sales conditions) 3. Filters condition lines by CondNo and ReferenceNo 4. Transfers fields to temporary buffer with sequential line numbers (0, 10000, 20000...) Used by KUMAVISION condition-based service pricing. Data persists in SingleInstance until cleared or replaced. Raises OnAfterSetTempServicePriceDiscCalcLine integration event.
GetTempPurchasePriceDiscCalcLine(Record KVSKBAPurchPriceDiscCalcLine, Record Purchase Line, Option) :#
Summary: Get the global TempKVSKBAPurchPriceDiscCalcLine
procedure GetTempPurchasePriceDiscCalcLine(var KVSKBAPurchPriceDiscCalcLine: Record "KVSKBAPurchPriceDiscCalcLine"; Purchaseline: Record "Purchase Line"; PriceDiscCalcLineType: Option):
Parameters:
KVSKBAPurchPriceDiscCalcLine: Record with transferd recordPurchaseline: Purchase Line for filterPriceDiscCalcLineType: Line Type for filter
Remarks: Retrieves purchase price/discount calculation lines from SingleInstance buffer: 1. Clears the output buffer 2. Copies matching lines from temporary buffer 3. Sets document type, number, and line number from purchase line 4. Clears the temporary buffer after transfer Used to transfer condition-based pricing data to the calling context. After this call, SingleInstance buffer is empty for this line type.
GetTempSalesPriceDiscCalcLine(Record KVSKBASalesPriceDiscCalcLine, Record Sales Line, Option) :#
Summary: Get the global TempKVSKBAPurchPriceDiscCalcLine
procedure GetTempSalesPriceDiscCalcLine(var KVSKBASalesPriceDiscCalcLine: Record "KVSKBASalesPriceDiscCalcLine"; Salesline: Record "Sales Line"; PriceDiscCalcLineType: Option):
Parameters:
KVSKBASalesPriceDiscCalcLine: Record with transferd recordSalesline: Sales Line for filterPriceDiscCalcLineType: Line Type for filter
Remarks: Retrieves sales price/discount calculation lines from SingleInstance buffer: 1. Clears the output buffer 2. Copies matching lines from temporary buffer 3. Sets document type, number, and line number from sales line 4. Raises OnAfterGetTempSalesPriceDiscCalcLine integration event 5. Clears the temporary buffer after transfer Used to transfer condition-based pricing data to the calling context. After this call, SingleInstance buffer is empty for this line type.
GetTempServicePriceDiscCalcLine(Record KVSKBAServicePriceDiscCalcLine, Record Service Line, Enum KVSKBAPriceDiscLineType) :#
Summary: Get the TempKVSKBAServicePriceDiscCalcLine
procedure GetTempServicePriceDiscCalcLine(var KVSKBAServicePriceDiscCalcLine: Record "KVSKBAServicePriceDiscCalcLine"; Serviceline: Record "Service Line"; PriceDiscCalcLineType: Enum "KVSKBAPriceDiscLineType"):
Parameters:
KVSKBAServicePriceDiscCalcLine: Record with transferd recordServiceline: Service Line for filterPriceDiscCalcLineType: Line type for filter
Remarks: Retrieves service price/discount calculation lines from SingleInstance buffer: 1. Clears the output buffer 2. Copies matching lines from temporary buffer 3. Sets document type, number, and line number from service line 4. Raises OnAfterGetTempServicePriceDiscCalcLine integration event 5. Clears the temporary buffer after transfer Used to transfer condition-based pricing data to the calling context. After this call, SingleInstance buffer is empty for this line type.
Events#
OnAfterSetTempSalesPriceDiscCalcLine(Record KVSKBASalesConditionHeader, Record KVSKBASalesConditionLine, Record KVSKBASalesPriceDiscCalcLine, Option, Integer) :#
Summary: Integration event raised after setting temporary sales price/discount calculation lines.
[IntegrationEvent(false, false)]
local procedure OnAfterSetTempSalesPriceDiscCalcLine(var KVSKBASalesConditionHeader: Record "KVSKBASalesConditionHeader"; var KVSKBASalesConditionLine: Record "KVSKBASalesConditionLine"; var TempKVSKBASalesPriceDiscCalcLine: Record "KVSKBASalesPriceDiscCalcLine" temporary; PriceDiscCalcLineType: Option; var NextLineNo: Integer):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAPriceCalcSingleInstance", 'OnAfterSetTempSalesPriceDiscCalcLine', '', false, false)]
local procedure DoSomethingOnAfterSetTempSalesPriceDiscCalcLine(var KVSKBASalesConditionHeader: Record "KVSKBASalesConditionHeader"; var KVSKBASalesConditionLine: Record "KVSKBASalesConditionLine"; var TempKVSKBASalesPriceDiscCalcLine: Record "KVSKBASalesPriceDiscCalcLine" temporary; PriceDiscCalcLineType: Option; var NextLineNo: Integer)
begin
end;
Parameters:
KVSKBASalesConditionHeader: The sales condition header record.KVSKBASalesConditionLine: The sales condition line records processed.TempKVSKBASalesPriceDiscCalcLine: Temporary buffer containing the calculated lines.PriceDiscCalcLineType: The line type (Price or Line Discount).NextLineNo: The next available line number for additional entries.
Remarks: Allows subscribers to: - Add additional calculation lines to the temporary buffer - Modify existing calculation lines - Perform validation or logging Called after all condition lines have been transferred to the temporary buffer. Use NextLineNo to maintain proper line number sequence when adding lines.
OnAfterSetTempServicePriceDiscCalcLine(Record KVSKBASalesConditionHeader, Record KVSKBASalesConditionLine, Record KVSKBAServicePriceDiscCalcLine, Enum KVSKBAPriceDiscLineType, Integer) :#
Summary: Integration event raised after setting temporary service price/discount calculation lines.
[IntegrationEvent(false, false)]
local procedure OnAfterSetTempServicePriceDiscCalcLine(var KVSKBASalesConditionHeader: Record "KVSKBASalesConditionHeader"; var KVSKBASalesConditionLine: Record "KVSKBASalesConditionLine"; var TempKVSKBAServicePriceDiscCalcLine: Record "KVSKBAServicePriceDiscCalcLine" temporary; KVSKBAPriceDiscLineType: Enum "KVSKBAPriceDiscLineType"; var NextLineNo: Integer):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAPriceCalcSingleInstance", 'OnAfterSetTempServicePriceDiscCalcLine', '', false, false)]
local procedure DoSomethingOnAfterSetTempServicePriceDiscCalcLine(var KVSKBASalesConditionHeader: Record "KVSKBASalesConditionHeader"; var KVSKBASalesConditionLine: Record "KVSKBASalesConditionLine"; var TempKVSKBAServicePriceDiscCalcLine: Record "KVSKBAServicePriceDiscCalcLine" temporary; KVSKBAPriceDiscLineType: Enum "KVSKBAPriceDiscLineType"; var NextLineNo: Integer)
begin
end;
Parameters:
KVSKBASalesConditionHeader: The sales condition header record (used for service pricing).KVSKBASalesConditionLine: The sales condition line records processed.TempKVSKBAServicePriceDiscCalcLine: Temporary buffer containing the calculated lines.KVSKBAPriceDiscLineType: The line type enum (Price or Line Discount).NextLineNo: The next available line number for additional entries.
Remarks: Allows subscribers to: - Add additional calculation lines to the temporary buffer - Modify existing calculation lines - Perform validation or logging Called after all condition lines have been transferred to the temporary buffer. Service pricing uses sales condition structures. Use NextLineNo to maintain proper line number sequence when adding lines.
OnAfterGetTempSalesPriceDiscCalcLine(Record KVSKBASalesPriceDiscCalcLine, Record KVSKBASalesPriceDiscCalcLine, Record Sales Line, Option) :#
Summary: Integration event raised after retrieving temporary sales price/discount calculation lines.
[IntegrationEvent(false, false)]
local procedure OnAfterGetTempSalesPriceDiscCalcLine(var KVSKBASalesPriceDiscCalcLine: Record "KVSKBASalesPriceDiscCalcLine"; var TempKVSKBASalesPriceDiscCalcLine: Record "KVSKBASalesPriceDiscCalcLine" temporary; SalesLine: Record "Sales Line"; PriceDiscCalcLineType: Option):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAPriceCalcSingleInstance", 'OnAfterGetTempSalesPriceDiscCalcLine', '', false, false)]
local procedure DoSomethingOnAfterGetTempSalesPriceDiscCalcLine(var KVSKBASalesPriceDiscCalcLine: Record "KVSKBASalesPriceDiscCalcLine"; var TempKVSKBASalesPriceDiscCalcLine: Record "KVSKBASalesPriceDiscCalcLine" temporary; SalesLine: Record "Sales Line"; PriceDiscCalcLineType: Option)
begin
end;
Parameters:
KVSKBASalesPriceDiscCalcLine: The output record containing transferred calculation lines.TempKVSKBASalesPriceDiscCalcLine: The temporary buffer that was transferred from (about to be cleared).SalesLine: The sales line context for document type, number, and line number.PriceDiscCalcLineType: The line type (Price or Line Discount).
Remarks: Allows subscribers to: - Modify the output calculation lines before they are used - Add additional lines based on sales line context - Perform validation or logging Called after lines are transferred but before the temporary buffer is cleared. This is the last chance to access or modify the data before buffer cleanup.
OnAfterGetTempServicePriceDiscCalcLine(Record KVSKBAServicePriceDiscCalcLine, Record KVSKBAServicePriceDiscCalcLine, Record Service Line, Enum KVSKBAPriceDiscLineType) :#
Summary: Integration event raised after retrieving temporary service price/discount calculation lines.
[IntegrationEvent(false, false)]
local procedure OnAfterGetTempServicePriceDiscCalcLine(var KVSKBAServicePriceDiscCalcLine: Record "KVSKBAServicePriceDiscCalcLine"; var TempKVSKBAServicePriceDiscCalcLine: Record "KVSKBAServicePriceDiscCalcLine" temporary; ServiceLine: Record "Service Line"; KVSKBAPriceDiscLineType: Enum "KVSKBAPriceDiscLineType"):
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSKBAPriceCalcSingleInstance", 'OnAfterGetTempServicePriceDiscCalcLine', '', false, false)]
local procedure DoSomethingOnAfterGetTempServicePriceDiscCalcLine(var KVSKBAServicePriceDiscCalcLine: Record "KVSKBAServicePriceDiscCalcLine"; var TempKVSKBAServicePriceDiscCalcLine: Record "KVSKBAServicePriceDiscCalcLine" temporary; ServiceLine: Record "Service Line"; KVSKBAPriceDiscLineType: Enum "KVSKBAPriceDiscLineType")
begin
end;
Parameters:
KVSKBAServicePriceDiscCalcLine: The output record containing transferred calculation lines.TempKVSKBAServicePriceDiscCalcLine: The temporary buffer that was transferred from (about to be cleared).ServiceLine: The service line context for document type, number, and line number.KVSKBAPriceDiscLineType: The line type enum (Price or Line Discount).
Remarks: Allows subscribers to: - Modify the output calculation lines before they are used - Add additional lines based on service line context - Perform validation or logging Called after lines are transferred but before the temporary buffer is cleared. This is the last chance to access or modify the data before buffer cleanup.