Hello Lamounia,
If AX would calculate the sales price based on the cost price that can be found in the on-hand window, then your sales prices would fluctuate a lot as the cost price in the on-hand window can change often. Imagine a customer orders an item in the morning and AX would calculate a sales Price of 100. If the same customer orders the same item later in the afternoon again, the sales Price might be 101, that is different.
Hope it helps,
Ludwig