Skip to content

Commit

Permalink
Merge pull request #1423 from fiterlatam/bug/SU-537
Browse files Browse the repository at this point in the history
SU-537 : Archivo de cartera
  • Loading branch information
tabrez-fiter authored Dec 22, 2024
2 parents a4ffc71 + 00a7633 commit d0e57aa
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,12 @@ public RepeatStatus execute(StepContribution contribution, ChunkContext chunkCon
estadoCliente = ClientStatus.fromInt(loan.getClient().getStatus()).name();
}

BigDecimal waivedFees = currentInstallment.getFeeChargesWaived(loan.getCurrency()).getAmount();
BigDecimal waivedInterest = currentInstallment.getInterestWaived(loan.getCurrency()).getAmount();
BigDecimal waivedPenalties = currentInstallment.getPenaltyChargesWaived(loan.getCurrency()).getAmount();
BigDecimal totalWaived = waivedFees.add(waivedInterest).add(waivedPenalties);
BigDecimal writtenOffPrincipal = currentInstallment.getPrincipalWrittenOff(loan.getCurrency()).getAmount();
BigDecimal writtenOffInterest = currentInstallment.getInterestWrittenOff(loan.getCurrency()).getAmount();
BigDecimal writtenOffFees = currentInstallment.getFeeChargesWrittenOff(loan.getCurrency()).getAmount();
BigDecimal writtenOffPenalties = currentInstallment.getPenaltyChargesWrittenOff(loan.getCurrency()).getAmount();
BigDecimal totalWrittenOff = writtenOffPrincipal.add(writtenOffInterest).add(writtenOffFees)
.add(writtenOffPenalties);

if (existingLoanArchive.isPresent()) {

Expand Down Expand Up @@ -298,7 +300,7 @@ public RepeatStatus execute(StepContribution contribution, ChunkContext chunkCon
existingEntry.setPeriodicidad(PeriodFrequencyType.fromInt(loan.getTermPeriodFrequencyType()).name());
existingEntry.setEmpresaReporta("INTERCREDITO");
existingEntry.setAbono(currentInstallment.getTotalPaid(loan.getCurrency()).getAmount());
existingEntry.setCondonaciones(totalWaived);
existingEntry.setCondonaciones(totalWrittenOff);
existingEntry.setActividadLaboral(actividadLaboral);
existingEntry.setNumeroDeReprogramaciones(numberReschedule);
existingEntry.setCreSaldo(creSaldo);
Expand Down Expand Up @@ -365,7 +367,7 @@ public RepeatStatus execute(StepContribution contribution, ChunkContext chunkCon
loanArchiveHistory.setPeriodicidad(PeriodFrequencyType.fromInt(loan.getTermPeriodFrequencyType()).name());
loanArchiveHistory.setEmpresaReporta("INTERCREDITO");
loanArchiveHistory.setAbono(currentInstallment.getTotalPaid(loan.getCurrency()).getAmount());
loanArchiveHistory.setCondonaciones(totalWaived);
loanArchiveHistory.setCondonaciones(totalWrittenOff);
loanArchiveHistory.setActividadLaboral(actividadLaboral);
loanArchiveHistory.setNumeroDeReprogramaciones(numberReschedule);
loanArchiveHistory.setCreSaldo(creSaldo);
Expand Down

0 comments on commit d0e57aa

Please sign in to comment.