Calculates FIFO prices correctly.