Repository: incubator-fineract Updated Branches: refs/heads/develop 121df4eb0 -> b5c130736
FINERACT-117 : Tranche disbursement charge % disbursed amount is displaying as -ve amount if the 2nd tranche disbursed is with lesser amount and charge was waived before 2nd disbursement Project: http://git-wip-us.apache.org/repos/asf/incubator-fineract/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-fineract/commit/d32aeabe Tree: http://git-wip-us.apache.org/repos/asf/incubator-fineract/tree/d32aeabe Diff: http://git-wip-us.apache.org/repos/asf/incubator-fineract/diff/d32aeabe Branch: refs/heads/develop Commit: d32aeabe66b2d4aec99afe74dae7b5ee1feca517 Parents: f1f3d65 Author: nazeer1100126 <nazeer.sh...@confluxtechnologies.com> Authored: Thu Mar 9 15:25:58 2017 +0530 Committer: nazeer1100126 <nazeer.sh...@confluxtechnologies.com> Committed: Thu Mar 9 15:25:58 2017 +0530 ---------------------------------------------------------------------- .../fineract/portfolio/loanaccount/domain/Loan.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-fineract/blob/d32aeabe/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java ---------------------------------------------------------------------- diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java index 8b5a707..c747760 100755 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/Loan.java @@ -2570,14 +2570,15 @@ public class Loan extends AbstractPersistableCustom<Long> { * Ability to regenerate the repayment schedule based on the loans current * details/state. */ - public void regenerateRepaymentSchedule(final ScheduleGeneratorDTO scheduleGeneratorDTO, AppUser currentUser) { - + public void regenerateRepaymentSchedule(final ScheduleGeneratorDTO scheduleGeneratorDTO, final AppUser currentUser) { final LoanScheduleModel loanSchedule = regenerateScheduleModel(scheduleGeneratorDTO); - + if (loanSchedule == null) { return; } updateLoanSchedule(loanSchedule, currentUser); - Set<LoanCharge> charges = this.charges(); - for (LoanCharge loanCharge : charges) { - recalculateLoanCharge(loanCharge, scheduleGeneratorDTO.getPenaltyWaitPeriod()); + final Set<LoanCharge> charges = this.charges(); + for (final LoanCharge loanCharge : charges) { + if (!loanCharge.isWaived()) { + recalculateLoanCharge(loanCharge, scheduleGeneratorDTO.getPenaltyWaitPeriod()); + } } }