use of org.mifos.accounts.savings.struts.actionforms.SavingsActionForm in project head by mifos.
the class SavingsAction method edit.
@TransactionDemarcate(joinToken = true)
public ActionForward edit(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
logger.debug("In SavingsAction::edit()");
SavingsBO savings = (SavingsBO) SessionUtils.getAttribute(Constants.BUSINESS_KEY, request);
SavingsActionForm actionForm = (SavingsActionForm) form;
List<CustomFieldDto> customFields = new ArrayList<CustomFieldDto>();
actionForm.setRecommendedAmount(savings.getRecommendedAmount().toString());
actionForm.setAccountCustomFieldSet(customFields);
List<CustomFieldDefinitionEntity> customFieldDefinitions = new ArrayList<CustomFieldDefinitionEntity>();
SessionUtils.setCollectionAttribute(SavingsConstants.CUSTOM_FIELDS, customFieldDefinitions, request);
return mapping.findForward("edit_success");
}
use of org.mifos.accounts.savings.struts.actionforms.SavingsActionForm in project head by mifos.
the class SavingsAction method waiveAmountOverDue.
@TransactionDemarcate(joinToken = true)
public ActionForward waiveAmountOverDue(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
logger.debug("In SavingsAction::waiveAmountOverDue()");
UserContext uc = (UserContext) SessionUtils.getAttribute(Constants.USER_CONTEXT_KEY, request.getSession());
SavingsBO savings = (SavingsBO) SessionUtils.getAttribute(Constants.BUSINESS_KEY, request);
Integer versionNum = savings.getVersionNo();
savings = this.savingsDao.findBySystemId(((SavingsActionForm) form).getGlobalAccountNum());
checkVersionMismatch(versionNum, savings.getVersionNo());
savings.setUserContext(uc);
Long savingsId = savings.getAccountId().longValue();
this.savingsServiceFacade.waiveDepositAmountOverDue(savingsId);
return mapping.findForward("waiveAmount_success");
}
use of org.mifos.accounts.savings.struts.actionforms.SavingsActionForm in project head by mifos.
the class SavingsAction method getPrdOfferings.
@TransactionDemarcate(saveToken = true)
public ActionForward getPrdOfferings(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
SavingsActionForm savingsActionForm = ((SavingsActionForm) form);
doCleanUp(savingsActionForm, request);
Integer customerId = Integer.valueOf(savingsActionForm.getCustomerId());
CustomerBO customer = this.customerDao.findCustomerById(customerId);
SessionUtils.setAttribute(SavingsConstants.CLIENT, customer, request);
List<PrdOfferingDto> savingPrds = this.savingsServiceFacade.retrieveApplicableSavingsProductsForCustomer(customerId);
SessionUtils.setCollectionAttribute(SavingsConstants.SAVINGS_PRD_OFFERINGS, savingPrds, request);
return mapping.findForward(AccountConstants.GET_PRDOFFERINGS_SUCCESS);
}
use of org.mifos.accounts.savings.struts.actionforms.SavingsActionForm in project head by mifos.
the class SavingsAction method getDepositDueDetails.
@TransactionDemarcate(saveToken = true)
public ActionForward getDepositDueDetails(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
logger.debug("In SavingsAction::getDepositDueDetails()");
SavingsActionForm actionform = (SavingsActionForm) form;
UserContext uc = (UserContext) SessionUtils.getAttribute(Constants.USER_CONTEXT_KEY, request.getSession());
SessionUtils.removeAttribute(Constants.BUSINESS_KEY, request);
String savingsSystemId = actionform.getGlobalAccountNum();
SavingsBO savings = savingsDao.findBySystemId(savingsSystemId);
for (AccountActionDateEntity actionDate : savings.getAccountActionDates()) {
Hibernate.initialize(actionDate);
}
Hibernate.initialize(savings.getAccountNotes());
for (AccountFlagMapping accountFlagMapping : savings.getAccountFlags()) {
Hibernate.initialize(accountFlagMapping.getFlag());
}
Hibernate.initialize(savings.getAccountFlags());
savings.setUserContext(uc);
SessionUtils.setAttribute(Constants.BUSINESS_KEY, savings, request);
SavingsAccountDepositDueDto depositDueDetails = this.savingsServiceFacade.retrieveDepositDueDetails(savingsSystemId);
return mapping.findForward("depositduedetails_success");
}
use of org.mifos.accounts.savings.struts.actionforms.SavingsActionForm in project head by mifos.
the class SavingsAction method load.
@TransactionDemarcate(joinToken = true)
public ActionForward load(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
SavingsActionForm savingsActionForm = ((SavingsActionForm) form);
logger.debug(" selectedPrdOfferingId: " + savingsActionForm.getSelectedPrdOfferingId());
UserContext uc = (UserContext) SessionUtils.getAttribute(Constants.USER_CONTEXT_KEY, request.getSession());
List<InterestCalcTypeEntity> interestCalculationTypes = this.savingsProductDao.retrieveInterestCalculationTypes();
SessionUtils.setCollectionAttribute(MasterConstants.INTEREST_CAL_TYPES, interestCalculationTypes, request);
Integer productId = Integer.valueOf(savingsActionForm.getSelectedPrdOfferingId());
SavingsOfferingBO savingsOfferingBO = this.savingsProductDao.findById(productId);
SessionUtils.setAttribute(SavingsConstants.PRDOFFERING, savingsOfferingBO, request);
// NOTE - these details are included in SavingsProductReferenceDto but left as is to satisfy JSP at present
SessionUtils.setCollectionAttribute(MasterConstants.SAVINGS_TYPE, legacyMasterDao.findMasterDataEntitiesWithLocale(SavingsTypeEntity.class), request);
SessionUtils.setCollectionAttribute(MasterConstants.RECOMMENDED_AMOUNT_UNIT, legacyMasterDao.findMasterDataEntitiesWithLocale(RecommendedAmntUnitEntity.class), request);
List<CustomFieldDefinitionEntity> customFieldDefinitions = new ArrayList<CustomFieldDefinitionEntity>();
SessionUtils.setCollectionAttribute(SavingsConstants.CUSTOM_FIELDS, customFieldDefinitions, request);
SavingsProductReferenceDto savingsProductReferenceDto = this.savingsServiceFacade.retrieveSavingsProductReferenceData(productId);
savingsActionForm.setRecommendedAmount(savingsProductReferenceDto.getSavingsProductDetails().getAmountForDeposit().toString());
List<CustomFieldDto> customFields = CustomFieldDefinitionEntity.toDto(customFieldDefinitions, uc.getPreferredLocale());
savingsActionForm.setAccountCustomFieldSet(customFields);
return mapping.findForward("load_success");
}
Aggregations