Merge DIT branch
Project: http://git-wip-us.apache.org/repos/asf/fineract/repo Commit: http://git-wip-us.apache.org/repos/asf/fineract/commit/98f5612a Tree: http://git-wip-us.apache.org/repos/asf/fineract/tree/98f5612a Diff: http://git-wip-us.apache.org/repos/asf/fineract/diff/98f5612a Branch: refs/heads/develop Commit: 98f5612ac57f13a29ba1e8fc8731936b47ebdb8f Parents: bf89473 bc12944 Author: Avik Ganguly <[email protected]> Authored: Wed Dec 13 14:31:55 2017 +0530 Committer: Avik Ganguly <[email protected]> Committed: Wed Dec 13 14:31:55 2017 +0530 ---------------------------------------------------------------------- fineract-provider/dependencies.gradle | 2 +- fineract-provider/dev-dependencies.gradle | 2 +- .../client/ClientEntityImportHandlerTest.java | 147 ++++ .../loan/LoanImportHandlerTest.java | 177 +++++ .../office/OfficeImportHandlerTest.java | 102 +++ .../savings/SavingsImportHandlerTest.java | 156 +++++ .../ClientEntityWorkbookPopulatorTest.java | 83 +++ .../loan/LoanWorkbookPopulatorTest.java | 129 ++++ .../office/OfficeWorkBookPopulatorTest.java | 64 ++ .../savings/SavingsWorkbookPopulateTest.java | 112 +++ .../integrationtests/common/ClientHelper.java | 33 + .../integrationtests/common/OfficeHelper.java | 33 + .../fineract/integrationtests/common/Utils.java | 40 +- .../common/loans/LoanTransactionHelper.java | 36 + .../common/savings/SavingsAccountHelper.java | 33 + .../common/savings/SavingsProductHelper.java | 2 +- .../glaccount/api/GLAccountsApiResource.java | 35 +- .../glaccount/data/GLAccountData.java | 50 ++ .../glaccount/domain/GLAccountType.java | 23 + .../GLAccountReadPlatformServiceImpl.java | 12 +- .../api/JournalEntriesApiResource.java | 37 +- .../journalentry/data/CreditDebit.java | 31 + .../journalentry/data/JournalEntryData.java | 87 +++ .../bulkimport/api/BulkImportApiResource.java | 114 ++++ .../bulkimport/constants/CenterConstants.java | 51 ++ .../constants/ChartOfAcountsConstants.java | 38 ++ .../constants/ClientEntityConstants.java | 61 ++ .../constants/ClientPersonConstants.java | 58 ++ .../constants/FixedDepositConstants.java | 55 ++ .../bulkimport/constants/GroupConstants.java | 47 ++ .../constants/GuarantorConstants.java | 45 ++ .../constants/JournalEntryConstants.java | 49 ++ .../bulkimport/constants/LoanConstants.java | 75 +++ .../constants/LoanRepaymentConstants.java | 44 ++ .../bulkimport/constants/OfficeConstants.java | 33 + .../constants/RecurringDepositConstants.java | 60 ++ .../bulkimport/constants/SavingsConstants.java | 57 ++ .../constants/SharedAccountsConstants.java | 45 ++ .../bulkimport/constants/StaffConstants.java | 32 + .../TemplatePopulateImportConstants.java | 143 ++++ .../constants/TransactionConstants.java | 43 ++ .../bulkimport/constants/UserConstants.java | 34 + .../bulkimport/data/BulkImportEvent.java | 71 ++ .../infrastructure/bulkimport/data/Count.java | 45 ++ .../bulkimport/data/GlobalEntityType.java | 118 ++++ .../bulkimport/data/ImportData.java | 80 +++ .../bulkimport/data/ImportFormatType.java | 49 ++ .../bulkimport/domain/ImportDocument.java | 124 ++++ .../domain/ImportDocumentRepository.java | 27 + .../exceptions/ImportTypeNotFoundException.java | 29 + .../bulkimport/importhandler/ImportHandler.java | 27 + .../importhandler/ImportHandlerUtils.java | 355 ++++++++++ .../center/CenterImportHandler.java | 259 +++++++ .../ChartOfAccountsImportHandler.java | 143 ++++ .../client/ClientEntityImportHandler.java | 212 ++++++ .../client/ClientPersonImportHandler.java | 197 ++++++ .../FixedDepositImportHandler.java | 390 +++++++++++ .../FixedDepositTransactionImportHandler.java | 150 +++++ .../importhandler/group/GroupImportHandler.java | 257 +++++++ .../guarantor/GuarantorImportHandler.java | 151 +++++ .../helper/ClientIdSerializer.java | 38 ++ .../helper/CodeValueDataIdSerializer.java | 34 + .../helper/CurrencyDateCodeSerializer.java | 34 + .../importhandler/helper/DateSerializer.java | 41 ++ .../helper/EnumOptionDataIdSerializer.java | 34 + .../helper/EnumOptionDataValueSerializer.java | 34 + .../importhandler/helper/GroupIdSerializer.java | 37 + ...gsAccountTransactionEnumValueSerialiser.java | 35 + .../JournalEntriesImportHandler.java | 226 +++++++ .../importhandler/loan/LoanImportHandler.java | 464 +++++++++++++ .../LoanRepaymentImportHandler.java | 134 ++++ .../office/OfficeImportHandler.java | 123 ++++ .../RecurringDepositImportHandler.java | 372 ++++++++++ ...ecurringDepositTransactionImportHandler.java | 157 +++++ .../savings/SavingsImportHandler.java | 364 ++++++++++ .../SavingsTransactionImportHandler.java | 152 +++++ .../SharedAccountImportHandler.java | 174 +++++ .../importhandler/staff/StaffImportHandler.java | 124 ++++ .../importhandler/users/UserImportHandler.java | 137 ++++ .../populator/AbstractWorkbookPopulator.java | 161 +++++ .../populator/CenterSheetPopulator.java | 123 ++++ .../populator/ClientSheetPopulator.java | 144 ++++ .../populator/ExtrasSheetPopulator.java | 116 ++++ .../FixedDepositProductSheetPopulator.java | 173 +++++ .../populator/GlAccountSheetPopulator.java | 71 ++ .../populator/GroupSheetPopulator.java | 126 ++++ .../populator/LoanProductSheetPopulator.java | 199 ++++++ .../populator/OfficeSheetPopulator.java | 82 +++ .../populator/PersonnelSheetPopulator.java | 131 ++++ .../RecurringDepositProductSheetPopulator.java | 190 ++++++ .../populator/RoleSheetPopulator.java | 67 ++ .../populator/SavingsAccountSheetPopulator.java | 84 +++ .../populator/SavingsProductSheetPopulator.java | 136 ++++ .../populator/SharedProductsSheetPopulator.java | 159 +++++ .../bulkimport/populator/WorkbookPopulator.java | 27 + .../centers/CentersWorkbookPopulator.java | 235 +++++++ .../ChartOfAccountsWorkbook.java | 236 +++++++ .../client/ClientEntityWorkbookPopulator.java | 405 +++++++++++ .../client/ClientPersonWorkbookPopulator.java | 370 ++++++++++ .../LoanComparatorByStatusActive.java | 52 ++ ...ixedDepositTransactionWorkbookPopulator.java | 235 +++++++ .../FixedDepositWorkbookPopulator.java | 349 ++++++++++ .../group/GroupsWorkbookPopulator.java | 254 +++++++ .../guarantor/GuarantorWorkbookPopulator.java | 314 +++++++++ .../JournalEntriesWorkbookPopulator.java | 191 ++++++ .../populator/loan/LoanWorkbookPopulator.java | 565 ++++++++++++++++ .../LoanRepaymentWorkbookPopulator.java | 277 ++++++++ .../office/OfficeWorkbookPopulator.java | 114 ++++ ...ringDepositTransactionWorkbookPopulator.java | 242 +++++++ .../RecurringDepositWorkbookPopulator.java | 404 +++++++++++ .../SavingsTransactionsWorkbookPopulator.java | 240 +++++++ .../savings/SavingsWorkbookPopulator.java | 411 +++++++++++ .../SharedAccountWorkBookPopulator.java | 240 +++++++ .../populator/staff/StaffWorkbookPopulator.java | 120 ++++ .../populator/users/UserWorkbookPopulator.java | 133 ++++ .../service/BulkImportEventListener.java | 174 +++++ .../BulkImportWorkbookPopulatorService.java | 26 + .../BulkImportWorkbookPopulatorServiceImpl.java | 674 +++++++++++++++++++ .../service/BulkImportWorkbookService.java | 40 ++ .../service/BulkImportWorkbookServiceImpl.java | 296 ++++++++ .../codes/data/CodeValueData.java | 9 + .../data/PaginationParametersDataValidator.java | 37 +- .../service/DocumentWritePlatformService.java | 5 + ...ntWritePlatformServiceJpaRepositoryImpl.java | 18 +- .../monetary/data/CurrencyData.java | 14 + .../office/api/OfficesApiResource.java | 34 +- .../organisation/office/data/OfficeData.java | 31 + .../service/OfficeReadPlatformServiceImpl.java | 16 +- .../staff/api/StaffApiResource.java | 36 +- .../organisation/staff/data/StaffData.java | 36 + .../service/StaffReadPlatformServiceImpl.java | 16 +- .../accounts/api/AccountsApiResource.java | 35 +- .../portfolio/address/data/AddressData.java | 32 + .../portfolio/calendar/data/CalendarData.java | 121 +++- .../portfolio/charge/data/ChargeData.java | 12 + .../client/api/ClientApiConstants.java | 1 + .../client/api/ClientsApiResource.java | 33 +- .../portfolio/client/data/ClientData.java | 219 ++++++ .../client/data/ClientNonPersonData.java | 26 + .../service/ClientReadPlatformServiceImpl.java | 41 +- .../fineract/portfolio/fund/data/FundData.java | 8 + .../portfolio/group/api/CentersApiResource.java | 32 +- .../portfolio/group/api/GroupsApiResource.java | 36 +- .../portfolio/group/data/CenterData.java | 54 ++ .../portfolio/group/data/GroupGeneralData.java | 99 +++ .../service/CenterReadPlatformServiceImpl.java | 97 +-- .../service/GroupReadPlatformServiceImpl.java | 98 +-- .../loanaccount/api/LoansApiResource.java | 53 +- .../loanaccount/data/DisbursementData.java | 33 + .../loanaccount/data/LoanAccountData.java | 392 +++++++++++ .../loanaccount/data/LoanApprovalData.java | 22 + .../loanaccount/data/LoanTransactionData.java | 111 +++ .../guarantor/api/GuarantorsApiResource.java | 34 +- .../guarantor/data/GuarantorData.java | 64 ++ .../service/LoanReadPlatformServiceImpl.java | 62 +- .../loanproduct/data/LoanProductData.java | 23 + .../paymenttype/data/PaymentTypeData.java | 8 + .../api/FixedDepositAccountsApiResource.java | 53 +- .../RecurringDepositAccountsApiResource.java | 54 +- .../savings/api/SavingsAccountsApiResource.java | 53 +- .../savings/data/ClosingOfSavingsAccounts.java | 102 +++ .../savings/data/DepositAccountData.java | 53 ++ .../savings/data/DepositProductData.java | 47 +- .../savings/data/FixedDepositAccountData.java | 64 ++ .../savings/data/FixedDepositProductData.java | 48 ++ .../data/RecurringDepositAccountData.java | 77 +++ .../data/RecurringDepositProductData.java | 59 ++ .../SavingsAccountApplicationTimelineData.java | 4 + .../savings/data/SavingsAccountChargeData.java | 25 + .../savings/data/SavingsAccountData.java | 221 +++++- .../data/SavingsAccountTransactionData.java | 68 ++ .../savings/data/SavingsActivation.java | 60 ++ .../portfolio/savings/data/SavingsApproval.java | 67 ++ .../savings/data/SavingsProductData.java | 58 +- .../savings/domain/DepositTermDetail.java | 1 + .../SavingsAccountReadPlatformServiceImpl.java | 52 +- .../data/ShareAccountChargeData.java | 21 + .../shareaccounts/data/ShareAccountData.java | 71 ++ .../api/UsersApiResource.java | 58 +- .../useradministration/data/AppUserData.java | 40 ++ .../useradministration/data/RoleData.java | 8 + .../core_db/V336__m_import_document.sql | 39 ++ 182 files changed, 19647 insertions(+), 248 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/fineract/blob/98f5612a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/api/ClientApiConstants.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/fineract/blob/98f5612a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/data/ClientData.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/fineract/blob/98f5612a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/service/ClientReadPlatformServiceImpl.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/fineract/blob/98f5612a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupReadPlatformServiceImpl.java ---------------------------------------------------------------------- diff --cc fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupReadPlatformServiceImpl.java index af28a31,e8a1fd6..2caf668 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupReadPlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/GroupReadPlatformServiceImpl.java @@@ -211,58 -214,57 +214,57 @@@ public class GroupReadPlatformServiceIm StringBuffer extraCriteria = new StringBuffer(200); extraCriteria.append(" and g.level_Id = ").append(GroupTypes.GROUP.getId()); - String sqlSearch = searchCriteria.getSqlSearch(); - if (sqlSearch != null) { - SQLInjectionValidator.validateSQLInput(sqlSearch); - sqlSearch = sqlSearch.replaceAll(" display_name ", " g.display_name "); - sqlSearch = sqlSearch.replaceAll("display_name ", "g.display_name "); - extraCriteria.append(" and ( ").append(sqlSearch).append(") "); - this.columnValidator.validateSqlInjection(schemaSql, sqlSearch); - } + String sqlSearch = searchCriteria.getSqlSearch(); + if (sqlSearch != null) { + SQLInjectionValidator.validateSQLInput(sqlSearch); + sqlSearch = sqlSearch.replaceAll(" display_name ", " g.display_name "); + sqlSearch = sqlSearch.replaceAll("display_name ", "g.display_name "); + extraCriteria.append(" and ( ").append(sqlSearch).append(") "); + this.columnValidator.validateSqlInjection(schemaSql, sqlSearch); + } - final Long officeId = searchCriteria.getOfficeId(); - if (officeId != null) { - paramList.add(officeId); - extraCriteria.append(" and g.office_id = ? "); - } + final Long officeId = searchCriteria.getOfficeId(); + if (officeId != null) { + paramList.add(officeId); + extraCriteria.append(" and g.office_id = ? "); + } - final String externalId = searchCriteria.getExternalId(); - if (externalId != null) { - paramList.add(ApiParameterHelper.sqlEncodeString(externalId)); - extraCriteria.append(" and g.external_id = ? "); - } + final String externalId = searchCriteria.getExternalId(); + if (externalId != null) { + paramList.add(ApiParameterHelper.sqlEncodeString(externalId)); + extraCriteria.append(" and g.external_id = ? "); + } - final String name = searchCriteria.getName(); - if (name != null) { - paramList.add(ApiParameterHelper.sqlEncodeString("%" + name + "%")); - extraCriteria.append(" and g.display_name like ? "); - } + final String name = searchCriteria.getName(); + if (name != null) { + paramList.add("%" + name + "%"); + extraCriteria.append(" and g.display_name like ? "); + } - final String hierarchy = searchCriteria.getHierarchy(); - if (hierarchy != null) { - paramList.add(ApiParameterHelper.sqlEncodeString(hierarchy + "%")); - extraCriteria.append(" and o.hierarchy like ? "); - } + final String hierarchy = searchCriteria.getHierarchy(); + if (hierarchy != null) { + paramList.add(ApiParameterHelper.sqlEncodeString(hierarchy + "%")); + extraCriteria.append(" and o.hierarchy like ? "); + } - if (searchCriteria.isStaffIdPassed()) { - paramList.add(searchCriteria.getStaffId()); - extraCriteria.append(" and g.staff_id = ? "); - } + if (searchCriteria.isStaffIdPassed()) { + paramList.add(searchCriteria.getStaffId()); + extraCriteria.append(" and g.staff_id = ? "); + } - if (StringUtils.isNotBlank(extraCriteria.toString())) { - extraCriteria.delete(0, 4); - } + if (StringUtils.isNotBlank(extraCriteria.toString())) { + extraCriteria.delete(0, 4); + } - final Long staffId = searchCriteria.getStaffId(); - if (staffId != null) { - paramList.add(staffId); - extraCriteria.append(" and g.staff_id = ? "); - } - - if(searchCriteria.isOrphansOnly()){ - extraCriteria.append(" and g.parent_id IS NULL"); - } + final Long staffId = searchCriteria.getStaffId(); + if (staffId != null) { + paramList.add(staffId); + extraCriteria.append(" and g.staff_id = ? "); + } + if (searchCriteria.isOrphansOnly()) { + extraCriteria.append(" and g.parent_id IS NULL"); + } return extraCriteria.toString(); } http://git-wip-us.apache.org/repos/asf/fineract/blob/98f5612a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanAccountData.java ---------------------------------------------------------------------- diff --cc fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/data/LoanAccountData.java index ad21674,fbcf5c0..2cdbfb8 --- 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 @@@ -213,8 -214,394 +214,395 @@@ public class LoanAccountData private final Integer maximumGap; private List<DatatableData> datatables = null; + private final Boolean isEqualAmortization; + //import fields + private String dateFormat; + private String locale; + private transient Integer rowIndex; + private LocalDate submittedOnDate; + private Long productId; + private Integer loanTermFrequency; + private EnumOptionData loanTermFrequencyType; + private LocalDate repaymentsStartingFromDate; + private String linkAccountId; + private Long groupId; + private LocalDate expectedDisbursementDate; + + public static LoanAccountData importInstanceIndividual(EnumOptionData loanTypeEnumOption,Long clientId,Long productId, + Long loanOfficerId,LocalDate submittedOnDate, + Long fundId,BigDecimal principal, Integer numberOfRepayments,Integer repaymentEvery, + EnumOptionData repaidEveryFrequencyEnums, Integer loanTermFrequency,EnumOptionData loanTermFrequencyTypeEnum, + BigDecimal nominalInterestRate,LocalDate expectedDisbursementDate ,EnumOptionData amortizationEnumOption, + EnumOptionData interestMethodEnum, EnumOptionData interestCalculationPeriodTypeEnum,BigDecimal inArrearsTolerance,Long transactionProcessingStrategyId, + Integer graceOnPrincipalPayment,Integer graceOnInterestPayment,Integer graceOnInterestCharged, + LocalDate interestChargedFromDate,LocalDate repaymentsStartingFromDate,Integer rowIndex , + String externalId,Long groupId,Collection<LoanChargeData> charges,String linkAccountId, + String locale,String dateFormat){ + + return new LoanAccountData(loanTypeEnumOption, clientId, productId, loanOfficerId, submittedOnDate, fundId, + principal, numberOfRepayments, + repaymentEvery, repaidEveryFrequencyEnums, loanTermFrequency, loanTermFrequencyTypeEnum, nominalInterestRate, expectedDisbursementDate, + amortizationEnumOption, interestMethodEnum, interestCalculationPeriodTypeEnum, inArrearsTolerance, transactionProcessingStrategyId, + graceOnPrincipalPayment, graceOnInterestPayment, graceOnInterestCharged, interestChargedFromDate, repaymentsStartingFromDate, + rowIndex, externalId, null, charges, 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,LocalDate expectedDisbursementDate ,EnumOptionData amortizationType, + EnumOptionData interestType, EnumOptionData interestCalculationPeriodType,BigDecimal inArrearsTolerance,Long transactionProcessingStrategyId, + Integer graceOnPrincipalPayment,Integer graceOnInterestPayment,Integer graceOnInterestCharged, + LocalDate interestChargedFromDate,LocalDate repaymentsStartingFromDate,Integer rowIndex , + String externalId,Long groupId,Collection<LoanChargeData> charges,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=groupId; + this.expectedDisbursementDate=expectedDisbursementDate; + this.charges = charges; + 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; + } + + 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; + } + + + public Integer getRowIndex() { + return rowIndex; + } + + public Long getClientId() { + return clientId; + } + + public String getClientName() { + return clientName; + } + + public BigDecimal getPrincipal() { + return principal; + } + + public LoanApplicationTimelineData getTimeline() { + return timeline; + } + + public String getAccountNo() { + return accountNo; + } + + public String getLoanProductName() { + return loanProductName; + } + + public static final Comparator<LoanAccountData> ClientNameComparator = new Comparator<LoanAccountData>() { + + @Override + public int compare(LoanAccountData loan1, LoanAccountData loan2) { + String clientOfLoan1 = loan1.getClientName().toUpperCase(Locale.ENGLISH); + String clientOfLoan2 = loan2.getClientName().toUpperCase(Locale.ENGLISH); + return clientOfLoan1.compareTo(clientOfLoan2); + } + }; + + public String getClientAccountNo() { + return clientAccountNo; + } /** * Used to produce a {@link LoanAccountData} with only collateral options * for now. http://git-wip-us.apache.org/repos/asf/fineract/blob/98f5612a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/fineract/blob/98f5612a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/data/LoanProductData.java ---------------------------------------------------------------------- diff --cc fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/data/LoanProductData.java index 31729b3,c846490..9d0af8b --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/data/LoanProductData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanproduct/data/LoanProductData.java @@@ -1203,8 -1197,27 +1203,31 @@@ public class LoanProductData return this.interestRateDifferential; } + public boolean isEqualAmortization() { + return isEqualAmortization; + } + + public LocalDate getStartDate() { + return startDate; + } + + public LocalDate getCloseDate() { + return closeDate; + } + + public Integer getMinNumberOfRepayments() { + return minNumberOfRepayments; + } + + public Integer getMaxNumberOfRepayments() { + return maxNumberOfRepayments; + } + + public BigDecimal getMinInterestRatePerPeriod() { + return minInterestRatePerPeriod; + } + + public BigDecimal getMaxInterestRatePerPeriod() { + return maxInterestRatePerPeriod; + } } http://git-wip-us.apache.org/repos/asf/fineract/blob/98f5612a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/data/SavingsAccountTransactionData.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/fineract/blob/98f5612a/fineract-provider/src/main/java/org/apache/fineract/portfolio/savings/service/SavingsAccountReadPlatformServiceImpl.java ----------------------------------------------------------------------
