fix for MIFOSX-474

This commit is contained in:
Vishwas Babu AJ
2013-06-19 19:43:59 +05:30
parent 3c9184bf1c
commit d414e677d6
@@ -450,7 +450,16 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf
final String noteText = command.stringValueOfParameterNamed("note");
if (StringUtils.isNotBlank(noteText)) {
changes.put("note", noteText);
Note note = Note.loanTransactionNote(loan, newTransactionDetail, noteText);
Note note = null;
/**
* If a new transaction is not created, associate note with the
* transaction to be adjusted
**/
if (newTransactionDetail.isGreaterThanZero(loan.getPrincpal().getCurrency())) {
note = Note.loanTransactionNote(loan, newTransactionDetail, noteText);
} else {
note = Note.loanTransactionNote(loan, transactionToAdjust, noteText);
}
this.noteRepository.save(note);
}