Steps to reproduce:
1. Create a loan product(Principal:10000, interest rate:1% per month, repaid every one month, number of repayments;12) with two guarantors self and external:
In Loan product: check 'Place Guarantee Funds on-hold'
Mandatory guarantee 40%
Minimum guarantee from own funds: 20%
Minimum guarantee from guarantor funds: 20%
2. Create a loan account for a client with this product. Just submit it. Don't approve it.
3. Add two guarantors self and external with guarantee of 2000 each.(Each guarantor should have savings account with balance at least 200)
4. Approve and Disburse the loan.
5. After Disbursal, Add 2nd 'Self' guarantor (self guarantor should have two savings accounts).
6. Remove first self guarantor which had been added before loan approval.
7. Withdraw all the money from 2nd self guarantor.
>>Here, the application allows the 7th step, which it shouldn't be as repayments haven't done yet.
Another issue is, consider there are only two guarantors self and external.
Let's client make all the repayments. Now, both self and external guarantors can withdraw even their minimum guarantee amount. After their withdrawal, we can undo all the repayments.
Expected Result: Undoing of repayments should not be allowed for the loan account having guarantors.