Search in sources :

Example 11 with SavingsActionForm

use of org.mifos.accounts.savings.struts.actionforms.SavingsActionForm in project head by mifos.

the class SavingsAction method reLoad.

@TransactionDemarcate(joinToken = true)
public ActionForward reLoad(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    SavingsActionForm savingsActionForm = ((SavingsActionForm) form);
    logger.debug(" selectedPrdOfferingId: " + (savingsActionForm).getSelectedPrdOfferingId());
    Integer productId = Integer.valueOf(savingsActionForm.getSelectedPrdOfferingId());
    SavingsOfferingBO savingsOfferingBO = this.savingsProductDao.findById(productId);
    SessionUtils.setAttribute(SavingsConstants.PRDOFFERING, savingsOfferingBO, request);
    savingsActionForm.setRecommendedAmount(savingsOfferingBO.getRecommendedAmount().toString());
    logger.info("Data loaded successfully ");
    return mapping.findForward("load_success");
}
Also used : SavingsActionForm(org.mifos.accounts.savings.struts.actionforms.SavingsActionForm) SavingsOfferingBO(org.mifos.accounts.productdefinition.business.SavingsOfferingBO) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 12 with SavingsActionForm

use of org.mifos.accounts.savings.struts.actionforms.SavingsActionForm in project head by mifos.

the class SavingsActionStrutsTest method testSuccessfulEdit.

@Test
public void testSuccessfulEdit() throws Exception {
    setMifosUserFromContext();
    createAndAddObjects(AccountState.SAVINGS_PARTIAL_APPLICATION);
    savingsOffering = null;
    setRequestPathInfo("/savingsAction.do");
    addRequestParameter("method", "get");
    addRequestParameter("globalAccountNum", savings.getGlobalAccountNum());
    actionPerform();
    setRequestPathInfo("/savingsAction.do");
    addRequestParameter("method", "edit");
    addRequestParameter(Constants.CURRENTFLOWKEY, (String) request.getAttribute(Constants.CURRENTFLOWKEY));
    performNoErrors();
    verifyForward("edit_success");
    SavingsActionForm actionForm = (SavingsActionForm) request.getSession().getAttribute("savingsActionForm");
    Assert.assertEquals("300.0", actionForm.getRecommendedAmount());
}
Also used : SavingsActionForm(org.mifos.accounts.savings.struts.actionforms.SavingsActionForm) Test(org.junit.Test)

Aggregations

SavingsActionForm (org.mifos.accounts.savings.struts.actionforms.SavingsActionForm)12 TransactionDemarcate (org.mifos.framework.util.helpers.TransactionDemarcate)11 SavingsBO (org.mifos.accounts.savings.business.SavingsBO)7 UserContext (org.mifos.security.util.UserContext)6 ArrayList (java.util.ArrayList)3 CustomFieldDefinitionEntity (org.mifos.application.master.business.CustomFieldDefinitionEntity)3 RecommendedAmntUnitEntity (org.mifos.accounts.productdefinition.business.RecommendedAmntUnitEntity)2 SavingsOfferingBO (org.mifos.accounts.productdefinition.business.SavingsOfferingBO)2 SavingsTypeEntity (org.mifos.accounts.productdefinition.business.SavingsTypeEntity)2 CustomerBO (org.mifos.customers.business.CustomerBO)2 CustomFieldDto (org.mifos.dto.domain.CustomFieldDto)2 Test (org.junit.Test)1 AccountActionDateEntity (org.mifos.accounts.business.AccountActionDateEntity)1 AccountFlagMapping (org.mifos.accounts.business.AccountFlagMapping)1 InterestCalcTypeEntity (org.mifos.accounts.productdefinition.business.InterestCalcTypeEntity)1 MifosRuntimeException (org.mifos.core.MifosRuntimeException)1 PrdOfferingDto (org.mifos.dto.domain.PrdOfferingDto)1 SavingsAccountCreationDto (org.mifos.dto.domain.SavingsAccountCreationDto)1 SavingsAccountDetailDto (org.mifos.dto.domain.SavingsAccountDetailDto)1 SavingsAccountDepositDueDto (org.mifos.dto.screen.SavingsAccountDepositDueDto)1