How is Commission being calculated and what happens if a trader is switched between books?

Commission is included in the Realised PnL at the time a trade opens. So, it will hit the book where the trade was originally opened. It will not be moved when an open position is moved between books.