Skip to content

Commit

Permalink
test FBR-724
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianMuhimbura committed Dec 11, 2024
1 parent f9e42fe commit 139062a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2264,14 +2264,14 @@ public Map<String, Object> loanApplicationApproval(final AppUser currentUser, fi
actualChanges.put("status", LoanEnumerations.status(this.loanStatus));

// only do below if status has changed in the 'approval' case
LocalDate approvedOn = command.localDateValueOfParameterNamed("approvedOnDate");
String approvedOnDateChange = command.stringValueOfParameterNamed("approvedOnDate");
LocalDate approvedOn = this.expectedDisbursementDate;
String approvedOnDateChange = this.expectedDisbursementDate.format(DateTimeFormatter.ofPattern(command.dateFormat()));
if (approvedOn == null) {
approvedOn = command.localDateValueOfParameterNamed("eventDate");
approvedOnDateChange = command.stringValueOfParameterNamed("eventDate");
}

LocalDate expecteddisbursementDate = command.localDateValueOfParameterNamed("expectedDisbursementDate");
LocalDate expecteddisbursementDate = this.expectedDisbursementDate;

BigDecimal approvedLoanAmount = command.bigDecimalValueOfParameterNamed(LoanApiConstants.approvedLoanAmountParameterName);
if (approvedLoanAmount != null) {
Expand Down Expand Up @@ -2319,7 +2319,7 @@ public Map<String, Object> loanApplicationApproval(final AppUser currentUser, fi
this.approvedBy = currentUser;
actualChanges.put("locale", command.locale());
actualChanges.put("dateFormat", command.dateFormat());
actualChanges.put("approvedOnDate", approvedOnDateChange);
actualChanges.put("approvedOnDate", expecteddisbursementDate);

final LocalDate submittalDate = this.submittedOnDate;
if (approvedOn.isBefore(submittalDate)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2600,7 +2600,7 @@ public CommandProcessingResult approveApplication(final Long loanId, final JsonC

final JsonArray disbursementDataArray = command.arrayOfParameterNamed(LoanApiConstants.disbursementDataParameterName);

expectedDisbursementDate = command.localDateValueOfParameterNamed(LoanApiConstants.disbursementDateParameterName);
expectedDisbursementDate = loan.getExpectedDisbursedOnLocalDate();
if (expectedDisbursementDate == null) {
expectedDisbursementDate = loan.getExpectedDisbursedOnLocalDate();
}
Expand Down Expand Up @@ -2705,7 +2705,7 @@ public CommandProcessingResult approveApplication(final Long loanId, final JsonC
}

// Post Journal Entry
final LocalDate approvedOnDate = command.localDateValueOfParameterNamed(LoanApiConstants.approvedOnDateParameterName);
final LocalDate approvedOnDate = loan.getDisbursementDate();
final BigDecimal principal = command.bigDecimalValueOfParameterNamed(LoanApiConstants.approvedLoanAmountParameterName);
BitaCoraMaster bitaCoraMaster = this.lumaAccountingProcessorForLoan
.createJournalEntry(LumaBitacoraTransactionTypeEnum.LOANS_APPROVAL, loan, approvedOnDate, principal);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ public CommandProcessingResult disburseLoan(final Long loanId, final JsonCommand
}
}

final LocalDate actualDisbursementDate = command.localDateValueOfParameterNamed("actualDisbursementDate");
final LocalDate actualDisbursementDate = loan.getDisbursementDate();

// validate ActualDisbursement Date Against Expected Disbursement Date
LoanProduct loanProduct = loan.loanProduct();
Expand Down

0 comments on commit 139062a

Please sign in to comment.