diff --git a/mifosng-provider/src/main/java/org/mifosplatform/accounting/glaccount/service/GLAccountReadPlatformServiceImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/accounting/glaccount/service/GLAccountReadPlatformServiceImpl.java index 45fabdd15..1380a34bc 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/accounting/glaccount/service/GLAccountReadPlatformServiceImpl.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/accounting/glaccount/service/GLAccountReadPlatformServiceImpl.java @@ -63,7 +63,7 @@ public class GLAccountReadPlatformServiceImpl implements GLAccountReadPlatformSe final EnumOptionData usage = AccountingEnumerations.gLAccountUsage(usageId); final String description = rs.getString("description"); final String nameDecorated = rs.getString("nameDecorated"); - final Long codeId = rs.wasNull()? null : rs.getLong("codeId"); + final Long codeId = rs.wasNull() ? null : rs.getLong("codeId"); final String codeValue = rs.getString("codeValue"); CodeValueData tagId = CodeValueData.instance(codeId, codeValue); return new GLAccountData(id, name, parentId, glCode, disabled, manualEntriesAllowed, accountType, usage, description, diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java index a54c6346b..b6c285350 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanWritePlatformServiceJpaRepositoryImpl.java @@ -694,13 +694,13 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf final List existingReversedTransactionIds = new ArrayList(); this.loanChargeRepository.save(loanCharge); - final LoanTransaction applyLoanChargeTransaction = loan.handleChargeAppliedTransaction(loanCharge, null); final ChangedTransactionDetail changedTransactionDetail = loan.addLoanCharge(loanCharge, existingTransactionIds, existingReversedTransactionIds); // we want to apply charge transactions only for those loans charges // that are applied when a loan is active if (loan.status().isActive()) { + final LoanTransaction applyLoanChargeTransaction = loan.handleChargeAppliedTransaction(loanCharge, null); this.loanTransactionRepository.save(applyLoanChargeTransaction); /*** * TODO Vishwas Batch save is giving me a @@ -714,12 +714,9 @@ public class LoanWritePlatformServiceJpaRepositoryImpl implements LoanWritePlatf this.loanTransactionRepository.save(loanTransaction); } } - } - this.loanRepository.save(loan); - - // we post Journal entries only for loans in active status - if (loan.status().isActive()) { + this.loanRepository.save(loan); + // we post Journal entries only for loans in active status postJournalEntries(loan, existingTransactionIds, existingReversedTransactionIds); }