Because this product is present in two different forms with two different units of measure, you must have two different inventory items. Let’s call the input A and the output B.
Set up an inventory location for the outside manufacturing company. When you ship A, enter an inventory transfer. Now X m3 of A will no longer be at your regular location. This step is actually optional. You only need to do it if you think it will be important to know how much A remains in your regular inventory while the amount you sent to the manufacturer is away.
When you receive B, enter a production order converting X m3 of A to Y m2 of B. Add non-inventory costs to the production order equal to the fee charged by your outside manufacturer. You will probably want to make sure the outside manufacturer’s invoice and the non-inventory costs on the production order are posted to the same account. If you used the second inventory location, enter another inventory transfer moving B back to your regular location. Now, you have Y m2 of B in your main inventory at its full average cost, including the fee from the outside manufacturer.
Note: if we ever see the ability to specify multiple inventory locations on production orders, the inventory transfer at the end will be unnecessary. You will be able to record conversion of A at one location to B at another directly.