I built a database for my company which services interest only loans for construction companies who need quick capital to build then get paid and pay off the loan. Everything on it works great except one part, and I can't figure out how to finish it. My database generates a payment schedule on a table called Payments for the appropriate number of months of the loan. I have code that automatically subtracts the payment made for that month on the same line as the monthly payment due (simple subtraction code), but the problem arrises when someone pays more than they owe.
When a borrower overpays on the payment of a loan for a month, the difference between the payment due and how much they paid should be taken off the following month's payment. So for example:
If the minimum payment due = $500 and a borrower pays $800 then Month1 due = $0 and Month2 = $200.
Likewise, if the if the minimum payment due = $500 and a borrower pays $1,200 then Month1 due = $0, Month2 = $0 and Month3 = $300.
If there is an overpayment on the last month or anything that causes a negative balance after the last month, then it should remain a negative balance on that final month (e.x. --> 3 Month loan, minimum payments $100 and borrower pays $500, Month1 = $0, Month2 = $0 and Month3 = -$200).
Help is VERY MUCH appreciated. Thank you.
When a borrower overpays on the payment of a loan for a month, the difference between the payment due and how much they paid should be taken off the following month's payment. So for example:
If the minimum payment due = $500 and a borrower pays $800 then Month1 due = $0 and Month2 = $200.
Likewise, if the if the minimum payment due = $500 and a borrower pays $1,200 then Month1 due = $0, Month2 = $0 and Month3 = $300.
If there is an overpayment on the last month or anything that causes a negative balance after the last month, then it should remain a negative balance on that final month (e.x. --> 3 Month loan, minimum payments $100 and borrower pays $500, Month1 = $0, Month2 = $0 and Month3 = -$200).
Help is VERY MUCH appreciated. Thank you.