This is an automated email from the ASF dual-hosted git repository.
adamsaghy pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git
The following commit(s) were added to refs/heads/develop by this push:
new 26061067d FINERACT-1971: Credited Principal renamed back to credits
amount.
26061067d is described below
commit 26061067d70b87657a26c68d8d74469422511d01
Author: Peter Bagrij <[email protected]>
AuthorDate: Fri Mar 8 16:35:35 2024 +0100
FINERACT-1971: Credited Principal renamed back to credits amount.
---
.../domain/LoanRepaymentScheduleInstallment.java | 5 ++++-
.../tenant/module/loan/module-changelog-master.xml | 1 +
...e_credited_principal_back_to_credits_amount.xml | 26 ++++++++++++++++++++++
.../service/LoanReadPlatformServiceImpl.java | 2 +-
4 files changed, 32 insertions(+), 2 deletions(-)
diff --git
a/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepaymentScheduleInstallment.java
b/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepaymentScheduleInstallment.java
index 6d6456510..72ffbd798 100644
---
a/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepaymentScheduleInstallment.java
+++
b/fineract-loan/src/main/java/org/apache/fineract/portfolio/loanaccount/domain/LoanRepaymentScheduleInstallment.java
@@ -130,7 +130,10 @@ public class LoanRepaymentScheduleInstallment extends
AbstractAuditableWithUTCDa
@Column(name = "is_additional", nullable = false)
private boolean additional;
- @Column(name = "credited_principal", scale = 6, precision = 19, nullable =
true)
+ // TODO: At some point in time this database column needs to be renamed to
credited_principal using the following
+ // approach
+ //
https://blog.thepete.net/blog/2023/12/05/expand/contract-making-a-breaking-change-without-a-big-bang/
+ @Column(name = "credits_amount", scale = 6, precision = 19, nullable =
true)
private BigDecimal creditedPrincipal;
@Column(name = "credited_fee", scale = 6, precision = 19, nullable = true)
diff --git
a/fineract-loan/src/main/resources/db/changelog/tenant/module/loan/module-changelog-master.xml
b/fineract-loan/src/main/resources/db/changelog/tenant/module/loan/module-changelog-master.xml
index 71521ef69..b90df0097 100644
---
a/fineract-loan/src/main/resources/db/changelog/tenant/module/loan/module-changelog-master.xml
+++
b/fineract-loan/src/main/resources/db/changelog/tenant/module/loan/module-changelog-master.xml
@@ -40,4 +40,5 @@
<include relativeToChangelogFile="true"
file="parts/1015_remove_disable_schedule_extension_column.xml"/>
<include relativeToChangelogFile="true"
file="parts/1016_add_credit_allocation_rule.xml"/>
<include relativeToChangelogFile="true"
file="parts/1017_add_fee_and_penalty_adjustments_to_loan.xml"/>
+ <include relativeToChangelogFile="true"
file="parts/1018_rename_credited_principal_back_to_credits_amount.xml"/>
</databaseChangeLog>
diff --git
a/fineract-loan/src/main/resources/db/changelog/tenant/module/loan/parts/1018_rename_credited_principal_back_to_credits_amount.xml
b/fineract-loan/src/main/resources/db/changelog/tenant/module/loan/parts/1018_rename_credited_principal_back_to_credits_amount.xml
new file mode 100644
index 000000000..35e2733c3
--- /dev/null
+++
b/fineract-loan/src/main/resources/db/changelog/tenant/module/loan/parts/1018_rename_credited_principal_back_to_credits_amount.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd">
+ <changeSet author="fineract" id="1">
+ <renameColumn tableName="m_loan_repayment_schedule"
oldColumnName="credited_principal" newColumnName="credits_amount"
columnDataType="DECIMAL(19, 6)"/>
+ </changeSet>
+</databaseChangeLog>
diff --git
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java
index 9b0be1385..a84d4127b 100644
---
a/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java
+++
b/fineract-provider/src/main/java/org/apache/fineract/portfolio/loanaccount/service/LoanReadPlatformServiceImpl.java
@@ -1157,7 +1157,7 @@ public class LoanReadPlatformServiceImpl implements
LoanReadPlatformService, Loa
+ " ls.fee_charges_amount as feeChargesDue,
ls.fee_charges_completed_derived as feeChargesPaid,
ls.fee_charges_waived_derived as feeChargesWaived,
ls.fee_charges_writtenoff_derived as feeChargesWrittenOff, "
+ " ls.penalty_charges_amount as penaltyChargesDue,
ls.penalty_charges_completed_derived as penaltyChargesPaid,
ls.penalty_charges_waived_derived as penaltyChargesWaived, "
+ " ls.penalty_charges_writtenoff_derived as
penaltyChargesWrittenOff, ls.total_paid_in_advance_derived as
totalPaidInAdvanceForPeriod, "
- + " ls.total_paid_late_derived as totalPaidLateForPeriod,
(coalesce(ls.credited_principal,0) + coalesce(ls.credited_fee,0) +
coalesce(ls.credited_penalty,0)) as totalCredits, ls.is_down_payment
isDownPayment "
+ + " ls.total_paid_late_derived as totalPaidLateForPeriod,
(coalesce(ls.credits_amount,0) + coalesce(ls.credited_fee,0) +
coalesce(ls.credited_penalty,0)) as totalCredits, ls.is_down_payment
isDownPayment "
+ " from m_loan_repayment_schedule ls ";
}