Skip to content

KVSFCYCostCalcMgtSubscriber#

Procedures#

CalcProdOrderLineActCost(Record Prod. Order Line, Decimal, Decimal, Decimal, Decimal, Decimal, Decimal, Decimal, Decimal, Decimal, Decimal) :#

Summary: Calculates actual costs for a production order line including material, capacity, subcontracting, and overhead costs. This procedure computes the actual usage costs for a production order line by analyzing inventory adjustment entries and calculating output quantities. It retrieves actual costs in both local currency (LCY) and additional currency (ACY) for comprehensive cost analysis. The procedure handles different cost categories including material costs, direct capacity costs, subcontracting costs, capacity overhead costs, and manufacturing overhead costs. For production orders with status less than released, all costs are set to zero.

procedure CalcProdOrderLineActCost(ProdOrderLine: Record "Prod. Order Line"; var ActMatCost: Decimal; var ActCapDirCost: Decimal; var ActSubDirCost: Decimal; var ActCapOvhdCost: Decimal; var ActMfgOvhdCost: Decimal; var ActMatCostCostACY: Decimal; var ActCapDirCostACY: Decimal; var ActSubDirCostACY: Decimal; var ActCapOvhdCostACY: Decimal; var ActMfgOvhdCostACY: Decimal): 

Parameters:

  • ProdOrderLine: Record "Prod. Order Line": The production order line for which actual costs should be calculated.
  • ActMatCost: Decimal: Reference parameter that returns the actual material cost in local currency.
  • ActCapDirCost: Decimal: Reference parameter that returns the actual direct capacity cost in local currency.
  • ActSubDirCost: Decimal: Reference parameter that returns the actual direct subcontracting cost in local currency.
  • ActCapOvhdCost: Decimal: Reference parameter that returns the actual capacity overhead cost in local currency.
  • ActMfgOvhdCost: Decimal: Reference parameter that returns the actual manufacturing overhead cost in local currency.
  • ActMatCostCostACY: Decimal: Reference parameter that returns the actual material cost in additional currency.
  • ActCapDirCostACY: Decimal: Reference parameter that returns the actual direct capacity cost in additional currency.
  • ActSubDirCostACY: Decimal: Reference parameter that returns the actual direct subcontracting cost in additional currency.
  • ActCapOvhdCostACY: Decimal: Reference parameter that returns the actual capacity overhead cost in additional currency.
  • ActMfgOvhdCostACY: Decimal: Reference parameter that returns the actual manufacturing overhead cost in additional currency.

CalcProdOrderLineExpCost(Record Prod. Order Line, Decimal, Decimal, Decimal, Decimal, Decimal, Decimal, Decimal, Decimal) :#

Summary: Calculates expected costs for a production order line including material, capacity, subcontracting, and overhead costs. This recursive procedure computes expected costs by analyzing production order components and routing lines, handling both direct materials and components supplied by other production order lines. It processes routing operations to calculate capacity and subcontracting costs, distinguishing between work centers and subcontractors. The procedure applies share-based cost allocation for capacity costs and calculates manufacturing overhead based on direct costs and overhead rates. It integrates with the KUMAVISION factory calculation module when active to provide enhanced cost calculation capabilities including material and subcontracting overhead costs.

procedure CalcProdOrderLineExpCost(ProdOrderLine: Record "Prod. Order Line"; ShareOfTotalCapCost: Decimal; var ExpMatCost: Decimal; var ExpCapDirCost: Decimal; var ExpSubDirCost: Decimal; var ExpCapOvhdCost: Decimal; var ExpMfgOvhdCost: Decimal; var ExpMatOvhdCostVar: Decimal; var ExpSubOvhdCostVar: Decimal): 

Parameters:

  • ProdOrderLine: Record "Prod. Order Line": The production order line for which expected costs should be calculated.
  • ShareOfTotalCapCost: Decimal: The share factor for allocating total capacity costs to this production order line.
  • ExpMatCost: Decimal: Reference parameter that returns the expected material cost.
  • ExpCapDirCost: Decimal: Reference parameter that returns the expected direct capacity cost.
  • ExpSubDirCost: Decimal: Reference parameter that returns the expected direct subcontracting cost.
  • ExpCapOvhdCost: Decimal: Reference parameter that returns the expected capacity overhead cost.
  • ExpMfgOvhdCost: Decimal: Reference parameter that returns the expected manufacturing overhead cost.
  • ExpMatOvhdCostVar: Decimal: Reference parameter that returns the expected material overhead cost (KUMAVISION factory extension).
  • ExpSubOvhdCostVar: Decimal: Reference parameter that returns the expected subcontracting overhead cost (KUMAVISION factory extension).

Events#

OnCalcProdOrderLineExpCostOnExpOperCostCalculated(Decimal, Record Prod. Order Routing Line) :#

Summary: Event triggered after calculating expected operation cost during production order line cost calculation.

[IntegrationEvent(false, false)]
local procedure OnCalcProdOrderLineExpCostOnExpOperCostCalculated(var ExpOperCost: Decimal; ProdOrderRtngLine: Record "Prod. Order Routing Line"): 
[EventSubscriber(ObjectType::Codeunit, Codeunit::"KVSFCYCostCalcMgtSubscriber", 'OnCalcProdOrderLineExpCostOnExpOperCostCalculated', '', false, false)]
local procedure DoSomethingOnCalcProdOrderLineExpCostOnExpOperCostCalculated(var ExpOperCost: Decimal; ProdOrderRtngLine: Record "Prod. Order Routing Line")
begin
end;

Parameters:

  • ExpOperCost: The calculated expected operation cost that can be modified.
  • ProdOrderRtngLine: The production order routing line for which the operation cost was calculated.