fix overdraft account balance (PR #659 for FINERACT-753)
This commit is contained in:
committed by
Michael Vorburger ⛑️
parent
26b4e0000c
commit
0474f59bcf
+9
@@ -851,6 +851,15 @@ public class SavingsAccount extends AbstractPersistableCustom<Long> {
|
||||
transaction.updateOverdraftAmount(overdraftAmount.getAmount());
|
||||
} else if (overdraftAmount.isNotEqualTo(transaction.getOverdraftAmount(getCurrency()))) {
|
||||
SavingsAccountTransaction accountTransaction = SavingsAccountTransaction.copyTransaction(transaction);
|
||||
if(transaction.isChargeTransaction()){
|
||||
Set<SavingsAccountChargePaidBy> chargesPaidBy = transaction.getSavingsAccountChargesPaid();
|
||||
final Set<SavingsAccountChargePaidBy> newChargePaidBy = new HashSet<>();
|
||||
chargesPaidBy.forEach(x->
|
||||
newChargePaidBy.add(SavingsAccountChargePaidBy.instance(accountTransaction,x.getSavingsAccountCharge(),
|
||||
x.getAmount()))
|
||||
);
|
||||
accountTransaction.getSavingsAccountChargesPaid().addAll(newChargePaidBy);
|
||||
}
|
||||
transaction.reverse();
|
||||
if (overdraftAmount.isGreaterThanZero()) {
|
||||
accountTransaction.updateOverdraftAmount(overdraftAmount.getAmount());
|
||||
|
||||
Reference in New Issue
Block a user