use of org.mifos.accounts.business.AccountTrxnEntity in project head by mifos.
the class TestObjectFactory method deleteAccountPayment.
private static void deleteAccountPayment(final AccountPaymentEntity accountPayment, final Session session) {
Set<AccountTrxnEntity> loanTrxns = accountPayment.getAccountTrxns();
for (AccountTrxnEntity accountTrxn : loanTrxns) {
if (accountTrxn instanceof LoanTrxnDetailEntity) {
LoanTrxnDetailEntity loanTrxn = (LoanTrxnDetailEntity) accountTrxn;
for (FeesTrxnDetailEntity feesTrxn : loanTrxn.getFeesTrxnDetails()) {
session.delete(feesTrxn);
}
for (FinancialTransactionBO financialTrxn : loanTrxn.getFinancialTransactions()) {
session.delete(financialTrxn);
}
session.delete(loanTrxn);
}
}
session.delete(accountPayment);
}
Aggregations