Skip to content

Commit

Permalink
F sf 12 15 main (#971)
Browse files Browse the repository at this point in the history
* feature fbr 648

* fix fbr 663

* fix fbr 663

* fix fbr 646

* Fix FBR-664 (#696)

* Fix missing entry for migration file

* Spotless fixes

* Fix for FBR-664

* Fix FBR-665 (#699)

* Fix FBR-665 (#699) (#702)

* fix fbr 648

* fix fbr 647

* fix fbr 647

* initial commit FBR-644 hard policy updates (#655)

FBR-644 hard policy updates

* Update LoanApplicationWritePlatformServiceJpaRepositoryImpl.java (#708)

* Update LoanApplicationWritePlatformServiceJpaRepositoryImpl.java (#708) (#709)

* Update changelog-tenant.xml (#711)

* Update changelog-tenant.xml

* fixed typo in query

* fixed table name in query

---------

Co-authored-by: Faheem Ahmad <[email protected]>

* Fix/fbr 644 v2 (#714)

* Update changelog-tenant.xml

* fixed typo in query

* fixed table name in query

* fixed multiple issues with queries

* FBR-644

---------

Co-authored-by: Leonardo Hildt <[email protected]>
Co-authored-by: Faheem Ahmad <[email protected]>

* fix fbr 667

* fix fbr 667

* fix fbr 666 (#718)

* release fbr 648

* release fbr 648

* release fbr 648 (#727)

* release fbr 669

* release fbr 669

* Fix/fbr 669 qa (#730)

* release fbr 669

* release fbr 669

* release fbr 668

* release fbr 668

* release fbr 670

* release fbr 671

* release fbr 672

* release fbr 678

* fix fbr 677

* fix fbr 684

* fix fbr 677

* release fbr 678

* fix fbr 684

* Reports Fix QA (#750)

* fix  FBR 673

* fix  FBR 673

* fix  FBR 673

* fix  QA REPORTS

* fix  QA REPORTS

* fix  QA REPORTS

* fix  QA REPORTS (#756)

* fix  QA REPORTS

* fix  QA REPORTS

* fix FBR 674

* fix QA REPORTS

* fix REPORTS

* fix Topu Loan Policies

* Fix/fbr 673 (#768)

* fix Policy Labels

* fix Hard Policy Labels

* Qa/fbr 673 674 (#769)

* fix FBR 674

* fix REPORTS

* fix Topu Loan Policies

* Fix/fbr 673 (#768)

* fix Policy Labels

* fix Hard Policy Labels

* fix/FBR-676

* fix/FBR-676 (#773)

* fix/FBR-676

* fix/FBR-HARDPOLICIES

* fix/FBR-HARDPOLICIES

* fix/FBR-HARDPOLICIES

* fix/FBR-HARDPOLICIES

* Fix/fbr 676 (#777)

* fix/FBR-HARDPOLICIES

* fix/FBR-HARDPOLICIES

* fix/FBR-HARDPOLICIES

* fix/FBR-HARDPOLICIES

* fix/FBR-682

* fix/FBR-688

* fix/FBR-688

* fix/FBR-690

* Fix FBR-692 (#803)

* Fix for FBR-692

* Spotless fixes

* fix/FBR-699

* fix/FBR-699 (#805)

* fix/FBR-699

* fix/FBR-699

* fix/FBR-699

* fix/FBR-699

* fix/FBR-699

* fix/FBR-700

* fix/FBR-700 (#812)

* fix/FBR-690

* fix/FBR-696

* Release v1.0.45 (#817)

* fix/FBR-699

* fix/FBR-700

* fix/FBR-700 (#812)

* fix/FBR-690

* fix/FBR-696

---------

Co-authored-by: Muhimbura Brian Mart <[email protected]>

* fix/FBR-690

* fix/FBR-690 (#820)

* Release v1.0.47 (#826)

* fix/FBR-699

* fix/FBR-700

* fix/FBR-700 (#812)

* fix/FBR-690

* fix/FBR-696

* fix/FBR-690 (#820)

---------

Co-authored-by: Muhimbura Brian Mart <[email protected]>

* fix/FBR-691

* Fix FBR-691 (#831)

* fix/FBR-699

* fix/FBR-700

* fix/FBR-700 (#812)

* fix/FBR-690

* fix/FBR-696

* fix/FBR-690

* fix/FBR-690 (#820)

* fix/FBR-691

---------

Co-authored-by: Muhimbura Brian Mart <[email protected]>

* fix/FBR-689

* fix/FBR-690 (#836)

* fix FBR 697

* fix FBR 698

* fix FBR 699

* fixed NPE (#848)

Co-authored-by: Faheem Ahmad <[email protected]>

* fixed NPE (#848) (#849)

Co-authored-by: Faheem Ahmad <[email protected]>
Co-authored-by: Faheem Ahmad <[email protected]>

* fix FBR 689

* fix FBR 695

* fix FBR 699

* fix FBR 697

* fix FBR 697 (#861)

* fix FBR 701

* Release/1.0.47/prepare (#864)

* fix FBR 697

* fix FBR 701

* fix FBR 704

* Release/1.0.48/prepare (#868)

* fix FBR 697

* fix FBR 701

* fix FBR 704

* fix FBR 704

* fix FBR 704

* Release/1.0.48/prepare (#869)

* fix FBR 697

* fix FBR 701

* fix FBR 704

* fix FBR 704

* fix FBR 704

* fix FBR 704 (#870)

* Fix/fbr 704 (#871)

* fix FBR 704

* fix FBR 704

* fix FBR 704

* Release/1.0.48/prepare (#872)

* fix FBR 697

* fix FBR 701

* fix FBR 704

* fix FBR 704

* fix FBR 704

* fix FBR 704 (#870)

* Fix/fbr 704 (#871)

* fix FBR 704

* fix FBR 704

* fix FBR 704

* fix FBR 702 (#874)

* Fic 699 (#878)

* Fic 689

* Fic 689 (#883)

* Fic 705 (#887)

* Fic 705 (#887) (#888)

Co-authored-by: Brian Muhimbura <[email protected]>

* Fix/fbr 707 (#890)

* Fic 705

* Fic 707

* Release/1.0.48/prepare (#891)

* Fic 689

* Fic 705 (#887)

* Fix/fbr 707 (#890)

* Fic 705

* Fic 707

* Fix/fbr 690 (#896)

* Fic 690

* fix/FBR-690

* Recredit Categorization fix

* Recredit Categorization fix

* Fix/fbr 690 (#897)

* Fic 690

* fix/FBR-690

* Recredit Categorization fix

* Recredit Categorization fix

* Recredit Categorization fix

* Fix/fbr 690 (#898)

* Fic 690

* fix/FBR-690

* Recredit Categorization fix

* Recredit Categorization fix

* Recredit Categorization fix

* Recredit Categorization fix

* Release/1.0.48/prepare (#899)

* Fic 689

* Fic 705 (#887)

* Fix/fbr 707 (#890)

* Fic 705

* Fic 707

* Fix/fbr 690 (#896)

* Fic 690

* fix/FBR-690

* Recredit Categorization fix

* Recredit Categorization fix

* Fix/fbr 690 (#897)

* Fic 690

* fix/FBR-690

* Recredit Categorization fix

* Recredit Categorization fix

* Recredit Categorization fix

* Fix/fbr 690 (#898)

* Fic 690

* fix/FBR-690

* Recredit Categorization fix

* Recredit Categorization fix

* Recredit Categorization fix

* Recredit Categorization fix

* fix FBR 709

* fix FBR 709 (#901)

* fix FBR 709

* Fix/fbr 709 (#903)

* fix FBR 709

* fix FBR 709

* Release 1.0.49 prepare (#906)

* Fic 689

* Fic 705 (#887)

* Fix/fbr 707 (#890)

* Fic 705

* Fic 707

* Fix/fbr 690 (#896)

* Fic 690

* fix/FBR-690

* Recredit Categorization fix

* Recredit Categorization fix

* Fix/fbr 690 (#897)

* Fic 690

* fix/FBR-690

* Recredit Categorization fix

* Recredit Categorization fix

* Recredit Categorization fix

* Fix/fbr 690 (#898)

* Fic 690

* fix/FBR-690

* Recredit Categorization fix

* Recredit Categorization fix

* Recredit Categorization fix

* Recredit Categorization fix

* fix FBR 709 (#901)

* Fix/fbr 709 (#903)

* fix FBR 709

* fix FBR 709

---------

Co-authored-by: Muhimbura Brian Mart <[email protected]>

* fix FS-005

* fix FS-007

* fix FS-007

* fix FS-003

* fix FS-003

* fix FS-2

* fix FSF-8

* Release v1.0.50 (#951)

* fix FSF-9

* fix FSF-4 (#945)

* Fix/fsf 11 (#947)

* fix FSF-4

* fix FSF-11

* Fix/fsf 11 (#950)

* fix FSF-4

* fix FSF-11

* fix FSF-11

---------

Co-authored-by: Muhimbura Brian Mart <[email protected]>

* Fix/fsf 17 qa (#958)

* fix FSF-9

* fix FSF-4 (#945)

* Fix/fsf 11 (#947)

* fix FSF-4

* fix FSF-11

* Fix/fsf 11 (#950)

* fix FSF-4

* fix FSF-11

* fix FSF-11

* fix FSF-17 (#957)

* F sf 12 15 qa (#965)

* fix FSF-9

* fix FSF-4 (#945)

* Fix/fsf 11 (#947)

* fix FSF-4

* fix FSF-11

* Fix/fsf 11 (#950)

* fix FSF-4

* fix FSF-11

* fix FSF-11

* fix FSF-17 (#957)

* fix FSF-15

* fix FSF-12

* MERGE FSF 12-15

---------

Co-authored-by: Leonardo Hildt <[email protected]>
Co-authored-by: Faheem Ahmad <[email protected]>
Co-authored-by: Faheem Ahmad <[email protected]>
Co-authored-by: Leonardo Hildt <[email protected]>
  • Loading branch information
5 people authored Aug 1, 2024
1 parent 4082c1e commit bce71a7
Show file tree
Hide file tree
Showing 12 changed files with 177 additions and 12 deletions.
Binary file not shown.
Binary file modified fineract-provider/pentahoReports/Print Bank Cheque.prpt
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ public String schema() {
SELECT mc.id AS clientId,mc.loan_cycle as loanCycle, mpgm.id AS prequalificationMemberId, IFNULL(mc.display_name,mpgm.name) AS name, mpg.id AS prequalificationId,\s
mpgm.requested_amount AS requestedAmount, IFNULL(mc.date_of_birth, mpgm.dob) AS dateOfBirth, IFNULL(mc.dpi, mpgm.dpi) AS dpi,
mpgm.work_with_puente AS workWithPuente, mcv.code_value As gender, mpgm.is_president AS president, mpgm.buro_check_status as buroCheckStatus, mpgm.agency_bureau_status as agencyBuroStatus,
ml.is_topup AS isTopup, ml.id AS loanId,
ml.is_topup AS isTopup, ml.id AS loanId, mcvl.code_value as loanCycleCompleted,
ml.is_topup AS isTopup, ml.id AS loanId, mcvl.code_value as loanCycleCompleted,
CASE WHEN (? NOT IN (3,7,4,5)) AND (COALESCE(mc.loan_cycle, 0) >= 3) THEN 'RECURRING'
WHEN (? IN (4,5)) AND (COALESCE(mc.loan_cycle, 0) >= 1) THEN 'RECURRING'
ELSE 'NEW' END as clientCategorization,
Expand All @@ -276,6 +277,8 @@ CASE WHEN (? NOT IN (3,7,4,5)) AND (COALESCE(mc.loan_cycle, 0) >= 3) THEN 'RECUR
LEFT JOIN m_code_value areacv ON areacv.id = cinf.area
LEFT JOIN m_prequalification_group mpg ON mpg.id = mpgm.group_id
LEFT JOIN m_loan ml ON ml.client_id = mc.id AND ml.loan_status_id = 100 AND ml.prequalification_id = mpg.id
LEFT JOIN m_loan_additionals_group mlad ON mlad.loan_id = ml.id
LEFT JOIN m_code_value mcvl ON mcv.id = mlad.loan_cycle_completed
WHERE mpg.id = ? GROUP BY mc.id
""";
}
Expand All @@ -298,7 +301,12 @@ public ClientData mapRow(@NotNull ResultSet rs, int rowNum) throws SQLException
final String gender = rs.getString("gender");
final String clientArea = rs.getString("clientArea");
final String clientCategorization = rs.getString("clientCategorization");
final String recreditCategorization = isTopup?"RECREDITO" : "NUEVO";
String recreditCategorization = isTopup?"RECREDITO" : "NUEVO";
final String loanCycleCompleted = rs.getString("loanCycleCompleted");
if (!StringUtils.isBlank(loanCycleCompleted)){
recreditCategorization = StringUtils.equalsIgnoreCase(loanCycleCompleted, "fromAnotherGroup") ? "RECREDITO" : "NUEVO";
}

return ClientData.builder().clientId(clientId).prequalificationId(prequalificationId).clientArea(clientArea)
.clientCategorization(clientCategorization).recreditCategorization(recreditCategorization).prequalificationMemberId(prequalificationMemberId).name(name)
.dateOfBirth(dateOfBirth).dpi(dpi).requestedAmount(requestedAmount).gender(gender).workWithPuente(workWithPuente)
Expand Down Expand Up @@ -386,7 +394,7 @@ private CheckValidationColor runCheck3(final ClientData clientData) {
final String percentageIncreaseSQL = """
SELECT
CASE WHEN (mlag.current_credit_value <= 0) THEN 0
ELSE ((mlag.requested_value/mlag.current_credit_value) - 1) * 100
ELSE ((mlag.agency_authorized_amount/mlag.current_credit_value) - 1) * 100
END AS percentageIncrease
FROM m_loan_additionals_group mlag
INNER JOIN m_loan ml ON ml.id = mlag.loan_id
Expand Down Expand Up @@ -599,7 +607,7 @@ private CheckValidationColor runCheck7(final ClientData clientData) {
reportParams.put("${prequalificationId}", prequalificationId);
reportParams.put("${loanProductId}", productId);
reportParams.put("${clientArea}", clientArea);
reportParams.put("${categorization}", clientData.getRecreditCategorization());
reportParams.put("${categorization}", clientData.getCategorization());
reportParams.put("${isTopup}", String.valueOf(clientData.getIsLoanTopup()));
reportParams.put("${requestedAmount}", String.valueOf(clientData.getRequestedAmount()));
final GenericResultsetData result = this.readReportingService.retrieveGenericResultset(reportName, "report", reportParams, false);
Expand Down Expand Up @@ -639,7 +647,7 @@ private CheckValidationColor runCheck8(final GroupData groupData) {
reportParams.put("${prequalificationId}", prequalificationId);
reportParams.put("${loanProductId}", productId);
reportParams.put("${clientArea}", clientArea);
String categorization = groupData.getTopupMembers().size()>0?"RECREDITO":"NUEVO";
String categorization = groupData.getPreviousPrequalification()!=null?"RECREDITO":"NUEVO";
reportParams.put("${categorization}", categorization);
reportParams.put("${disparityRatio}", disparityRatio);
final GenericResultsetData result = this.readReportingService.retrieveGenericResultset(reportName, "report", reportParams, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,7 @@ static final class GroupTypeLoanMapper implements RowMapper<LoanData> {
ml.is_topup AS isTopup,
mpg.id AS prequalificationId,
mg.id AS groupId,
mcv.code_description AS loanCycleCompleted,
mcv.code_value AS loanCycleCompleted,
ml.principal_amount AS principalAmount
FROM m_prequalification_group mpg
INNER JOIN m_prequalification_group_members mpgm ON mpgm.group_id = mpg.id
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/**
* 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.
*/
package org.apache.fineract.portfolio.group.exception;

import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException;

public class PortfolioOfficeNotFoundException extends AbstractPlatformDomainRuleException {

public PortfolioOfficeNotFoundException(final String potfolioOffice) {
super("error.msg.portfolio.office.not.found",
"The Portfolio with name `" + potfolioOffice + "` Does not have a matching office created. First created the office", potfolioOffice);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
import org.apache.fineract.portfolio.group.exception.GroupMustBePendingToBeDeletedException;
import org.apache.fineract.portfolio.group.exception.InvalidGroupLevelException;
import org.apache.fineract.portfolio.group.exception.InvalidGroupStateTransitionException;
import org.apache.fineract.portfolio.group.exception.PortfolioOfficeNotFoundException;
import org.apache.fineract.portfolio.group.exception.PrequalificationMappedException;
import org.apache.fineract.portfolio.group.serialization.GroupingTypesDataValidator;
import org.apache.fineract.portfolio.loanaccount.domain.Loan;
Expand Down Expand Up @@ -293,11 +294,20 @@ private CommandProcessingResult createGroupingType(final JsonCommand command, fi

final Integer distance = command.integerValueOfParameterNamed(GroupingTypesApiConstants.distance);

final Integer meetingStart = command.integerValueOfParameterNamed(GroupingTypesApiConstants.meetingStart);
Integer meetingStart = command.integerValueOfParameterNamed(GroupingTypesApiConstants.meetingStart);
if (meetingStart == null && parentGroup != null) {
meetingStart = parentGroup.getMeetingStart();
}

final Integer meetingEnd = command.integerValueOfParameterNamed(GroupingTypesApiConstants.meetingEnd);
Integer meetingEnd = command.integerValueOfParameterNamed(GroupingTypesApiConstants.meetingEnd);
if (meetingEnd == null && parentGroup != null) {
meetingEnd = parentGroup.getMeetingEnd();
}

final Integer meetingDay = command.integerValueOfParameterNamed(GroupingTypesApiConstants.meetingDay);
Integer meetingDay = command.integerValueOfParameterNamed(GroupingTypesApiConstants.meetingDay);
if (meetingDay == null && parentGroup != null) {
meetingDay = parentGroup.getMeetingDay();
}

final String referencePoint = command.stringValueOfParameterNamed(GroupingTypesApiConstants.referencePoint);

Expand Down Expand Up @@ -552,6 +562,18 @@ private CommandProcessingResult updateGroupingType(final Long groupId, final Jso

final GroupLevel groupLevel = this.groupLevelRepository.findById(groupForUpdate.getGroupLevel().getId()).orElse(null);

if (groupingType == GroupTypes.GROUP){
if (groupForUpdate.getMeetingDay()==null){
groupForUpdate.updateMeetingDay(parent.getMeetingDay());
}
if (groupForUpdate.getMeetingStart()==null){
groupForUpdate.updateMeetingStart(parent.getMeetingStart());
}
if (groupForUpdate.getMeetingEnd()==null){
groupForUpdate.updateMeetingEnd(parent.getMeetingEnd());
}
}

if (groupingType == GroupTypes.CENTER) {
if (command.longValueOfParameterNamed(GroupingTypesApiConstants.cityId) != 0) {
final Long cityId = command.longValueOfParameterNamed(GroupingTypesApiConstants.cityId);
Expand Down Expand Up @@ -1121,6 +1143,14 @@ public CommandProcessingResult generateCentersByPortfolio(Portfolio portfolio) {

// set values to generate the centers
final Office office = portfolio.getParentOffice();

String portfolioOfficeQuery = "SELECT id from m_office where name=?";
List<Long> portfolioIds = jdbcTemplate.queryForList(portfolioOfficeQuery, Long.class, portfolio.getName());
if (portfolioIds.size()<=0) {
throw new PortfolioOfficeNotFoundException(portfolio.getName());
}
Office portfolioOffice = this.officeRepositoryWrapper.findOneWithNotFoundDetection(portfolioIds.get(0));
// Office portfolioOffice = office.getParent();
final boolean active = true;
final LocalDate activationDate = DateUtils.getLocalDateOfTenant();
final LocalDate submittedOnDate = DateUtils.getLocalDateOfTenant();
Expand All @@ -1136,7 +1166,7 @@ public CommandProcessingResult generateCentersByPortfolio(Portfolio portfolio) {
final Integer meetingStart = rangeTemplateData.getStartDay();
final Integer meetingEnd = rangeTemplateData.getEndDay();

Group newCenter = Group.assembleNewCenterFrom(office, groupLevel, centerName, active, activationDate, submittedOnDate,
Group newCenter = Group.assembleNewCenterFrom(portfolioOffice, groupLevel, centerName, active, activationDate, submittedOnDate,
currentUser, meetingStartTime, meetingEndTime, portfolio, meetingStart, meetingEnd, meetingDayValue);

this.groupRepository.saveAndFlush(newCenter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import javax.persistence.PersistenceException;
import org.apache.commons.lang3.ObjectUtils;
Expand Down Expand Up @@ -157,6 +158,7 @@
import org.apache.fineract.portfolio.loanproduct.LoanProductConstants;
import org.apache.fineract.portfolio.loanproduct.data.LoanProductData;
import org.apache.fineract.portfolio.loanproduct.domain.LoanProduct;
import org.apache.fineract.portfolio.loanproduct.domain.LoanProductOwnerType;
import org.apache.fineract.portfolio.loanproduct.domain.LoanProductRelatedDetail;
import org.apache.fineract.portfolio.loanproduct.domain.LoanProductRepository;
import org.apache.fineract.portfolio.loanproduct.domain.LoanTransactionProcessingStrategy;
Expand Down Expand Up @@ -2649,7 +2651,12 @@ public CommandProcessingResult approveApplication(final Long loanId, final JsonC
calendar = calendarInstance.getCalendar();
}

LocalDate deriveFirstRepaymentDate = loanScheduleAssembler.deriveFirstRepaymentDate(loan, expectedDisbursementDate, calendar);
LocalDate deriveFirstRepaymentDate;
if (loan.getExpectedFirstRepaymentOnDate() != null && Objects.equals(loan.getLoanProduct().getOwnerType(), LoanProductOwnerType.INDIVIDUAL.getValue())) {
deriveFirstRepaymentDate = loan.getExpectedFirstRepaymentOnDate();
} else {
deriveFirstRepaymentDate = loanScheduleAssembler.deriveFirstRepaymentDate(loan, expectedDisbursementDate, calendar);
}
loan.setExpectedFirstRepaymentOnDate(deriveFirstRepaymentDate);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand Down Expand Up @@ -226,6 +227,7 @@
import org.apache.fineract.portfolio.loanaccount.serialization.LoanUpdateCommandFromApiJsonDeserializer;
import org.apache.fineract.portfolio.loanproduct.data.LoanOverdueDTO;
import org.apache.fineract.portfolio.loanproduct.domain.LoanProduct;
import org.apache.fineract.portfolio.loanproduct.domain.LoanProductOwnerType;
import org.apache.fineract.portfolio.loanproduct.exception.InvalidCurrencyException;
import org.apache.fineract.portfolio.loanproduct.exception.LinkedAccountRequiredException;
import org.apache.fineract.portfolio.note.domain.Note;
Expand Down Expand Up @@ -406,7 +408,12 @@ public CommandProcessingResult disburseLoan(final Long loanId, final JsonCommand
CalendarEntityType.LOANS.getValue());
Calendar calendar = calendarInstance!=null? calendarInstance.getCalendar():null;

LocalDate deriveFirstRepaymentDate = loanScheduleAssembler.deriveFirstRepaymentDate(loan, actualDisbursementDate, calendar);
LocalDate deriveFirstRepaymentDate;
if (loan.getExpectedFirstRepaymentOnDate() != null && Objects.equals(loan.getLoanProduct().getOwnerType(), LoanProductOwnerType.INDIVIDUAL.getValue())) {
deriveFirstRepaymentDate = loan.getExpectedFirstRepaymentOnDate();
} else {
deriveFirstRepaymentDate = loanScheduleAssembler.deriveFirstRepaymentDate(loan, actualDisbursementDate, calendar);
}
loan.setExpectedFirstRepaymentOnDate(deriveFirstRepaymentDate);

ScheduleGeneratorDTO scheduleGeneratorDTO = this.loanUtilService.buildScheduleGeneratorDTO(loan, recalculateFrom);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,6 @@
<include file="parts/0131_FBR_644_hard_policy_checks_updates_sql_updates.xml" relativeToChangelogFile="true"/>
<include file="parts/0132_AddConfigurationForAmountFormats.xml" relativeToChangelogFile="true"/>
<include file="parts/0133_UpdateNewHardPolicyQueries.xml" relativeToChangelogFile="true"/>
<include file="parts/0134_HardPolicyFixes.xml" relativeToChangelogFile="true"/>
<include file="parts/FS_001_FIX_GROUP_MEETING_DATES.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,25 @@
</sql>
</changeSet>

<changeSet id="32" author="fineract">
<sql>
<![CDATA[
UPDATE stretchy_report SET report_sql = "SELECT
CASE
WHEN ${productId} NOT IN (7,3,6) THEN 'GREEN'
WHEN ${productId} IN (4,5) AND ${loanCycle}>1 THEN 'GREEN'
WHEN ${productId} = 7 AND ${loanCycle}>=3 THEN 'GREEN'
WHEN ${productId} = 7 AND ${loanCycle}>=2 AND ${loanCycle}<3 THEN 'ORANGE'
WHEN ${productId} = 7 AND ${loanCycle}<2 THEN 'RED'
WHEN ${productId} = 3 AND ${loanCycle}>1 THEN 'GREEN'
ELSE 'RED'
END AS color"
WHERE report_name = "Recurring customer categorization Policy Check";
]]>
</sql>
</changeSet>




</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,20 @@
</sql>
</changeSet>

<changeSet id="5" author="fineract">
<sql>
<![CDATA[
UPDATE stretchy_report SET report_sql = " SELECT CASE
WHEN (${loanProductId} IN (2,8)) AND ${requestedAmount} <= 6000 THEN 'GREEN'
WHEN (${loanProductId} IN (2,9,8,4,5,7)) AND (${photographs} <= 0 OR ${investmentPlan} <= 0) THEN 'RED'
ELSE 'GREEN'
END AS color"
WHERE report_name = "Mandatory to attach photographs and investment plan Policy Check";
]]>
</sql>
</changeSet>




</databaseChangeLog>
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?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 id="1" author="fineract">
<sql>
<![CDATA[
update m_group as child
join m_group as parent ON child.parent_id=parent.id
set child.meeting_start_date = parent.meeting_start_date
where child.meeting_start_date is null;
update m_group as child
join m_group as parent ON child.parent_id=parent.id
set child.meeting_end_date = parent.meeting_end_date
where child.meeting_end_date is null;
update m_group as child
join m_group as parent ON child.parent_id=parent.id
set child.meeting_day = parent.meeting_day
where child.meeting_day is null;
]]>
</sql>
</changeSet>

</databaseChangeLog>

0 comments on commit bce71a7

Please sign in to comment.