MIFOSX-998,MIFOSX-1008 Interest posting issue
This commit is contained in:
+5
@@ -159,6 +159,11 @@ public class GroupingTypesWritePlatformServiceJpaRepositoryImpl implements Group
|
||||
rollbackTransaction = this.commandProcessingService.validateCommand(commandWrapper, currentUser);
|
||||
}
|
||||
}
|
||||
|
||||
if (!newGroup.isCenter() && newGroup.hasActiveClients()) {
|
||||
final CommandWrapper commandWrapper = new CommandWrapperBuilder().associateClientsToGroup(newGroup.getId()).build();
|
||||
rollbackTransaction = this.commandProcessingService.validateCommand(commandWrapper, currentUser);
|
||||
}
|
||||
|
||||
// pre-save to generate id for use in group hierarchy
|
||||
this.groupRepository.save(newGroup);
|
||||
|
||||
+4
@@ -1164,6 +1164,10 @@ public class SavingsAccount extends AbstractPersistable<Long> {
|
||||
return this.client;
|
||||
}
|
||||
|
||||
public BigDecimal getNominalAnnualInterestRate() {
|
||||
return this.nominalAnnualInterestRate;
|
||||
}
|
||||
|
||||
public Map<String, Object> approveApplication(final AppUser currentUser, final JsonCommand command, final LocalDate tenantsTodayDate) {
|
||||
|
||||
final Map<String, Object> actualChanges = new LinkedHashMap<String, Object>();
|
||||
|
||||
+17
-15
@@ -309,25 +309,27 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
||||
|
||||
@Transactional
|
||||
private void postInterest(final SavingsAccount account) {
|
||||
final Set<Long> existingTransactionIds = new HashSet<Long>();
|
||||
final Set<Long> existingReversedTransactionIds = new HashSet<Long>();
|
||||
updateExistingTransactionsDetails(account, existingTransactionIds, existingReversedTransactionIds);
|
||||
final LocalDate today = DateUtils.getLocalDateOfTenant();
|
||||
final MathContext mc = new MathContext(10, RoundingMode.HALF_EVEN);
|
||||
if (account.getNominalAnnualInterestRate().compareTo(BigDecimal.ZERO) == 1) {
|
||||
final Set<Long> existingTransactionIds = new HashSet<Long>();
|
||||
final Set<Long> existingReversedTransactionIds = new HashSet<Long>();
|
||||
updateExistingTransactionsDetails(account, existingTransactionIds, existingReversedTransactionIds);
|
||||
final LocalDate today = DateUtils.getLocalDateOfTenant();
|
||||
final MathContext mc = new MathContext(10, RoundingMode.HALF_EVEN);
|
||||
|
||||
account.postInterest(mc, today);
|
||||
account.postInterest(mc, today);
|
||||
|
||||
// for generating transaction id's
|
||||
List<SavingsAccountTransaction> transactions = account.getTransactions();
|
||||
for (SavingsAccountTransaction accountTransaction : transactions) {
|
||||
if (accountTransaction.getId() == null) {
|
||||
this.savingsAccountTransactionRepository.save(accountTransaction);
|
||||
// for generating transaction id's
|
||||
List<SavingsAccountTransaction> transactions = account.getTransactions();
|
||||
for (SavingsAccountTransaction accountTransaction : transactions) {
|
||||
if (accountTransaction.getId() == null) {
|
||||
this.savingsAccountTransactionRepository.save(accountTransaction);
|
||||
}
|
||||
}
|
||||
|
||||
this.savingAccountRepository.save(account);
|
||||
|
||||
postJournalEntries(account, existingTransactionIds, existingReversedTransactionIds);
|
||||
}
|
||||
|
||||
this.savingAccountRepository.save(account);
|
||||
|
||||
postJournalEntries(account, existingTransactionIds, existingReversedTransactionIds);
|
||||
}
|
||||
|
||||
@CronTarget(jobName = JobName.POST_INTEREST_FOR_SAVINGS)
|
||||
|
||||
Reference in New Issue
Block a user