From 57d4c8f868f83bf0c03d6ff4b974bd3ea0baec35 Mon Sep 17 00:00:00 2001 From: Chandrika Date: Tue, 3 Feb 2015 17:14:53 +0530 Subject: [PATCH] MIFOSX-1464 spelling mistakes corrected --- api-docs/apiLive.htm | 6 +-- .../loanaccount/data/LoanAccountData.java | 46 +++++++++---------- .../portfolio/loanaccount/domain/Loan.java | 12 ++--- .../domain/LoanApplicationTerms.java | 24 +++++----- .../service/LoanScheduleAssembler.java | 4 +- ...anApplicationCommandFromApiJsonHelper.java | 4 +- .../loanaccount/service/LoanAssembler.java | 2 +- .../service/LoanReadPlatformServiceImpl.java | 6 +-- .../loanproduct/LoanProductConstants.java | 4 +- .../loanproduct/data/LoanProductData.java | 42 ++++++++--------- .../loanproduct/domain/LoanProduct.java | 38 +++++++-------- .../LoanProductDataValidator.java | 30 ++++++------ .../LoanProductReadPlatformServiceImpl.java | 10 ++-- 13 files changed, 114 insertions(+), 114 deletions(-) diff --git a/api-docs/apiLive.htm b/api-docs/apiLive.htm index 8639e2913..63d9e8b47 100644 --- a/api-docs/apiLive.htm +++ b/api-docs/apiLive.htm @@ -11297,7 +11297,7 @@ Request Body: Override the default value for rounding currency to multiples of value provided. - instalmentAmountInMultiplesOf + installmentAmountInMultiplesOf Override the default value for rounding instalment amount to multiples of value provided. @@ -11410,7 +11410,7 @@ Request Body: Field represents percentage of current instalment principal amount for comparing against principal outstanding to add another repayment instalment. If the outstanding principal amount is less then calculated amount, remaining outstanding amount will be added to current instalment. Default value for multi disburse loan is 50% and non-multi disburse loan is 0% - canDefineInstalmentAmount + canDefineInstallmentAmount if provided as true, then fixed instalment amount can be provided from loan account. @@ -12797,7 +12797,7 @@ GET https://DomainName/api/v1/loanproducts/{productId} numberOfRepaymentVariationsForBorrowerCycle, interestRateVariationsForBorrowerCycle, multiDisburseLoan,maxTrancheCount, - outstandingLoanBalance,overdueDaysForNPA,holdGuaranteeFunds, principalThresholdForLastInstalment, accountMovesOutOfNPAOnlyOnArrearsCompletion, canDefineInstalmentAmount, instalmentAmountInMultiplesOf + outstandingLoanBalance,overdueDaysForNPA,holdGuaranteeFunds, principalThresholdForLastInstalment, accountMovesOutOfNPAOnlyOnArrearsCompletion, canDefineInstallmentAmount, installmentAmountInMultiplesOf diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/data/LoanAccountData.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/data/LoanAccountData.java index db9ba90a2..bbc6ad1c0 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/data/LoanAccountData.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/data/LoanAccountData.java @@ -152,7 +152,7 @@ public class LoanAccountData { private final Boolean multiDisburseLoan; - private final Boolean canDefineInstalmentAmount; + private final Boolean canDefineInstallmentAmount; private final BigDecimal fixedEmiAmount; @@ -265,7 +265,7 @@ public class LoanAccountData { final PortfolioAccountData linkedAccount = null; final Collection disbursementData = null; final Boolean multiDisburseLoan = null; - final Boolean canDefineInstalmentAmount = null; + final Boolean canDefineInstallmentAmount = null; final BigDecimal fixedEmiAmount = null; final BigDecimal maxOutstandingLoanBalance = null; final Collection emiAmountVariations = null; @@ -296,7 +296,7 @@ public class LoanAccountData { interestRateFrequencyTypeOptions, amortizationTypeOptions, interestTypeOptions, interestCalculationPeriodTypeOptions, fundOptions, chargeOptions, chargeTemplate, loanOfficerOptions, loanPurposeOptions, loanCollateralOptions, calendarOptions, syncDisbursementWithMeeting, loancounter, loanProductCounter, notes, accountLinkingOptions, linkedAccount, - disbursementData, multiDisburseLoan, canDefineInstalmentAmount, fixedEmiAmount, maxOutstandingLoanBalance, + disbursementData, multiDisburseLoan, canDefineInstallmentAmount, fixedEmiAmount, maxOutstandingLoanBalance, emiAmountVariations, memberVariations, product, inArrears, graceOnArrearsAgeing, overdueCharges, isNPA, daysInMonthType, daysInYearType, isInterestRecalculationEnabled, interestRecalculationData, originalSchedule, createStandingInstructionAtDisbursement, paidInAdvance); @@ -385,7 +385,7 @@ public class LoanAccountData { final PortfolioAccountData linkedAccount = null; final Collection disbursementData = null; final Boolean multiDisburseLoan = null; - final Boolean canDefineInstalmentAmount = null; + final Boolean canDefineInstallmentAmount = null; final BigDecimal fixedEmiAmount = null; final BigDecimal maxOutstandingLoanBalance = null; final Collection emiAmountVariations = null; @@ -416,7 +416,7 @@ public class LoanAccountData { interestRateFrequencyTypeOptions, amortizationTypeOptions, interestTypeOptions, interestCalculationPeriodTypeOptions, fundOptions, chargeOptions, chargeTemplate, loanOfficerOptions, loanPurposeOptions, loanCollateralOptions, calendarOptions, syncDisbursementWithMeeting, loancounter, loanProductCounter, notes, accountLinkingOptions, linkedAccount, - disbursementData, multiDisburseLoan, canDefineInstalmentAmount, fixedEmiAmount, maxOutstandingLoanBalance, + disbursementData, multiDisburseLoan, canDefineInstallmentAmount, fixedEmiAmount, maxOutstandingLoanBalance, emiAmountVariations, memberVariations, product, inArrears, graceOnArrearsAgeing, overdueCharges, isNPA, daysInMonthType, daysInYearType, isInterestRecalculationEnabled, interestRecalculationData, originalSchedule, createStandingInstructionAtDisbursement, paidInAdvance); @@ -440,7 +440,7 @@ public class LoanAccountData { acc.interestTypeOptions, acc.interestCalculationPeriodTypeOptions, acc.fundOptions, acc.chargeOptions, null, acc.loanOfficerOptions, acc.loanPurposeOptions, acc.loanCollateralOptions, acc.calendarOptions, acc.syncDisbursementWithMeeting, acc.loanCounter, acc.loanProductCounter, acc.notes, acc.accountLinkingOptions, - acc.linkedAccount, acc.disbursementDetails, acc.multiDisburseLoan, acc.canDefineInstalmentAmount, acc.fixedEmiAmount, + acc.linkedAccount, acc.disbursementDetails, acc.multiDisburseLoan, acc.canDefineInstallmentAmount, acc.fixedEmiAmount, acc.maxOutstandingLoanBalance, acc.emiAmountVariations, acc.memberVariations, acc.product, acc.inArrears, acc.graceOnArrearsAgeing, acc.overdueCharges, acc.isNPA, acc.daysInMonthType, acc.daysInYearType, acc.isInterestRecalculationEnabled, acc.interestRecalculationData, acc.originalSchedule, @@ -531,7 +531,7 @@ public class LoanAccountData { final PortfolioAccountData linkedAccount = null; final Collection disbursementData = null; final Boolean multiDisburseLoan = null; - final Boolean canDefineInstalmentAmount = null; + final Boolean canDefineInstallmentAmount = null; final BigDecimal fixedEmiAmount = null; final BigDecimal maxOutstandingBalance = null; final Collection emiAmountVariations = null; @@ -562,7 +562,7 @@ public class LoanAccountData { interestRateFrequencyTypeOptions, amortizationTypeOptions, interestTypeOptions, interestCalculationPeriodTypeOptions, fundOptions, chargeOptions, chargeTemplate, loanOfficerOptions, loanPurposeOptions, loanCollateralOptions, calendarOptions, syncDisbursementWithMeeting, loancounter, loanProductCounter, notes, accountLinkingOptions, linkedAccount, - disbursementData, multiDisburseLoan, canDefineInstalmentAmount, fixedEmiAmount, maxOutstandingBalance, emiAmountVariations, + disbursementData, multiDisburseLoan, canDefineInstallmentAmount, fixedEmiAmount, maxOutstandingBalance, emiAmountVariations, memberVariations, product, inArrears, graceOnArrearsAgeing, overdueCharges, isNPA, daysInMonthType, daysInYearType, isInterestRecalculationEnabled, interestRecalculationData, originalSchedule, createStandingInstructionAtDisbursement, paidInAdvance); @@ -586,7 +586,7 @@ public class LoanAccountData { acc.interestTypeOptions, acc.interestCalculationPeriodTypeOptions, acc.fundOptions, acc.chargeOptions, null, acc.loanOfficerOptions, acc.loanPurposeOptions, acc.loanCollateralOptions, acc.calendarOptions, acc.syncDisbursementWithMeeting, acc.loanCounter, acc.loanProductCounter, acc.notes, acc.accountLinkingOptions, - acc.linkedAccount, acc.disbursementDetails, acc.multiDisburseLoan, acc.canDefineInstalmentAmount, acc.fixedEmiAmount, + acc.linkedAccount, acc.disbursementDetails, acc.multiDisburseLoan, acc.canDefineInstallmentAmount, acc.fixedEmiAmount, acc.maxOutstandingLoanBalance, acc.emiAmountVariations, acc.memberVariations, acc.product, acc.inArrears, acc.graceOnArrearsAgeing, acc.overdueCharges, acc.isNPA, acc.daysInMonthType, acc.daysInYearType, acc.isInterestRecalculationEnabled, acc.interestRecalculationData, acc.originalSchedule, @@ -723,7 +723,7 @@ public class LoanAccountData { amortizationTypeOptions, interestTypeOptions, interestCalculationPeriodTypeOptions, fundOptions, chargeOptions, chargeTemplate, loanOfficerOptions, loanPurposeOptions, loanCollateralOptions, calendarOptions, syncDisbursementWithMeeting, loancounter, loanProductCounter, notes, accountLinkingOptions, linkedAccount, - disbursementData, product.getMultiDisburseLoan(), product.canDefineInstalmentAmount(), fixedEmi, + disbursementData, product.getMultiDisburseLoan(), product.canDefineInstallmentAmount(), fixedEmi, product.getOutstandingLoanBalance(), emiAmountVariations, memberVariations, product, inArrears, product.getGraceOnArrearsAgeing(), product.overdueFeeCharges(), isNPA, product.getDaysInMonthType(), product.getDaysInYearType(), product.isInterestRecalculationEnabled(), product.toLoanInterestRecalculationData(), @@ -779,7 +779,7 @@ public class LoanAccountData { interestCalculationPeriodTypeOptions, fundOptions, chargeOptions, chargeTemplate, loanOfficerOptions, loanPurposeOptions, loanCollateralOptions, calendarOptions, acc.syncDisbursementWithMeeting, acc.loanCounter, acc.loanProductCounter, notes, acc.accountLinkingOptions, acc.linkedAccount, acc.disbursementDetails, product.getMultiDisburseLoan(), - product.canDefineInstalmentAmount(), acc.fixedEmiAmount, product.getOutstandingLoanBalance(), acc.emiAmountVariations, + product.canDefineInstallmentAmount(), acc.fixedEmiAmount, product.getOutstandingLoanBalance(), acc.emiAmountVariations, acc.memberVariations, product, acc.inArrears, product.getGraceOnArrearsAgeing(), product.overdueFeeCharges(), acc.isNPA, product.getDaysInMonthType(), product.getDaysInYearType(), product.isInterestRecalculationEnabled(), product.toLoanInterestRecalculationData(), acc.originalSchedule, acc.createStandingInstructionAtDisbursement, paidInAdvance); @@ -804,7 +804,7 @@ public class LoanAccountData { final Integer graceOnInterestCharged, final LocalDate interestChargedFromDate, final LoanApplicationTimelineData timeline, final LoanSummaryData loanSummary, final BigDecimal feeChargesDueAtDisbursementCharged, final Boolean syncDisbursementWithMeeting, final Integer loancounter, final Integer loanProductCounter, - final Boolean multiDisburseLoan, Boolean canDefineInstalmentAmount, final BigDecimal fixedEmiAmont, + final Boolean multiDisburseLoan, Boolean canDefineInstallmentAmount, final BigDecimal fixedEmiAmont, final BigDecimal outstandingLoanBalance, final Boolean inArrears, final Integer graceOnArrearsAgeing, final Boolean isNPA, final EnumOptionData daysInMonthType, final EnumOptionData daysInYearType, final boolean isInterestRecalculationEnabled, final LoanInterestRecalculationData interestRecalculationData, final Boolean createStandingInstructionAtDisbursement) { @@ -856,7 +856,7 @@ public class LoanAccountData { amortizationTypeOptions, interestTypeOptions, interestCalculationPeriodTypeOptions, fundOptions, chargeOptions, chargeTemplate, loanOfficerOptions, loanPurposeOptions, loanCollateralOptions, calendarOptions, syncDisbursementWithMeeting, loancounter, loanProductCounter, notes, accountLinkingOptions, linkedAccount, - disbursementData, multiDisburseLoan, canDefineInstalmentAmount, fixedEmiAmont, outstandingLoanBalance, emiAmountVariations, + disbursementData, multiDisburseLoan, canDefineInstallmentAmount, fixedEmiAmont, outstandingLoanBalance, emiAmountVariations, memberVariations, product, inArrears, graceOnArrearsAgeing, overdueCharges, isNPA, daysInMonthType, daysInYearType, isInterestRecalculationEnabled, interestRecalculationData, originalSchedule, createStandingInstructionAtDisbursement, paidInAdvance); @@ -899,7 +899,7 @@ public class LoanAccountData { interestRateFrequencyTypeOptions, amortizationTypeOptions, interestTypeOptions, interestCalculationPeriodTypeOptions, fundOptions, chargeOptions, chargeTemplate, loanOfficerOptions, loanPurposeOptions, loanCollateralOptions, calendarOptions, acc.syncDisbursementWithMeeting, acc.loanCounter, acc.loanProductCounter, notes, accountLinkingOptions, linkedAccount, - disbursementDetails, acc.multiDisburseLoan, acc.canDefineInstalmentAmount, acc.fixedEmiAmount, + disbursementDetails, acc.multiDisburseLoan, acc.canDefineInstallmentAmount, acc.fixedEmiAmount, acc.maxOutstandingLoanBalance, emiAmountVariations, acc.memberVariations, acc.product, acc.inArrears, acc.graceOnArrearsAgeing, overdueCharges, acc.isNPA, acc.daysInMonthType, acc.daysInYearType, acc.isInterestRecalculationEnabled, acc.interestRecalculationData, acc.originalSchedule, @@ -935,7 +935,7 @@ public class LoanAccountData { acc.interestTypeOptions, acc.interestCalculationPeriodTypeOptions, acc.fundOptions, acc.chargeOptions, null, acc.loanOfficerOptions, acc.loanPurposeOptions, acc.loanCollateralOptions, acc.calendarOptions, acc.syncDisbursementWithMeeting, acc.loanCounter, acc.loanProductCounter, acc.notes, acc.accountLinkingOptions, - acc.linkedAccount, acc.disbursementDetails, acc.multiDisburseLoan, acc.canDefineInstalmentAmount, acc.fixedEmiAmount, + acc.linkedAccount, acc.disbursementDetails, acc.multiDisburseLoan, acc.canDefineInstallmentAmount, acc.fixedEmiAmount, acc.maxOutstandingLoanBalance, acc.emiAmountVariations, acc.memberVariations, acc.product, acc.inArrears, acc.graceOnArrearsAgeing, acc.overdueCharges, acc.isNPA, acc.daysInMonthType, acc.daysInYearType, acc.isInterestRecalculationEnabled, acc.interestRecalculationData, acc.originalSchedule, @@ -996,7 +996,7 @@ public class LoanAccountData { acc.interestTypeOptions, acc.interestCalculationPeriodTypeOptions, acc.fundOptions, acc.chargeOptions, null, acc.loanOfficerOptions, acc.loanPurposeOptions, acc.loanCollateralOptions, acc.calendarOptions, acc.syncDisbursementWithMeeting, acc.loanCounter, acc.loanProductCounter, acc.notes, acc.accountLinkingOptions, - acc.linkedAccount, acc.disbursementDetails, acc.multiDisburseLoan, acc.canDefineInstalmentAmount, acc.fixedEmiAmount, + acc.linkedAccount, acc.disbursementDetails, acc.multiDisburseLoan, acc.canDefineInstallmentAmount, acc.fixedEmiAmount, acc.maxOutstandingLoanBalance, acc.emiAmountVariations, memberVariations, acc.product, acc.inArrears, acc.graceOnArrearsAgeing, acc.overdueCharges, acc.isNPA, acc.daysInMonthType, acc.daysInYearType, acc.isInterestRecalculationEnabled, acc.interestRecalculationData, acc.originalSchedule, @@ -1023,7 +1023,7 @@ public class LoanAccountData { acc.interestTypeOptions, acc.interestCalculationPeriodTypeOptions, acc.fundOptions, acc.chargeOptions, null, acc.loanOfficerOptions, acc.loanPurposeOptions, acc.loanCollateralOptions, acc.calendarOptions, acc.syncDisbursementWithMeeting, acc.loanCounter, acc.loanProductCounter, acc.notes, acc.accountLinkingOptions, - acc.linkedAccount, acc.disbursementDetails, acc.multiDisburseLoan, acc.canDefineInstalmentAmount, acc.fixedEmiAmount, + acc.linkedAccount, acc.disbursementDetails, acc.multiDisburseLoan, acc.canDefineInstallmentAmount, acc.fixedEmiAmount, acc.maxOutstandingLoanBalance, acc.emiAmountVariations, acc.memberVariations, acc.product, acc.inArrears, acc.graceOnArrearsAgeing, acc.overdueCharges, acc.isNPA, acc.daysInMonthType, acc.daysInYearType, acc.isInterestRecalculationEnabled, interestRecalculationData, acc.originalSchedule, @@ -1048,7 +1048,7 @@ public class LoanAccountData { acc.interestTypeOptions, acc.interestCalculationPeriodTypeOptions, acc.fundOptions, acc.chargeOptions, null, acc.loanOfficerOptions, acc.loanPurposeOptions, acc.loanCollateralOptions, acc.calendarOptions, acc.syncDisbursementWithMeeting, acc.loanCounter, acc.loanProductCounter, acc.notes, acc.accountLinkingOptions, - acc.linkedAccount, acc.disbursementDetails, acc.multiDisburseLoan, acc.canDefineInstalmentAmount, acc.fixedEmiAmount, + acc.linkedAccount, acc.disbursementDetails, acc.multiDisburseLoan, acc.canDefineInstallmentAmount, acc.fixedEmiAmount, acc.maxOutstandingLoanBalance, acc.emiAmountVariations, acc.memberVariations, acc.product, acc.inArrears, acc.graceOnArrearsAgeing, acc.overdueCharges, acc.isNPA, acc.daysInMonthType, acc.daysInYearType, acc.isInterestRecalculationEnabled, acc.interestRecalculationData, originalSchedule, @@ -1107,7 +1107,7 @@ public class LoanAccountData { final Boolean syncDisbursementWithMeeting, final Integer loanCounter, final Integer loanProductCounter, final Collection notes, final Collection accountLinkingOptions, final PortfolioAccountData linkedAccount, final Collection disbursementDetails, - final Boolean multiDisburseLoan, final Boolean canDefineInstalmentAmount, BigDecimal fixedEmiAmount, + final Boolean multiDisburseLoan, final Boolean canDefineInstallmentAmount, BigDecimal fixedEmiAmount, final BigDecimal maxOutstandingLoanBalance, final Collection emiAmountVariations, final Map memberVariations, final LoanProductData product, final Boolean inArrears, final Integer graceOnArrearsAgeing, final Collection overdueCharges, final Boolean isNPA, @@ -1235,13 +1235,13 @@ public class LoanAccountData { this.disbursementDetails = disbursementDetails; this.multiDisburseLoan = multiDisburseLoan; - Boolean canDefineEMIAmount = canDefineInstalmentAmount; - if (canDefineInstalmentAmount == null) { + Boolean canDefineEMIAmount = canDefineInstallmentAmount; + if (canDefineInstallmentAmount == null) { canDefineEMIAmount = multiDisburseLoan; } else if (multiDisburseLoan != null) { - canDefineEMIAmount = canDefineInstalmentAmount || multiDisburseLoan; + canDefineEMIAmount = canDefineInstallmentAmount || multiDisburseLoan; } - this.canDefineInstalmentAmount = canDefineEMIAmount; + this.canDefineInstallmentAmount = canDefineEMIAmount; this.fixedEmiAmount = fixedEmiAmount; this.maxOutstandingLoanBalance = maxOutstandingLoanBalance; diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/Loan.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/Loan.java index 64d4d2314..79ea46f60 100755 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/Loan.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/domain/Loan.java @@ -1405,7 +1405,7 @@ public class Loan extends AbstractPersistable { this.disbursementDetails.clear(); } - if (loanProduct.isMultiDisburseLoan() || loanProduct.canDefineInstalmentAmount()) { + if (loanProduct.isMultiDisburseLoan() || loanProduct.canDefineInstallmentAmount ()) { if (command.isChangeInBigDecimalParameterNamed(LoanApiConstants.emiAmountParameterName, this.fixedEmiAmount)) { this.fixedEmiAmount = command.bigDecimalValueOfParameterNamed(LoanApiConstants.emiAmountParameterName); actualChanges.put(LoanApiConstants.emiAmountParameterName, this.fixedEmiAmount); @@ -2071,7 +2071,7 @@ public class Loan extends AbstractPersistable { public void regenerateScheduleOnDisbursement(final ScheduleGeneratorDTO scheduleGeneratorDTO, final boolean recalculateSchedule, final LocalDate actualDisbursementDate, BigDecimal emiAmount, final AppUser currentUser) { boolean isEmiAmountChanged = false; - if ((this.loanProduct.isMultiDisburseLoan() || this.loanProduct.canDefineInstalmentAmount()) && emiAmount != null + if ((this.loanProduct.isMultiDisburseLoan() || this.loanProduct.canDefineInstallmentAmount ()) && emiAmount != null && emiAmount.compareTo(retriveLastEmiAmount()) != 0) { if (this.loanProduct.isMultiDisburseLoan()) { LoanTermVariations loanVariationTerms = new LoanTermVariations(LoanTermVariationType.EMI_AMOUNT.getValue(), @@ -2316,7 +2316,7 @@ public class Loan extends AbstractPersistable { getExpectedFirstRepaymentOnDate(), scheduleGeneratorDTO.getCalculatedRepaymentsStartingFromDate(), getInArrearsTolerance(), this.loanRepaymentScheduleDetail, this.loanProduct.isMultiDisburseLoan(), this.fixedEmiAmount, disbursementData, this.maxOutstandingLoanBalance, loanVariationTermsData, getInterestChargedFromDate(), - this.loanProduct.getPrincipalThresholdForLastInstalment(), this.loanProduct.getInstalmentAmountInMultiplesOf()); + this.loanProduct.getPrincipalThresholdForLastInstalment(), this.loanProduct.getInstallmentAmountInMultiplesOf()); final LoanScheduleModel loanSchedule = loanScheduleGenerator.generate(mc, loanApplicationTerms, charges(), scheduleGeneratorDTO.getHolidayDetailDTO()); @@ -4650,7 +4650,7 @@ public class Loan extends AbstractPersistable { this.loanProduct.isMultiDisburseLoan(), this.fixedEmiAmount, disbursementData, this.maxOutstandingLoanBalance, loanVariationTermsData, getInterestChargedFromDate(), this.loanInterestRecalculationDetails, calendarInstanceForInterestRecalculation, recalculationFrequencyType, - this.loanProduct.getPrincipalThresholdForLastInstalment(), this.loanProduct.getInstalmentAmountInMultiplesOf()); + this.loanProduct.getPrincipalThresholdForLastInstalment(), this.loanProduct.getInstallmentAmountInMultiplesOf()); return loanApplicationTerms; } @@ -4694,7 +4694,7 @@ public class Loan extends AbstractPersistable { loanTermPeriodFrequencyType, nthDayType, dayOfWeekType, getDisbursementDate(), getExpectedFirstRepaymentOnDate(), null, getInArrearsTolerance(), this.loanRepaymentScheduleDetail, this.loanProduct.isMultiDisburseLoan(), this.fixedEmiAmount, disbursementData, this.maxOutstandingLoanBalance, loanVariationTermsData, getInterestChargedFromDate(), - this.loanProduct.getPrincipalThresholdForLastInstalment(), this.loanProduct.getInstalmentAmountInMultiplesOf()); + this.loanProduct.getPrincipalThresholdForLastInstalment(), this.loanProduct.getInstallmentAmountInMultiplesOf()); installment = loanScheduleGenerator.calculatePrepaymentAmount(this.repaymentScheduleInstallments, getCurrency(), LocalDate.now(), getInterestChargedFromDate(), loanApplicationTerms, mc, charges()); @@ -4896,7 +4896,7 @@ public class Loan extends AbstractPersistable { dayOfWeekType, expectedDisbursementDate, repaymentsStartingFromDate, calculatedRepaymentsStartingFromDate, inArrearsToleranceMoney, this.loanRepaymentScheduleDetail, loanProduct.isMultiDisburseLoan(), emiAmount, disbursementData, maxOutstandingBalance, loanVariationTermsData, interestChargedFromDate, - this.loanProduct.getPrincipalThresholdForLastInstalment(), this.loanProduct.getInstalmentAmountInMultiplesOf()); + this.loanProduct.getPrincipalThresholdForLastInstalment(), this.loanProduct.getInstallmentAmountInMultiplesOf()); } /** diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/LoanApplicationTerms.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/LoanApplicationTerms.java index 93bedc3c9..fae0abd22 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/LoanApplicationTerms.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/domain/LoanApplicationTerms.java @@ -135,7 +135,7 @@ public final class LoanApplicationTerms { private final RecalculationFrequencyType recalculationFrequencyType; private final BigDecimal principalThresholdForLastInstalment; - private final Integer instalmentAmountInMultiplesOf; + private final Integer installmentAmountInMultiplesOf; public static LoanApplicationTerms assembleFrom(final ApplicationCurrency currency, final Integer loanTermFrequency, final PeriodFrequencyType loanTermPeriodFrequencyType, final Integer numberOfRepayments, final Integer repaymentEvery, @@ -150,7 +150,7 @@ public final class LoanApplicationTerms { final List disbursementDatas, final BigDecimal maxOutstandingBalance, final List emiAmountVariations, final Integer graceOnArrearsAgeing, final DaysInMonthType daysInMonthType, final DaysInYearType daysInYearType, final boolean isInterestRecalculationEnabled, - BigDecimal principalThresholdForLastInstalment, Integer instalmentAmountInMultiplesOf) { + BigDecimal principalThresholdForLastInstalment, Integer installmentAmountInMultiplesOf) { final LoanRescheduleStrategyMethod rescheduleStrategyMethod = null; final InterestRecalculationCompoundingMethod interestRecalculationCompoundingMethod = null; @@ -163,7 +163,7 @@ public final class LoanApplicationTerms { graceOnInterestPayment, graceOnInterestCharged, interestChargedFromDate, inArrearsTolerance, multiDisburseLoan, emiAmount, disbursementDatas, maxOutstandingBalance, emiAmountVariations, graceOnArrearsAgeing, daysInMonthType, daysInYearType, isInterestRecalculationEnabled, rescheduleStrategyMethod, interestRecalculationCompoundingMethod, restCalendarInstance, - recalculationFrequencyType, principalThresholdForLastInstalment, instalmentAmountInMultiplesOf); + recalculationFrequencyType, principalThresholdForLastInstalment, installmentAmountInMultiplesOf); } public static LoanApplicationTerms assembleFrom(final ApplicationCurrency applicationCurrency, final Integer loanTermFrequency, @@ -173,7 +173,7 @@ public final class LoanApplicationTerms { final LoanProductRelatedDetail loanProductRelatedDetail, final boolean multiDisburseLoan, final BigDecimal emiAmount, final List disbursementDatas, final BigDecimal maxOutstandingBalance, final List emiAmountVariations, final LocalDate interestChargedFromDate, - final BigDecimal principalThresholdForLastInstalment, Integer instalmentAmountInMultiplesOf) { + final BigDecimal principalThresholdForLastInstalment, Integer installmentAmountInMultiplesOf) { final Integer numberOfRepayments = loanProductRelatedDetail.getNumberOfRepayments(); final Integer repaymentEvery = loanProductRelatedDetail.getRepayEvery(); @@ -209,7 +209,7 @@ public final class LoanApplicationTerms { multiDisburseLoan, emiAmount, disbursementDatas, maxOutstandingBalance, emiAmountVariations, loanProductRelatedDetail.getGraceOnDueDate(), daysInMonthType, daysInYearType, isInterestRecalculationEnabled, rescheduleStrategyMethod, interestRecalculationCompoundingMethod, restCalendarInstance, recalculationFrequencyType, - principalThresholdForLastInstalment, instalmentAmountInMultiplesOf); + principalThresholdForLastInstalment, installmentAmountInMultiplesOf); } public static LoanApplicationTerms assembleFrom(final ApplicationCurrency applicationCurrency, final Integer loanTermFrequency, @@ -220,7 +220,7 @@ public final class LoanApplicationTerms { final List emiAmountVariations, final LocalDate interestChargedFromDate, final LoanInterestRecalculationDetails interestRecalculationDetails, final CalendarInstance restCalendarInstance, final RecalculationFrequencyType recalculationFrequencyType, final BigDecimal principalThresholdForLastInstalment, - Integer instalmentAmountInMultiplesOf) { + Integer installmentAmountInMultiplesOf) { final Integer numberOfRepayments = loanProductRelatedDetail.getNumberOfRepayments(); final Integer repaymentEvery = loanProductRelatedDetail.getRepayEvery(); @@ -258,7 +258,7 @@ public final class LoanApplicationTerms { disbursementDatas, maxOutstandingBalance, emiAmountVariations, loanProductRelatedDetail.getGraceOnDueDate(), daysInMonthType, daysInYearType, isInterestRecalculationEnabled, rescheduleStrategyMethod, interestRecalculationCompoundingMethod, restCalendarInstance, recalculationFrequencyType, - principalThresholdForLastInstalment, instalmentAmountInMultiplesOf); + principalThresholdForLastInstalment, installmentAmountInMultiplesOf); } public static LoanApplicationTerms assembleFrom(final Integer repaymentEvery, final PeriodFrequencyType repaymentPeriodFrequencyType, @@ -277,7 +277,7 @@ public final class LoanApplicationTerms { applicationTerms.interestRecalculationEnabled, applicationTerms.rescheduleStrategyMethod, applicationTerms.interestRecalculationCompoundingMethod, applicationTerms.restCalendarInstance, applicationTerms.recalculationFrequencyType, applicationTerms.principalThresholdForLastInstalment, - applicationTerms.instalmentAmountInMultiplesOf); + applicationTerms.installmentAmountInMultiplesOf); } private LoanApplicationTerms(final ApplicationCurrency currency, final Integer loanTermFrequency, @@ -295,7 +295,7 @@ public final class LoanApplicationTerms { final boolean isInterestRecalculationEnabled, final LoanRescheduleStrategyMethod rescheduleStrategyMethod, final InterestRecalculationCompoundingMethod interestRecalculationCompoundingMethod, final CalendarInstance restCalendarInstance, final RecalculationFrequencyType recalculationFrequencyType, - final BigDecimal principalThresholdForLastInstalment, final Integer instalmentAmountInMultiplesOf) { + final BigDecimal principalThresholdForLastInstalment, final Integer installmentAmountInMultiplesOf) { this.currency = currency; this.loanTermFrequency = loanTermFrequency; this.loanTermPeriodFrequencyType = loanTermPeriodFrequencyType; @@ -338,7 +338,7 @@ public final class LoanApplicationTerms { this.restCalendarInstance = restCalendarInstance; this.recalculationFrequencyType = recalculationFrequencyType; this.principalThresholdForLastInstalment = principalThresholdForLastInstalment; - this.instalmentAmountInMultiplesOf = instalmentAmountInMultiplesOf; + this.installmentAmountInMultiplesOf = installmentAmountInMultiplesOf; } public Money adjustPrincipalIfLastRepaymentPeriod(final Money principalForPeriod, final Money totalCumulativePrincipalToDate, @@ -817,8 +817,8 @@ public final class LoanApplicationTerms { double installmentAmount = FinanicalFunctions.pmt(periodicInterestRate.doubleValue(), periodsRemaining.doubleValue(), principalDouble, futureValue, false); - if (this.instalmentAmountInMultiplesOf != null) { - installmentAmount = Money.roundToMultiplesOf(installmentAmount, this.instalmentAmountInMultiplesOf); + if (this.installmentAmountInMultiplesOf != null) { + installmentAmount = Money.roundToMultiplesOf(installmentAmount, this.installmentAmountInMultiplesOf); } setFixedEmiAmount(BigDecimal.valueOf(installmentAmount)); } diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/service/LoanScheduleAssembler.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/service/LoanScheduleAssembler.java index fa882351b..1aa6bd6e9 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/service/LoanScheduleAssembler.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/loanschedule/service/LoanScheduleAssembler.java @@ -251,7 +251,7 @@ public class LoanScheduleAssembler { final boolean isInterestRecalculationEnabled = loanProduct.isInterestRecalculationEnabled(); final BigDecimal principalThresholdForLastInstalment = loanProduct.getPrincipalThresholdForLastInstalment(); - final Integer instalmentAmountInMultiplesOf = loanProduct.getInstalmentAmountInMultiplesOf(); + final Integer installmentAmountInMultiplesOf= loanProduct.getInstallmentAmountInMultiplesOf(); return LoanApplicationTerms.assembleFrom(applicationCurrency, loanTermFrequency, loanTermPeriodFrequencyType, numberOfRepayments, repaymentEvery, repaymentPeriodFrequencyType, nthDay, weekDayType, amortizationMethod, interestMethod, @@ -260,7 +260,7 @@ public class LoanScheduleAssembler { graceOnPrincipalPayment, graceOnInterestPayment, graceOnInterestCharged, interestChargedFromDate, inArrearsToleranceMoney, loanProduct.isMultiDisburseLoan(), emiAmount, disbursementDatas, maxOutstandingBalance, loanVariationTermsData, graceOnArrearsAgeing, daysInMonthType, daysInYearType, isInterestRecalculationEnabled, principalThresholdForLastInstalment, - instalmentAmountInMultiplesOf); + installmentAmountInMultiplesOf); } private List fetchDisbursementData(final JsonObject command) { diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/serialization/LoanApplicationCommandFromApiJsonHelper.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/serialization/LoanApplicationCommandFromApiJsonHelper.java index 9093805a6..72fae1c21 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/serialization/LoanApplicationCommandFromApiJsonHelper.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/serialization/LoanApplicationCommandFromApiJsonHelper.java @@ -363,7 +363,7 @@ public final class LoanApplicationCommandFromApiJsonHelper { } if (this.fromApiJsonHelper.parameterExists(LoanApiConstants.emiAmountParameterName, element)) { - if (!(loanProduct.canDefineInstalmentAmount() || loanProduct.isMultiDisburseLoan())) { + if (!(loanProduct.canDefineInstallmentAmount() || loanProduct.isMultiDisburseLoan())) { List unsupportedParameterList = new ArrayList<>(); unsupportedParameterList.add(LoanApiConstants.emiAmountParameterName); throw new UnsupportedParameterException(unsupportedParameterList); @@ -711,7 +711,7 @@ public final class LoanApplicationCommandFromApiJsonHelper { } if (this.fromApiJsonHelper.parameterExists(LoanApiConstants.emiAmountParameterName, element)) { - if (!(loanProduct.canDefineInstalmentAmount() || loanProduct.isMultiDisburseLoan())) { + if (!(loanProduct.canDefineInstallmentAmount() || loanProduct.isMultiDisburseLoan())) { List unsupportedParameterList = new ArrayList<>(); unsupportedParameterList.add(LoanApiConstants.emiAmountParameterName); throw new UnsupportedParameterException(unsupportedParameterList); diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanAssembler.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanAssembler.java index 59e2c512c..f0e8a1c70 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanAssembler.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanAssembler.java @@ -199,7 +199,7 @@ public class LoanAssembler { final EnumOptionData loanType = AccountEnumerations.loanType(loanTypeStr); Set disbursementDetails = null; BigDecimal fixedEmiAmount = null; - if (loanProduct.isMultiDisburseLoan() || loanProduct.canDefineInstalmentAmount()) { + if (loanProduct.isMultiDisburseLoan() || loanProduct.canDefineInstallmentAmount()) { fixedEmiAmount = this.fromApiJsonHelper.extractBigDecimalWithLocaleNamed(LoanApiConstants.emiAmountParameterName, element); } BigDecimal maxOutstandingLoanBalance = null; diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java index 26ed47e2b..a263d01b2 100755 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java @@ -501,7 +501,7 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService { + " l.loan_type_enum as loanType, l.loanpurpose_cv_id as loanPurposeId, cv.code_value as loanPurposeName," + " lp.id as loanProductId, lp.name as loanProductName, lp.description as loanProductDescription," + " lp.allow_multiple_disbursals as multiDisburseLoan," - + " lp.can_define_fixed_emi_amount as canDefineInstalmentAmount," + + " lp.can_define_fixed_emi_amount as canDefineInstallmentAmount," + " c.id as clientId, c.display_name as clientName, c.office_id as clientOfficeId," + " g.id as groupId, g.display_name as groupName," + " g.office_id as groupOfficeId, g.staff_id As groupStaffId , g.parent_id as groupParentId, " @@ -631,7 +631,7 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService { final String loanProductName = rs.getString("loanProductName"); final String loanProductDescription = rs.getString("loanProductDescription"); final Boolean multiDisburseLoan = rs.getBoolean("multiDisburseLoan"); - final Boolean canDefineInstalmentAmount = rs.getBoolean("canDefineInstalmentAmount"); + final Boolean canDefineInstallmentAmount = rs.getBoolean("canDefineInstallmentAmount"); final BigDecimal outstandingLoanBalance = rs.getBigDecimal("outstandingLoanBalance"); final LocalDate submittedOnDate = JdbcSupport.getLocalDate(rs, "submittedOnDate"); @@ -837,7 +837,7 @@ public class LoanReadPlatformServiceImpl implements LoanReadPlatformService { amortizationType, interestRatePerPeriod, interestRateFrequencyType, annualInterestRate, interestType, interestCalculationPeriodType, expectedFirstRepaymentOnDate, graceOnPrincipalPayment, graceOnInterestPayment, graceOnInterestCharged, interestChargedFromDate, timeline, loanSummary, feeChargesDueAtDisbursementCharged, - syncDisbursementWithMeeting, loanCounter, loanProductCounter, multiDisburseLoan, canDefineInstalmentAmount, + syncDisbursementWithMeeting, loanCounter, loanProductCounter, multiDisburseLoan, canDefineInstallmentAmount, fixedEmiAmount, outstandingLoanBalance, inArrears, graceOnArrearsAgeing, isNPA, daysInMonthType, daysInYearType, isInterestRecalculationEnabled, interestRecalculationData, createStandingInstructionAtDisbursement); } diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/LoanProductConstants.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/LoanProductConstants.java index 0b2edb91a..1a4c71eab 100755 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/LoanProductConstants.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/LoanProductConstants.java @@ -86,7 +86,7 @@ public interface LoanProductConstants { public static final BigDecimal DEFAULT_PRINCIPAL_THRESHOLD_FOR_MULTI_DISBURSE_LOAN = BigDecimal.valueOf(50); public static final BigDecimal DEFAULT_PRINCIPAL_THRESHOLD_FOR_SINGLE_DISBURSE_LOAN = BigDecimal.valueOf(0); // Fixed installment configuration related - public static final String canDefineEmiAmountParamName = "canDefineInstalmentAmount"; - public static final String instalmentAmountInMultiplesOfParamName = "instalmentAmountInMultiplesOf"; + public static final String canDefineEmiAmountParamName = "canDefineInstallmentAmount"; + public static final String installmentAmountInMultiplesOfParamName = "installmentAmountInMultiplesOf"; } diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/data/LoanProductData.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/data/LoanProductData.java index ac0802117..e1336aa2d 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/data/LoanProductData.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/data/LoanProductData.java @@ -84,8 +84,8 @@ public class LoanProductData { private final boolean isInterestRecalculationEnabled; private final LoanProductInterestRecalculationData interestRecalculationData; private final Integer minimumDaysBetweenDisbursalAndFirstRepayment; - private final boolean canDefineInstalmentAmount; - private final Integer instalmentAmountInMultiplesOf; + private final boolean canDefineInstallmentAmount; + private final Integer installmentAmountInMultiplesOf; // charges private final Collection charges; @@ -199,8 +199,8 @@ public class LoanProductData { final boolean isInterestRecalculationEnabled = false; final LoanProductInterestRecalculationData interestRecalculationData = null; final Integer minimumDaysBetweenDisbursalAndFirstRepayment = null; - final boolean canDefineInstalmentAmount = false; - final Integer instalmentAmountInMultiplesOf = null; + final boolean canDefineInstallmentAmount = false; + final Integer installmentAmountInMultiplesOf = null; return new LoanProductData(id, name, shortName, description, currency, principal, minPrincipal, maxPrincipal, tolerance, numberOfRepayments, minNumberOfRepayments, maxNumberOfRepayments, repaymentEvery, interestRatePerPeriod, @@ -211,8 +211,8 @@ public class LoanProductData { interestRateVariations, numberOfRepaymentVariations, multiDisburseLoan, maxTrancheCount, outstandingLoanBalance, graceOnArrearsAgeing, overdueDaysForNPA, daysInMonthType, daysInYearType, isInterestRecalculationEnabled, interestRecalculationData, minimumDaysBetweenDisbursalAndFirstRepayment, holdGuaranteeFunds, productGuaranteeData, - principalThresholdForLastInstalment, accountMovesOutOfNPAOnlyOnArrearsCompletion, canDefineInstalmentAmount, - instalmentAmountInMultiplesOf); + principalThresholdForLastInstalment, accountMovesOutOfNPAOnlyOnArrearsCompletion, canDefineInstallmentAmount, + installmentAmountInMultiplesOf); } public static LoanProductData lookupWithCurrency(final Long id, final String name, final CurrencyData currency) { @@ -270,8 +270,8 @@ public class LoanProductData { final LoanProductGuaranteeData productGuaranteeData = null; final BigDecimal principalThresholdForLastInstalment = null; final boolean accountMovesOutOfNPAOnlyOnArrearsCompletion = false; - final boolean canDefineInstalmentAmount = false; - final Integer instalmentAmountInMultiplesOf = null; + final boolean canDefineInstallmentAmount = false; + final Integer installmentAmountInMultiplesOf = null; return new LoanProductData(id, name, shortName, description, currency, principal, minPrincipal, maxPrincipal, tolerance, numberOfRepayments, minNumberOfRepayments, maxNumberOfRepayments, repaymentEvery, interestRatePerPeriod, @@ -282,8 +282,8 @@ public class LoanProductData { interestRateVariations, numberOfRepaymentVariations, multiDisburseLoan, maxTrancheCount, outstandingLoanBalance, graceOnArrearsAgeing, overdueDaysForNPA, daysInMonthType, daysInYearType, isInterestRecalculationEnabled, interestRecalculationData, minimumDaysBetweenDisbursalAndFirstRepayment, holdGuaranteeFunds, productGuaranteeData, - principalThresholdForLastInstalment, accountMovesOutOfNPAOnlyOnArrearsCompletion, canDefineInstalmentAmount, - instalmentAmountInMultiplesOf); + principalThresholdForLastInstalment, accountMovesOutOfNPAOnlyOnArrearsCompletion, canDefineInstallmentAmount, + installmentAmountInMultiplesOf); } public static LoanProductData sensibleDefaultsForNewLoanProductCreation() { @@ -348,8 +348,8 @@ public class LoanProductData { final LoanProductGuaranteeData productGuaranteeData = null; final BigDecimal principalThresholdForLastInstalment = null; final boolean accountMovesOutOfNPAOnlyOnArrearsCompletion = false; - final boolean canDefineInstalmentAmount = false; - final Integer instalmentAmountInMultiplesOf = null; + final boolean canDefineInstallmentAmount = false; + final Integer installmentAmountInMultiplesOf = null; return new LoanProductData(id, name, shortName, description, currency, principal, minPrincipal, maxPrincipal, tolerance, numberOfRepayments, minNumberOfRepayments, maxNumberOfRepayments, repaymentEvery, interestRatePerPeriod, @@ -361,7 +361,7 @@ public class LoanProductData { multiDisburseLoan, maxTrancheCount, outstandingLoanBalance, graceOnArrearsAgeing, overdueDaysForNPA, daysInMonthType, daysInYearType, isInterestRecalculationEnabled, interestRecalculationData, minimumDaysBetweenDisbursalAndFirstRepayment, holdGuaranteeFunds, productGuaranteeData, principalThresholdForLastInstalment, accountMovesOutOfNPAOnlyOnArrearsCompletion, - canDefineInstalmentAmount, instalmentAmountInMultiplesOf); + canDefineInstallmentAmount, installmentAmountInMultiplesOf); } public static LoanProductData withAccountingDetails(final LoanProductData productData, final Map accountingMappings, @@ -394,8 +394,8 @@ public class LoanProductData { final boolean isInterestRecalculationEnabled, final LoanProductInterestRecalculationData interestRecalculationData, final Integer minimumDaysBetweenDisbursalAndFirstRepayment, boolean holdGuaranteeFunds, final LoanProductGuaranteeData loanProductGuaranteeData, final BigDecimal principalThresholdForLastInstalment, - final boolean accountMovesOutOfNPAOnlyOnArrearsCompletion, boolean canDefineInstalmentAmount, - Integer instalmentAmountInMultiplesOf) { + final boolean accountMovesOutOfNPAOnlyOnArrearsCompletion, boolean canDefineInstallmentAmount, + Integer installmentAmountInMultiplesOf) { this.id = id; this.name = name; this.shortName = shortName; @@ -477,8 +477,8 @@ public class LoanProductData { this.rescheduleStrategyTypeOptions = null; this.interestRecalculationFrequencyTypeOptions = null; - this.canDefineInstalmentAmount = canDefineInstalmentAmount; - this.instalmentAmountInMultiplesOf = instalmentAmountInMultiplesOf; + this.canDefineInstallmentAmount = canDefineInstallmentAmount; + this.installmentAmountInMultiplesOf = installmentAmountInMultiplesOf; } @@ -590,8 +590,8 @@ public class LoanProductData { this.interestRecalculationFrequencyTypeOptions = interestRecalculationFrequencyTypeOptions; } - this.canDefineInstalmentAmount = productData.canDefineInstalmentAmount; - this.instalmentAmountInMultiplesOf = productData.instalmentAmountInMultiplesOf; + this.canDefineInstallmentAmount = productData.canDefineInstallmentAmount; + this.installmentAmountInMultiplesOf = productData.installmentAmountInMultiplesOf; } private Collection nullIfEmpty(final Collection charges) { @@ -842,7 +842,7 @@ public class LoanProductData { return null; } - public boolean canDefineInstalmentAmount() { - return this.canDefineInstalmentAmount; + public boolean canDefineInstallmentAmount() { + return this.canDefineInstallmentAmount; } } \ No newline at end of file diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/domain/LoanProduct.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/domain/LoanProduct.java index 6e751ec86..44a03395f 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/domain/LoanProduct.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/domain/LoanProduct.java @@ -143,10 +143,10 @@ public class LoanProduct extends AbstractPersistable { private boolean accountMovesOutOfNPAOnlyOnArrearsCompletion; @Column(name = "can_define_fixed_emi_amount") - private boolean canDefineInstalmentAmount; + private boolean canDefineInstallmentAmount; @Column(name = "instalment_amount_in_multiples_of", nullable = true) - private Integer instalmentAmountInMultiplesOf; + private Integer installmentAmountInMultiplesOf; public static LoanProduct assembleFromJson(final Fund fund, final LoanTransactionProcessingStrategy loanTransactionProcessingStrategy, final List productCharges, final JsonCommand command, final AprCalculator aprCalculator) { @@ -247,8 +247,8 @@ public class LoanProduct extends AbstractPersistable { final boolean accountMovesOutOfNPAOnlyOnArrearsCompletion = command .booleanPrimitiveValueOfParameterNamed(LoanProductConstants.accountMovesOutOfNPAOnlyOnArrearsCompletionParamName); final boolean canDefineEmiAmount = command.booleanPrimitiveValueOfParameterNamed(LoanProductConstants.canDefineEmiAmountParamName); - final Integer instalmentAmountInMultiplesOf = command - .integerValueOfParameterNamed(LoanProductConstants.instalmentAmountInMultiplesOfParamName); + final Integer installmentAmountInMultiplesOf = command + .integerValueOfParameterNamed(LoanProductConstants.installmentAmountInMultiplesOfParamName); return new LoanProduct(fund, loanTransactionProcessingStrategy, name, shortName, description, currency, principal, minPrincipal, maxPrincipal, interestRatePerPeriod, minInterestRatePerPeriod, maxInterestRatePerPeriod, interestFrequencyType, @@ -259,7 +259,7 @@ public class LoanProduct extends AbstractPersistable { outstandingLoanBalance, graceOnArrearsAgeing, overdueDaysForNPA, daysInMonthType, daysInYearType, isInterestRecalculationEnabled, interestRecalculationSettings, minimumDaysBetweenDisbursalAndFirstRepayment, holdGuarantorFunds, loanProductGuaranteeDetails, principalThresholdForLastInstalment, - accountMovesOutOfNPAOnlyOnArrearsCompletion, canDefineEmiAmount, instalmentAmountInMultiplesOf); + accountMovesOutOfNPAOnlyOnArrearsCompletion, canDefineEmiAmount, installmentAmountInMultiplesOf); } @@ -486,7 +486,7 @@ public class LoanProduct extends AbstractPersistable { final Integer minimumDaysBetweenDisbursalAndFirstRepayment, final boolean holdGuarantorFunds, final LoanProductGuaranteeDetails loanProductGuaranteeDetails, final BigDecimal principalThresholdForLastInstalment, final boolean accountMovesOutOfNPAOnlyOnArrearsCompletion, final boolean canDefineEmiAmount, - final Integer instalmentAmountInMultiplesOf) { + final Integer installmentAmountInMultiplesOf) { this.fund = fund; this.transactionProcessingStrategy = transactionProcessingStrategy; this.name = name.trim(); @@ -540,8 +540,8 @@ public class LoanProduct extends AbstractPersistable { this.loanProductGuaranteeDetails = loanProductGuaranteeDetails; this.principalThresholdForLastInstalment = principalThresholdForLastInstalment; this.accountMovesOutOfNPAOnlyOnArrearsCompletion = accountMovesOutOfNPAOnlyOnArrearsCompletion; - this.canDefineInstalmentAmount = canDefineEmiAmount; - this.instalmentAmountInMultiplesOf = instalmentAmountInMultiplesOf; + this.canDefineInstallmentAmount = canDefineEmiAmount; + this.installmentAmountInMultiplesOf = installmentAmountInMultiplesOf; } public MonetaryCurrency getCurrency() { @@ -783,18 +783,18 @@ public class LoanProduct extends AbstractPersistable { actualChanges.put(LoanProductConstants.accountMovesOutOfNPAOnlyOnArrearsCompletionParamName, newValue); this.accountMovesOutOfNPAOnlyOnArrearsCompletion = newValue; } - if (command.isChangeInBooleanParameterNamed(LoanProductConstants.canDefineEmiAmountParamName, this.canDefineInstalmentAmount)) { + if (command.isChangeInBooleanParameterNamed(LoanProductConstants.canDefineEmiAmountParamName, this.canDefineInstallmentAmount)) { final boolean newValue = command.booleanPrimitiveValueOfParameterNamed(LoanProductConstants.canDefineEmiAmountParamName); actualChanges.put(LoanProductConstants.canDefineEmiAmountParamName, newValue); - this.canDefineInstalmentAmount = newValue; + this.canDefineInstallmentAmount = newValue; } - if (command.isChangeInIntegerParameterNamedWithNullCheck(LoanProductConstants.instalmentAmountInMultiplesOfParamName, - this.instalmentAmountInMultiplesOf)) { - final Integer newValue = command.integerValueOfParameterNamed(LoanProductConstants.instalmentAmountInMultiplesOfParamName); - actualChanges.put(LoanProductConstants.instalmentAmountInMultiplesOfParamName, newValue); + if (command.isChangeInIntegerParameterNamedWithNullCheck(LoanProductConstants.installmentAmountInMultiplesOfParamName, + this.installmentAmountInMultiplesOf)) { + final Integer newValue = command.integerValueOfParameterNamed(LoanProductConstants.installmentAmountInMultiplesOfParamName); + actualChanges.put(LoanProductConstants.installmentAmountInMultiplesOfParamName, newValue); actualChanges.put("locale", localeAsInput); - this.instalmentAmountInMultiplesOf = newValue; + this.installmentAmountInMultiplesOf = newValue; } return actualChanges; @@ -1061,12 +1061,12 @@ public class LoanProduct extends AbstractPersistable { return isBasedOnOriginalSchedule; } - public boolean canDefineInstalmentAmount() { - return this.canDefineInstalmentAmount; + public boolean canDefineInstallmentAmount() { + return this.canDefineInstallmentAmount; } - public Integer getInstalmentAmountInMultiplesOf() { - return this.instalmentAmountInMultiplesOf; + public Integer getInstallmentAmountInMultiplesOf() { + return this.installmentAmountInMultiplesOf; } } \ No newline at end of file diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/serialization/LoanProductDataValidator.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/serialization/LoanProductDataValidator.java index f7db0791c..40712310e 100755 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/serialization/LoanProductDataValidator.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/serialization/LoanProductDataValidator.java @@ -76,7 +76,7 @@ public final class LoanProductDataValidator { LoanProductConstants.holdGuaranteeFundsParamName, LoanProductConstants.minimumGuaranteeFromGuarantorParamName, LoanProductConstants.minimumGuaranteeFromOwnFundsParamName, LoanProductConstants.principalThresholdForLastInstalmentParamName, LoanProductConstants.accountMovesOutOfNPAOnlyOnArrearsCompletionParamName, LoanProductConstants.canDefineEmiAmountParamName, - LoanProductConstants.instalmentAmountInMultiplesOfParamName)); + LoanProductConstants.installmentAmountInMultiplesOfParamName)); private final FromJsonHelper fromApiJsonHelper; @@ -340,17 +340,17 @@ public final class LoanProductDataValidator { baseDataValidator.reset().parameter(LoanProductConstants.principalThresholdForLastInstalmentParamName) .value(principalThresholdForLastInstalment).notLessThanMin(BigDecimal.ZERO).notGreaterThanMax(BigDecimal.valueOf(100)); if (this.fromApiJsonHelper.parameterExists(LoanProductConstants.canDefineEmiAmountParamName, element)) { - final Boolean canDefineInstalmentAmount = this.fromApiJsonHelper.extractBooleanNamed( + final Boolean canDefineInstallmentAmount = this.fromApiJsonHelper.extractBooleanNamed( LoanProductConstants.canDefineEmiAmountParamName, element); - baseDataValidator.reset().parameter(LoanProductConstants.canDefineEmiAmountParamName).value(canDefineInstalmentAmount) + baseDataValidator.reset().parameter(LoanProductConstants.canDefineEmiAmountParamName).value(canDefineInstallmentAmount) .isOneOfTheseValues(true, false); } - if (this.fromApiJsonHelper.parameterExists(LoanProductConstants.instalmentAmountInMultiplesOfParamName, element)) { - final Integer instalmentAmountInMultiplesOf = this.fromApiJsonHelper.extractIntegerWithLocaleNamed( - LoanProductConstants.instalmentAmountInMultiplesOfParamName, element); - baseDataValidator.reset().parameter(LoanProductConstants.instalmentAmountInMultiplesOfParamName) - .value(instalmentAmountInMultiplesOf).ignoreIfNull().integerGreaterThanZero(); + if (this.fromApiJsonHelper.parameterExists(LoanProductConstants.installmentAmountInMultiplesOfParamName, element)) { + final Integer installmentAmountInMultiplesOf = this.fromApiJsonHelper.extractIntegerWithLocaleNamed( + LoanProductConstants.installmentAmountInMultiplesOfParamName, element); + baseDataValidator.reset().parameter(LoanProductConstants.installmentAmountInMultiplesOfParamName) + .value(installmentAmountInMultiplesOf).ignoreIfNull().integerGreaterThanZero(); } // accounting related data validation @@ -797,17 +797,17 @@ public final class LoanProductDataValidator { .notGreaterThanMax(BigDecimal.valueOf(100)); } if (this.fromApiJsonHelper.parameterExists(LoanProductConstants.canDefineEmiAmountParamName, element)) { - final Boolean canDefineInstalmentAmount = this.fromApiJsonHelper.extractBooleanNamed( + final Boolean canDefineInstallmentAmount = this.fromApiJsonHelper.extractBooleanNamed( LoanProductConstants.canDefineEmiAmountParamName, element); - baseDataValidator.reset().parameter(LoanProductConstants.canDefineEmiAmountParamName).value(canDefineInstalmentAmount) + baseDataValidator.reset().parameter(LoanProductConstants.canDefineEmiAmountParamName).value(canDefineInstallmentAmount) .isOneOfTheseValues(true, false); } - if (this.fromApiJsonHelper.parameterExists(LoanProductConstants.instalmentAmountInMultiplesOfParamName, element)) { - final Integer instalmentAmountInMultiplesOf = this.fromApiJsonHelper.extractIntegerWithLocaleNamed( - LoanProductConstants.instalmentAmountInMultiplesOfParamName, element); - baseDataValidator.reset().parameter(LoanProductConstants.instalmentAmountInMultiplesOfParamName) - .value(instalmentAmountInMultiplesOf).ignoreIfNull().integerGreaterThanZero(); + if (this.fromApiJsonHelper.parameterExists(LoanProductConstants.installmentAmountInMultiplesOfParamName, element)) { + final Integer installmentAmountInMultiplesOf = this.fromApiJsonHelper.extractIntegerWithLocaleNamed( + LoanProductConstants.installmentAmountInMultiplesOfParamName, element); + baseDataValidator.reset().parameter(LoanProductConstants.installmentAmountInMultiplesOfParamName) + .value(installmentAmountInMultiplesOf).ignoreIfNull().integerGreaterThanZero(); } final Integer accountingRuleType = this.fromApiJsonHelper.extractIntegerNamed("accountingRule", element, Locale.getDefault()); diff --git a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/service/LoanProductReadPlatformServiceImpl.java b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/service/LoanProductReadPlatformServiceImpl.java index 783db5582..837110072 100644 --- a/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/service/LoanProductReadPlatformServiceImpl.java +++ b/mifosng-provider/src/main/java/org/mifosplatform/portfolio/loanproduct/service/LoanProductReadPlatformServiceImpl.java @@ -160,7 +160,7 @@ public class LoanProductReadPlatformServiceImpl implements LoanProductReadPlatfo + "lp.accounting_type as accountingType, lp.include_in_borrower_cycle as includeInBorrowerCycle,lp.use_borrower_cycle as useBorrowerCycle, lp.start_date as startDate, lp.close_date as closeDate, " + "lp.allow_multiple_disbursals as multiDisburseLoan, lp.max_disbursals as maxTrancheCount, lp.max_outstanding_loan_balance as outstandingLoanBalance, " + "lp.days_in_month_enum as daysInMonth, lp.days_in_year_enum as daysInYear, lp.interest_recalculation_enabled as isInterestRecalculationEnabled, " - + "lp.can_define_fixed_emi_amount as canDefineInstalmentAmount, lp.instalment_amount_in_multiples_of as instalmentAmountInMultiplesOf, " + + "lp.can_define_fixed_emi_amount as canDefineInstallmentAmount, lp.instalment_amount_in_multiples_of as installmentAmountInMultiplesOf, " + "lpr.id as lprId, lpr.product_id as productId, lpr.compound_type_enum as compoundType, lpr.reschedule_strategy_enum as rescheduleStrategy, " + "lpr.rest_frequency_type_enum as restFrequencyEnum, lpr.rest_frequency_interval as restFrequencyInterval, " + "lpr.rest_freqency_date as restFrequencyDate, lpr.arrears_based_on_original_schedule as isArrearsBasedOnOriginalSchedule, " @@ -277,8 +277,8 @@ public class LoanProductReadPlatformServiceImpl implements LoanProductReadPlatfo final EnumOptionData daysInMonthType = CommonEnumerations.daysInMonthType(daysInMonth); final int daysInYear = JdbcSupport.getInteger(rs, "daysInYear"); final EnumOptionData daysInYearType = CommonEnumerations.daysInYearType(daysInYear); - final Integer instalmentAmountInMultiplesOf = JdbcSupport.getInteger(rs, "instalmentAmountInMultiplesOf"); - final boolean canDefineInstalmentAmount = rs.getBoolean("canDefineInstalmentAmount"); + final Integer installmentAmountInMultiplesOf = JdbcSupport.getInteger(rs, "installmentAmountInMultiplesOf"); + final boolean canDefineInstallmentAmount = rs.getBoolean("canDefineInstallmentAmount"); final boolean isInterestRecalculationEnabled = rs.getBoolean("isInterestRecalculationEnabled"); LoanProductInterestRecalculationData interestRecalculationData = null; @@ -325,8 +325,8 @@ public class LoanProductReadPlatformServiceImpl implements LoanProductReadPlatfo numberOfRepaymentVariationsForBorrowerCycle, multiDisburseLoan, maxTrancheCount, outstandingLoanBalance, graceOnArrearsAgeing, overdueDaysForNPA, daysInMonthType, daysInYearType, isInterestRecalculationEnabled, interestRecalculationData, minimumDaysBetweenDisbursalAndFirstRepayment, holdGuaranteeFunds, loanProductGuaranteeData, - principalThresholdForLastInstalment, accountMovesOutOfNPAOnlyOnArrearsCompletion, canDefineInstalmentAmount, - instalmentAmountInMultiplesOf); + principalThresholdForLastInstalment, accountMovesOutOfNPAOnlyOnArrearsCompletion, canDefineInstallmentAmount, + installmentAmountInMultiplesOf); } }