I am scripting inventory adjustments to overcome limitations of built in manufacturing.
Used interactively, the inventory adjustment will show cost of items coming out of inventory. We note these costs and put them into value of new items for no net change.
When scripting, there is no access to the cost of what we are adjusting out of inventory, so as to know what to specify to for the cost of what's going into inventory (again, the goal is no net-change in adjustment account).
We have been able to get a cost by searching transactions for the item, but are unsure how to verify correctness of this approach.
Is there a specific way to get the cost of a quantity of inventory that takes into account the inventory costing method, etc?