SKULabs supports automatic cost averaging using the rate of received items from purchase orders. If enabled, when an item in a PO is received, the item's cost will reflect a weighted averaged using:
The existing on-hand quantity and current cost of the item.
The received quantity and the rate for that item in the PO.
You can enable this with the Average stock cost when purchase orders lines are received option on the Settings > inventory settings page.
Requirements
Ensure that all items have correct starting average cost.
Use the correct rate at the time of receiving the PO.
Formula
average cost = ((original cost * old quantity) + (new cost * received quantity)) / (old quantity + received quantity)