Skip to content

Commit

Permalink
Merge branch 'fiter/fb/dev' into release/1.0.50-prepare
Browse files Browse the repository at this point in the history
* fiter/fb/dev:
  Fix/fsf 11 (#950)
  Fix/fsf 11 (#947)
  fix FSF-4 (#945)
  fix FSF-9
  • Loading branch information
leonardohildt committed Jul 26, 2024
2 parents c5f3dcf + 2b372ff commit 063ae9c
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
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 @@ -394,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
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 @@ -1142,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 @@ -1157,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

0 comments on commit 063ae9c

Please sign in to comment.