Dates are not properly moved after changing disbursal date when Repayment day is set as 'Day 1 of every 1 month (s)'

Description

Dates are not properly moved after changing disbursal date when Repayment day is set to 'Day 1 of every 1 month (s)'.

Repro:
1. Login to Mifos.
2. Go to 'Clients & accounts' tab and click on 'Create new Loan account' link.
3. Select any client with weekly meetings and select monthly loan product with variable installments.
4. On 'Enter Loan accunt information' page, fill all necessary data and leave disbursal date set by default to next meeting date (31.05.2011) and set Repayment day as 'Day 1 of every 1 month (s)'.
5. Click 'Continue' button.
6. On 'Review installments' page, check dates in schedule (all dates are on 1 day of every month and first installment date is 01.06.2011).
7. Click preview button and then Submit button.
8. Approve Loan and click on 'Disburse loan' link.
9. Set disbursal date to today's date (26.05.2011).
10. Submit disbursal.
11. View repayment schedule and check Due dates.

Expected result:
First installement date is 27.05.2011 (moved because of changed disbursal date) and the rest of dates are appropriate.

Actual result:
First installement date is 27.06.2011.
Second installment date is 09.07.2011.
Third installment date is 28.07.2011.

Environment

None

Activity

Show:
keithwoodlock
June 8, 2011, 12:00 PM

assign back to lukasz so he can observer that this is not a regression in G.

Lukasz Chudy
June 8, 2011, 12:46 PM

Keith, as I understand you are saying that if date is set to 1st of month during the loan creation then after disbursal every instalment should also fall on 1st of month?

In variable installments specification there is a sentence about loan disbursal: "During Loan Disbursal, it may happen that the disbursal date is changed. This will result in the loan schedule to be moved forward while maintaining the gap between various installments." So according to that schedule movement after disbursal is not a bug. Moreover, if dates after disbursal will always be the same as during loan creation, then 'View Original schedule' link doesn't make sense.

The bug in this issue is that after disbursal the dates of first three installments are not properly moved. See 'Actual result' and 'Expected result' in the issue description.

keithwoodlock
June 8, 2011, 2:33 PM

Lukasz,

Yes, sorry, got a bit confused over functionality again. its adjusting the date of all installments based on number of days in difference for the early/late disbursal.

I cannot replicate what you are seeing: below are result of an early disbursement showing that the installments are recalculated correctly.

Application Approved
Disbursal date: 23/07/2011
Purpose of Loan: 0000-Animal Husbandry

Future Installments
1 20-Aug-2011 - 163.3 7.7 0.0 171.0
2 20-Sep-2011 - 164.0 7.0 0.0 171.0
3 20-Oct-2011 - 165.6 5.4 0.0 171.0
4 21-Nov-2011 - 166.7 4.3 0.0 171.0
5 20-Dec-2011 - 168.5 2.5 0.0 171.0
6 20-Jan-2012 - 171.9 1.2 0.0 173.1

=====

Active in Good Standing
Disbursal date: 08/06/2011
Purpose of Loan: 0000-Animal Husbandry

Future Installments
1 06-Jul-2011 - 163.3 7.7 0.0 171.0
2 06-Aug-2011 - 163.9 7.1 0.0 171.0
3 05-Sep-2011 - 165.5 5.5 0.0 171.0
4 07-Oct-2011 - 166.6 4.4 0.0 171.0
5 05-Nov-2011 - 168.3 2.7 0.0 171.0
6 06-Dec-2011 - 172.5 1.5 0.0 173.9

Although I think there might be a problem difference between the days between disbursement and first installment in original loan and 'early disbursed loan': Read on although if this is a problem, we should create another issue for it.

As a user, when I am creating a loan account (with LSIM on) I decide that all installments should fall on say 20th of the month like the example above i mentioned.

So when I create the 'loan for approval' and indicate it is to be dibursed to the party on the 27 of July, the schedule that is automatically generated and presented to user is a monthly loan schedule starting from 20th of August with each installment falling on the 20th.

The user can/could of adjusted this schedule to anything they liked for variable installments which makes the whole notion on repayment day for this type of loan product redundant. (confusing item 1)

Once the loan/loan schedule is approved, it is available for disbursal.

In the case where disbursal occurs on a different day than intended, the idea is to adjust each 'installment due date' by the number of days in the difference. (presumedly to preserve gaps between installments and hence interest calculation etc but what if thats not what the user wants? maybe they really want the installments to fall on certain days of month in certain month of year and dont want installments to be re-adjusted: confusing item 2)

So in the case above, instead of disbursing on 27th of july, i disburse the loan on the 8th of june, the first installment due orginally was 20 August but after early disbursal is now 04-Jul-2011

Possible problem?
=============

27th July - 20th August is 24days
08th June - 04th July is is 26 days? 24days from 8th of june should of fell on saturday 02th July? (i checked details on test server and working days were: Working days: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, and there was no holiday falling in july?)

Lukasz Chudy
June 9, 2011, 10:18 AM

Keith,

I've tried to reproduce this bug once again and I cannot. I have in my database 3 accounts created before in which this issue exists (where first installement date is 27.06.2011, second installment date is 09.07.2011 and third installment date is 28.07.2011) but when I am creating the same loan account now, even with moving system date to 26 May as in the issue description, then schedule is created correctly. So I think that we should leave this issue with the status 'Cannot Reproduce' and if this bug somehow repeats in the future then we will reopen the issue.

About confusing itmes which you've mentioned I think that Kay should answer.

I also reproduced your case - set disbursal date to 27th of july and installments on 20th of the month, then early disbursed loan on 8th june and I now have the first installment on 02th July not on 04th July as you have. So could you try to do it once again?

keithwoodlock
June 9, 2011, 1:19 PM

Lukasz,

Yes your are right, i must of being looking at the wrong loan schedule or used different disbursdal dates. the gap between disbursement and first installment looks right after early/late disbursal.

Assignee

mifosqa

Reporter

Lukasz Chudy

Labels

None

URL

None

Story Points

None

Team

Core

Scheduled For

Release

Epic

None

Notify

None

productboard URL

None

Man Day Estimate

None

Components

Fix versions

Affects versions

Priority

Major
Configure