From 2833318fd386b484a49bc9ecb76da25792788054 Mon Sep 17 00:00:00 2001 From: MithunKashyap Date: Mon, 23 Mar 2015 13:25:55 +0530 Subject: [PATCH] MIFOSX-1905: Consistency w.r.t spelling principalThresholdForLastInstalment for loan products --- .../portfolio/loanproduct/domain/LoanProduct.java | 2 +- .../service/LoanProductReadPlatformServiceImpl.java | 6 +++--- ...ncy_wrt_spelling_principalThresholdForLastInstalment.sql | 3 +++ 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 mifosng-provider/src/main/resources/sql/migrations/core_db/V247__consistency_wrt_spelling_principalThresholdForLastInstalment.sql 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 a1aedde2a..69c7dc542 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 @@ -136,7 +136,7 @@ public class LoanProduct extends AbstractPersistable { @OneToOne(cascade = CascadeType.ALL, mappedBy = "loanProduct", optional = true, orphanRemoval = true) private LoanProductGuaranteeDetails loanProductGuaranteeDetails; - @Column(name = "principal_threshold_for_last_instalment", scale = 2, precision = 5, nullable = false) + @Column(name = "principal_threshold_for_last_installment", scale = 2, precision = 5, nullable = false) private BigDecimal principalThresholdForLastInstallment; @Column(name = "account_moves_out_of_npa_only_on_arrears_completion") 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 837110072..f0cd945ea 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 @@ -165,7 +165,7 @@ public class LoanProductReadPlatformServiceImpl implements LoanProductReadPlatfo + "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, " + "lp.hold_guarantee_funds as holdGuaranteeFunds, " - + "lp.principal_threshold_for_last_instalment as principalThresholdForLastInstalment, " + + "lp.principal_threshold_for_last_installment as principalThresholdForLastInstallment, " + "lpg.id as lpgId, lpg.mandatory_guarantee as mandatoryGuarantee, " + "lpg.minimum_guarantee_from_own_funds as minimumGuaranteeFromOwnFunds, lpg.minimum_guarantee_from_guarantor_funds as minimumGuaranteeFromGuarantor, " + "lp.account_moves_out_of_npa_only_on_arrears_completion as accountMovesOutOfNPAOnlyOnArrearsCompletion, " @@ -312,7 +312,7 @@ public class LoanProductReadPlatformServiceImpl implements LoanProductReadPlatfo minimumGuaranteeFromGuarantor); } - final BigDecimal principalThresholdForLastInstalment = rs.getBigDecimal("principalThresholdForLastInstalment"); + final BigDecimal principalThresholdForLastInstallment = rs.getBigDecimal("principalThresholdForLastInstallment"); final boolean accountMovesOutOfNPAOnlyOnArrearsCompletion = rs.getBoolean("accountMovesOutOfNPAOnlyOnArrearsCompletion"); return new LoanProductData(id, name, shortName, description, currency, principal, minPrincipal, maxPrincipal, tolerance, @@ -325,7 +325,7 @@ public class LoanProductReadPlatformServiceImpl implements LoanProductReadPlatfo numberOfRepaymentVariationsForBorrowerCycle, multiDisburseLoan, maxTrancheCount, outstandingLoanBalance, graceOnArrearsAgeing, overdueDaysForNPA, daysInMonthType, daysInYearType, isInterestRecalculationEnabled, interestRecalculationData, minimumDaysBetweenDisbursalAndFirstRepayment, holdGuaranteeFunds, loanProductGuaranteeData, - principalThresholdForLastInstalment, accountMovesOutOfNPAOnlyOnArrearsCompletion, canDefineInstallmentAmount, + principalThresholdForLastInstallment, accountMovesOutOfNPAOnlyOnArrearsCompletion, canDefineInstallmentAmount, installmentAmountInMultiplesOf); } } diff --git a/mifosng-provider/src/main/resources/sql/migrations/core_db/V247__consistency_wrt_spelling_principalThresholdForLastInstalment.sql b/mifosng-provider/src/main/resources/sql/migrations/core_db/V247__consistency_wrt_spelling_principalThresholdForLastInstalment.sql new file mode 100644 index 000000000..8c604b2fd --- /dev/null +++ b/mifosng-provider/src/main/resources/sql/migrations/core_db/V247__consistency_wrt_spelling_principalThresholdForLastInstalment.sql @@ -0,0 +1,3 @@ + +ALTER TABLE `m_product_loan` + CHANGE COLUMN `principal_threshold_for_last_instalment` `principal_threshold_for_last_installment` DECIMAL(5,2) NOT NULL DEFAULT '50.00' AFTER `hold_guarantee_funds`;