This script is used to find all open invoices with no payments
select Distinct a.Customer_Number as Customer Number,
b.Invoice_Number, b.Invoice_Id, b.Amount, b.Payment, b.Payment_Date
from AR_Customer a, ar_invoice b, AR_Invoice_Item c
where a.customer_id = b.Customer_Id
and c.Invoice_Id = b.Invoice_Id
and b.Payment_Date <> '1899-12-30 00:00:00:000'
and b.Payment = 0
order by a.Customer_Number, b.Invoice_Number