Search in sources :

Example 1 with OfficeGlobalDto

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

the class ApproveTransactions 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 2 with OfficeGlobalDto

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

the class AuditTransactionAction 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 3 with OfficeGlobalDto

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

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

the class ConsolidatedTransactionAction method approveCPBPTransactions.

public void approveCPBPTransactions(ConsolidatedTransactionActionForm actionForm, String TransactioncpbpNoValue, HttpServletRequest request) {
    ViewStageTransactionsDto viewStageTransactionsDto = accountingServiceFacade.getstagedAccountingTransactions(TransactioncpbpNoValue);
    try {
        if (viewStageTransactionsDto.getTransactionDate().toString() != null)
            actionForm.setStageTrxnDate(changeDateFormat(viewStageTransactionsDto.getTransactionDate().toString()));
        //actionForm.setStageTrxnDate(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(TransactioncpbpNoValue);
    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[] cpbpTransactionNO1 = actionForm.getTransactionCpBpNo();
    for (int j = 0; j < cpbpTransactionNO1.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(cpbpTransactionNO1[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)

Example 5 with OfficeGlobalDto

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

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