The accounting methodology used determines the daily PnL on any given position.
Say if a trader starts the day with a long position, then throughout the day does multiple buys and sells of different quantity at different prices and still ends up with an open position at the end of that given day, the accounting methodology determines how the trades of opposite directions are paired off. This then determines by how much the PnL has moved.
FIFO methodology specifies that the oldest trade in the opposite direction has to be paired out first. So the oldest inventory is first disposed of or closed against.
Long position at start of day => long then short position load
Short position at start of day => short position then long position load