This is the third instalment in my series of articles explaining the inventory cost model in Dynamics 365 for Finance and Operations (D365FO). The series is expected to include the following parts:
- Part 1: Core concepts.
- Part 2: Configuration.
- Part 3: Cost management.
- Part 4: Landed cost.
- Part 5: Cost controlling.
In the previous posts, we looked at the core concepts underpinning the inventory cost model in D365FO and how some of the key areas should be configured. In this post we will look more into how you actually manage costs and how this affects various parts of the system.
How you actually manage costs, depends on your scenario. Therefore, I will initially explore a couple of basic cost management areas in the system and then follow-up with an Costing and adjustment example to highlight how to use the system.
The Cost Management Module
Before we get started, I just wanted to highlight the Cost management module in D365FO:
This module was not available in Dynamics AX 2012. It consolidates most of the functions, queries and reports you need to manage costs in D365FO, and in addition, it brings along two new workspaces for cost administration and cost analysis.
Inventory Dimensions
The first thing to understand in D365FO when it comes to managing costs, is how to use inventory dimensions and how they affect costing.
The above picture shows an example of a Tracking dimension group. What is important in terms costing is the tick in the Financial inventory column. This indicates that we, in this case, are tracking cost on batch level. You can use this to calculate cost on the appropriate level for a given scenario.
For instance, if you manufacture a product on two different sites, the cost is likely to be different for each site. By calculating cost by site using the inventory dimensions, you are able to correctly track cost depending on where and how you manufacture the product. Similarly, if the overhead costs in one warehouse differs from another, you can decide if you would like to track cost by warehouse.
It goes without saying that tracking cost by batch or serial number allows for very specific and granular costing. This is often used in scenarios where you need to track the specific cost of an activity. This could be sub-contracting work or very expensive materials.
In my first post on this subject, I wrote about how D365FO uses the average cost price on outbound inventory transactions. Actually, the average is based on the inventory dimensions set up, so if you have ticked the Financial inventory column on batch number, the system will use the average cost for the specific batch in question.
The Costing Sheet
How a company calculates its cost-of-goods-sold (COGS) for manufactured products is determined by the costing sheet ( for more detailed information see Docs). Only one costing sheet can be defined per legal entity.
As the above example shows, the costing sheet is a hierarchical representation of the cost model. It details how materials, resources and indirect costs are included in COGS and the hierarchical structure determines how the cost calculation is displayed in various queries.
BOM Calculations
The actual calculation of COGS for a manufactured product is done through the BOM calculation (for more details see Docs). The BOM calculation is used to roll up all costs included in the BOM, route and indirect costs from the costing sheet. The BOM calculation can be invoked from various places, but most commonly it is used to calculate standard cost prices and for calculating the estimated cost of a specific production order.
Standard Cost
In many manufacturing scenarios, standard cost is used for the manufactured product. Often, this is done out of convenience but also to be able to more easily track variances.
As the above picture shows, variance posting can be set up across a number of variance types including variances in lot size, substituted materials and variances in materials quantity consumed.
Before setting up standard cost prices, you must define one or more cost versions. Cost versions are basically used to track the development of standard cost prices over time and simulate standard cost price calculations without affecting the current standard cost price.
Cost versions are maintained under Cost management / Inventory accounting / Costing versions.
From within the cost version, the user is able to
- Maintain standard cost prices for each product.
- Maintain prices for cost categories used in manufacturing routes.
- Maintain indirect cost calculations.
This allows the user to create different standard cost calculation formulas for different segments of the product master.
You can read more about maintaining cost versions in Docs.
It is worth noting that any cost data entered in the cost version is pending until the user activates the new data.
As mentioned in my second blog post on inventory costing, a product must be linked to an item model group that is set up for standard cost as shown in the following screen:
When using a product that has been set up for standard cost, the system will always use the active standard cost when consuming the product on a sales order, production order etc.
As mentioned above, if the actual cost of the product is different to the standard cost price, the system will automatically post the difference to the variance account. This can for instance happen when purchasing materials. If the purchase price on the invoice differs from the standard cost price when the invoice is approved (and posted), the system posts a purchase variance. As you can imagine, this may create quite a lot of variance transactions so you need a thorough procedure for controlling variances.
Cost Prices
So, what if you are not using standard cost? How do you maintain prices? The short answer is: that depends.
At the most basic level, you can maintain the purchase price of a material directly on the product record. However, the most flexible way to maintain purchase prices for a product is to use the trade agreements where you are able to maintain prices, discounts, lead times, quantity breaks etc. When creating a purchase order line, the system will automatically use the trade agreements to find the correct purchase price. When invoicing the purchase order line, the system will use the price on the purchase order line plus any charges added to the line as well as overheads applied through the costing sheet (see above). The concept of charges will be explored further in the next blog post.
The cost of a manufactured product that is not set up for standard cost is calculated through a BOM calculation (see above).
Closing and Adjustment
And now to the big topic when managing inventory costs in D365FO: Closing and adjustment. As discussed in previous blog posts, the cost of an inventory transaction is not fixed until it has been financially settled (unless you use standard costing, in which case, closing and adjustment is redundant).
Every time you run the Closing and adjustment job (found under Cost management / Inventory accounting / Closing and adjustment) the cost of an outbound transaction may change until the entire quantity of an outbound transaction has been financially settled against inbound quantities.
Let’s try looking at Closing and adjustment through an example. The following screen shows the on-hand inventory for the product HML-007:
As you can see, we have 100 pieces in stock. Of these 100, 50 have been posted financially (invoiced) and 50 have only been received.
Now I sell (invoice) 100 pieces to a customer on a sales order. I have now sold 100 pieces at an average cost price of $510 (total cost amount of $51,000) as the following screen shows:
However, the 50 pieces I have yet to invoice were purchased at $693.60 per piece (total cost amount of $34,680) as the following screen shows:
Interestingly, when you look at the on-hand inventory for HML-007 in the following screen, the system displays zero quantity in stock but an inventory cost of $9,180. This is actually, the un-allocated difference between the cost of goods purchased and the provisional COGS.
The product (HML-007) is linked to an inventory model group set to the FIFO inventory model. When I now go a perform a Closing and adjustment the system will settle inbound transactions against outbound transactions using the FIFO method. This should recalculate the COGS on the sales order inventory transaction accordingly.
Firstly, I use the Recalculation option in the ribbon. This option recalculates the inventory cost, but does not create settlements and close the inventory. This is the option to use if you would like to recalculate inventory costs daily (for accuracy) but maintain the ability to correct inventory transactions during the period. To permanently settle and close the inventory, use the Close procedure option in the ribbon.
Both recalculations and closings can be reversed.
Let’s have a look at the result of my recalculation. Firstly, let’s look at the financial transactions created:
As you can see, our residual of $9,180 has now been taken out of inventory and been allocated to COGS.
Similarly, the residual inventory cost value has been removed from on-hand inventory as the following screen shows:
Lastly, as the following screen shows, the COGS for the inventory sales transaction has been adjusted to include the correct cost prices for all 100 pieces.
When I go back to the Closing and adjustment screen and run the Close inventory option, the system settles the inventory transactions and closes the inventory so I can make no further changes in the period. The resulting settlements are shown in the following screen:
This simple example may look easy, but with millions of transactions to settle, controlling and auditing the inventory cost system can be tricky.
Note: For product HML-007 I have used a storage dimension group set up for financial inventory by Site. If the product had been purchased across multiple warehouses, the average cost price and the FIFO recalculation would have made the calculation across all warehouse. Therefore, correction settings of this parameters can have significant impact on how the system calculates inventory costs.
You can read more about Closing and adjustment here.
Summary
In this blog post we have explored how to manage cost in D365FO. In the coming two blog posts we will be looking into how you work with landed costs and, last but not least, how to monitor and control inventory costs.
Hi Henrik,
I have 2 questions regarding 2 parameters in the Close inventory dialog. I would be happy if you knew the answers.
1) The Close inventory dialog has “Specification” do you leave it at Total? Or do you change it?
2) Also the Close inventory dialog has a parametr in the bottom section Post-Closing – Run recalculation after closing. Do you know what this does? I thought the recalculation happens automatically when the inventory close is run. So why is there a special parameter for recalculation? Do you set it to Yes?
Thank you
L.