Search in sources :

Example 6 with GLCodeDto

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

the class MultipleGeneralLedgerAction method preview.

public ActionForward preview(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    MultipleGeneralLedgerActionForm actionForm = (MultipleGeneralLedgerActionForm) form;
    String[] accounthead = actionForm.getAccountHead1();
    String[] amounts = actionForm.getAmount1();
    String[] trannotes = actionForm.getNotes1();
    // saveErrors(request, actionerrors);
    double total = 0;
    glcodelist = new ArrayList<GLCodeDto>();
    for (int i = 0; i < amounts.length; i++) {
        total = total + Double.parseDouble(amounts[i]);
        GLCodeDto gLcodeDto = new GLCodeDto();
        gLcodeDto.setAccountHead(accounthead[i]);
        gLcodeDto.setAmounts(amounts[i]);
        gLcodeDto.setTrannotes(trannotes[i]);
        glcodelist.add(gLcodeDto);
    }
    actionForm.setTotal((String.format("%.2f", total)));
    storingSession(request, "accounHeadValues", glcodelist);
    storingSession(request, "GeneralLedgerActionForm", actionForm);
    monthClosingServiceFacade.validateTransactionDate(DateUtils.getDate(actionForm.getTrxnDate()));
    return mapping.findForward(ActionForwards.preview_success.toString());
}
Also used : GLCodeDto(org.mifos.dto.domain.GLCodeDto) MultipleGeneralLedgerActionForm(org.mifos.accounting.struts.actionform.MultipleGeneralLedgerActionForm)

Example 7 with GLCodeDto

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

the class SingleGeneralLedgerAction method loadMainAccounts.

public ActionForward loadMainAccounts(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    SingleGeneralLedgerActionForm actionForm = (SingleGeneralLedgerActionForm) form;
    List<GLCodeDto> accountingDtos = null;
    if (actionForm.getTrxnType().equals("CR") || actionForm.getTrxnType().equals("CP")) {
        accountingDtos = accountingServiceFacade.mainAccountForCash();
    } else if (actionForm.getTrxnType().equals("BR") || actionForm.getTrxnType().equals("BP")) {
        accountingDtos = accountingServiceFacade.mainAccountForBank();
    }
    storingSession(request, "MainAccountGlCodes", accountingDtos);
    return mapping.findForward(ActionForwards.load_success.toString());
}
Also used : SingleGeneralLedgerActionForm(org.mifos.accounting.struts.actionform.SingleGeneralLedgerActionForm) GLCodeDto(org.mifos.dto.domain.GLCodeDto)

Example 8 with GLCodeDto

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

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

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

GLCodeDto (org.mifos.dto.domain.GLCodeDto)37 ViewStageTransactionActionForm (org.mifos.accounting.struts.actionform.ViewStageTransactionActionForm)9 OfficeGlobalDto (org.mifos.dto.domain.OfficeGlobalDto)9 ArrayList (java.util.ArrayList)7 VoucherBranchMappingActionForm (org.mifos.accounting.struts.actionform.VoucherBranchMappingActionForm)5 GlDetailDto (org.mifos.dto.domain.GlDetailDto)5 ViewStageTransactionsDto (org.mifos.dto.domain.ViewStageTransactionsDto)5 MultipleGeneralLedgerActionForm (org.mifos.accounting.struts.actionform.MultipleGeneralLedgerActionForm)4 OfficesList (org.mifos.dto.domain.OfficesList)4 BigDecimal (java.math.BigDecimal)3 ParseException (java.text.ParseException)3 Date (java.util.Date)3 CoaBranchMappingActionForm (org.mifos.accounting.struts.actionform.CoaBranchMappingActionForm)3 GlDetailBO (org.mifos.application.accounting.business.GlDetailBO)3 UserContext (org.mifos.security.util.UserContext)3 LinkedHashMap (java.util.LinkedHashMap)2 List (java.util.List)2 InterOfficeTransferActionForm (org.mifos.accounting.struts.actionform.InterOfficeTransferActionForm)2 JournalVoucherActionForm (org.mifos.accounting.struts.actionform.JournalVoucherActionForm)2 SingleGeneralLedgerActionForm (org.mifos.accounting.struts.actionform.SingleGeneralLedgerActionForm)2