You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/12/12 06:02:00 UTC

[jira] [Commented] (FINERACT-668) In Bulk Import Section, Not able to download templates

    [ https://issues.apache.org/jira/browse/FINERACT-668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16718496#comment-16718496 ] 

ASF GitHub Bot commented on FINERACT-668:
-----------------------------------------

ShruthiRajaram closed pull request #496: FINERACT-668 Download bulk import templates fix
URL: https://github.com/apache/fineract/pull/496
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/AbstractWorkbookPopulator.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/AbstractWorkbookPopulator.java
index d92b90337..731390bbc 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/AbstractWorkbookPopulator.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/AbstractWorkbookPopulator.java
@@ -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,
@@ -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();
             }
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/fixeddeposits/FixedDepositTransactionWorkbookPopulator.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/fixeddeposits/FixedDepositTransactionWorkbookPopulator.java
index cd7dd9bd2..0b2d32419 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/fixeddeposits/FixedDepositTransactionWorkbookPopulator.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/fixeddeposits/FixedDepositTransactionWorkbookPopulator.java
@@ -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());
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/guarantor/GuarantorWorkbookPopulator.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/guarantor/GuarantorWorkbookPopulator.java
index 912eb2b1a..945526fca 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/guarantor/GuarantorWorkbookPopulator.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/guarantor/GuarantorWorkbookPopulator.java
@@ -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());
             }
 
     }
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/recurringdeposit/RecurringDepositTransactionWorkbookPopulator.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/recurringdeposit/RecurringDepositTransactionWorkbookPopulator.java
index d462b5f65..874d1cdba 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/recurringdeposit/RecurringDepositTransactionWorkbookPopulator.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/recurringdeposit/RecurringDepositTransactionWorkbookPopulator.java
@@ -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());
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/savings/SavingsTransactionsWorkbookPopulator.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/savings/SavingsTransactionsWorkbookPopulator.java
index 2573b7106..29f195369 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/savings/SavingsTransactionsWorkbookPopulator.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/populator/savings/SavingsTransactionsWorkbookPopulator.java
@@ -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());


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> In Bulk Import Section, Not  able to download templates
> -------------------------------------------------------
>
>                 Key: FINERACT-668
>                 URL: https://issues.apache.org/jira/browse/FINERACT-668
>             Project: Apache Fineract
>          Issue Type: Bug
>          Components: Organization
>    Affects Versions: 1.1.0
>            Reporter: Santosh Math
>            Assignee: Shruthi  M R
>            Priority: Critical
>              Labels: p1
>             Fix For: 1.3.0
>
>         Attachments: 500 internal server error.png
>
>
> 1) Go to Organization>Bulk Import and try to download template for the following:
>  >Loan Accounts
>  >Savings Accounts
>  >Savings Transactions
>  >Fixed Deposit Transactions
>  >Recurring Deposit Transactions
>  >Guarantors
> It's throwing 500 internal server error in next navigation page. 
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)