Field help (SIHCPRPRI) 

The cost price is loaded by default by the valuation of the product chosen for the margin calculation (see the valuation methods defined for the Product-Site record) at the time of the creation of the document line and is expressed in sales unit. The different choices possible for the cost price valuation are: Standard price, Revised standard price, Last price, Weighed average price, FIFO price, Lot average price and LIFO price. If the valuation method happened to return a zero value, a fall value can be used by specifying another valuation method contained in the list previously described. This value is stored in the document line.

It is possible to pre-load this information as a function of the document transaction used.

The 'cost price' is systematically recalculated upon: 

In quote management, the 'lot average price' always returns a null value. The alternative default is used in this case. During the delivery confirmation, the Lot average price is used again to recalculate the margin and thus obtain a real margin depending on the shipped lot(s).

Specificities related to credit memos:
When a credit memo is created with a customer return or an invoice as its origin, the cost price proposed is the cost price from the original document. If it is a direct credit memo, the cost price is calculated from the margin calculation rule defined by the Product-site valuation method.