Skip to content

KVSFCYCalculateStandardCost#

Procedures#

ClearTempVariables() :#

Summary: Clears all temporary variables and cached data in the KUMAVISION factory standard cost calculation system. This procedure performs cleanup of all temporary tables used during cost calculations including items, work centers, machine centers, resource costs, production BOM versions, routing versions, and component items. It ensures memory cleanup and data integrity by removing all temporary calculation data, making the codeunit ready for fresh calculations without interference from previous calculation sessions.

procedure ClearTempVariables(): 

Events#

OnAfterCalcRtngLineCost(Record Routing Line, Decimal, Decimal, Decimal, Decimal) :#

Summary: Event raised after calculating routing line cost for standard cost calculation.

[IntegrationEvent(false, false)]
local procedure OnAfterCalcRtngLineCost(RoutingLine: Record "Routing Line"; MfgItemQtyBase: Decimal; var SLCap: Decimal; var SLSub: Decimal; var SLCapOvhd: Decimal): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSFCYCalculateStandardCost", 'OnAfterCalcRtngLineCost', '', false, false)]
local procedure DoSomethingOnAfterCalcRtngLineCost(RoutingLine: Record "Routing Line"; MfgItemQtyBase: Decimal; var SLCap: Decimal; var SLSub: Decimal; var SLCapOvhd: Decimal)
begin
end;

Parameters:

  • RoutingLine: The routing line record for which costs were calculated.
  • MfgItemQtyBase: The manufacturing item quantity base used in the calculation.
  • SLCap: The single-level capacity cost calculated for the routing line.
  • SLSub: The single-level subcontracting cost calculated for the routing line.
  • SLCapOvhd: The single-level capacity overhead cost calculated for the routing line.

OnBeforeCalcItems(Record Item) :#

Summary: Event raised before calculating standard costs for multiple items.

