Each variant on Price and inventory has a cost per item, which customers do not see. A physical product's Stock history lists every change to its stock (opening stock, sales, restocks, stock received and corrections) with the quantity after it and who made it. Record a stock change adds stock received or removes damaged, lost or returned items; stock received at a cost updates the cost per item to a weighted average. Each sale records the cost per item at that moment.
Existing tracked stock was recorded as opening stock.