Customer is using Intercompany. The items are setup to calculate the Cost price + markup. When we have a sales order and AX should find the costprice, on the inventory transactions and it is the last items on the selected batch the sales price on the IC sales line it is not calculated correctly.
It should take: Cost price on all inventory transactions linked to this SO line / Qty on the Sales order line.
In the case where the inventory transaction takes the last Qty of the batch the sales price is calculated to zero.
This has resulted in that the Sales price on the intercompany order are much too low or even zero.