Inter company costs

I’m making inter-cpmpany stock transfer as described here

All is fine, but I need the price as item cost with exact margin (cost+5% or just cost) for such entry.
How can I make such pricing rule (or smth else), where item in sales invoice would contain its fifo cost as sales rate.