use of org.mifos.dto.screen.TransactionHistoryDto in project head by mifos.
the class AccountAppAction method getTrxnHistory.
@TransactionDemarcate(joinToken = true)
public ActionForward getTrxnHistory(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
String globalAccountNum = request.getParameter("globalAccountNum");
AccountBO accountBO = getAccountBusinessService().findBySystemId(globalAccountNum);
List<TransactionHistoryDto> transactionHistoryDto = this.centerServiceFacade.retrieveAccountTransactionHistory(globalAccountNum);
if (accountBO.isGroupLoanAccount() && null == ((LoanBO) accountBO).getParentAccount()) {
SessionUtils.setAttribute(Constants.TYPE_OF_GROUP_LOAN, "parentAcc", request);
} else if (accountBO.isGroupLoanAccount() && null != ((LoanBO) accountBO).getParentAccount()) {
SessionUtils.setAttribute(Constants.TYPE_OF_GROUP_LOAN, "memberAcc", request);
}
SessionUtils.setCollectionAttribute(SavingsConstants.TRXN_HISTORY_LIST, transactionHistoryDto, request);
SessionUtils.setAttribute(Constants.BUSINESS_KEY, accountBO, request);
request.setAttribute("GlNamesMode", AccountingRules.getGlNamesMode());
return mapping.findForward("getTransactionHistory_success");
}
use of org.mifos.dto.screen.TransactionHistoryDto in project head by mifos.
the class AccountBOIntegrationTest method testGetTransactionHistoryView.
@Test
public void testGetTransactionHistoryView() throws Exception {
Date currentDate = new Date(System.currentTimeMillis());
LoanBO loan = groupLoan;
loan.setUserContext(TestUtils.makeUser());
List<AccountActionDateEntity> accntActionDates = new ArrayList<AccountActionDateEntity>();
accntActionDates.addAll(loan.getAccountActionDates());
PaymentData accountPaymentDataView = TestObjectFactory.getLoanAccountPaymentData(accntActionDates, TestUtils.createMoney(100), null, loan.getPersonnel(), "receiptNum", Short.valueOf("1"), currentDate, currentDate);
IntegrationTestObjectMother.applyAccountPayment(loan, accountPaymentDataView);
loan = TestObjectFactory.getObject(LoanBO.class, loan.getAccountId());
List<Integer> ids = new ArrayList<Integer>();
for (AccountPaymentEntity accountPaymentEntity : loan.getAccountPayments()) {
for (AccountTrxnEntity accountTrxnEntity : accountPaymentEntity.getAccountTrxns()) {
for (FinancialTransactionBO financialTransactionBO : accountTrxnEntity.getFinancialTransactions()) {
ids.add(financialTransactionBO.getTrxnId());
}
}
}
loan.setUserContext(TestUtils.makeUser());
List<TransactionHistoryDto> trxnHistlist = loan.getTransactionHistoryView();
Assert.assertNotNull("Account TrxnHistoryView list object should not be null", trxnHistlist);
Assert.assertTrue("Account TrxnHistoryView list object Size should be greater than zero", trxnHistlist.size() > 0);
Assert.assertEquals(ids.size(), trxnHistlist.size());
int i = 0;
for (TransactionHistoryDto transactionHistoryDto : trxnHistlist) {
Assert.assertEquals(ids.get(i), transactionHistoryDto.getAccountTrxnId());
i++;
}
StaticHibernateUtil.flushSession();
groupLoan = TestObjectFactory.getObject(LoanBO.class, loan.getAccountId());
}
use of org.mifos.dto.screen.TransactionHistoryDto in project head by mifos.
the class ViewLoanAccountDetailsController method showLoanAccountTransactionHistory.
@RequestMapping(value = "/viewLoanAccountTransactionHistory", method = RequestMethod.GET)
public ModelAndView showLoanAccountTransactionHistory(HttpServletRequest request, HttpServletResponse response) {
ModelAndView modelAndView = new ModelAndView();
sitePreferenceHelper.resolveSiteType(modelAndView, "viewLoanAccountTransactionHistory", request);
modelAndView.addObject("include_page", new IncludePage(request, response));
String globalAccountNum = request.getParameter("globalAccountNum");
LoanInformationDto loanInformationDto = loanAccountServiceFacade.retrieveLoanInformation(globalAccountNum);
modelAndView.addObject("loanInformationDto", loanInformationDto);
AccountingConfigurationDto configurationDto = this.configurationServiceFacade.getAccountingConfiguration();
modelAndView.addObject("GLCodeMode", configurationDto.getGlCodeMode());
List<TransactionHistoryDto> transactionHistoryDto = this.centerServiceFacade.retrieveAccountTransactionHistory(globalAccountNum);
request.setAttribute("trxnHistoryList", transactionHistoryDto);
return modelAndView;
}
Aggregations