openMF / mifos-mobile

Repository for the Mifos Mobile Banking App for clients
https://openmf.github.io/mobileapps.github.io/
Mozilla Public License 2.0
274 stars 686 forks source link

In Loan Account Details , Next Instalment and and Due Date are showing wrong values. #456

Closed santoshconflux closed 5 years ago

santoshconflux commented 7 years ago

As you can see from the screenshot & Link:

Next Instalment Amount should be 987.72 (but showing total outstanding) Next Due Date should be 02 February 2017 (but showing disbursement date)

https://mobile.openmf.org/#/viewloanaccount/1345

screenshot_2017-10-13-15-17-27

fazerlicourice7 commented 6 years ago

Just to clarify what is required here, is the next Due Date always on the same date each month? So the day of the date of disbursement of the loan (in this case the 2nd)? So the next couple of due dates would be Feb 2nd, Mar 2nd, April 2nd, etc.

However, for the installment amount due, how does one split up the total outstanding balance? Since there is no variable already existing for installment amount, so what fraction of the total outstanding balance should be displayed as next installment. Or, is there some more calculation required to find the next installment amount. There is a maturity date variable. Should the Total outstanding balance just be divided by the number of months between "current date" and maturity date?

santoshconflux commented 6 years ago

Next due is always on same month because repayment frequency is monthly. Each month repayment is just EMI, calculated based on some parameters. You can check repayment schedule of any loan account on Web side

fazerlicourice7 commented 6 years ago

Alright, but I can't find any information about the number of repayments or length of the loan, or anything of that sort. Could someone please direct me to that information for each loan, it's definitely not in LoanAccount

therajanmaurya commented 6 years ago

Sorry @fazerlicourice7, wait I am looking into this.

fazerlicourice7 commented 6 years ago

I found the data I need in the LoanWithAssociations.java class; numberofRepayaments and interestRate. However, I'm not yet familiar with the structure of the mifos application, and therefore am not sure how to get a LoanWithAssociations data object in the LoanAccountsDetailFragment class where the view is set.

We have the data, and I know the calculation, but I'm not sure how to access the data. Thanks.