diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java index bf126f58d..c9504b4b2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java @@ -2100,20 +2100,18 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService { @Override public PaidInAdvanceData retrieveTotalPaidInAdvance(Long loanId) { - // TODO Auto-generated method stub try { - final String sql = " select (SUM(COALESCE(mr.principal_completed_derived, 0)) +" + final String sql = " select (SUM(COALESCE(mr.principal_completed_derived, 0))" + " + SUM(COALESCE(mr.interest_completed_derived, 0)) " + " + SUM(COALESCE(mr.fee_charges_completed_derived, 0)) " + " + SUM(COALESCE(mr.penalty_charges_completed_derived, 0))) as total_in_advance_derived " + " from m_loan ml INNER JOIN m_loan_repayment_schedule mr on mr.loan_id = ml.id " - + " where ml.id=? and mr.duedate >= ? group by ml.id having " + " (SUM(COALESCE(mr.principal_completed_derived, 0)) " - + " + SUM(COALESCE(mr.interest_completed_derived, 0)) " + " + SUM(COALESCE(mr.fee_charges_completed_derived, 0)) " + + " where ml.id=? and mr.duedate >= " + sqlGenerator.currentDate() + " group by ml.id having " + + " (SUM(COALESCE(mr.principal_completed_derived, 0)) " + " + SUM(COALESCE(mr.interest_completed_derived, 0)) " + + " + SUM(COALESCE(mr.fee_charges_completed_derived, 0)) " + "+ SUM(COALESCE(mr.penalty_charges_completed_derived, 0))) > 0"; - BigDecimal bigDecimal = this.jdbcTemplate.queryForObject(sql, BigDecimal.class, - new Object[] { loanId, sqlGenerator.currentDate() }); // NOSONAR + BigDecimal bigDecimal = this.jdbcTemplate.queryForObject(sql, BigDecimal.class, new Object[] { loanId }); // NOSONAR return new PaidInAdvanceData(bigDecimal); } catch (DataAccessException e) { - // TODO Auto-generated catch block return new PaidInAdvanceData(new BigDecimal(0)); } } diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/ClientLoanIntegrationTest.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/ClientLoanIntegrationTest.java index 965e84c9d..b5324799b 100644 --- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/ClientLoanIntegrationTest.java +++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/ClientLoanIntegrationTest.java @@ -4714,8 +4714,7 @@ public class ClientLoanIntegrationTest { /*** * Test case to verify default Style payment strategy */ - // @Test // TODO: @galovics failing since - // https://github.com/apache/fineract/commit/d5c611564f7b8c877136f3b3aca647bf7de15fe0 + @Test public void testLoanRefundByCashCashBasedAccounting() { this.journalEntryHelper = new JournalEntryHelper(this.requestSpec, this.responseSpec); @@ -4898,8 +4897,7 @@ public class ClientLoanIntegrationTest { /*** * Test case to verify Default style payment strategy */ - // @Test // TODO: @galovics failing since - // https://github.com/apache/fineract/commit/d5c611564f7b8c877136f3b3aca647bf7de15fe0 + @Test public void testLoanRefundByCashAccrualBasedAccounting() { this.journalEntryHelper = new JournalEntryHelper(this.requestSpec, this.responseSpec); @@ -5077,8 +5075,7 @@ public class ClientLoanIntegrationTest { } - // @Test // TODO: @galovics failing since - // https://github.com/apache/fineract/commit/d5c611564f7b8c877136f3b3aca647bf7de15fe0 + @Test public void testLoanRefundByTransferCashBasedAccounting() { this.journalEntryHelper = new JournalEntryHelper(this.requestSpec, this.responseSpec); this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);