Recording current Cost of BOM items on a sales order


We are an AX2009 shop using the weighted-average-date model in our environment. The cost of component items is constantly changing. However, the cost of BOMs remains constant (InventItemPrice.Price).

When a sales order is invoiced, the cost for the BOM items is the value from the InventItemPrice.Price, which no longer is the sum of the cost of the components. So, how to update the costs for the BOMs and keep them current so the proper costs are recorded on the sales order invoice?