[IntegrationEvent(false, false)]
local procedure OnBeforeCalcItems(var Item: Record "Item"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSFCYCalculateStandardCost", 'OnBeforeCalcItems', '', false, false)]
local procedure DoSomethingOnBeforeCalcItems(var Item: Record "Item")
begin
end;

Parameters:

  • Item: The item record set for which standard costs will be calculated.

OnBeforeCalcItem(Record Item, Boolean, Boolean) :#

Summary: Event raised before calculating standard cost for a single item.

[IntegrationEvent(false, false)]
local procedure OnBeforeCalcItem(var Item: Record "Item"; UseAssemblyList: Boolean; var IsHandled: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSFCYCalculateStandardCost", 'OnBeforeCalcItem', '', false, false)]
local procedure DoSomethingOnBeforeCalcItem(var Item: Record "Item"; UseAssemblyList: Boolean; var IsHandled: Boolean)
begin
end;

Parameters:

  • Item: The item record for which standard cost will be calculated.
  • UseAssemblyList: Indicates whether to use assembly list for cost calculation.
  • IsHandled: Set to true to skip default calculation processing.

OnBeforeCalcRtngLineCost(Record Routing Line, Decimal) :#

Summary: Event raised before calculating routing line cost for standard cost calculation.

[IntegrationEvent(false, false)]
local procedure OnBeforeCalcRtngLineCost(RoutingLine: Record "Routing Line"; MfgItemQtyBase: Decimal): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSFCYCalculateStandardCost", 'OnBeforeCalcRtngLineCost', '', false, false)]
local procedure DoSomethingOnBeforeCalcRtngLineCost(RoutingLine: Record "Routing Line"; MfgItemQtyBase: Decimal)
begin
end;

Parameters:

  • RoutingLine: The routing line record for which costs will be calculated.
  • MfgItemQtyBase: The manufacturing item quantity base to be used in the calculation.

OnAfterCalcCostTime(Decimal, Decimal, Option, Record Routing Line) :#

Summary: Event raised after calculating cost time for routing line operations.

[IntegrationEvent(false, false)]
local procedure OnAfterCalcCostTime(var CostTime: Decimal; MfgItemQtyBase: Decimal; UnitCostCalculation: Option; RoutingLine: Record "Routing Line"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSFCYCalculateStandardCost", 'OnAfterCalcCostTime', '', false, false)]
local procedure DoSomethingOnAfterCalcCostTime(var CostTime: Decimal; MfgItemQtyBase: Decimal; UnitCostCalculation: Option; RoutingLine: Record "Routing Line")
begin
end;

Parameters:

  • CostTime: The calculated cost time that can be modified.
  • MfgItemQtyBase: The manufacturing item quantity base used in the calculation.
  • UnitCostCalculation: The unit cost calculation type used (Time or Units).
  • RoutingLine: The routing line record for which cost time was calculated.

OnCalcItemOnBeforeShowStrMenu(Record Item, Boolean, Boolean) :#

Summary: Event raised before showing the string menu for calculation level selection.

[IntegrationEvent(false, false)]
local procedure OnCalcItemOnBeforeShowStrMenu(var Item: Record "Item"; var ShowStrMenu: Boolean; var NewCalcMultiLevel: Boolean): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSFCYCalculateStandardCost", 'OnCalcItemOnBeforeShowStrMenu', '', false, false)]
local procedure DoSomethingOnCalcItemOnBeforeShowStrMenu(var Item: Record "Item"; var ShowStrMenu: Boolean; var NewCalcMultiLevel: Boolean)
begin
end;

Parameters:

  • Item: The item record for which calculation is being performed.
  • ShowStrMenu: Indicates whether the string menu should be shown to the user.
  • NewCalcMultiLevel: Indicates whether multi-level calculation should be performed.

OnCalcMfgItemOnBeforeCalcRtngCost(Record Item, Integer, Decimal, Date, Decimal) :#

Summary: Event raised before calculating routing cost for a manufacturing item.

[IntegrationEvent(false, false)]
local procedure OnCalcMfgItemOnBeforeCalcRtngCost(var Item: Record "Item"; Level: Integer; var LotSize: Decimal; var CalculationDate: Date; var MfgItemQtyBase: Decimal): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSFCYCalculateStandardCost", 'OnCalcMfgItemOnBeforeCalcRtngCost', '', false, false)]
local procedure DoSomethingOnCalcMfgItemOnBeforeCalcRtngCost(var Item: Record "Item"; Level: Integer; var LotSize: Decimal; var CalculationDate: Date; var MfgItemQtyBase: Decimal)
begin
end;

Parameters:

  • Item: The manufacturing item record for which routing cost will be calculated.
  • Level: The BOM level at which the calculation is being performed.
  • LotSize: The lot size used for the calculation that can be modified.
  • CalculationDate: The date used for the calculation that can be modified.
  • MfgItemQtyBase: The manufacturing item quantity base that can be modified.

OnCalcMfgItemOnBeforeCalculateCosts(Decimal, Decimal, Decimal, Decimal, Decimal, Record Item, Decimal, Decimal, Integer, Date, Decimal, Decimal, Decimal) :#

Summary: Event raised before calculating final costs for a manufacturing item.

[IntegrationEvent(false, false)]
local procedure OnCalcMfgItemOnBeforeCalculateCosts(var SLMat: Decimal; var SLCap: Decimal; var SLSub: Decimal; var SLCapOvhd: Decimal; var SLMfgOvhd: Decimal; var Item: Record "Item"; LotSize: Decimal; MfgItemQtyBase: Decimal; Level: Integer; CalculationDate: Date; var RUMat: Decimal; var SLMatOvhd: Decimal; var RUMatOvhd: Decimal): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSFCYCalculateStandardCost", 'OnCalcMfgItemOnBeforeCalculateCosts', '', false, false)]
local procedure DoSomethingOnCalcMfgItemOnBeforeCalculateCosts(var SLMat: Decimal; var SLCap: Decimal; var SLSub: Decimal; var SLCapOvhd: Decimal; var SLMfgOvhd: Decimal; var Item: Record "Item"; LotSize: Decimal; MfgItemQtyBase: Decimal; Level: Integer; CalculationDate: Date; var RUMat: Decimal; var SLMatOvhd: Decimal; var RUMatOvhd: Decimal)
begin
end;

Parameters:

  • SLMat: The single-level material cost that can be modified.
  • SLCap: The single-level capacity cost that can be modified.
  • SLSub: The single-level subcontracting cost that can be modified.
  • SLCapOvhd: The single-level capacity overhead cost that can be modified.
  • SLMfgOvhd: The single-level manufacturing overhead cost that can be modified.
  • Item: The manufacturing item record being calculated.
  • LotSize: The lot size used for the calculation.
  • MfgItemQtyBase: The manufacturing item quantity base used in the calculation.
  • Level: The BOM level at which the calculation is being performed.
  • CalculationDate: The date used for the calculation.
  • RUMat: The rolled-up material cost that can be modified.
  • SLMatOvhd: The single-level material overhead cost that can be modified.
  • RUMatOvhd: The rolled-up material overhead cost that can be modified.

OnCalcProdBOMCostOnAfterCalcCompItemQtyBase(Date, Record Item, Decimal, Boolean, Record Production BOM Line, Decimal, Code[20], Decimal) :#

Summary: Event raised after calculating component item quantity base for production BOM cost calculation.

[IntegrationEvent(false, false)]
local procedure OnCalcProdBOMCostOnAfterCalcCompItemQtyBase(CalculationDate: Date; MfgItem: Record "Item"; MfgItemQtyBase: Decimal; IsTypeItem: Boolean; var ProdBOMLine: Record "Production BOM Line"; var CompItemQtyBase: Decimal; RtngNo: Code[20]; UOMFactor: Decimal): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSFCYCalculateStandardCost", 'OnCalcProdBOMCostOnAfterCalcCompItemQtyBase', '', false, false)]
local procedure DoSomethingOnCalcProdBOMCostOnAfterCalcCompItemQtyBase(CalculationDate: Date; MfgItem: Record "Item"; MfgItemQtyBase: Decimal; IsTypeItem: Boolean; var ProdBOMLine: Record "Production BOM Line"; var CompItemQtyBase: Decimal; RtngNo: Code[20]; UOMFactor: Decimal)
begin
end;

Parameters:

  • CalculationDate: The date used for the calculation.
  • MfgItem: The manufacturing item record for which BOM cost is being calculated.
  • MfgItemQtyBase: The manufacturing item quantity base used in the calculation.
  • IsTypeItem: Indicates whether the BOM line type is Item.
  • ProdBOMLine: The production BOM line record being processed.
  • CompItemQtyBase: The calculated component item quantity base that can be modified.
  • RtngNo: The routing number associated with the BOM calculation.
  • UOMFactor: The unit of measure conversion factor used in the calculation.

OnBeforeInsertTempItem(Record Item, Record Item) :#

Summary: This event is triggered after Insert a temp Item

[IntegrationEvent(false, false)]
local procedure OnBeforeInsertTempItem(var Item: Record "Item"; var TempItem: Record "Item" temporary): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSFCYCalculateStandardCost", 'OnBeforeInsertTempItem', '', false, false)]
local procedure DoSomethingOnBeforeInsertTempItem(var Item: Record "Item"; var TempItem: Record "Item" temporary)
begin
end;

Parameters:

  • Item: The used Item Table
  • LocalKVSFCYActPurchDelSchedEntry: The current Active Purchase Delivery Schedule Entry
  • GlobalKVSFCYPurchDelScheduleHeader: The related Purchase Delivery Schedule Header