process current and previous standing instructions on loans

This commit is contained in:
Wilfred Kigenyi
2024-03-26 12:44:04 +01:00
committed by Adam Saghy
parent 5c54a9dbea
commit 7c618a69d5
2 changed files with 69 additions and 1 deletions
@@ -97,7 +97,7 @@ public class ExecuteStandingInstructionsTasklet implements Tasklet {
transactionAmount = standingInstructionDuesData.totalDueAmount();
}
if (recurrenceType.isDuesRecurrence()) {
isDueForTransfer = LocalDate.now(DateUtils.getDateTimeZoneOfTenant()).equals(standingInstructionDuesData.dueDate());
isDueForTransfer = isDueForTransfer(standingInstructionDuesData);
}
}
@@ -164,4 +164,9 @@ public class ExecuteStandingInstructionsTasklet implements Tasklet {
jdbcTemplate.update(updateQuery.toString());
return transferCompleted;
}
public boolean isDueForTransfer(StandingInstructionDuesData standingInstructionDuesData) {
return standingInstructionDuesData.dueDate() != null
&& !standingInstructionDuesData.dueDate().isAfter(LocalDate.now(DateUtils.getDateTimeZoneOfTenant()));
}
}