Can i forecast Revenue if i know: The date and amount when bills are due along with Receivables?

I am building an app to show Accounts Receivable along with Accounts Payable. I have a table showing due dates along with the amount due (payable). I also have a table showing Payments Received by date. Can i build inside my app - forecast (Payments - Payables = Potential Revenue this day)?

The tables are not together so i need to reference one from the other.

I would think you could, though I have no experience with this specific challenge. Referencing one table from another is not a problem.