Search in sources :

Example 1 with OfficesList

use of org.mifos.dto.domain.OfficesList in project head by mifos.

the class VoucherBranchMappingAction method load.

public ActionForward load(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    logger.debug("start Load method of loan Product Action");
    VoucherBranchMappingActionForm actionForm = (VoucherBranchMappingActionForm) form;
    java.util.Date trxnDate = DateUtils.getCurrentDateWithoutTimeStamp();
    //actionForm.setTransactiondate(trxnDate);
    List<OfficeGlobalDto> officeDetailsDtos = null;
    UserContext context = getUserContext(request);
    actionForm.setOfficeLevelId(String.valueOf(context.getOfficeLevelId()));
    List<OfficesList> offices = new ArrayList<OfficesList>();
    short branches = 5;
    officeDetailsDtos = accountingServiceFacade.loadOfficesForLevel(branches);
    List<GLCodeDto> accountingDtos = accountingServiceFacade.coaBranchAccountHead();
    List<GLCodeDto> coaNameslist = new ArrayList<GLCodeDto>();
    storingSession(request, "coaNamesList", coaNameslist);
    storingSession(request, "MainAccountGlCodes", null);
    actionForm.setBranch("");
    actionForm.setTransactiondate("");
    storingSession(request, "OfficesOnHierarchy", officeDetailsDtos);
    return mapping.findForward(ActionForwards.load_success.toString());
}
Also used : OfficeGlobalDto(org.mifos.dto.domain.OfficeGlobalDto) GLCodeDto(org.mifos.dto.domain.GLCodeDto) OfficesList(org.mifos.dto.domain.OfficesList) Date(java.util.Date) UserContext(org.mifos.security.util.UserContext) ArrayList(java.util.ArrayList) VoucherBranchMappingActionForm(org.mifos.accounting.struts.actionform.VoucherBranchMappingActionForm)

Example 2 with OfficesList

use of org.mifos.dto.domain.OfficesList in project head by mifos.

the class ConsolidatedTransactionAction method load.

public ActionForward load(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    logger.debug("start Load method of loan Product Action");
    ConsolidatedTransactionActionForm actionForm = (ConsolidatedTransactionActionForm) form;
    java.util.Date trxnDate = DateUtils.getCurrentDateWithoutTimeStamp();
    List<OfficeGlobalDto> officeDetailsDtos = null;
    UserContext context = getUserContext(request);
    actionForm.setOfficeLevelId(String.valueOf(context.getOfficeLevelId()));
    List<OfficesList> offices = new ArrayList<OfficesList>();
    short branches = 5;
    officeDetailsDtos = accountingServiceFacade.loadOfficesForLevel(branches);
    List<GLCodeDto> accountingDtos = accountingServiceFacade.coaBranchAccountHead();
    storingSession(request, "viewStageTransactionsDtoCRBRListValues", null);
    storingSession(request, "viewStageTransactionsDtoCPBPListValues", null);
    storingSession(request, "viewStageTransactionsDtoCRMisListValues", null);
    storingSession(request, "viewStageTransactionsDtoCPMisListValues", null);
    storingSession(request, "viewStageTransactionsDtoInterOfficeList", null);
    storingSession(request, "OfficesOnHierarchy", null);
    actionForm.setTransactiondate("");
    actionForm.setCptotal("0");
    actionForm.setCrtotal("0");
    actionForm.setBranch("");
    storingSession(request, "OfficesOnHierarchy", officeDetailsDtos);
    return mapping.findForward(ActionForwards.load_success.toString());
}
Also used : OfficeGlobalDto(org.mifos.dto.domain.OfficeGlobalDto) GLCodeDto(org.mifos.dto.domain.GLCodeDto) OfficesList(org.mifos.dto.domain.OfficesList) Date(java.util.Date) UserContext(org.mifos.security.util.UserContext) ArrayList(java.util.ArrayList) ConsolidatedTransactionActionForm(org.mifos.accounting.struts.actionform.ConsolidatedTransactionActionForm)

Example 3 with OfficesList

use of org.mifos.dto.domain.OfficesList in project head by mifos.

the class JournalVoucherAction method loadOffices.

