commit for FINERACT-44 (Cannot delete an inactive charge associated with a product (loan/savings))

This commit is contained in:
Emmanuel Nnaa
2016-07-14 15:32:59 +02:00
parent 5ac0da03d3
commit 65df32c444
@@ -233,14 +233,14 @@ public class ChargeWritePlatformServiceJpaRepositoryImpl implements ChargeWriteP
private boolean isAnyLoansAssociateWithThisCharge(final Long chargeId) {
final String sql = "select if((exists (select 1 from m_loan_charge lc where lc.charge_id = ?)) = 1, 'true', 'false')";
final String sql = "select if((exists (select 1 from m_loan_charge lc where lc.charge_id = ? and lc.is_active = 1)) = 1, 'true', 'false')";
final String isLoansUsingCharge = this.jdbcTemplate.queryForObject(sql, String.class, new Object[] { chargeId });
return new Boolean(isLoansUsingCharge);
}
private boolean isAnySavingsAssociateWithThisCharge(final Long chargeId) {
final String sql = "select if((exists (select 1 from m_savings_account_charge sc where sc.charge_id = ?)) = 1, 'true', 'false')";
final String sql = "select if((exists (select 1 from m_savings_account_charge sc where sc.charge_id = ? and sc.is_active = 1)) = 1, 'true', 'false')";
final String isSavingsUsingCharge = this.jdbcTemplate.queryForObject(sql, String.class, new Object[] { chargeId });
return new Boolean(isSavingsUsingCharge);
}