diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/group/GroupImportHandler.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/group/GroupImportHandler.java index 068e8741f..ada465d58 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/group/GroupImportHandler.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/bulkimport/importhandler/group/GroupImportHandler.java @@ -131,7 +131,7 @@ public class GroupImportHandler implements ImportHandler { if (clientName==null) break; Long clientId = ImportHandlerUtils.getIdByName(workbook.getSheet(TemplatePopulateImportConstants.CLIENT_SHEET_NAME), clientName); - ClientData clientData = new ClientData(clientId); + ClientData clientData = ClientData.emptyInstance(clientId); if (!containsClientId(clientMembers,clientId)) { clientMembers.add(clientData); } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/data/ClientData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/data/ClientData.java index bed206fde..96f136db6 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/data/ClientData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/data/ClientData.java @@ -123,30 +123,36 @@ final public class ClientData implements Comparable { Long clientClassificationId,Long staffId,Boolean active,LocalDate activationDate,LocalDate submittedOnDate, String externalId,LocalDate dateOfBirth,String mobileNo,ClientNonPersonData clientNonPersonDetails, AddressData address,String locale,String dateFormat){ - return new ClientData(legalFormId,rowIndex,fullname,officeId,clientTypeId,clientClassificationId, - staffId,active,activationDate,submittedOnDate, externalId,dateOfBirth,mobileNo,clientNonPersonDetails,address, - locale,dateFormat); + return new ClientData(legalFormId,rowIndex,fullname, null, null, null, submittedOnDate,activationDate,active, externalId, + officeId, staffId,mobileNo,dateOfBirth,clientTypeId, null,clientClassificationId,null, + address,clientNonPersonDetails, locale,dateFormat); } public static ClientData importClientPersonInstance(Long legalFormId,Integer rowIndex,String firstName,String lastName,String middleName, LocalDate submittedOn,LocalDate activationDate,Boolean active,String externalId,Long officeId, Long staffId,String mobileNo, LocalDate dob,Long clientTypeId,Long genderId, - Long clientClassificationId,Boolean isStaff,AddressData address,String locale,String dateFormat){ + Long clientClassificationId, Boolean isStaff, AddressData address,String locale,String dateFormat){ - return new ClientData(legalFormId,rowIndex,firstName,lastName,middleName,submittedOn,activationDate,active,externalId, - officeId,staffId,mobileNo,dob,clientTypeId,genderId,clientClassificationId,isStaff,address,locale,dateFormat); + return new ClientData(legalFormId,rowIndex, null, firstName,lastName,middleName,submittedOn,activationDate,active,externalId, + officeId,staffId,mobileNo,dob,clientTypeId,genderId,clientClassificationId,isStaff,address, null, locale,dateFormat); + } + + public static ClientData emptyInstance(Long clientId) { + return lookup(clientId, null, null, null); } - private ClientData(Long legalFormId,Integer rowIndex,String firstname,String lastname,String middlename, + private ClientData(Long legalFormId,Integer rowIndex, String fullname, String firstname,String lastname,String middlename, LocalDate submittedOn,LocalDate activationDate,Boolean active,String externalId,Long officeId, Long staffId,String mobileNo, LocalDate dob,Long clientTypeId,Long genderId, - Long clientClassificationId,Boolean isStaff,AddressData address,String locale,String dateFormat ) { + Long clientClassificationId,Boolean isStaff, AddressData address, ClientNonPersonData clientNonPersonDetails, + String locale,String dateFormat ) { this.rowIndex=rowIndex; this.dateFormat=dateFormat; this.locale= locale; this.firstname = firstname; this.lastname = lastname; this.middlename = middlename; + this.fullname = fullname; this.activationDate=activationDate; this.submittedOnDate=submittedOn; this.active=active; @@ -165,7 +171,6 @@ final public class ClientData implements Comparable { this.accountNo = null; this.status = null; this.subStatus = null; - this.fullname = null; this.displayName = null; this.gender = null; this.clientType = null; @@ -197,120 +202,10 @@ final public class ClientData implements Comparable { this.isAddressEnabled =null; this.datatables = null; this.familyMemberOptions=null; + this.emailAddress = null; } - private ClientData(Long legalFormId,Integer rowIndex,String fullname,Long officeId, Long clientTypeId, - Long clientClassificationId,Long staffId,Boolean active,LocalDate activationDate,LocalDate submittedOnDate, - String externalId,LocalDate dateOfBirth,String mobileNo,ClientNonPersonData clientNonPersonDetails, - AddressData address,String locale,String dateFormat) { - this.id = null; - this.accountNo = null; - this.externalId = externalId; - this.status = null; - this.subStatus = null; - this.active = active; - this.activationDate = activationDate; - this.firstname = null; - this.middlename = null; - this.lastname = null; - this.fullname = fullname; - this.displayName = null; - this.mobileNo = mobileNo; - this.dateOfBirth = dateOfBirth; - this.gender = null; - this.clientType = null; - this.clientClassification = null; - this.isStaff = null; - this.officeId = officeId; - this.officeName = null; - this.transferToOfficeId = null; - this.transferToOfficeName = null; - this.imageId = null; - this.imagePresent = null; - this.staffId = staffId; - this.staffName = null; - this.timeline = null; - this.savingsProductId = null; - this.savingsProductName = null; - this.savingsAccountId = null; - this.legalForm = null; - this.groups = null; - this.officeOptions = null; - this.staffOptions = null; - this.narrations = null; - this.savingProductOptions = null; - this.savingAccountOptions = null; - this.genderOptions = null; - this.clientTypeOptions = null; - this.clientClassificationOptions = null; - this.clientNonPersonConstitutionOptions = null; - this.clientNonPersonMainBusinessLineOptions = null; - this.clientLegalFormOptions = null; - this.clientNonPersonDetails = clientNonPersonDetails; - this.address = address; - this.isAddressEnabled = null; - this.datatables = null; - this.rowIndex = rowIndex; - this.dateFormat=dateFormat; - this.locale= locale; - this.clientTypeId = clientTypeId; - this.genderId = null; - this.clientClassificationId = clientClassificationId; - this.legalFormId = legalFormId; - this.submittedOnDate = submittedOnDate; - this.familyMemberOptions=null; - } - public ClientData(Long id) { - this.id = id; - this.accountNo = null; - this.externalId = null; - this.status = null; - this.subStatus = null; - this.active = null; - this.activationDate = null; - this.firstname = null; - this.middlename = null; - this.lastname = null; - this.fullname = null; - this.displayName = null; - this.mobileNo = null; - this.dateOfBirth = null; - this.gender = null; - this.clientType = null; - this.clientClassification = null; - this.isStaff = null; - this.officeId = null; - this.officeName = null; - this.transferToOfficeId = null; - this.transferToOfficeName = null; - this.imageId = null; - this.imagePresent = null; - this.staffId = null; - this.staffName = null; - this.timeline = null; - this.savingsProductId = null; - this.savingsProductName = null; - this.savingsAccountId = null; - this.legalForm = null; - this.groups = null; - this.officeOptions = null; - this.staffOptions = null; - this.narrations = null; - this.savingProductOptions = null; - this.savingAccountOptions = null; - this.genderOptions = null; - this.clientTypeOptions = null; - this.clientClassificationOptions = null; - this.clientNonPersonConstitutionOptions = null; - this.clientNonPersonMainBusinessLineOptions = null; - this.clientLegalFormOptions = null; - this.clientNonPersonDetails = null; - this.address = null; - this.isAddressEnabled = null; - this.datatables = null; - this.familyMemberOptions=null; - } public Integer getRowIndex() { return rowIndex; diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanAccountData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanAccountData.java index 2cdbfb8d1..0432cbbb2 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanAccountData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanAccountData.java @@ -248,6 +248,26 @@ public class LoanAccountData { rowIndex, externalId, null, charges, linkAccountId,locale,dateFormat); } + + public static LoanAccountData importInstanceGroup(EnumOptionData loanTypeEnumOption,Long groupIdforGroupLoan,Long productId, + Long loanOfficerId,LocalDate submittedOnDate, + Long fundId,BigDecimal principal, Integer numberOfRepayments,Integer repaidEvery, + EnumOptionData repaidEveryFrequencyEnums, Integer loanTermFrequency,EnumOptionData loanTermFrequencyTypeEnum, + BigDecimal nominalInterestRate, EnumOptionData amortizationEnumOption,EnumOptionData interestMethodEnum, + EnumOptionData interestCalculationPeriodEnum,BigDecimal arrearsTolerance, + Long transactionProcessingStrategyId, + Integer graceOnPrincipalPayment,Integer graceOnInterestPayment,Integer graceOnInterestCharged, + LocalDate interestChargedFromDate,LocalDate repaymentsStartingFromDate, + Integer rowIndex ,String externalId,String linkAccountId,String locale,String dateFormat){ + + return new LoanAccountData(loanTypeEnumOption, groupIdforGroupLoan, productId, loanOfficerId, submittedOnDate, fundId, + principal, numberOfRepayments, + repaidEvery, repaidEveryFrequencyEnums, loanTermFrequency, loanTermFrequencyTypeEnum, nominalInterestRate, null, + amortizationEnumOption, interestMethodEnum, interestCalculationPeriodEnum, arrearsTolerance, + transactionProcessingStrategyId, graceOnPrincipalPayment, graceOnInterestPayment, graceOnInterestCharged, + interestChargedFromDate, repaymentsStartingFromDate, rowIndex, externalId, null, null, linkAccountId,locale,dateFormat); + } + private LoanAccountData(EnumOptionData loanType,Long clientId,Long productId,Long loanOfficerId,LocalDate submittedOnDate, Long fundId,BigDecimal principal, Integer numberOfRepayments,Integer repaymentEvery, EnumOptionData repaymentFrequencyType, Integer loanTermFrequency,EnumOptionData loanTermFrequencyType, @@ -394,171 +414,7 @@ public class LoanAccountData { this.isVariableInstallmentsAllowed = null; this.minimumGap = null; this.maximumGap = null; - } - - public static LoanAccountData importInstanceGroup(EnumOptionData loanTypeEnumOption,Long groupIdforGroupLoan,Long productId, - Long loanOfficerId,LocalDate submittedOnDate, - Long fundId,BigDecimal principal, Integer numberOfRepayments,Integer repaidEvery, - EnumOptionData repaidEveryFrequencyEnums, Integer loanTermFrequency,EnumOptionData loanTermFrequencyTypeEnum, - BigDecimal nominalInterestRate, EnumOptionData amortizationEnumOption,EnumOptionData interestMethodEnum, - EnumOptionData interestCalculationPeriodEnum,BigDecimal arrearsTolerance, - Long transactionProcessingStrategyId, - Integer graceOnPrincipalPayment,Integer graceOnInterestPayment,Integer graceOnInterestCharged, - LocalDate interestChargedFromDate,LocalDate repaymentsStartingFromDate, - Integer rowIndex ,String externalId,String linkAccountId,String locale,String dateFormat){ - - return new LoanAccountData(loanTypeEnumOption, groupIdforGroupLoan, productId, loanOfficerId, submittedOnDate, fundId, - principal, numberOfRepayments, - repaidEvery, repaidEveryFrequencyEnums, loanTermFrequency, loanTermFrequencyTypeEnum, nominalInterestRate, - amortizationEnumOption, interestMethodEnum, interestCalculationPeriodEnum, arrearsTolerance, - transactionProcessingStrategyId, graceOnPrincipalPayment, graceOnInterestPayment, graceOnInterestCharged, - interestChargedFromDate, repaymentsStartingFromDate, rowIndex, externalId, linkAccountId,locale,dateFormat); - } - private LoanAccountData(EnumOptionData loanType,Long clientId,Long productId,Long loanOfficerId,LocalDate submittedOnDate, - Long fundId,BigDecimal principal, Integer numberOfRepayments,Integer repaymentEvery, - EnumOptionData repaymentFrequencyType, Integer loanTermFrequency,EnumOptionData loanTermFrequencyType, - BigDecimal interestRatePerPeriod, EnumOptionData amortizationType,EnumOptionData interestType, - EnumOptionData interestCalculationPeriodType,BigDecimal inArrearsTolerance, - Long transactionProcessingStrategyId, - Integer graceOnPrincipalPayment,Integer graceOnInterestPayment,Integer graceOnInterestCharged, - LocalDate interestChargedFromDate,LocalDate repaymentsStartingFromDate, - Integer rowIndex ,String externalId,String linkAccountId,String locale,String dateFormat) { - this.dateFormat=dateFormat; - this.locale= locale; - this.rowIndex=rowIndex; - this.submittedOnDate=submittedOnDate; - this.productId=productId; - this.loanTermFrequency=loanTermFrequency; - this.loanTermFrequencyType=loanTermFrequencyType; - this.repaymentsStartingFromDate=repaymentsStartingFromDate; - this.linkAccountId=linkAccountId; - this.externalId = externalId; - this.clientId = clientId; - this.fundId = fundId; - this.loanOfficerId = loanOfficerId; - this.numberOfRepayments = numberOfRepayments; - this.loanType = loanType; - this.principal = principal; - this.repaymentEvery = repaymentEvery; - this.repaymentFrequencyType = repaymentFrequencyType; - this.interestRatePerPeriod = interestRatePerPeriod; - this.amortizationType = amortizationType; - this.interestType = interestType; - this.interestCalculationPeriodType = interestCalculationPeriodType; - this.inArrearsTolerance = inArrearsTolerance; - this.transactionProcessingStrategyId = transactionProcessingStrategyId; - this.graceOnInterestPayment = graceOnInterestPayment; - this.graceOnInterestCharged = graceOnInterestCharged; - this.graceOnPrincipalPayment = graceOnPrincipalPayment; - this.interestChargedFromDate = interestChargedFromDate; - this.groupId=null; - this.charges = null; - this.id = null; - this.accountNo = null; - - this.status = null; - this.subStatus = null; - - this.clientAccountNo = null; - this.clientName = null; - this.clientOfficeId = null; - this.group = null; - this.loanProductId = null; - this.loanProductName = null; - this.loanProductDescription = null; - this.isLoanProductLinkedToFloatingRate = false; - - this.fundName = null; - this.loanPurposeId = null; - this.loanPurposeName = null; - - this.loanOfficerName = null; - - this.currency = null; - - this.approvedPrincipal = null; - this.proposedPrincipal = null; - this.termFrequency = null; - this.termPeriodFrequencyType = null; - - - this.repaymentFrequencyNthDayType = null; - this.repaymentFrequencyDayOfWeekType = null; - - this.interestRateFrequencyType = null; - this.annualInterestRate = null; - this.isFloatingInterestRate = false; - this.interestRateDifferential = null; - - this.allowPartialPeriodInterestCalcualtion = null; - - this.transactionProcessingStrategyName = null; - - this.recurringMoratoriumOnPrincipalPeriods = null; - - this.graceOnArrearsAgeing = null; - - this.expectedFirstRepaymentOnDate = null; - this.syncDisbursementWithMeeting = null; - this.timeline = null; - this.summary = null; - this.repaymentSchedule = null; - this.transactions = null; - - this.collateral = null; - this.guarantors = null; - this.meeting = null; - this.notes = null; - this.disbursementDetails = null; - this.originalSchedule = null; - this.productOptions = null; - this.loanOfficerOptions = null; - this.loanPurposeOptions = null; - this.fundOptions = null; - this.termFrequencyTypeOptions = null; - this.repaymentFrequencyTypeOptions = null; - this.repaymentFrequencyNthDayTypeOptions = null; - this.repaymentFrequencyDaysOfWeekTypeOptions = null; - this.interestRateFrequencyTypeOptions = null; - this.amortizationTypeOptions = null; - this.interestTypeOptions = null; - this.interestCalculationPeriodTypeOptions = null; - this.transactionProcessingStrategyOptions = null; - this.chargeOptions = null; - this.loanCollateralOptions = null; - this.calendarOptions = null; - this.feeChargesAtDisbursementCharged = null; - this.totalOverpaid = null; - this.loanCounter = null; - this.loanProductCounter = null; - this.linkedAccount = null; - this.accountLinkingOptions = null; - this.multiDisburseLoan = null; - this.canDefineInstallmentAmount = null; - this.fixedEmiAmount = null; - this.maxOutstandingLoanBalance = null; - this.canDisburse = null; - this.emiAmountVariations = null; - this.clientActiveLoanOptions = null; - this.canUseForTopup = null; - this.isTopup = false; - this.closureLoanId = null; - this.closureLoanAccountNo = null; - this.topupAmount = null; - this.memberVariations = null; - this.inArrears = null; - this.isNPA = null; - this.overdueCharges = null; - this.daysInMonthType = null; - this.daysInYearType = null; - this.isInterestRecalculationEnabled = false; - this.interestRecalculationData = null; - this.createStandingInstructionAtDisbursement = null; - this.paidInAdvance = null; - this.interestRatesPeriods = null; - this.isVariableInstallmentsAllowed = null; - this.minimumGap = null; - this.maximumGap = null; + this.isEqualAmortization = null; } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountTransactionData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountTransactionData.java index 6bc6f6a2f..98bee0667 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountTransactionData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountTransactionData.java @@ -21,7 +21,6 @@ package org.apache.fineract.portfolio.savings.data; import java.math.BigDecimal; import java.util.Collection; -import org.apache.fineract.infrastructure.bulkimport.constants.TemplatePopulateImportConstants; import org.apache.fineract.infrastructure.codes.data.CodeValueData; import org.apache.fineract.infrastructure.core.service.DateUtils; import org.apache.fineract.organisation.monetary.data.CurrencyData; @@ -111,6 +110,8 @@ public class SavingsAccountTransactionData { this.receiptNumber = receiptNumber; this.bankNumber = bankNumber; this.paymentTypeOptions = null; + this.submittedByUsername = null; + this.note = null; } public Integer getRowIndex() { diff --git a/fineract-provider/src/main/resources/sql/migrations/core_db/V336__m_import_document.sql b/fineract-provider/src/main/resources/sql/migrations/core_db/V341__m_import_document.sql similarity index 100% rename from fineract-provider/src/main/resources/sql/migrations/core_db/V336__m_import_document.sql rename to fineract-provider/src/main/resources/sql/migrations/core_db/V341__m_import_document.sql