fix(savings): post GL entries for facility-charge collections at edit approval
Charges collected when a maker-checker Nominee/Digital-Feature edit is approved deducted the account balance and appeared in the passbook, but never posted a journal entry -- collectCharges() saved the charge transaction directly and skipped the accounting bridge entirely, so the GL never balanced against the subledger. Also fixes an unrelated NPE this exposed: collectCharges() used saveAll() instead of saveAllAndFlush(), so the new charge transaction had no id yet when the journal-entry code tried to read it.
This commit is contained in:
+5
-1
@@ -160,7 +160,11 @@ public class FacilityChargeAutoApplyService {
|
||||
}
|
||||
}
|
||||
if (!transactions.isEmpty()) {
|
||||
savingsAccountTransactionRepository.saveAll(transactions);
|
||||
// Flush immediately (not just save) so each transaction gets its DB-generated id right
|
||||
// away -- the caller posts GL journal entries for these transactions straight after this
|
||||
// call returns, and that requires a real id on each one, not one that only appears at
|
||||
// end-of-transaction commit.
|
||||
savingsAccountTransactionRepository.saveAllAndFlush(transactions);
|
||||
account.recalculateBalancesAfterFacilityCharges(transactionDate);
|
||||
}
|
||||
return transactions;
|
||||
|
||||
+3
@@ -79,6 +79,9 @@ public interface SavingsAccountWritePlatformService {
|
||||
void processPostActiveActions(SavingsAccount account, DateTimeFormatter fmt, Set<Long> existingTransactionIds,
|
||||
Set<Long> existingReversedTransactionIds);
|
||||
|
||||
void postJournalEntriesForSavingsAccount(SavingsAccount account, Set<Long> existingTransactionIds,
|
||||
Set<Long> existingReversedTransactionIds, boolean backdatedTxnsAllowedTill);
|
||||
|
||||
CommandProcessingResult modifyWithHoldTax(Long savingsAccountId, JsonCommand command);
|
||||
|
||||
void setSubStatusInactive(Long savingsId);
|
||||
|
||||
Reference in New Issue
Block a user