Merge pull request #829 from lingalamadhukar/MIFOSX-1008
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);
|
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
|
// pre-save to generate id for use in group hierarchy
|
||||||
this.groupRepository.save(newGroup);
|
this.groupRepository.save(newGroup);
|
||||||
|
|||||||
+4
@@ -1164,6 +1164,10 @@ public class SavingsAccount extends AbstractPersistable<Long> {
|
|||||||
return this.client;
|
return this.client;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BigDecimal getNominalAnnualInterestRate() {
|
||||||
|
return this.nominalAnnualInterestRate;
|
||||||
|
}
|
||||||
|
|
||||||
public Map<String, Object> approveApplication(final AppUser currentUser, final JsonCommand command, final LocalDate tenantsTodayDate) {
|
public Map<String, Object> approveApplication(final AppUser currentUser, final JsonCommand command, final LocalDate tenantsTodayDate) {
|
||||||
|
|
||||||
final Map<String, Object> actualChanges = new LinkedHashMap<String, Object>();
|
final Map<String, Object> actualChanges = new LinkedHashMap<String, Object>();
|
||||||
|
|||||||
+17
-15
@@ -309,25 +309,27 @@ public class SavingsAccountWritePlatformServiceJpaRepositoryImpl implements Savi
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
private void postInterest(final SavingsAccount account) {
|
private void postInterest(final SavingsAccount account) {
|
||||||
final Set<Long> existingTransactionIds = new HashSet<Long>();
|
if (account.getNominalAnnualInterestRate().compareTo(BigDecimal.ZERO) == 1) {
|
||||||
final Set<Long> existingReversedTransactionIds = new HashSet<Long>();
|
final Set<Long> existingTransactionIds = new HashSet<Long>();
|
||||||
updateExistingTransactionsDetails(account, existingTransactionIds, existingReversedTransactionIds);
|
final Set<Long> existingReversedTransactionIds = new HashSet<Long>();
|
||||||
final LocalDate today = DateUtils.getLocalDateOfTenant();
|
updateExistingTransactionsDetails(account, existingTransactionIds, existingReversedTransactionIds);
|
||||||
final MathContext mc = new MathContext(10, RoundingMode.HALF_EVEN);
|
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
|
// for generating transaction id's
|
||||||
List<SavingsAccountTransaction> transactions = account.getTransactions();
|
List<SavingsAccountTransaction> transactions = account.getTransactions();
|
||||||
for (SavingsAccountTransaction accountTransaction : transactions) {
|
for (SavingsAccountTransaction accountTransaction : transactions) {
|
||||||
if (accountTransaction.getId() == null) {
|
if (accountTransaction.getId() == null) {
|
||||||
this.savingsAccountTransactionRepository.save(accountTransaction);
|
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)
|
@CronTarget(jobName = JobName.POST_INTEREST_FOR_SAVINGS)
|
||||||
|
|||||||
Reference in New Issue
Block a user