I'm developing a web application to manage loans. I have a table which stores the amortization schedule (how much does the person has to pay in a given date) and I also store payments in the same table (the actual payment of the person). However there are sometimes where the person doesn't pay on time, in this case there should be a charge (interest in arrears) for every day the person misses the payment. What do you think is the best way to calculate this interest in arrears?
I've thought on two approaches:
Anyone has another idea? I'm a newbie in term of finance. I hope to make myself understood
As the amount in arrears is calculated from other data, and is not a particularly difficult calculation, there is no reason to store it. Just calculate it when you need it. I'd think you would need it when a customer asks how much he owes, and maybe for some reports. So just calculate it when you produce the response to the customer query and/or when you produce the report.
I would recommend calculating the interest when the payment is due, for two reasons:
I don't know your exact circumstances, but my vote is on calculating the interest when you actually need it.