sales order charges code question

Hi, I’m trying to pull the total amount of the ‘charges code’ from the backend database, but when I join the SALESTABLE & MARKUPTRANS with RECID/TRANSRECID in SQL, it’s showing more lines than what’s on CHARGES CODE selected under sales order in AX. Thanks in advance.

Try CustInvoiceJour & MarkupTrans instead.