I need some help with the last part of a script to forecast deposits for our company.
I have a sql statement and php script that gathers the average days to pay invoices for each of our customers and the customer code, invoice amount, and invoice date of all of our open invoices. By combining the two on each open invoice, I hope to be able to guesstimate the day each open invoice will be paid (using the customer on that invoice's previous avg days to pay).
I can gather the info fine so far, but what I am left with is a dollar amount of the invoice and an estimated pay date. I want to summarize by day, the total amount of dollars on invoices that will be paid.