Question regarding Invoice Table relationships.

SOLVED

Hello, 

I am trying to put together a report for tax purposes and am not confident I am pulling paid invoices correctly. 

My initial thought was that all invoices in the ar_invoicehistoryheader table were paid, but I was told that these invoices are 'completed' but not necessarily paid. 

I was then told that I should just check the ar_openinvoice table where balance = 0. However, I have found invoices that exist in the ar_invoicehistoryheader table and do not  exist in the ar_openinvoice table. When I pull said invoices in the Invoice History Inquiry window, most have a balance of 0, but there is no balance field on ar_invoicehistory header... Where is this value coming from if the record does not exist in ar_openinvoice? 

Long story short I am trying to find the best way to pull paid invoices, but some clarification on my thoughts above would be helpful as well. 

Thanks!