AP_OpenInvoice with balance 0

SOLVED

Hi,

I'm trying to write a code that gets all the invoices which were fully paid. My idea was to take all the invoice and remove all the open invoices from "AP_OpenInvoice".

But, I see invoices in that tables that have 0 balance. So probsbly it doesn't mean what it though.

1. What does an open invoice mean? balance 0? due date not passed? else?

2. How do I get all the closed invoices = fully paid invoices