Skip to content

Commit

Permalink
Prepare release v1.0.22 (#391)
Browse files Browse the repository at this point in the history
* Feature/FBR-422: Edit Fund sources (#293)

Co-authored-by: Julius Peter Oketayot <[email protected]>

* Fix/fbr 457 (#295)

* Fix Prequalification Processflow

* Fix Prequalification Processflow

* Fbr 47 guarantees (#297)

* FBR-47 deposit guarantee to client savings account on disbursal of loan

* FBR-47 limit creation of gurantee account if user already has account

* FBR-47 added account number generation and restriction for adding second savings for client

* Check meeting time when creating or editing a group

* Transfer group validations

* BAC-52/Feature: Add Daily Journal Posting Report (#300)

Co-authored-by: Julius Peter Oketayot <[email protected]>

* BAC-52/Feature: Add Daily Journal Posting Report (#301)

Co-authored-by: Julius Peter Oketayot <[email protected]>

* Bug/FBR-15: Reset mifos processed fields (#302)

Co-authored-by: Julius Peter Oketayot <[email protected]>

* fix prequalification of existing group

* Feature/FBR-465: Retrieve Loan Product from Prequalification (#306)

Co-authored-by: Julius Peter Oketayot <[email protected]>

* validate client loan request before hard policy

* Feature/FBR-44: Add authorization user roles (#308)

Co-authored-by: Julius Peter Oketayot <[email protected]>

* Fix for FBR-469 - Update center name (#309)

* Block full deposit amount

* Feature/FBR-468: Approve and reject loan applications (#310)

Co-authored-by: Julius Peter Oketayot <[email protected]>

* Enhancement/FBR-477: Improve batch loan repayment imports (#313)

Co-authored-by: Julius Peter Oketayot <[email protected]>

* Display agencies in proper hierarchy

* Display agencies in proper hierarchy

* Fbr 437 release guarantee (#315)

* FBR-437 added number of repayments to loan transaction template

* FBR-437 added number of repayments to loan transaction template

* WIP: FBR-437 added loan_id to saving transactions table

* FBR-437 release guanrantee payment of last payment

* FBR-437 set loan id on release transaction to help with report generation

* FBR-437 set loan id on release transaction

* fix merge conflicts

* Group Additionals migration

* Hold full required amount.

* FBR-436 added guarantee report (#316)

* Hold full required amount.

* Bug/Remove JLG Constraint on client loan (#321)

Co-authored-by: Julius Peter Oketayot <[email protected]>

* group additionals migration

* group additionals domain

* FBR 489

* Bug/FBR-488: Approve/Reject Loan Request Fixes (#324)

Co-authored-by: Julius Peter Oketayot <[email protected]>

* Bug/FBR-488: Approve/Reject Loan Request Fixes (#325)

Co-authored-by: Julius Peter Oketayot <[email protected]>

* Bug/FBR-488: Approve/Reject Loan Request Fixes (#326)

Co-authored-by: Julius Peter Oketayot <[email protected]>

* Bug/FBR-488: Approve/Reject Loan Request Fixes (#327)

Co-authored-by: Julius Peter Oketayot <[email protected]>

* Fix migration scripts (#329)

Removed the database hard-coded in the migration scripts

* FBR-460 misc changes required for bulk loan and user import

* Feature/FBR-418: Add Additional Loan Properties (#319)

Co-authored-by: Julius Peter Oketayot <[email protected]>

* FBR-460 bypass prequalification check for bulk import (#332)

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

* FBR 489

* FBR-493: Adjust prequalification workflows (#335)

Co-authored-by: Julius Peter Oketayot <[email protected]>

* Bug/FBR-418: Make Loan Additional Optional (#336)

Co-authored-by: Julius Peter Oketayot <[email protected]>

* FBR 489

* FBR-485 - Wrong status for Individual prequalification (#337)

* Feature/FBR-420: Optimize Loan Additional Information (#333)

Co-authored-by: Julius Peter Oketayot <[email protected]>

* FBR-484 add permission to role

* FBR-430 Date and BigDecimal locale issue for Spanish fixed

* FBR-438,FBR-439 & FBR-440 (#343)

* Pager Libre Protesto Grupal Report

* New reports

* FBR-472

* Feature/FBR-420: Add Hard Policy Checks V1 (#342)

Co-authored-by: Julius Peter Oketayot <[email protected]>

* FBR-487

* Changes on the reports datasources (#346)

* Pager Libre Protesto Grupal Report

* New reports

* Latest Pagare report changes

* Latest Changes on Pagare Libre reports

* Latest report changes

* Libre report changes

* Feature/FBR-420: Add hard policy check V4 (#347)

Co-authored-by: Julius Peter Oketayot <[email protected]>

* FBR-481

* FBR-481

* FBR-481

* FBR-481

* FBR-481

* FBR-482/FBR-492: Edit Prequalifications (#349)

Co-authored-by: Julius Peter Oketayot <[email protected]>

* New parameter definition on FBR-438,439 & 440 (#350)

* Pager Libre Protesto Grupal Report

* New reports

* Latest Pagare report changes

* Latest Changes on Pagare Libre reports

* Latest report changes

* Libre report changes

* Libre reports with New parameters defined

* Feature/FBR-486-FBR-53: Edit loan application (#351)

Co-authored-by: Julius Peter Oketayot <[email protected]>

* FBR-453

* FBR-453

* Changes on report Params on Fbr 440 branch (#352)

* Libre report under FBR-440

* FBR-440 report parameter changes

* Pagare reports fixes on paramaters (#354)

* fix/FBR-419

* Feature/FBR-440: Add Pagare Libre Protesto Reporte (#355)

* Feature/FBR-440: Add Pagare Libre Protesto Reporte

* Feature/FBR-440: Add Pagare Libre Protesto Reporte

* FBR-482: Fix Prequalification Date Of Birth Date Picker (#357)

* Create Group loan pagaré report (LIBRE DE PROTESTO) (#358)

* fix/FBR-453

* fix/FBR-453 (#359)

* FBR-439 report query changes based on the changes in DB (#360)

* group additional data details

* FBR-497 retain loan external id for bulk import and fix 500 exception for loans with no additional data

* group additional data details

* Feature/FBR-418: Solicitud de crédito individual - Agregar pestaña para campos adicionales en nuevo préstamo (#361)

* FBR-476 show supervision and supervision office while creating portfolio

* FBR-429 update loan restructuting to outstanding principal

* Feature/FBR-490: Préstamo complementario (#366)

* Feature/FBR-420: Refactor hard-policy implementation Final (#370)

* Enhancement/FBR-505: Edit Reporte de Garantas (#371)

* group additional data details

* Bug/FBR-435-502-509: Fix Reported Bugs (#373)

* group additional data details

* group additional data details (#374)

* date of birth param validation

* Fix/fbr417 (#375)

* group additional data details

* date of birth param validation

* Bugs/FBR-418-FBR-505: Bug Fixes (#376)

* FBR-508

* Bug/FBR-506: Reporte Grupal de Cobranzas y Saldos por Financista is missing some groups (#378)

* FBR-508

* Bug/FBR-490: Préstamo complementario - Waive Interest (#380)

* FBR-501 Negative balance in savings accounts after releasing the guarantee Fixed

* Add prequalificatiobn group validation linkage (#382)

* FBR-383

* FBR-394

* FBR-511

* FBR-427 portfolio planning issue fixed for active group loans

* FBR-394

* Pagare Grupo Report changes (#388)

---------

Co-authored-by: fiter-julius-oketayot <[email protected]>
Co-authored-by: Julius Peter Oketayot <[email protected]>
Co-authored-by: Brian Muhimbura <[email protected]>
Co-authored-by: Moses Kalema <[email protected]>
Co-authored-by: Leonardo Hildt <[email protected]>
Co-authored-by: Faheem Ahmad <[email protected]>
Co-authored-by: Faheem Ahmad <[email protected]>
Co-authored-by: josephNak <[email protected]>
Co-authored-by: Faheem Ahmad <[email protected]>
Co-authored-by: Leonardo Hildt <[email protected]>
  • Loading branch information
11 people authored Jan 4, 2024
1 parent c35e746 commit 8ef6202
Show file tree
Hide file tree
Showing 98 changed files with 13,463 additions and 3,235 deletions.
Binary file not shown.
Binary file not shown.
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 @@ -103,7 +103,7 @@ public String schema() {
.append(" creatingUser.username as createdByUserName, journalEntry.description as comments, ")
.append(" journalEntry.created_date as createdDate, journalEntry.reversed as reversed, ")
.append(" journalEntry.currency_code as currencyCode, curr.name as currencyName, curr.internationalized_name_code as currencyNameCode, ")
.append(" curr.display_symbol as currencyDisplaySymbol, curr.decimal_places as currencyDigits, curr.currency_multiplesof as inMultiplesOf ");
.append(" curr.display_symbol as currencyDisplaySymbol, curr.decimal_places as currencyDigits, curr.currency_multiplesof as inMultiplesOf, curr.int_code AS intCode ");
if (associationParametersData.isRunningBalanceRequired()) {
sb.append(" ,journalEntry.is_running_balance_calculated as runningBalanceComputed, ")
.append(" journalEntry.office_running_balance as officeRunningBalance, ")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ private LoanConstants() {
public static final int LOAN_COLLATERAL_QUANTITY = 48;// AW
public static final int CHARGE_AMOUNT_TYPE_1 = 49;// AX
public static final int CHARGE_AMOUNT_TYPE_2 = 50;// AY
public static final int LOAN_CYCLE = 51;// AY

public static final String LOAN_TYPE_INDIVIDUAL = "Individual";
public static final String LOAN_TYPE_GROUP = "Group";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,6 @@ private LoanRepaymentConstants() {
public static final int LOOKUP_PRINCIPAL_COL = 21;// T
public static final int LOOKUP_TOTAL_OUTSTANDING_AMOUNT_COL = 22;
public static final int LOOKUP_LOAN_DISBURSEMENT_DATE_COL = 23;// U
public static final int TRANSACTION_EXTERNAL_ID_COL = 24;// U
public static final int TRANSACTION_NOTE_COL = 25;// U
}
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,12 @@ private DisbursementData readDisbursalData(Row row, String locale, String dateFo

private LoanApprovalData readLoanApproval(Row row, String locale, String dateFormat) {
LocalDate approvedDate = ImportHandlerUtils.readAsDate(LoanConstants.APPROVED_DATE_COL, row);
BigDecimal principal = BigDecimal.ZERO;
if (ImportHandlerUtils.readAsDouble(LoanConstants.PRINCIPAL_COL, row) != null) {
principal = BigDecimal.valueOf(ImportHandlerUtils.readAsDouble(LoanConstants.PRINCIPAL_COL, row));
}
if (approvedDate != null) {
return LoanApprovalData.importInstance(approvedDate, row.getRowNum(), locale, dateFormat);
return LoanApprovalData.importInstance(approvedDate, row.getRowNum(), locale, dateFormat, principal);
}

return null;
Expand All @@ -147,6 +151,7 @@ private LoanAccountData readLoan(Row row, String locale, String dateFormat) {
String externalId = ImportHandlerUtils.readAsString(LoanConstants.EXTERNAL_ID_COL, row);
String status = ImportHandlerUtils.readAsString(LoanConstants.STATUS_COL, row);
String productName = ImportHandlerUtils.readAsString(LoanConstants.PRODUCT_COL, row);
Integer borrowerCycle = ImportHandlerUtils.readAsInt(LoanConstants.LOAN_CYCLE, row);
Long productId = ImportHandlerUtils.getIdByName(workbook.getSheet(TemplatePopulateImportConstants.PRODUCT_SHEET_NAME), productName);
String loanOfficerName = ImportHandlerUtils.readAsString(LoanConstants.LOAN_OFFICER_NAME_COL, row);
Long loanOfficerId = ImportHandlerUtils.getIdByName(workbook.getSheet(TemplatePopulateImportConstants.STAFF_SHEET_NAME),
Expand Down Expand Up @@ -355,21 +360,25 @@ private LoanAccountData readLoan(Row row, String locale, String dateFormat) {
if (loanType.equals("individual")) {
Long clientId = ImportHandlerUtils.getIdByName(workbook.getSheet(TemplatePopulateImportConstants.CLIENT_SHEET_NAME),
clientOrGroupName);
return LoanAccountData.importInstanceIndividual(loanTypeEnumOption, clientId, productId, loanOfficerId, submittedOnDate,
fundId, principal, numberOfRepayments, repaidEvery, repaidEveryFrequencyEnums, loanTerm, loanTermFrequencyEnum,
nominalInterestRate, submittedOnDate, amortizationEnumOption, interestMethodEnum, interestCalculationPeriodEnum,
arrearsTolerance, repaymentStrategyId, graceOnPrincipalPayment, graceOnInterestPayment, graceOnInterestCharged,
interestChargedFromDate, firstRepaymentOnDate, row.getRowNum(), externalId, null, charges, linkAccountId, locale,
dateFormat, loanCollateralManagementData);
LoanAccountData data = LoanAccountData.importInstanceIndividual(loanTypeEnumOption, clientId, productId, loanOfficerId,
submittedOnDate, fundId, principal, numberOfRepayments, repaidEvery, repaidEveryFrequencyEnums, loanTerm,
loanTermFrequencyEnum, nominalInterestRate, submittedOnDate, amortizationEnumOption, interestMethodEnum,
interestCalculationPeriodEnum, arrearsTolerance, repaymentStrategyId, graceOnPrincipalPayment,
graceOnInterestPayment, graceOnInterestCharged, interestChargedFromDate, firstRepaymentOnDate, row.getRowNum(),
externalId, null, charges, linkAccountId, locale, dateFormat, loanCollateralManagementData);
data.setBorrowerCycle(borrowerCycle);
return data;
} else if (loanType.equals("jlg")) {
Long clientId = ImportHandlerUtils.getIdByName(workbook.getSheet(TemplatePopulateImportConstants.CLIENT_SHEET_NAME),
clientOrGroupName);
return LoanAccountData.importInstanceIndividual(loanTypeEnumOption, clientId, productId, loanOfficerId, submittedOnDate,
fundId, principal, numberOfRepayments, repaidEvery, repaidEveryFrequencyEnums, loanTerm, loanTermFrequencyEnum,
nominalInterestRate, submittedOnDate, amortizationEnumOption, interestMethodEnum, interestCalculationPeriodEnum,
arrearsTolerance, repaymentStrategyId, graceOnPrincipalPayment, graceOnInterestPayment, graceOnInterestCharged,
interestChargedFromDate, firstRepaymentOnDate, row.getRowNum(), externalId, groupId, charges, linkAccountId, locale,
dateFormat, null);
LoanAccountData data = LoanAccountData.importInstanceIndividual(loanTypeEnumOption, clientId, productId, loanOfficerId,
submittedOnDate, fundId, principal, numberOfRepayments, repaidEvery, repaidEveryFrequencyEnums, loanTerm,
loanTermFrequencyEnum, nominalInterestRate, submittedOnDate, amortizationEnumOption, interestMethodEnum,
interestCalculationPeriodEnum, arrearsTolerance, repaymentStrategyId, graceOnPrincipalPayment,
graceOnInterestPayment, graceOnInterestCharged, interestChargedFromDate, firstRepaymentOnDate, row.getRowNum(),
externalId, groupId, charges, linkAccountId, locale, dateFormat, null);
data.setBorrowerCycle(borrowerCycle);
return data;
} else {
Long groupIdforGroupLoan = ImportHandlerUtils
.getIdByName(workbook.getSheet(TemplatePopulateImportConstants.GROUP_SHEET_NAME), clientOrGroupName);
Expand Down Expand Up @@ -411,11 +420,11 @@ public Count importEntity(String dateFormat) {
}

if (progressLevel <= 1 && approvalDates.get(i) != null) {
progressLevel = importLoanApproval(result, i, dateFormat);
progressLevel = importLoanApproval(result, i, dateFormat, loanId);
}

if (progressLevel <= 2 && disbursalDates.get(i) != null) {
progressLevel = importDisbursalData(result, i, dateFormat);
progressLevel = importDisbursalData(result, i, dateFormat, loanId);
}

if (loanRepayments.get(i) != null) {
Expand Down Expand Up @@ -482,10 +491,12 @@ private Integer importLoanRepayment(CommandProcessingResult result, int rowIndex
return 4;
}

private Integer importDisbursalData(CommandProcessingResult result, int rowIndex, String dateFormat) {
private Integer importDisbursalData(CommandProcessingResult result, int rowIndex, String dateFormat, String loanId) {
if (approvalDates.get(rowIndex) != null && disbursalDates.get(rowIndex) != null) {
Integer loanCycle = loans.get(rowIndex).getBorrowerCycle();

DisbursementData disbusalData = disbursalDates.get(rowIndex);
disbusalData.setBorrowerCycle(loanCycle);
String linkAccountId = disbusalData.getLinkAccountId();
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
Expand All @@ -499,7 +510,7 @@ private Integer importDisbursalData(CommandProcessingResult result, int rowIndex
} else {
String payload = gsonBuilder.create().toJson(disbusalData);
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
.disburseLoanApplication(result.getLoanId()) //
.disburseLoanApplication(result == null ? Long.parseLong(loanId) : result.getLoanId()) //
.withJson(payload) //
.build(); //

Expand All @@ -509,13 +520,13 @@ private Integer importDisbursalData(CommandProcessingResult result, int rowIndex
return 3;
}

private Integer importLoanApproval(CommandProcessingResult result, int rowIndex, String dateFormat) {
private Integer importLoanApproval(CommandProcessingResult result, int rowIndex, String dateFormat, String loanId) {
if (approvalDates.get(rowIndex) != null) {
GsonBuilder gsonBuilder = GoogleGsonSerializerHelper.createGsonBuilder();
gsonBuilder.registerTypeAdapter(LocalDate.class, new DateSerializer(dateFormat));
String payload = gsonBuilder.create().toJson(approvalDates.get(rowIndex));
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
.approveLoanApplication(result.getLoanId()) //
.approveLoanApplication(result == null ? Long.parseLong(loanId) : result.getLoanId()) //
.withJson(payload) //
.build(); //

Expand Down Expand Up @@ -545,6 +556,7 @@ private CommandProcessingResult importLoan(int rowIndex, String dateFormat) {
}
}
loanJsonOb.remove("isTopup");
loanJsonOb.addProperty("isBulkImport", true);
String payload = loanJsonOb.toString();
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
.createLoanApplication() //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,13 @@ private LoanTransactionData readLoanRepayment(Row row, String locale, String dat
Integer routingCode = ImportHandlerUtils.readAsInt(LoanRepaymentConstants.ROUTING_CODE_COL, row);
Integer receiptNumber = ImportHandlerUtils.readAsInt(LoanRepaymentConstants.RECEIPT_NO_COL, row);
Integer bankNumber = ImportHandlerUtils.readAsInt(LoanRepaymentConstants.BANK_NO_COL, row);
return LoanTransactionData.importInstance(repaymentAmount, repaymentDate, repaymentTypeId, accountNumber, checkNumber, routingCode,
receiptNumber, bankNumber, loanAccountId, "", row.getRowNum(), locale, dateFormat);
String transactionExternalId = ImportHandlerUtils.readAsString(LoanRepaymentConstants.TRANSACTION_EXTERNAL_ID_COL, row);
String note = ImportHandlerUtils.readAsString(LoanRepaymentConstants.TRANSACTION_NOTE_COL, row);
LoanTransactionData data = LoanTransactionData.importInstance(repaymentAmount, repaymentDate, repaymentTypeId, accountNumber,
checkNumber, routingCode, receiptNumber, bankNumber, loanAccountId, "", row.getRowNum(), locale, dateFormat);
data.setNote(note);
data.setExternalId(transactionExternalId);
return data;
}

public Count importEntity(String dateFormat) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ private ExternalServicesConstants() {
public static final String NOTIFICATION_SERVICE_NAME = "NOTIFICATION";
public static final String GUARANTEE_SERVICE_NAME = "GUARANTEE";
public static final String DPI_BURO_CHECK_SERVICE_NAME = "DPI_BURO_CHECK";
public static final String LOAN_ADDITIONAL_PROPERTIES_SERVICE_NAME = "LOAN_ADDITIONAL_PROPERTIES";
public static final String NOTIFICATION_SERVER_KEY = "server_key";
public static final String NOTIFICATION_GCM_END_POINT = "gcm_end_point";
public static final String NOTIFICATION_FCM_END_POINT = "fcm_end_point";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ public Collection<ExternalServicesPropertiesData> retrieveOne(String serviceName
serviceNameToUse = ExternalServicesConstants.DPI_BURO_CHECK_SERVICE_NAME;
break;

case ExternalServicesConstants.LOAN_ADDITIONAL_PROPERTIES_SERVICE_NAME:
serviceNameToUse = ExternalServicesConstants.LOAN_ADDITIONAL_PROPERTIES_SERVICE_NAME;
break;
default:
throw new ExternalServiceConfigurationNotFoundException(serviceName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,16 @@ public LocalDate extractLocalDateAsArrayNamed(final String parameterName, final
}

public BigDecimal extractBigDecimalWithLocaleNamed(final String parameterName, final JsonElement element) {
return this.helperDelegator.extractBigDecimalWithLocaleNamed(parameterName, element, new HashSet<String>());
BigDecimal withLocale = this.helperDelegator.extractBigDecimalWithLocaleNamed(parameterName, element, new HashSet<String>());
// FBR-430 2024.00 is converted as 202400 in Spanish locale. Below fix is to get correct value if locale is
// Spanish
if (withLocale != null && this.helperDelegator.extractLocaleValueAsString(element.getAsJsonObject()).equalsIgnoreCase("es")) {
BigDecimal withoutLocale = this.extractBigDecimalNamed(parameterName, element, new HashSet<String>());
if (withLocale.compareTo(withoutLocale) != 0) {
return withoutLocale;
}
}
return withLocale;
}

public BigDecimal extractBigDecimalWithLocaleNamed(final String parameterName, final JsonElement element,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -786,4 +786,14 @@ private Locale extractLocaleValue(final JsonObject object) {
}
return clientApplicationLocale;
}

public String extractLocaleValueAsString(final JsonObject object) {
String locale = null;
if (object.has("locale") && object.get("locale").isJsonPrimitive()) {
final JsonPrimitive primitive = object.get("locale").getAsJsonPrimitive();
locale = primitive.getAsString();

}
return locale;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ private DataTableApiConstant() {
public static final String linkedAccountAssociateParamName = "linkedAccount";
public static final String multiDisburseDetailsAssociateParamName = "multiDisburseDetails";
public static final String futureScheduleAssociateParamName = "futureSchedule";
public static final String additionalDetailsParamName = "additionalDetails";
public static final String meetingAssociateParamName = "meeting";
public static final String emiAmountVariationsAssociateParamName = "emiAmountVariations";
public static final String collectionAssociateParamName = "collection";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static final class ChequeMapper implements RowMapper<ChequeData> {
mbc.description AS description,
mbc.guarantee_amount As guaranteeAmount,
ml.approved_principal as loanAmount,
(case when ml.approved_principal>0 then ml.approved_principal else mbc.guarantee_amount end) as chequeAmount,
(case when ml.net_disbursal_amount > 0 then ml.net_disbursal_amount when ml.approved_principal > 0 then ml.approved_principal else mbc.guarantee_amount end) as chequeAmount,
mbc.case_id AS caseId,
mbc.guarantee_id AS guaranteeId,
mc.account_no AS clientNo,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ public CommandProcessingResult createBatch(JsonCommand command) {
this.chequeBatchRepositoryWrapper.createBatch(batch);
Set<Cheque> chequeList = new HashSet<>();
for (Long i = from; i <= to; i++) {
Cheque cheque = new Cheque().setBatch(batch).setChequeNo(i).setStatus(BankChequeStatus.AVAILABLE.getValue())
.setDescription(createChequeCommand.getDescription());
Cheque cheque = new Cheque().setBatch(batch).setChequeNo(i).setStatus(BankChequeStatus.AVAILABLE.getValue());
cheque.stampAudit(currentUserId, localDateTime);
chequeList.add(cheque);
}
Expand Down Expand Up @@ -379,14 +378,14 @@ public CommandProcessingResult printCheques(JsonCommand command) {
throw new BankChequeException(
"print.cheques.loan:" + loan.getAccountNumber() + " is.not.in.disbursement.authorization.status");
}

if (!chequeData.getReassingedCheque()) {
CommandProcessingResult result = this.loanWritePlatformService.disburseLoan(loanAccId, command, false);
if (result.getLoanId() == null) {
throw new BankChequeException("print.cheques", "failed.to.disburse.loan " + loanAccId);
}
}

chequeAmount = chequeData.getLoanAmount();
chequeAmount = loan.getNetDisbursalAmount();
}
final String amountInWords = NumberToWordsConverter.convertToWords(chequeAmount.intValue(),
NumberToWordsConverter.Language.SPANISH);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,14 @@ public PortfolioData findById(Long portfolioId) {
public PortfolioData retrieveNewPortfolioTemplate() {
this.context.authenticatedUser();

final Collection<OfficeData> parentOfficesOptions = officeReadPlatformService.retrieveChildOfficesByUserHierarchyAsParent();
final Collection<OfficeData> parentOfficesOptions = officeReadPlatformService
.retrieveOfficesByHierarchyLevel(Long.valueOf(OfficeHierarchyLevel.GERENCIA.getValue()));

// retrieve list of users under agency hierarchy level as this is the user role to access these feature
final List<AppUserData> appUsers = new ArrayList<>(
this.appUserReadPlatformService.retrieveUsersUnderHierarchy(Long.valueOf(OfficeHierarchyLevel.CARTERA.getValue())));
final Collection<SupervisionData> supervisionOptions = this.supervisionReadPlatformService.retrieveAllByUser();
final String hierarchy = this.context.authenticatedUser().getOffice().getHierarchy();
final Collection<SupervisionData> supervisionOptions = this.supervisionReadPlatformService.retrieveByOfficeHierarchy(hierarchy);
return PortfolioData.template(parentOfficesOptions, appUsers, supervisionOptions);
}

Expand Down Expand Up @@ -235,6 +237,5 @@ public PortfolioPlanningData mapRow(final ResultSet rs, @SuppressWarnings("unuse
public String schema() {
return this.schema;
}

}
}
Loading

0 comments on commit 8ef6202

Please sign in to comment.