Search in sources :

Example 1 with ClosedAccountDto

use of org.mifos.dto.screen.ClosedAccountDto in project head by mifos.

the class CustAction method getClosedAccounts.

@TransactionDemarcate(joinToken = true)
public ActionForward getClosedAccounts(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    logger.debug("In CustAction::getClosedAccounts()");
    UserContext userContext = getUserContext(request);
    Integer customerId = getIntegerValue(((CustActionForm) form).getCustomerId());
    List<ClosedAccountDto> allClosedAccounts = this.centerServiceFacade.retrieveAllClosedAccounts(customerId);
    List<AccountBO> loanAccountsList = new CustomerPersistence().getAllClosedAccount(customerId, AccountTypes.LOAN_ACCOUNT.getValue());
    loanAccountsList.addAll(new CustomerPersistence().getAllClosedAccount(customerId, AccountTypes.GROUP_LOAN_ACCOUNT.getValue()));
    List<AccountBO> savingsAccountList = new CustomerPersistence().getAllClosedAccount(customerId, AccountTypes.SAVINGS_ACCOUNT.getValue());
    SessionUtils.setCollectionAttribute(AccountConstants.CLOSEDLOANACCOUNTSLIST, loanAccountsList, request);
    SessionUtils.setCollectionAttribute(AccountConstants.CLOSEDSAVINGSACCOUNTSLIST, savingsAccountList, request);
    return mapping.findForward(ActionForwards.getAllClosedAccounts.toString());
}
Also used : ClosedAccountDto(org.mifos.dto.screen.ClosedAccountDto) AccountBO(org.mifos.accounts.business.AccountBO) UserContext(org.mifos.security.util.UserContext) CustomerPersistence(org.mifos.customers.persistence.CustomerPersistence) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 2 with ClosedAccountDto

use of org.mifos.dto.screen.ClosedAccountDto in project head by mifos.

the class CenterServiceFacadeWebTier method retrieveAllClosedAccounts.

@Override
public List<ClosedAccountDto> retrieveAllClosedAccounts(Integer customerId) {
    List<ClosedAccountDto> closedAccounts = new ArrayList<ClosedAccountDto>();
    List<AccountBO> allClosedAccounts = this.customerDao.retrieveAllClosedLoanAndSavingsAccounts(customerId);
    for (AccountBO account : allClosedAccounts) {
        LocalDate closedDate = new LocalDate(account.getClosedDate());
        ClosedAccountDto closedAccount = new ClosedAccountDto(account.getAccountId(), account.getGlobalAccountNum(), account.getType().getValue().intValue(), account.getState().getValue().intValue(), closedDate);
        closedAccounts.add(closedAccount);
    }
    return closedAccounts;
}
Also used : ClosedAccountDto(org.mifos.dto.screen.ClosedAccountDto) AccountBO(org.mifos.accounts.business.AccountBO) CustomerAccountBO(org.mifos.customers.business.CustomerAccountBO) ArrayList(java.util.ArrayList) LocalDate(org.joda.time.LocalDate)

Aggregations

AccountBO (org.mifos.accounts.business.AccountBO)2 ClosedAccountDto (org.mifos.dto.screen.ClosedAccountDto)2 ArrayList (java.util.ArrayList)1 LocalDate (org.joda.time.LocalDate)1 CustomerAccountBO (org.mifos.customers.business.CustomerAccountBO)1 CustomerPersistence (org.mifos.customers.persistence.CustomerPersistence)1 TransactionDemarcate (org.mifos.framework.util.helpers.TransactionDemarcate)1 UserContext (org.mifos.security.util.UserContext)1