Skip to content

Commit

Permalink
Merge pull request apache#496 from ShruthiRajaram/FINERACT-668
Browse files Browse the repository at this point in the history
FINERACT-668 Download bulk import templates fix
  • Loading branch information
ShruthiRajaram authored Dec 12, 2018
2 parents 5e56d93 + ce87284 commit b225748
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ protected void writeDate(int colIndex, Row row, String value, CellStyle dateCell
}

protected void writeBigDecimal(int colIndex, Row row, BigDecimal value) {
row.createCell(colIndex).setCellValue(value.doubleValue());
row.createCell(colIndex).setCellValue(((value != null) ? value.doubleValue() : 0));
}

protected void setOfficeDateLookupTable(Sheet sheet, List<OfficeData> offices, int officeNameCol,
Expand Down Expand Up @@ -142,17 +142,20 @@ protected void setClientAndGroupDateLookupTable(Sheet sheet, List<ClientData> cl

}
}
if (groups!=null){
for (GroupGeneralData group : groups) {
Row row = sheet.getRow(++rowIndex);
if (row == null)
row = sheet.createRow(rowIndex);
writeString(nameCol, row, group.getName().replaceAll("[ )(] ", "_"));

date = inputFormat.parse(group.getActivationDate().toString());
writeDate(activationDateCol, row, outputFormat.format(date), dateCellStyle,dateFormat);
}
}
if (groups != null) {
for (GroupGeneralData group : groups) {
Row row = sheet.getRow(++rowIndex);
if (row == null)
row = sheet.createRow(rowIndex);
writeString(nameCol, row, group.getName().replaceAll("[ )(] ", "_"));

if (group.getActivationDate() != null) {
date = inputFormat.parse(group.getActivationDate().toString());
writeDate(activationDateCol, row, outputFormat.format(date), dateCellStyle, dateFormat);
}

}
}
} catch (ParseException e) {
e.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ private void populateSavingsTable(Sheet savingsTransactionSheet,String dateForma
for(SavingsAccountData savingsAccount : savingsAccounts) {
row = savingsTransactionSheet.createRow(rowIndex++);
writeString(TransactionConstants.LOOKUP_CLIENT_NAME_COL, row, savingsAccount.getClientName() + "(" + savingsAccount.getClientId() + ")");
writeLong(TransactionConstants.LOOKUP_ACCOUNT_NO_COL, row, Long.parseLong(savingsAccount.getAccountNo()));
writeString(TransactionConstants.LOOKUP_ACCOUNT_NO_COL, row, savingsAccount.getAccountNo());
writeString(TransactionConstants.LOOKUP_PRODUCT_COL, row, savingsAccount.getSavingsProductName());
if(savingsAccount.getMinRequiredOpeningBalance() != null)
writeBigDecimal(TransactionConstants.LOOKUP_OPENING_BALANCE_COL, row, savingsAccount.getMinRequiredOpeningBalance());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ private void populateSavingsTable(Sheet addGuarantorSheet,String dateFormat) {
row=addGuarantorSheet.getRow(rowIndex++);
}
writeString(GuarantorConstants.LOOKUP_SAVINGS_CLIENT_NAME_COL, row, savingsAccount.getClientName() + "(" + savingsAccount.getClientId() + ")");
writeLong(GuarantorConstants.LOOKUP_SAVINGS_ACCOUNT_NO_COL, row, Long.parseLong(savingsAccount.getAccountNo()));
writeString(GuarantorConstants.LOOKUP_SAVINGS_ACCOUNT_NO_COL, row,savingsAccount.getAccountNo());
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ private void populateSavingsTable(Sheet savingsTransactionSheet,String dateForma
for(SavingsAccountData savingsAccount : savingsAccounts) {
row = savingsTransactionSheet.createRow(rowIndex++);
writeString(TransactionConstants.LOOKUP_CLIENT_NAME_COL, row, savingsAccount.getClientName() + "(" + savingsAccount.getClientId() + ")");
writeLong(TransactionConstants.LOOKUP_ACCOUNT_NO_COL, row, Long.parseLong(savingsAccount.getAccountNo()));
writeString(TransactionConstants.LOOKUP_ACCOUNT_NO_COL, row, savingsAccount.getAccountNo());
writeString(TransactionConstants.LOOKUP_PRODUCT_COL, row, savingsAccount.getSavingsProductName());
if(savingsAccount.getMinRequiredOpeningBalance() != null)
writeBigDecimal(TransactionConstants.LOOKUP_OPENING_BALANCE_COL, row, savingsAccount.getMinRequiredOpeningBalance());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ private void populateSavingsTable(Sheet savingsTransactionSheet,String dateForma
for(SavingsAccountData savingsAccount : savingsAccounts) {
row = savingsTransactionSheet.createRow(rowIndex++);
writeString(TransactionConstants.LOOKUP_CLIENT_NAME_COL, row, savingsAccount.getClientName() + "(" + savingsAccount.getClientId() + ")");
writeLong(TransactionConstants.LOOKUP_ACCOUNT_NO_COL, row, Long.parseLong(savingsAccount.getAccountNo()));
writeString(TransactionConstants.LOOKUP_ACCOUNT_NO_COL, row, savingsAccount.getAccountNo());
writeString(TransactionConstants.LOOKUP_PRODUCT_COL, row, savingsAccount.getSavingsProductName());
if(savingsAccount.getMinRequiredOpeningBalance() != null)
writeBigDecimal(TransactionConstants.LOOKUP_OPENING_BALANCE_COL, row, savingsAccount.getMinRequiredOpeningBalance());
Expand Down

0 comments on commit b225748

Please sign in to comment.