use of org.mifos.dto.screen.ChangeAccountStatusDto in project head by mifos.
the class LoanAccountServiceFacadeWebTier method retrieveAllActiveBranchesAndLoanOfficerDetails.
@Override
public ChangeAccountStatusDto retrieveAllActiveBranchesAndLoanOfficerDetails() {
MifosUser mifosUser = (MifosUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
UserContext userContext = new UserContextFactory().create(mifosUser);
List<PersonnelDto> loanOfficers = new ArrayList<PersonnelDto>();
List<OfficeDetailsDto> activeBranches = this.officeDao.findActiveBranches(userContext.getBranchId());
if (onlyOneActiveBranchExists(activeBranches)) {
OfficeDetailsDto singleOffice = activeBranches.get(0);
CenterCreation officeDetails = new CenterCreation(singleOffice.getOfficeId(), userContext.getId(), userContext.getLevelId(), userContext.getPreferredLocale());
loanOfficers = this.personnelDao.findActiveLoanOfficersForOffice(officeDetails);
}
boolean loanPendingApprovalStateEnabled = ProcessFlowRules.isLoanPendingApprovalStateEnabled();
Short accountState = AccountState.LOAN_PARTIAL_APPLICATION.getValue();
if (loanPendingApprovalStateEnabled) {
accountState = AccountState.LOAN_PENDING_APPROVAL.getValue();
}
boolean centerHierarchyExists = ClientRules.getCenterHierarchyExists();
return new ChangeAccountStatusDto(activeBranches, loanOfficers, loanPendingApprovalStateEnabled, accountState, centerHierarchyExists);
}
use of org.mifos.dto.screen.ChangeAccountStatusDto in project head by mifos.
the class LoanAccountServiceFacadeWebTier method retrieveLoanOfficerDetailsForBranch.
@Override
public ChangeAccountStatusDto retrieveLoanOfficerDetailsForBranch(Short officeId) {
MifosUser mifosUser = (MifosUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
UserContext userContext = new UserContextFactory().create(mifosUser);
CenterCreation officeDetails = new CenterCreation(officeId, userContext.getId(), userContext.getLevelId(), userContext.getPreferredLocale());
List<PersonnelDto> loanOfficers = this.personnelDao.findActiveLoanOfficersForOffice(officeDetails);
boolean loanPendingApprovalStateEnabled = ProcessFlowRules.isLoanPendingApprovalStateEnabled();
Short accountState = AccountState.LOAN_PARTIAL_APPLICATION.getValue();
if (loanPendingApprovalStateEnabled) {
accountState = AccountState.LOAN_PENDING_APPROVAL.getValue();
}
boolean centerHierarchyExists = ClientRules.getCenterHierarchyExists();
return new ChangeAccountStatusDto(new ArrayList<OfficeDetailsDto>(), loanOfficers, loanPendingApprovalStateEnabled, accountState, centerHierarchyExists);
}
use of org.mifos.dto.screen.ChangeAccountStatusDto in project head by mifos.
the class MultipleLoanAccountsCreationAction method getLoanOfficers.
@TransactionDemarcate(joinToken = true)
public ActionForward getLoanOfficers(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
Short officeId = getShortValue(((MultipleLoanAccountsCreationActionForm) form).getBranchOfficeId());
ChangeAccountStatusDto accountDetails = this.loanAccountServiceFacade.retrieveLoanOfficerDetailsForBranch(officeId);
SessionUtils.setCollectionAttribute(LoanConstants.MULTIPLE_LOANS_LOAN_OFFICERS_LIST, accountDetails.getLoanOfficers(), request);
return mapping.findForward(ActionForwards.load_success.toString());
}
use of org.mifos.dto.screen.ChangeAccountStatusDto in project head by mifos.
the class MultipleLoanAccountsCreationAction method load.
@TransactionDemarcate(saveToken = true)
public ActionForward load(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
ChangeAccountStatusDto accountDetails = this.loanAccountServiceFacade.retrieveAllActiveBranchesAndLoanOfficerDetails();
SessionUtils.setCollectionAttribute(LoanConstants.MULTIPLE_LOANS_OFFICES_LIST, accountDetails.getActiveBranches(), request);
Short centerHierarchyExistsValue = accountDetails.isCenterHierarchyExists() ? Constants.YES : Constants.NO;
SessionUtils.setAttribute(LoanConstants.IS_CENTER_HIERARCHY_EXISTS, centerHierarchyExistsValue, request);
request.getSession().setAttribute(LoanConstants.MULTIPLE_LOANS_ACTION_FORM, null);
request.getSession().setAttribute(Constants.BUSINESS_KEY, null);
return mapping.findForward(ActionForwards.load_success.toString());
}
use of org.mifos.dto.screen.ChangeAccountStatusDto in project head by mifos.
the class AccountStatusAction method getLoanOfficers.
@TransactionDemarcate(joinToken = true)
public ActionForward getLoanOfficers(final ActionMapping mapping, final ActionForm form, final HttpServletRequest request, @SuppressWarnings("unused") final HttpServletResponse httpservletresponse) throws Exception {
AccountStatusActionForm accountStatusActionForm = (AccountStatusActionForm) form;
Short officeId = Short.valueOf(accountStatusActionForm.getOfficeId());
ChangeAccountStatusDto changeAccountStatusDto = this.loanAccountServiceFacade.retrieveLoanOfficerDetailsForBranch(officeId);
SessionUtils.setCollectionAttribute(LoanConstants.LOAN_OFFICERS, changeAccountStatusDto.getLoanOfficers(), request);
if (officeId != null) {
AccountStateEntity accountStateEntity = legacyMasterDao.getPersistentObject(AccountStateEntity.class, changeAccountStatusDto.getAccountState());
SessionUtils.setAttribute(LoanConstants.LOANACCOUNTSTAES, accountStateEntity, request);
}
return mapping.findForward(ActionForwards.changeAccountStatus_success.toString());
}
Aggregations