Skip to content

Commit 7f11d81

Browse files
johnw65vidakovic
authored andcommitted
FINERACT-1557 enable previous disabled refundByCash accounting tests
1 parent 9d4d848 commit 7f11d81

2 files changed

Lines changed: 8 additions & 13 deletions

File tree

fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2100,20 +2100,18 @@ public Date retrieveMinimumDateOfRepaymentTransaction(Long loanId) {
21002100

21012101
@Override
21022102
public PaidInAdvanceData retrieveTotalPaidInAdvance(Long loanId) {
2103-
// TODO Auto-generated method stub
21042103
try {
2105-
final String sql = " select (SUM(COALESCE(mr.principal_completed_derived, 0)) +"
2104+
final String sql = " select (SUM(COALESCE(mr.principal_completed_derived, 0))"
21062105
+ " + SUM(COALESCE(mr.interest_completed_derived, 0)) " + " + SUM(COALESCE(mr.fee_charges_completed_derived, 0)) "
21072106
+ " + SUM(COALESCE(mr.penalty_charges_completed_derived, 0))) as total_in_advance_derived "
21082107
+ " from m_loan ml INNER JOIN m_loan_repayment_schedule mr on mr.loan_id = ml.id "
2109-
+ " where ml.id=? and mr.duedate >= ? group by ml.id having " + " (SUM(COALESCE(mr.principal_completed_derived, 0)) "
2110-
+ " + SUM(COALESCE(mr.interest_completed_derived, 0)) " + " + SUM(COALESCE(mr.fee_charges_completed_derived, 0)) "
2108+
+ " where ml.id=? and mr.duedate >= " + sqlGenerator.currentDate() + " group by ml.id having "
2109+
+ " (SUM(COALESCE(mr.principal_completed_derived, 0)) " + " + SUM(COALESCE(mr.interest_completed_derived, 0)) "
2110+
+ " + SUM(COALESCE(mr.fee_charges_completed_derived, 0)) "
21112111
+ "+ SUM(COALESCE(mr.penalty_charges_completed_derived, 0))) > 0";
2112-
BigDecimal bigDecimal = this.jdbcTemplate.queryForObject(sql, BigDecimal.class,
2113-
new Object[] { loanId, sqlGenerator.currentDate() }); // NOSONAR
2112+
BigDecimal bigDecimal = this.jdbcTemplate.queryForObject(sql, BigDecimal.class, new Object[] { loanId }); // NOSONAR
21142113
return new PaidInAdvanceData(bigDecimal);
21152114
} catch (DataAccessException e) {
2116-
// TODO Auto-generated catch block
21172115
return new PaidInAdvanceData(new BigDecimal(0));
21182116
}
21192117
}

integration-tests/src/test/java/org/apache/fineract/integrationtests/ClientLoanIntegrationTest.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4714,8 +4714,7 @@ private void verifyLoanRepaymentSchedule(final ArrayList<HashMap> loanSchedule,
47144714
/***
47154715
* Test case to verify default Style payment strategy
47164716
*/
4717-
// @Test // TODO: @galovics failing since
4718-
// https://github.com/apache/fineract/commit/d5c611564f7b8c877136f3b3aca647bf7de15fe0
4717+
@Test
47194718
public void testLoanRefundByCashCashBasedAccounting() {
47204719
this.journalEntryHelper = new JournalEntryHelper(this.requestSpec, this.responseSpec);
47214720

@@ -4898,8 +4897,7 @@ public void testLoanRefundByCashCashBasedAccounting() {
48984897
/***
48994898
* Test case to verify Default style payment strategy
49004899
*/
4901-
// @Test // TODO: @galovics failing since
4902-
// https://github.com/apache/fineract/commit/d5c611564f7b8c877136f3b3aca647bf7de15fe0
4900+
@Test
49034901
public void testLoanRefundByCashAccrualBasedAccounting() {
49044902
this.journalEntryHelper = new JournalEntryHelper(this.requestSpec, this.responseSpec);
49054903

@@ -5077,8 +5075,7 @@ public void testLoanRefundByCashAccrualBasedAccounting() {
50775075

50785076
}
50795077

5080-
// @Test // TODO: @galovics failing since
5081-
// https://github.com/apache/fineract/commit/d5c611564f7b8c877136f3b3aca647bf7de15fe0
5078+
@Test
50825079
public void testLoanRefundByTransferCashBasedAccounting() {
50835080
this.journalEntryHelper = new JournalEntryHelper(this.requestSpec, this.responseSpec);
50845081
this.savingsAccountHelper = new SavingsAccountHelper(this.requestSpec, this.responseSpec);

0 commit comments

Comments
 (0)