Information about transaction under accounts and related documents

I am trying to get data about transactions made per account between dates and get information about related documents with transactions.
Payable and receivable. So I need Purchase Orders and Sales Orders documents etc.

What I know / discovered in database:
nltranm - transactions
nlmastm - transactions
plitemm - purchase transactions
opheadm - sales orders
opdetm - sales orders details
opsadetm - purchase orders
podetm - purchase orders details

But I cannot join these PO and SO to tables with Account transactions informaiton.
In nltranm there are:
columns which looks unique, but I couldn't find it in PO, SO tables.
Maybe I missed any table?

BTW. Do you have any documentations for Sage 500 7.1 database?

Thank you!

Kind regards,