Skip to content

Commit

Permalink
FINERACT-1806: fix ProductToGLAccountMapping
Browse files Browse the repository at this point in the history
  • Loading branch information
magyari-adam committed Dec 11, 2024
1 parent bb8480a commit e899bc8
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ public Map<String, Object> mapRow(final ResultSet rs, @SuppressWarnings("unused"
final String codeValue = rs.getString("codeValueName");
final String codeDescription = rs.getString("codeDescription");
final Integer orderPosition = rs.getInt("orderPosition");
final Integer isActive = rs.getInt("isActive");
final Integer isMandatory = rs.getInt("isMandatory");
final Boolean isActive = rs.getBoolean("isActive");
final Boolean isMandatory = rs.getBoolean("isMandatory");

final Map<String, Object> loanProductToGLAccountMap = new LinkedHashMap<>(5);
loanProductToGLAccountMap.put("id", id);
Expand Down Expand Up @@ -377,12 +377,10 @@ private List<ChargeOffReasonToGLAccountMapper> fetchChargeOffReasonMappings(fina
final String codeValue = (String) chargeOffReasonMap.get("codeValue");
final String codeDescription = (String) chargeOffReasonMap.get("codeDescription");
final Integer orderPosition = (Integer) chargeOffReasonMap.get("orderPosition");
final Integer isActive = (Integer) chargeOffReasonMap.get("isActive");
final Integer isMandatory = (Integer) chargeOffReasonMap.get("isMandatory");
final boolean active = isActive != null && isActive == 1;
final boolean mandatory = isMandatory != null && isMandatory == 1;
final Boolean isActive = (Boolean) chargeOffReasonMap.get("isActive");
final Boolean isMandatory = (Boolean) chargeOffReasonMap.get("isMandatory");
final CodeValueData chargeOffReasonsCodeValue = CodeValueData.builder().id(Long.valueOf(chargeOffReasonId)).name(codeValue)
.description(codeDescription).position(orderPosition).active(active).mandatory(mandatory).build();
.description(codeDescription).position(orderPosition).active(isActive).mandatory(isMandatory).build();

final ChargeOffReasonToGLAccountMapper chargeOffReasonToGLAccountMapper = new ChargeOffReasonToGLAccountMapper()
.setChargeOffReasonsCodeValue(chargeOffReasonsCodeValue).setChargeOffExpenseAccount(chargeOffExpenseAccount);
Expand Down

0 comments on commit e899bc8

Please sign in to comment.