Merge pull request #379 from vishwasbabu/bug-fix

fix for MIFOSX-474
This commit is contained in:
Vishwas Babu A J
2013-06-19 07:29:07 -07:00
@@ -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);
}