Search in sources :

Example 26 with AccountBusinessService

use of org.mifos.accounts.business.service.AccountBusinessService in project head by mifos.

the class BirtAdminDocumentUploadAction method loadProductInstance.

@TransactionDemarcate(joinToken = true)
public ActionForward loadProductInstance(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    BirtAdminDocumentUploadActionForm uploadForm = (BirtAdminDocumentUploadActionForm) form;
    SessionUtils.removeAttribute(ProductDefinitionConstants.AVAILABLEACCOUNTSTATUS, request);
    SessionUtils.removeAttribute(ProductDefinitionConstants.SELECTEDACCOUNTSTATUS, request);
    SessionUtils.removeAttribute(ProductDefinitionConstants.STATUS_LIST, request);
    if (StringUtils.isNotBlank(uploadForm.getAccountTypeId()) && Short.valueOf(uploadForm.getAccountTypeId()).shortValue() <= 2) {
        SessionUtils.setCollectionAttribute(ProductDefinitionConstants.AVAILABLEACCOUNTSTATUS, new AccountBusinessService().retrieveAllActiveAccountStateList(AccountTypes.getAccountType(Short.valueOf(uploadForm.getAccountTypeId()))), request);
    } else if (StringUtils.isNotBlank(uploadForm.getAccountTypeId())) {
        SessionUtils.setCollectionAttribute(ProductDefinitionConstants.AVAILABLEACCOUNTSTATUS, getAvailableLoanTransactions((Short) SessionUtils.getAttribute("CURRENT_LOCALE_ID", request)), request);
    }
    return mapping.findForward(ActionForwards.load_success.toString());
}
Also used : AccountBusinessService(org.mifos.accounts.business.service.AccountBusinessService) BirtAdminDocumentUploadActionForm(org.mifos.reports.admindocuments.struts.actionforms.BirtAdminDocumentUploadActionForm) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Aggregations

AccountBusinessService (org.mifos.accounts.business.service.AccountBusinessService)26 AccountBO (org.mifos.accounts.business.AccountBO)20 MifosRuntimeException (org.mifos.core.MifosRuntimeException)16 ServiceException (org.mifos.framework.exceptions.ServiceException)16 UserContext (org.mifos.security.util.UserContext)16 MifosUser (org.mifos.security.MifosUser)11 TransactionDemarcate (org.mifos.framework.util.helpers.TransactionDemarcate)10 LoanBO (org.mifos.accounts.loan.business.LoanBO)8 BusinessRuleException (org.mifos.service.BusinessRuleException)7 ArrayList (java.util.ArrayList)6 AccountException (org.mifos.accounts.exceptions.AccountException)6 ApplicationException (org.mifos.framework.exceptions.ApplicationException)6 CustomerAccountBO (org.mifos.customers.business.CustomerAccountBO)5 SavingsBO (org.mifos.accounts.savings.business.SavingsBO)4 BigDecimal (java.math.BigDecimal)3 Date (java.util.Date)3 List (java.util.List)3 AccountStateEntity (org.mifos.accounts.business.AccountStateEntity)3 EditStatusActionForm (org.mifos.accounts.struts.actionforms.EditStatusActionForm)3 CloseSession (org.mifos.framework.util.helpers.CloseSession)3