Search in sources :

Example 6 with OfficeGlobalDto

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

the class InterOfficeTransferAction method loadToOffices.

public ActionForward loadToOffices(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    InterOfficeTransferActionForm actionForm = (InterOfficeTransferActionForm) form;
    List<OfficeGlobalDto> toOfficeDetailsDtos = null;
    actionForm.getFromOfficeHierarchy();
    actionForm.getFromOffice();
    if (actionForm.getFromOfficeHierarchy().equals(actionForm.getToOfficeHierarchy())) {
        if (actionForm.getFromOfficeHierarchy().equals("")) {
            toOfficeDetailsDtos = null;
        } else if (actionForm.getToOfficeHierarchy().equals("6")) {
            // to
            // recognize
            // center
            toOfficeDetailsDtos = accountingServiceFacade.loadCustomerForLevel(new Short("3"), actionForm.getFromOffice());
        } else if (actionForm.getToOfficeHierarchy().equals("7")) {
            // to
            // recognize
            // group
            toOfficeDetailsDtos = accountingServiceFacade.loadCustomerForLevel(new Short("2"), actionForm.getFromOffice());
        } else {
            toOfficeDetailsDtos = accountingServiceFacade.loadOfficesForLevel(Short.valueOf(actionForm.getToOfficeHierarchy()), actionForm.getFromOffice());
        }
    } else {
        if (actionForm.getFromOfficeHierarchy().equals("")) {
            toOfficeDetailsDtos = null;
        } else if (actionForm.getToOfficeHierarchy().equals("6")) {
            // to
            // recognize
            // center
            toOfficeDetailsDtos = accountingServiceFacade.loadCustomerForLevel(new Short("3"));
        } else if (actionForm.getToOfficeHierarchy().equals("7")) {
            // to
            // recognize
            // group
            toOfficeDetailsDtos = accountingServiceFacade.loadCustomerForLevel(new Short("2"));
        } else {
            toOfficeDetailsDtos = accountingServiceFacade.loadOfficesForLevel(Short.valueOf(actionForm.getToOfficeHierarchy()));
        }
    }
    storingSession(request, "IOToOfficeHierarchy", toOfficeDetailsDtos);
    return mapping.findForward(ActionForwards.load_success.toString());
}
Also used : OfficeGlobalDto(org.mifos.dto.domain.OfficeGlobalDto) InterOfficeTransferActionForm(org.mifos.accounting.struts.actionform.InterOfficeTransferActionForm)

Example 7 with OfficeGlobalDto

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

the class ViewStageTransactionAction method loadOffices.

public ActionForward loadOffices(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    ViewStageTransactionActionForm actionForm = (ViewStageTransactionActionForm) form;
    List<OfficeGlobalDto> officeDetailsDtos = null;
    if (actionForm.getStageOfficeHierarchy().equals("")) {
        officeDetailsDtos = null;
    } else if (actionForm.getStageOfficeHierarchy().equals("6")) {
        // to
        // recognize
        // center
        officeDetailsDtos = accountingServiceFacade.loadCustomerForLevel(new Short("3"));
    } else if (actionForm.getStageOfficeHierarchy().equals("7")) {
        // to
        // recognize
        // group
        officeDetailsDtos = accountingServiceFacade.loadCustomerForLevel(new Short("2"));
    } else {
        officeDetailsDtos = accountingServiceFacade.loadOfficesForLevel(Short.valueOf(actionForm.getStageOfficeHierarchy()));
    }
    storingSession(request, "OfficesOnHierarchy", officeDetailsDtos);
    return mapping.findForward("load_stage_success");
}
Also used : OfficeGlobalDto(org.mifos.dto.domain.OfficeGlobalDto) ViewStageTransactionActionForm(org.mifos.accounting.struts.actionform.ViewStageTransactionActionForm)

Example 8 with OfficeGlobalDto

use of org.mifos.dto.domain.OfficeGlobalDto 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 9 with OfficeGlobalDto

use of org.mifos.dto.domain.OfficeGlobalDto 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 10 with OfficeGlobalDto

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

the class ConsolidatedTransactionAction method approveCRBRTransactions.