public ActionForward loadOffices(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    JournalVoucherActionForm actionForm = (JournalVoucherActionForm) form;
    UserContext userContext = getUserContext(request);
    //List<OfficeGlobalDto> officeDetailsDtos = null;
    List<OfficeGlobalDto> dynamicOfficeDetailsDtos = null;
    List<OfficesList> offices = new ArrayList<OfficesList>();
    // list of offices for a single parent office
    List<DynamicOfficeDto> listOfOffices = null;
    listOfOffices = accountingServiceFacade.getOfficeDetails(String.valueOf(userContext.getBranchId()), String.valueOf(userContext.getOfficeLevelId()));
    OfficesList officesList = null;
    for (DynamicOfficeDto officeDto : listOfOffices) {
        if (actionForm.getOfficeHierarchy().equals("")) {
            offices = null;
        // to recognise center and group
        } else if (actionForm.getOfficeHierarchy().equals("6") || actionForm.getOfficeHierarchy().equals("7")) {
            if (actionForm.getOfficeHierarchy().equals(String.valueOf(officeDto.getOfficeLevelId()))) {
                officesList = new OfficesList(officeDto.getCustomerId(), officeDto.getDisplayName(), officeDto.getCustomerLevelId(), officeDto.getGlobalCustomerNumber());
                offices.add(officesList);
            }
        } else {
            if (actionForm.getOfficeHierarchy().equals(String.valueOf(officeDto.getOfficeLevelId()))) {
                officesList = new OfficesList(officeDto.getOfficeId(), officeDto.getDisplayName(), officeDto.getOfficeLevelId(), officeDto.getGlobalOfficeNumber());
                offices.add(officesList);
            }
        }
    }
    //		storingSession(request, "OfficesOnHierarchy", officeDetailsDtos);
    storingSession(request, "DynamicOfficesOnHierarchy", offices);
    return mapping.findForward(ActionForwards.load_success.toString());
}
Also used : OfficeGlobalDto(org.mifos.dto.domain.OfficeGlobalDto) OfficesList(org.mifos.dto.domain.OfficesList) UserContext(org.mifos.security.util.UserContext) JournalVoucherActionForm(org.mifos.accounting.struts.actionform.JournalVoucherActionForm) ArrayList(java.util.ArrayList) DynamicOfficeDto(org.mifos.dto.domain.DynamicOfficeDto)

Example 4 with OfficesList

use of org.mifos.dto.domain.OfficesList in project head by mifos.

the class MultipleGeneralLedgerAction method loadOffices.

public ActionForward loadOffices(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    MultipleGeneralLedgerActionForm actionForm = (MultipleGeneralLedgerActionForm) form;
    UserContext userContext = getUserContext(request);
    //List<OfficeGlobalDto> officeDetailsDtos = null;
    List<OfficeGlobalDto> dynamicOfficeDetailsDtos = null;
    List<OfficesList> offices = new ArrayList<OfficesList>();
    // list of offices for a single parent office
    List<DynamicOfficeDto> listOfOffices = null;
    listOfOffices = accountingServiceFacade.getOfficeDetails(String.valueOf(userContext.getBranchId()), String.valueOf(userContext.getOfficeLevelId()));
    OfficesList officesList = null;
    for (DynamicOfficeDto officeDto : listOfOffices) {
        if (actionForm.getOfficeHierarchy().equals("")) {
            offices = null;
        // to recognise center and group
        } else if (actionForm.getOfficeHierarchy().equals("6") || actionForm.getOfficeHierarchy().equals("7")) {
            if (actionForm.getOfficeHierarchy().equals(String.valueOf(officeDto.getOfficeLevelId()))) {
                officesList = new OfficesList(officeDto.getCustomerId(), officeDto.getDisplayName(), officeDto.getCustomerLevelId(), officeDto.getGlobalCustomerNumber());
                offices.add(officesList);
            }
        //			officeDetailsDtos = accountingServiceFacade
        //					.loadCustomerForLevel(new Short("3"));
        //		} else if (actionForm.getOfficeHierarchy().equals("7")) { // to
        //																	// recognize
        //																	// group
        //			officeDetailsDtos = accountingServiceFacade
        //					.loadCustomerForLevel(new Short("2"));
        } else {
            if (actionForm.getOfficeHierarchy().equals(String.valueOf(officeDto.getOfficeLevelId()))) {
                officesList = new OfficesList(officeDto.getOfficeId(), officeDto.getDisplayName(), officeDto.getOfficeLevelId(), officeDto.getGlobalOfficeNumber());
                offices.add(officesList);
            }
        }
    }
    //		storingSession(request, "OfficesOnHierarchy", officeDetailsDtos);
    storingSession(request, "DynamicOfficesOnHierarchy", offices);
    return mapping.findForward(ActionForwards.load_success.toString());
}
Also used : OfficeGlobalDto(org.mifos.dto.domain.OfficeGlobalDto) OfficesList(org.mifos.dto.domain.OfficesList) UserContext(org.mifos.security.util.UserContext) ArrayList(java.util.ArrayList) DynamicOfficeDto(org.mifos.dto.domain.DynamicOfficeDto) MultipleGeneralLedgerActionForm(org.mifos.accounting.struts.actionform.MultipleGeneralLedgerActionForm)

