Search in sources :

Example 1 with CoaBranchMappingActionForm

use of org.mifos.accounting.struts.actionform.CoaBranchMappingActionForm in project head by mifos.

the class CoaBranchMappingAction 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");
    CoaBranchMappingActionForm actionForm = (CoaBranchMappingActionForm) form;
    List<OfficeGlobalDto> officeDetailsDtos = null;
    List<GLCodeDto> accountingDtos = null;
    short branches = 5;
    officeDetailsDtos = accountingServiceFacade.loadOfficesForLevel(branches);
    CoaBranchMappingActionForm acti = (CoaBranchMappingActionForm) form;
    accountingDtos = accountingServiceFacade.coaBranchAccountHead();
    List<GLCodeDto> emptyaccountingDtos = new ArrayList<GLCodeDto>();
    storingSession(request, "CoaNamesList", accountingDtos);
    storingSession(request, "emptycoanames", emptyaccountingDtos);
    actionForm.setBranchoffice("");
    storingSession(request, "OfficesOnHierarchy", null);
    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) ArrayList(java.util.ArrayList) CoaBranchMappingActionForm(org.mifos.accounting.struts.actionform.CoaBranchMappingActionForm)

Example 2 with CoaBranchMappingActionForm

use of org.mifos.accounting.struts.actionform.CoaBranchMappingActionForm in project head by mifos.

the class CoaBranchMappingAction method submit.

public ActionForward submit(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    CoaBranchMappingActionForm coaBranchMappingActionForm = (CoaBranchMappingActionForm) form;
    List<GLCodeDto> glcodelist = new ArrayList<GLCodeDto>();
    List<GLCodeDto> accountingglnames = accountingServiceFacade.coaBranchAccountHead();
    int accinggl = accountingServiceFacade.deleteGlobalNumRelatedCoaNames(coaBranchMappingActionForm.getBranchoffice());
    List<OfficeGlobalDto> officeDetailsDtos = null;
    short branches = 5;
    officeDetailsDtos = accountingServiceFacade.loadOfficesForLevel(branches);
    List<Integer> glcodeint = new ArrayList<Integer>();
    CoaBranchBO coabranchbo = null;
    if (coaBranchMappingActionForm.getBranchoffice().equalsIgnoreCase("All")) {
        for (String glname : coaBranchMappingActionForm.getCoaBranchMainHeadglcode()) {
            String glcode = glname;
            for (GLCodeDto accountinggln : accountingglnames) {
                if (accountinggln.getGlcode().equalsIgnoreCase(glcode)) {
                    for (OfficeGlobalDto officeGlobalDto : officeDetailsDtos) {
                        coabranchbo = new CoaBranchBO();
                        coabranchbo.setCoaname(accountinggln.getGlname());
                        coabranchbo.setGlcode(accountinggln.getGlcode());
                        coabranchbo.setGlobalofficenum(officeGlobalDto.getGlobalOfficeNum());
                        accountingServiceFacade.savingCoaBranchTransactions(coabranchbo);
                    }
                }
            }
        }
    } else {
        for (String glname : coaBranchMappingActionForm.getCoaBranchMainHeadglcode()) {
            String glcode = glname;
            for (GLCodeDto accountinggln : accountingglnames) {
                if (accountinggln.getGlcode().equalsIgnoreCase(glcode)) {
                    coabranchbo = new CoaBranchBO();
                    coabranchbo.setCoaname(accountinggln.getGlname());
                    coabranchbo.setGlcode(accountinggln.getGlcode());
                    coabranchbo.setGlobalofficenum(coaBranchMappingActionForm.getBranchoffice());
                    accountingServiceFacade.savingCoaBranchTransactions(coabranchbo);
                }
            }
        }
    }
    List<GLCodeDto> coabranchvalues = accountingServiceFacade.loadCoaBranchNames(coaBranchMappingActionForm.getBranchoffice());
    List<GLCodeDto> accountingDtos = null;
    CoaBranchMappingActionForm acti = (CoaBranchMappingActionForm) form;
    accountingDtos = accountingServiceFacade.coaBranchAccountHead();
    List<GLCodeDto> emptyaccountingDtos = new ArrayList<GLCodeDto>();
    storingSession(request, "CoaNamesList", accountingDtos);
    storingSession(request, "emptycoanames", coabranchvalues);
    return mapping.findForward(ActionForwards.submit_success.toString());
}
Also used : OfficeGlobalDto(org.mifos.dto.domain.OfficeGlobalDto) GLCodeDto(org.mifos.dto.domain.GLCodeDto) CoaBranchBO(org.mifos.application.accounting.business.CoaBranchBO) ArrayList(java.util.ArrayList) CoaBranchMappingActionForm(org.mifos.accounting.struts.actionform.CoaBranchMappingActionForm)

Example 3 with CoaBranchMappingActionForm

use of org.mifos.accounting.struts.actionform.CoaBranchMappingActionForm in project head by mifos.

the class CoaBranchMappingAction method findCoaNames.

public ActionForward findCoaNames(ActionMapping mapping, @SuppressWarnings("unused") ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    logger.debug("start Load method of loan Product Action");
    CoaBranchMappingActionForm actionform = (CoaBranchMappingActionForm) form;
    List<GLCodeDto> accountingDtos = null;
    accountingDtos = accountingServiceFacade.coaBranchAccountHead();
    List<GLCodeDto> remainingvalues = accountingServiceFacade.loadRemainingCoaNames(actionform.getBranchoffice());
    List<GLCodeDto> coabranchvalues = accountingServiceFacade.loadCoaBranchNames(actionform.getBranchoffice());
    storingSession(request, "CoaNamesList", accountingDtos);
    storingSession(request, "emptycoanames", coabranchvalues);
    return mapping.findForward(ActionForwards.load_success.toString());
}
Also used : GLCodeDto(org.mifos.dto.domain.GLCodeDto) CoaBranchMappingActionForm(org.mifos.accounting.struts.actionform.CoaBranchMappingActionForm)

Aggregations

CoaBranchMappingActionForm (org.mifos.accounting.struts.actionform.CoaBranchMappingActionForm)3 GLCodeDto (org.mifos.dto.domain.GLCodeDto)3 ArrayList (java.util.ArrayList)2 OfficeGlobalDto (org.mifos.dto.domain.OfficeGlobalDto)2 CoaBranchBO (org.mifos.application.accounting.business.CoaBranchBO)1