commit for FINERACT-44 (Cannot delete an inactive charge associated with a product (loan/savings))
This commit is contained in:
+2
-2
@@ -233,14 +233,14 @@ public class ChargeWritePlatformServiceJpaRepositoryImpl implements ChargeWriteP
|
|||||||
|
|
||||||
private boolean isAnyLoansAssociateWithThisCharge(final Long chargeId) {
|
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 });
|
final String isLoansUsingCharge = this.jdbcTemplate.queryForObject(sql, String.class, new Object[] { chargeId });
|
||||||
return new Boolean(isLoansUsingCharge);
|
return new Boolean(isLoansUsingCharge);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isAnySavingsAssociateWithThisCharge(final Long chargeId) {
|
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 });
|
final String isSavingsUsingCharge = this.jdbcTemplate.queryForObject(sql, String.class, new Object[] { chargeId });
|
||||||
return new Boolean(isSavingsUsingCharge);
|
return new Boolean(isSavingsUsingCharge);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user