I have most of the customers who do not pay me the full payment against the invoice total amount. Instead, they pay partial payments.
And the invoice total is never a final total because there are some products in the line items against which I am paid full or partial payment. That's why, the remaining (calculated) prices of most of the products changes automatically from time to time in the reports.
So I need a continuous invoices and continuous payments system.
I can manage the latest invoice total by calculating the line items of a specific customer, and I have created a payment table (with CustomerID) to record the received payments but I do not have an idea of how to relate the payments with invoices and getting the latest Receivable Amount.