We want a list per account the button that opens the form will be on the contactsFull form IT opens a continuous form that shows all of the unpaid invoices for that client with a check box that we can check the invoices that this payment applies to. There will be a text box in the header that will allow us to put in the amount of the payment. The math will work to tell us if the selected invoices will match with the amount to be applied.
The math to show an unpaid invoice will be lookup the invoice number (may be multiple Records) take the charged amount and subtract the Paid amount. If that number is zero do not show on the list. ( I guess we could make a "Paid" field in the multiPay table and after the math is done the first time it could check the box so we don't have to check all of the invoices every time to see if they are paid?. This up to you how to solve that problem. I want there to be no lag time in listing unpaid invoices process)
Overpaid Balances from previous payments will be added to this paid amount allowing the full amount to be available to be applied to the outstanding invoices.
When the amount is "received" there will need to be an additional entry made to the payments table to show that the invoice was paid for each invoice being paid.
In the description field of MultiPay we need to keep track of the invoices that were selected and paid with the payment.