Search in sources :

Example 11 with ProductTypeEntity

use of org.mifos.accounts.productdefinition.business.ProductTypeEntity in project head by mifos.

the class BirtAdminDocumentUploadAction method getBirtAdminDocumentUploadPage.

@TransactionDemarcate(saveToken = true)
public ActionForward getBirtAdminDocumentUploadPage(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    BirtAdminDocumentUploadActionForm uploadForm = (BirtAdminDocumentUploadActionForm) form;
    uploadForm.clear();
    List<ProductTypeEntity> productTypes = getProductTypes();
    SessionUtils.setCollectionAttribute(ProductDefinitionConstants.PRODUCTTYPELIST, productTypes, request);
    return mapping.findForward(ActionForwards.load_success.toString());
}
Also used : BirtAdminDocumentUploadActionForm(org.mifos.reports.admindocuments.struts.actionforms.BirtAdminDocumentUploadActionForm) ProductTypeEntity(org.mifos.accounts.productdefinition.business.ProductTypeEntity) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 12 with ProductTypeEntity

use of org.mifos.accounts.productdefinition.business.ProductTypeEntity in project head by mifos.

the class ProductCategoryPersistenceIntegrationTest method testGetProductTypesByType.

@Test
public void testGetProductTypesByType() throws Exception {
    ProductTypeEntity productTypeEntity = legacyProductCategoryDao.getProductTypes(ProductType.LOAN.getValue());
    Assert.assertNotNull(productTypeEntity);
    if (productTypeEntity.getType() == ProductType.LOAN) {
        Assert.assertEquals("Loan", productTypeEntity.getName());
    } else {
        Assert.assertEquals("", productTypeEntity.getName());
    }
}
Also used : ProductTypeEntity(org.mifos.accounts.productdefinition.business.ProductTypeEntity) Test(org.junit.Test)

Example 13 with ProductTypeEntity

use of org.mifos.accounts.productdefinition.business.ProductTypeEntity in project head by mifos.

the class IntegrationTestObjectMother method createAccountChecklist.

public static AccountCheckListBO createAccountChecklist(Short prdTypeId, AccountState accountState, Short checklistStatus, List<String> details) {
    try {
        StaticHibernateUtil.startTransaction();
        ProductTypeEntity productTypeEntity = (ProductTypeEntity) StaticHibernateUtil.getSessionTL().get(ProductTypeEntity.class, prdTypeId);
        AccountStateEntity accountStateEntity = new AccountStateEntity(accountState);
        AccountCheckListBO accountChecklist = new AccountCheckListBO(productTypeEntity, accountStateEntity, "productchecklist", checklistStatus, details, Short.valueOf("1"), PersonnelConstants.SYSTEM_USER);
        customerDao.save(accountChecklist);
        StaticHibernateUtil.commitTransaction();
        return accountChecklist;
    } catch (Exception e) {
        StaticHibernateUtil.rollbackTransaction();
        throw new RuntimeException(e);
    } finally {
        StaticHibernateUtil.closeSession();
    }
}
Also used : MifosRuntimeException(org.mifos.core.MifosRuntimeException) AccountCheckListBO(org.mifos.customers.checklist.business.AccountCheckListBO) AccountStateEntity(org.mifos.accounts.business.AccountStateEntity) CustomerException(org.mifos.customers.exceptions.CustomerException) MifosRuntimeException(org.mifos.core.MifosRuntimeException) PersistenceException(org.mifos.framework.exceptions.PersistenceException) AccountException(org.mifos.accounts.exceptions.AccountException) ProductTypeEntity(org.mifos.accounts.productdefinition.business.ProductTypeEntity)

Aggregations

ProductTypeEntity (org.mifos.accounts.productdefinition.business.ProductTypeEntity)13 Test (org.junit.Test)5 MifosRuntimeException (org.mifos.core.MifosRuntimeException)5 ServiceException (org.mifos.framework.exceptions.ServiceException)4 UserContext (org.mifos.security.util.UserContext)4 AccountStateEntity (org.mifos.accounts.business.AccountStateEntity)3 ProductCategoryBusinessService (org.mifos.accounts.productdefinition.business.service.ProductCategoryBusinessService)3 UserContextFactory (org.mifos.accounts.servicefacade.UserContextFactory)3 AccountCheckListBO (org.mifos.customers.checklist.business.AccountCheckListBO)3 PersistenceException (org.mifos.framework.exceptions.PersistenceException)3 MifosUser (org.mifos.security.MifosUser)3 BusinessRuleException (org.mifos.service.BusinessRuleException)3 CheckListException (org.mifos.customers.checklist.exceptions.CheckListException)2 ArrayList (java.util.ArrayList)1 AccountException (org.mifos.accounts.exceptions.AccountException)1 ProductCategoryBO (org.mifos.accounts.productdefinition.business.ProductCategoryBO)1 CheckListPersistence (org.mifos.customers.checklist.persistence.CheckListPersistence)1 CustomerException (org.mifos.customers.exceptions.CustomerException)1 ProductCategoryTypeDto (org.mifos.dto.screen.ProductCategoryTypeDto)1 ProductConfigurationDto (org.mifos.dto.screen.ProductConfigurationDto)1