public void approveCRBRTransactions(ConsolidatedTransactionActionForm actionForm, String Transactionno, HttpServletRequest request) {
    ViewStageTransactionsDto viewStageTransactionsDto = accountingServiceFacade.getstagedAccountingTransactions(Transactionno);
    try {
        actionForm.setStageTrxnDate(changeDateFormat(viewStageTransactionsDto.getTransactionDate().toString()));
        actionForm.setStageOfficeHierarchy(this.getOfficeHierarchy(viewStageTransactionsDto.getOfficeLevel()));
        actionForm.setStageTrxnType(getTranType(viewStageTransactionsDto.getTransactionType()));
        actionForm.setStageMainAccount(viewStageTransactionsDto.getMainAccount());
        viewStageTransactionsDto.getSubAccount();
        actionForm.setStageAccountHead(viewStageTransactionsDto.getSubAccount());
        actionForm.setStageOffice(viewStageTransactionsDto.getFromOfficeId());
    } catch (Exception e) {
        e.printStackTrace();
    }
    GlDetailDto glDetailDto = accountingServiceFacade.getChequeDetails(Transactionno);
    if (glDetailDto != null) {
        actionForm.setStageChequeNo(glDetailDto.getChequeNo());
        if (glDetailDto.getChequeDate() != null) {
            actionForm.setChequeDate(changeDateFormat(glDetailDto.getChequeDate().toString()));
        }
        actionForm.setStageBankName(glDetailDto.getBankName());
        actionForm.setStageankBranch(glDetailDto.getBankBranch());
    }
    short s = new Integer(actionForm.getStageOfficeHierarchy()).shortValue();
    List<OfficeGlobalDto> officeDetailsDtos = null;
    if (actionForm.getStageOfficeHierarchy() == "0") {
        officeDetailsDtos = null;
    // To recognize center
    } else if (actionForm.getStageOfficeHierarchy() == "6") {
        officeDetailsDtos = accountingServiceFacade.loadCustomerForLevel(new Short("3"));
    // to recognize group
    } else if (actionForm.getStageOfficeHierarchy() == "7") {
        officeDetailsDtos = accountingServiceFacade.loadCustomerForLevel(new Short("2"));
    } else {
        officeDetailsDtos = accountingServiceFacade.loadOfficesForLevel(s);
    }
    storingSession(request, "OfficesOnHierarchy", officeDetailsDtos);
    // load main accounts
    List<GLCodeDto> accountingDtos = null;
    if (actionForm.getStageTrxnType().equals("CR") || actionForm.getStageTrxnType().equals("CP") || actionForm.getStageTrxnType().equals("BR") || actionForm.getStageTrxnType().equals("BP") || actionForm.getStageTrxnType().equals("JV")) {
        accountingDtos = accountingServiceFacade.auditAccountHeads();
    }
    actionForm.setTransactionDetailID(viewStageTransactionsDto.getTransactionID());
    actionForm.setStageMainAccount(viewStageTransactionsDto.getMainAccount());
    actionForm.setStageAccountHead(viewStageTransactionsDto.getSubAccount());
    actionForm.setStageNotes(viewStageTransactionsDto.getNarration());
    actionForm.setStageAmount(viewStageTransactionsDto.getTransactionAmount());
    String[] Transactionno1 = actionForm.getTransactionNo();
    String[] cpbpTransactionNO1 = actionForm.getTransactionCpBpNo();
    for (int j = 0; j < Transactionno1.length; j++) {
        GlMasterBO glMasterBO = new GlMasterBO();
        int stage = 1;
        List<String> amountActionList = getAmountAction(actionForm);
        List<GlDetailBO> glDetailBOList = getGlDetailBOList(actionForm, amountActionList, Integer.parseInt(actionForm.getTransactionDetailID()));
        glMasterBO.setTransactionMasterId(Integer.parseInt(Transactionno1[j]));
        glMasterBO.setTransactionDate(DateUtils.getDate(actionForm.getStageTrxnDate()));
        glMasterBO.setTransactionType(actionForm.getStageTrxnType());
        glMasterBO.setFromOfficeLevel(new Integer(actionForm.getStageOfficeHierarchy()));
        glMasterBO.setFromOfficeId(actionForm.getStageOffice());
        glMasterBO.setToOfficeLevel(new Integer(actionForm.getStageOfficeHierarchy()));
        glMasterBO.setToOfficeId(actionForm.getStageOffice());
        glMasterBO.setMainAccount(actionForm.getStageMainAccount());
        glMasterBO.setTransactionAmount(new BigDecimal(actionForm.getStageAmount()));
        glMasterBO.setAmountAction(amountActionList.get(0));
        glMasterBO.setTransactionNarration(actionForm.getStageNotes());
        glMasterBO.setStage(stage);
        glMasterBO.setGlDetailBOList(glDetailBOList);
        // default value
        glMasterBO.setStatus("");
        // default value
        glMasterBO.setTransactionBy(0);
        glMasterBO.setCreatedBy(getUserContext(request).getId());
        glMasterBO.setCreatedDate(DateUtils.getCurrentDateWithoutTimeStamp());
        accountingServiceFacade.savingAccountingTransactions(glMasterBO);
    }
}
Also used : OfficeGlobalDto(org.mifos.dto.domain.OfficeGlobalDto) GLCodeDto(org.mifos.dto.domain.GLCodeDto) GlDetailDto(org.mifos.dto.domain.GlDetailDto) ViewStageTransactionsDto(org.mifos.dto.domain.ViewStageTransactionsDto) ParseException(java.text.ParseException) BigDecimal(java.math.BigDecimal) GlMasterBO(org.mifos.application.accounting.business.GlMasterBO) GlDetailBO(org.mifos.application.accounting.business.GlDetailBO)

Aggregations

OfficeGlobalDto (org.mifos.dto.domain.OfficeGlobalDto)19 GLCodeDto (org.mifos.dto.domain.GLCodeDto)9 ArrayList (java.util.ArrayList)8 ViewStageTransactionActionForm (org.mifos.accounting.struts.actionform.ViewStageTransactionActionForm)6 OfficesList (org.mifos.dto.domain.OfficesList)6 UserContext (org.mifos.security.util.UserContext)6 GlDetailDto (org.mifos.dto.domain.GlDetailDto)5 ViewStageTransactionsDto (org.mifos.dto.domain.ViewStageTransactionsDto)5 DynamicOfficeDto (org.mifos.dto.domain.DynamicOfficeDto)4 BigDecimal (java.math.BigDecimal)2 ParseException (java.text.ParseException)2 Date (java.util.Date)2 CoaBranchMappingActionForm (org.mifos.accounting.struts.actionform.CoaBranchMappingActionForm)2 InterOfficeTransferActionForm (org.mifos.accounting.struts.actionform.InterOfficeTransferActionForm)2 GlDetailBO (org.mifos.application.accounting.business.GlDetailBO)2 GlMasterBO (org.mifos.application.accounting.business.GlMasterBO)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 OpenBalanceActionForm (org.mifos.accounting.struts.actionform.OpenBalanceActionForm)1