Search in sources :

Example 1 with CenterFormCreationDto

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

the class CenterCustAction method load.

@TransactionDemarcate(saveToken = true)
public ActionForward load(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    CenterCustActionForm actionForm = (CenterCustActionForm) form;
    actionForm.clearActionFormFields();
    SessionUtils.removeAttribute(CustomerConstants.CUSTOMER_MEETING, request);
    UserContext userContext = getUserContext(request);
    CenterCreation centerCreationDto = new CenterCreation(actionForm.getOfficeIdValue(), userContext.getId(), userContext.getLevelId(), userContext.getPreferredLocale());
    CenterFormCreationDto centerFormCreation = this.centerServiceFacade.retrieveCenterFormCreationData(centerCreationDto);
    //        SessionUtils.setCollectionAttribute(CustomerConstants.CUSTOM_FIELDS_LIST, new ArrayList<Serializable>(), request);
    SessionUtils.setCollectionAttribute(CustomerConstants.LOAN_OFFICER_LIST, centerFormCreation.getActiveLoanOfficersForBranch(), request);
    SessionUtils.setCollectionAttribute(CustomerConstants.ADDITIONAL_FEES_LIST, centerFormCreation.getAdditionalFees(), request);
    //        actionForm.setCustomFields(centerFormCreation.getCustomFieldViews());
    actionForm.setDefaultFees(centerFormCreation.getDefaultFees());
    DateTime today = new DateTime().toDateMidnight().toDateTime();
    actionForm.setMfiJoiningDate(today.getDayOfMonth(), today.getMonthOfYear(), today.getYear());
    return mapping.findForward(ActionForwards.load_success.toString());
}
Also used : CenterCustActionForm(org.mifos.customers.center.struts.actionforms.CenterCustActionForm) UserContext(org.mifos.security.util.UserContext) CenterCreation(org.mifos.dto.domain.CenterCreation) CenterFormCreationDto(org.mifos.dto.screen.CenterFormCreationDto) DateTime(org.joda.time.DateTime) TransactionDemarcate(org.mifos.framework.util.helpers.TransactionDemarcate)

Example 2 with CenterFormCreationDto

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

the class CenterServiceFacadeWebTier method retrieveCenterFormCreationData.

@Override
public CenterFormCreationDto retrieveCenterFormCreationData(CenterCreation centerCreation) {
    MifosUser user = (MifosUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    UserContext userContext = toUserContext(user);
    List<PersonnelDto> activeLoanOfficersForBranch = personnelDao.findActiveLoanOfficersForOffice(centerCreation);
    List<FeeBO> fees = customerDao.retrieveFeesApplicableToCenters();
    CustomerApplicableFeesDto applicableFees = CustomerApplicableFeesDto.toDto(fees, userContext);
    List<ApplicableAccountFeeDto> applicableDefaultAccountFees = new ArrayList<ApplicableAccountFeeDto>();
    for (FeeDto fee : applicableFees.getDefaultFees()) {
        applicableDefaultAccountFees.add(new ApplicableAccountFeeDto(fee.getFeeIdValue().intValue(), fee.getFeeName(), fee.getAmount(), fee.isRemoved(), fee.isWeekly(), fee.isMonthly(), fee.isPeriodic(), fee.getFeeSchedule()));
    }
    List<ApplicableAccountFeeDto> applicableDefaultAdditionalFees = new ArrayList<ApplicableAccountFeeDto>();
    for (FeeDto fee : applicableFees.getAdditionalFees()) {
        applicableDefaultAdditionalFees.add(new ApplicableAccountFeeDto(fee.getFeeIdValue().intValue(), fee.getFeeName(), fee.getAmount(), fee.isRemoved(), fee.isWeekly(), fee.isMonthly(), fee.isPeriodic(), fee.getFeeSchedule()));
    }
    return new CenterFormCreationDto(activeLoanOfficersForBranch, applicableDefaultAdditionalFees, applicableDefaultAccountFees);
}
Also used : UserContext(org.mifos.security.util.UserContext) CenterFormCreationDto(org.mifos.dto.screen.CenterFormCreationDto) ArrayList(java.util.ArrayList) CreateAccountFeeDto(org.mifos.dto.domain.CreateAccountFeeDto) ApplicableAccountFeeDto(org.mifos.dto.domain.ApplicableAccountFeeDto) FeeDto(org.mifos.accounts.fees.business.FeeDto) PersonnelDto(org.mifos.dto.domain.PersonnelDto) MifosUser(org.mifos.security.MifosUser) FeeBO(org.mifos.accounts.fees.business.FeeBO) ApplicableAccountFeeDto(org.mifos.dto.domain.ApplicableAccountFeeDto)

Aggregations

CenterFormCreationDto (org.mifos.dto.screen.CenterFormCreationDto)2 UserContext (org.mifos.security.util.UserContext)2 ArrayList (java.util.ArrayList)1 DateTime (org.joda.time.DateTime)1 FeeBO (org.mifos.accounts.fees.business.FeeBO)1 FeeDto (org.mifos.accounts.fees.business.FeeDto)1 CenterCustActionForm (org.mifos.customers.center.struts.actionforms.CenterCustActionForm)1 ApplicableAccountFeeDto (org.mifos.dto.domain.ApplicableAccountFeeDto)1 CenterCreation (org.mifos.dto.domain.CenterCreation)1 CreateAccountFeeDto (org.mifos.dto.domain.CreateAccountFeeDto)1 PersonnelDto (org.mifos.dto.domain.PersonnelDto)1 TransactionDemarcate (org.mifos.framework.util.helpers.TransactionDemarcate)1 MifosUser (org.mifos.security.MifosUser)1