Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
*
* <p>
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand All @@ -22,6 +22,7 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.List;

import org.apache.fineract.infrastructure.bulkimport.constants.TemplatePopulateImportConstants;
import org.apache.fineract.infrastructure.bulkimport.constants.TransactionConstants;
import org.apache.fineract.infrastructure.bulkimport.populator.AbstractWorkbookPopulator;
Expand Down Expand Up @@ -54,7 +55,7 @@ public class FixedDepositTransactionWorkbookPopulator extends AbstractWorkbookPo
private final List<SavingsAccountData> savingsAccounts;

public FixedDepositTransactionWorkbookPopulator(OfficeSheetPopulator officeSheetPopulator, ClientSheetPopulator clientSheetPopulator,
ExtrasSheetPopulator extrasSheetPopulator, List<SavingsAccountData> savingsAccounts) {
ExtrasSheetPopulator extrasSheetPopulator, List<SavingsAccountData> savingsAccounts) {
this.officeSheetPopulator = officeSheetPopulator;
this.clientSheetPopulator = clientSheetPopulator;
this.extrasSheetPopulator = extrasSheetPopulator;
Expand All @@ -75,7 +76,7 @@ public void populate(Workbook workbook, String dateFormat) {
}

private void setDefaults(Sheet worksheet) {
for (Integer rowNo = 1; rowNo < 3000; rowNo++) {
for (int rowNo = 1; rowNo < 3000; rowNo++) {
Row row = worksheet.getRow(rowNo);
if (row == null) {
row = worksheet.createRow(rowNo);
Expand Down Expand Up @@ -103,9 +104,10 @@ private void setTextFormatStyle(Workbook workbook, Sheet worksheet, int... textC
for (int col : textCols) {
Cell cell = row.getCell(col);
if (cell == null) {
cell = row.createCell(col);
cell = row.createCell(col, CellType.STRING);
} else if (cell.getCellType() != CellType.STRING) {
cell = row.createCell(col, CellType.STRING);
}
cell.setCellType(CellType.STRING);
cell.setCellStyle(textCellStyle);
}
}
Expand Down Expand Up @@ -135,7 +137,7 @@ private void setRules(Sheet worksheet, String dateFormat) {
DataValidationConstraint accountNumberConstraint = validationHelper.createFormulaListConstraint(
"INDIRECT(CONCATENATE(\"Account_\",SUBSTITUTE(SUBSTITUTE(SUBSTITUTE($B1,\" \",\"_\"),\"(\",\"_\"),\")\",\"_\")))");
DataValidationConstraint transactionTypeConstraint = validationHelper
.createExplicitListConstraint(new String[] { "Withdrawal", "Deposit" });
.createExplicitListConstraint(new String[]{"Withdrawal", "Deposit"});
DataValidationConstraint paymentTypeConstraint = validationHelper.createFormulaListConstraint("PaymentTypes");
DataValidationConstraint transactionDateConstraint = validationHelper.createDateConstraint(
DataValidationConstraint.OperatorType.BETWEEN,
Expand Down Expand Up @@ -166,7 +168,7 @@ private void setNames(Sheet worksheet) {
officeGroup.setRefersToFormula(TemplatePopulateImportConstants.OFFICE_SHEET_NAME + "!$B$2:$B$" + (officeNames.size() + 1));

// Clients Named after Offices
for (Integer i = 0; i < officeNames.size(); i++) {
for (int i = 0; i < officeNames.size(); i++) {
Integer[] officeNameToBeginEndIndexesOfClients = clientSheetPopulator.getOfficeNameToBeginEndIndexesOfClients().get(i);
Name name = savingsTransactionWorkbook.createName();
if (officeNameToBeginEndIndexesOfClients != null) {
Expand All @@ -188,7 +190,7 @@ private void setNames(Sheet worksheet) {
for (int i = 0; i < savingsAccounts.size(); i++) {
if (!clientName.equals(savingsAccounts.get(i).getClientName())) {
endIndex = i + 1;
clientNameToBeginEndIndexes.put(clientName, new Integer[] { startIndex, endIndex });
clientNameToBeginEndIndexes.put(clientName, new Integer[]{startIndex, endIndex});
startIndex = i + 2;
clientName = savingsAccounts.get(i).getClientName();
clientId = savingsAccounts.get(i).getClientId();
Expand All @@ -197,7 +199,7 @@ private void setNames(Sheet worksheet) {
}
if (i == savingsAccounts.size() - 1) {
endIndex = i + 2;
clientNameToBeginEndIndexes.put(clientName, new Integer[] { startIndex, endIndex });
clientNameToBeginEndIndexes.put(clientName, new Integer[]{startIndex, endIndex});
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void populate(Workbook workbook, String dateFormat) {
}

private void setDefaults(Sheet worksheet) {
for (Integer rowNo = 1; rowNo < 3000; rowNo++) {
for (int rowNo = 1; rowNo < 3000; rowNo++) {
Row row = worksheet.getRow(rowNo);
if (row == null) {
row = worksheet.createRow(rowNo);
Expand Down Expand Up @@ -104,9 +104,10 @@ private void setTextFormatStyle(Workbook workbook, Sheet worksheet, int... textC
for (int col : textCols) {
Cell cell = row.getCell(col);
if (cell == null) {
cell = row.createCell(col);
cell = row.createCell(col, CellType.STRING);
} else if (cell.getCellType() != CellType.STRING) {
cell = row.createCell(col, CellType.STRING);
}
cell.setCellType(CellType.STRING);
cell.setCellStyle(textCellStyle);
}
}
Expand Down Expand Up @@ -167,7 +168,7 @@ private void setNames(Sheet worksheet) {
officeGroup.setRefersToFormula(TemplatePopulateImportConstants.OFFICE_SHEET_NAME + "!$B$2:$B$" + (officeNames.size() + 1));

// Clients Named after Offices
for (Integer i = 0; i < officeNames.size(); i++) {
for (int i = 0; i < officeNames.size(); i++) {
Integer[] officeNameToBeginEndIndexesOfClients = clientSheetPopulator.getOfficeNameToBeginEndIndexesOfClients().get(i);
Name name = savingsTransactionWorkbook.createName();
if (officeNameToBeginEndIndexesOfClients != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void populate(Workbook workbook, String dateFormat) {
}

private void setDefaults(Sheet worksheet) {
for (Integer rowNo = 1; rowNo < 3000; rowNo++) {
for (int rowNo = 1; rowNo < 3000; rowNo++) {
Row row = worksheet.getRow(rowNo);
if (row == null) {
row = worksheet.createRow(rowNo);
Expand Down Expand Up @@ -103,9 +103,10 @@ private void setTextFormatStyle(Workbook workbook, Sheet worksheet, int... textC
for (int col : textCols) {
Cell cell = row.getCell(col);
if (cell == null) {
cell = row.createCell(col);
cell = row.createCell(col, CellType.STRING);
} else if (cell.getCellType() != CellType.STRING) {
cell = row.createCell(col, CellType.STRING);
}
cell.setCellType(CellType.STRING);
cell.setCellStyle(textCellStyle);
}
}
Expand Down Expand Up @@ -166,7 +167,7 @@ private void setNames(Sheet worksheet) {
officeGroup.setRefersToFormula(TemplatePopulateImportConstants.OFFICE_SHEET_NAME + "!$B$2:$B$" + (officeNames.size() + 1));

// Clients Named after Offices
for (Integer i = 0; i < officeNames.size(); i++) {
for (int i = 0; i < officeNames.size(); i++) {
Integer[] officeNameToBeginEndIndexesOfClients = clientSheetPopulator.getOfficeNameToBeginEndIndexesOfClients().get(i);
Name name = savingsTransactionWorkbook.createName();
if (officeNameToBeginEndIndexesOfClients != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public RepeatStatus execute(StepContribution contribution, ChunkContext chunkCon
String key = validateStretchyReportParamMapEntry.getKey();
String value = validateStretchyReportParamMapEntry.getValue();

if (StringUtils.containsIgnoreCase(key, "date")) {
if (key != null && key.toLowerCase().contains("date")) {
ReportMailingJobStretchyReportParamDateOption reportMailingJobStretchyReportParamDateOption = ReportMailingJobStretchyReportParamDateOption
.newInstance(value);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public CustomAuditingHandler(PersistentEntities entities) {
* @since 1.8
* @deprecated use {@link AuditingHandler(PersistentEntities)} instead.
*/
@Deprecated
public CustomAuditingHandler(MappingContext<? extends PersistentEntity<?, ?>, ? extends PersistentProperty<?>> mappingContext,
AuditorAware<?> auditorAware) {
this(PersistentEntities.of(mappingContext));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.apache.fineract.infrastructure.core.data.EnumOptionData;

public enum ReportMailingJobEmailAttachmentFileFormat {
Expand Down Expand Up @@ -50,11 +49,11 @@ public enum ReportMailingJobEmailAttachmentFileFormat {
public static ReportMailingJobEmailAttachmentFileFormat newInstance(final String value) {
ReportMailingJobEmailAttachmentFileFormat emailAttachmentFileFormat = INVALID;

if (StringUtils.equalsIgnoreCase(value, XLS.value)) {
if (XLS.value.equalsIgnoreCase(value)) {
emailAttachmentFileFormat = XLS;
} else if (StringUtils.equalsIgnoreCase(value, PDF.value)) {
} else if (PDF.value.equalsIgnoreCase(value)) {
emailAttachmentFileFormat = PDF;
} else if (StringUtils.equalsIgnoreCase(value, CSV.value)) {
} else if (CSV.value.equalsIgnoreCase(value)) {
emailAttachmentFileFormat = CSV;
}

Expand Down
Loading