Example 5 with OfficesList

use of org.mifos.dto.domain.OfficesList in project head by mifos.

the class SingleGeneralLedgerAction method loadOffices.

public ActionForward loadOffices(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    SingleGeneralLedgerActionForm actionForm = (SingleGeneralLedgerActionForm) form;
    UserContext userContext = getUserContext(request);
    //List<OfficeGlobalDto> officeDetailsDtos = null;
    List<OfficeGlobalDto> dynamicOfficeDetailsDtos = null;
    List<OfficesList> offices = new ArrayList<OfficesList>();
    // list of offices for a single parent office
    List<DynamicOfficeDto> listOfOffices = null;
    /*listOfOffices = accountingServiceFacade.getOfficeDetails(String.valueOf(userContext.getBranchId()),String.valueOf(userContext.getOfficeLevelId()));
		OfficesList officesList = null;

		for(DynamicOfficeDto officeDto :listOfOffices){

			if(actionForm.getOfficeHierarchy().equals(String.valueOf(officeDto.getOfficeLevelId()))){

				officesList = new OfficesList(officeDto.getOfficeId(), officeDto.displayName, officeDto.officeLevelId, officeDto.globalOfficeNumber);
				offices.add(officesList);
			}

		}*/
    listOfOffices = accountingServiceFacade.getOfficeDetails(String.valueOf(userContext.getBranchId()), String.valueOf(userContext.getOfficeLevelId()));
    OfficesList officesList = null;
    for (DynamicOfficeDto officeDto : listOfOffices) {
        if (actionForm.getOfficeHierarchy().equals("")) {
            offices = null;
        // to recognise center and group
        } else if (actionForm.getOfficeHierarchy().equals("6") || actionForm.getOfficeHierarchy().equals("7")) {
            if (actionForm.getOfficeHierarchy().equals(String.valueOf(officeDto.getOfficeLevelId()))) {
                officesList = new OfficesList(officeDto.getCustomerId(), officeDto.getDisplayName(), officeDto.getCustomerLevelId(), officeDto.getGlobalCustomerNumber());
                offices.add(officesList);
            }
        //			officeDetailsDtos = accountingServiceFacade
        //					.loadCustomerForLevel(new Short("3"));
        //		} else if (actionForm.getOfficeHierarchy().equals("7")) { // to
        //																	// recognize
        //																	// group
        //			officeDetailsDtos = accountingServiceFacade
        //					.loadCustomerForLevel(new Short("2"));
        } else {
            if (actionForm.getOfficeHierarchy().equals(String.valueOf(officeDto.getOfficeLevelId()))) {
                officesList = new OfficesList(officeDto.getOfficeId(), officeDto.getDisplayName(), officeDto.getOfficeLevelId(), officeDto.getGlobalOfficeNumber());
                offices.add(officesList);
            }
        }
    }
    //		storingSession(request, "OfficesOnHierarchy", officeDetailsDtos);
    storingSession(request, "DynamicOfficesOnHierarchy", offices);
    return mapping.findForward(ActionForwards.load_success.toString());
}
Also used : OfficeGlobalDto(org.mifos.dto.domain.OfficeGlobalDto) SingleGeneralLedgerActionForm(org.mifos.accounting.struts.actionform.SingleGeneralLedgerActionForm) OfficesList(org.mifos.dto.domain.OfficesList) UserContext(org.mifos.security.util.UserContext) ArrayList(java.util.ArrayList) DynamicOfficeDto(org.mifos.dto.domain.DynamicOfficeDto)

Aggregations

ArrayList (java.util.ArrayList)6 OfficeGlobalDto (org.mifos.dto.domain.OfficeGlobalDto)6 OfficesList (org.mifos.dto.domain.OfficesList)6 UserContext (org.mifos.security.util.UserContext)6 DynamicOfficeDto (org.mifos.dto.domain.DynamicOfficeDto)4 Date (java.util.Date)2 GLCodeDto (org.mifos.dto.domain.GLCodeDto)2 ConsolidatedTransactionActionForm (org.mifos.accounting.struts.actionform.ConsolidatedTransactionActionForm)1 JournalVoucherActionForm (org.mifos.accounting.struts.actionform.JournalVoucherActionForm)1 MultipleGeneralLedgerActionForm (org.mifos.accounting.struts.actionform.MultipleGeneralLedgerActionForm)1 ProcessAccountingTransactionsActionForm (org.mifos.accounting.struts.actionform.ProcessAccountingTransactionsActionForm)1 SingleGeneralLedgerActionForm (org.mifos.accounting.struts.actionform.SingleGeneralLedgerActionForm)1 VoucherBranchMappingActionForm (org.mifos.accounting.struts.actionform.VoucherBranchMappingActionForm)1