In order to learn how this all worked, I just keyed a couple of items in to the TWO company and watched the data flow. I'll describe that to you here.
First, I keyed a new test item into the Item Maintenance window.
While you're in there, add a price for the item, we'll need that later. I put my test item in the TWO RETAIL price level and set the price at $50


Now, open Receiving Transaction Entry and receive the new item. In order to save time, I keyed 4 lines into this window, 1 each, with 4 different unit costs. This is not the normal way to do receiving, but I'm trying to prove something. The screen looks like this

Now, run this query:
select ITEMNMBR, STNDCOST, CURRCOST from IV00101 where itemnmbr = 'TEST03'
select ITEMNMBR, LOCNCODE,RCRDTYPE, QTYONHND from iv00102 where itemnmbr = 'TEST03'
select ITEMNMBR, TRXLOCTN, DATERECD, RCTSEQNM, QTYRECVD,
QTYSOLD, QTYCOMTD, QTYRESERVED, UNITCOST, ADJUNITCOST, DEX_ROW_ID
from IV10200 where itemnmbr = 'TEST03'
and you'll see this:
Note that STNDCODE = 0, CURRCOST is the amount of the LAST RECEIPT. Note the 'layers' in IV10200, each with it's own UNITCOST. Note that I MANUALLY updated (read: used SQL) the cost of the second item to $20.01. This is how we change unit cost layers. NOTE: with FIFO/LIFO, there is no one unit price. It is layered.

Now key 3 Invoices, one at a time (or, because I really am that lazy, one SOP document with three lines), and watch the IV10200 change as the items are sold. Note that the third line has a quantity of two.

Post the document and then run this query:
select ITEMNMBR, TRXLOCTN, DATERECD, RCTSEQNM, QTYRECVD,
QTYSOLD, QTYCOMTD, QTYRESERVED, UNITCOST, ADJUNITCOST, DEX_ROW_ID
from IV10200 where itemnmbr = 'TEST03'
select SOPNUMBE, ITEMNMBR, QUANTITY, UNITCOST from sop30300 where itemnmbr = 'TEST03'
and we see the result of our work. The IV10200 shows QTYSOLD = 1 for each line, and our three SOP lines all have different (and correct) costs for FIFO cost layering. If we had posted 3 sop documents individually, we could have watched the QTYSOLD change incrementally.

Conclusion:
We've shown you the tables involved in FIFO/LIFO cost layering, and how to change unit cost if you need to.
Note that in all this, the IV00101 STNDCOST stayed at 0, and the CURRCOST stayed at the LAST RECEIVED PRICE. Neither was used in assigning cost to a SOP document.