RE: Automatically Change Unit Cost
Actually, during a receipt, if the valuation method is standard, the items will be received at standard into inventory and issued at standard. Any differences between price paid and standard is written to PPV.
For Perpetual, layers are stored for each receipt, and, as was stated above by Mahmoud Saadi, if the stack is FIFO, the new receipt is placed at the end of the stack and the top of the stack is used to cost the issue. LIFO works the other way and might get you closer on the issues.
The Average valuation method will take the new cost and do a weighted average revaluation of inventory and issue at this new value.
Are you looking for an Actual Cost system where the cost you received items for is used during the issue? You would need to use one of the stack methods and lots.
Valuation methods and how they work are covered in our Inventory Management Techniques book. You might want to get a copy.