Search in sources :

Example 1 with GlMasterBO

use of org.mifos.application.accounting.business.GlMasterBO in project head by mifos.

the class AccountingServiceFacadeWebTier method getGlMasterBO.

GlMasterBO getGlMasterBO(MisProcessingTransactionsDto dto, Short createdBy) {
    GlMasterBO bo = new GlMasterBO();
    List<GlDetailBO> glDetailBOList = new ArrayList<GlDetailBO>();
    glDetailBOList.add(new GlDetailBO(dto.getGlCredit(), dto.getAmount(), "credit", "", null, "", "", dto.getTransactionNotes()));
    bo.setGlDetailBOList(glDetailBOList);
    bo.setTransactionDate(dto.getPostedDate());
    bo.setTransactionType(dto.getVoucherType());
    bo.setFromOfficeLevel(dto.getOfficeLevel());
    bo.setFromOfficeId(dto.getGlobalOfficeNum());
    bo.setToOfficeLevel(dto.getOfficeLevel());
    bo.setToOfficeId(dto.getGlobalOfficeNum());
    //
    bo.setMainAccount(dto.getGlDebit());
    bo.setTransactionAmount(dto.getAmount());
    //
    bo.setAmountAction("debit");
    //
    bo.setTransactionNarration("Mis Processing");
    // default value
    bo.setStatus("");
    // default value
    bo.setTransactionBy(1);
    bo.setCreatedBy(createdBy);
    bo.setCreatedDate(dto.getVoucherDate());
    return bo;
}
Also used : GlMasterBO(org.mifos.application.accounting.business.GlMasterBO) ArrayList(java.util.ArrayList) GlDetailBO(org.mifos.application.accounting.business.GlDetailBO)

Example 2 with GlMasterBO

use of org.mifos.application.accounting.business.GlMasterBO in project head by mifos.

the class VoucherBranchMappingAction method submit.

public ActionForward submit(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    String totalAmount = "0";
    String[] amounts;
    VoucherBranchMappingActionForm actionForm = (VoucherBranchMappingActionForm) form;
    //storingSession(request, "coaNamesList", coaNameslist);
    List<String> amountActionList = getAmountAction(actionForm);
    List<GlDetailBO> glDetailBOList = getGlDetailBOList(actionForm, amountActionList);
    String[] amounts1 = actionForm.getAmount();
    amounts = actionForm.getAmount();
    double totalcheck = Double.parseDouble(actionForm.getTotal());
    if (totalcheck != 0) {
        GlMasterBO glMasterBO = new GlMasterBO();
        glMasterBO.setTransactionDate(DateUtils.getDate(actionForm.getTransactiondate()));
        glMasterBO.setTransactionType(actionForm.getTransactiontype());
        glMasterBO.setFromOfficeLevel(new Integer("5"));
        glMasterBO.setFromOfficeId(actionForm.getBranch());
        glMasterBO.setToOfficeLevel(new Integer("5"));
        glMasterBO.setToOfficeId(actionForm.getBranch());
        glMasterBO.setMainAccount(actionForm.getMainAccount());
        glMasterBO.setTransactionAmount(new BigDecimal(Double.parseDouble(actionForm.getTotal())));
        glMasterBO.setAmountAction(amountActionList.get(0));
        glMasterBO.setTransactionNarration("success");
        glMasterBO.setGlDetailBOList(glDetailBOList);
        // default value
        glMasterBO.setStatus("");
        glMasterBO.setStage(0);
        // default value
        glMasterBO.setTransactionBy(0);
        glMasterBO.setCreatedBy(getUserContext(request).getId());
        glMasterBO.setCreatedDate(DateUtils.getCurrentDateWithoutTimeStamp());
        accountingServiceFacade.savingAccountingTransactions(glMasterBO);
        actionForm.setTransactiontype(null);
    }
    return mapping.findForward(ActionForwards.submit_success.toString());
}
Also used : GlMasterBO(org.mifos.application.accounting.business.GlMasterBO) VoucherBranchMappingActionForm(org.mifos.accounting.struts.actionform.VoucherBranchMappingActionForm) BigDecimal(java.math.BigDecimal) GlDetailBO(org.mifos.application.accounting.business.GlDetailBO)

Example 3 with GlMasterBO

use of org.mifos.application.accounting.business.GlMasterBO in project head by mifos.

the class ApproveTransactions method submit.

public ActionForward submit(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    HttpSession session = request.getSession(true);
    ViewStageTransactionActionForm actionForm = (ViewStageTransactionActionForm) form;
    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(actionForm.getStageTransactionNo()));
    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);
    return mapping.findForward("submit_success");
}
Also used : HttpSession(javax.servlet.http.HttpSession) GlMasterBO(org.mifos.application.accounting.business.GlMasterBO) ViewStageTransactionActionForm(org.mifos.accounting.struts.actionform.ViewStageTransactionActionForm) BigDecimal(java.math.BigDecimal) GlDetailBO(org.mifos.application.accounting.business.GlDetailBO)

Example 4 with GlMasterBO

use of org.mifos.application.accounting.business.GlMasterBO in project head by mifos.

the class SingleGeneralLedgerAction method insertionSaveAndStage.

public void insertionSaveAndStage(SingleGeneralLedgerActionForm actionForm, HttpServletRequest request, int stage) {
    List<String> amountActionList = getAmountAction(actionForm);
    List<GlDetailBO> glDetailBOList = getGlDetailBOList(actionForm, amountActionList);
    GlMasterBO glMasterBO = new GlMasterBO();
    glMasterBO.setTransactionDate(DateUtils.getDate(actionForm.getTrxnDate()));
    glMasterBO.setTransactionType(actionForm.getTrxnType());
    glMasterBO.setFromOfficeLevel(new Integer(actionForm.getOfficeHierarchy()));
    glMasterBO.setFromOfficeId(actionForm.getOffice());
    glMasterBO.setToOfficeLevel(new Integer(actionForm.getOfficeHierarchy()));
    glMasterBO.setToOfficeId(actionForm.getOffice());
    glMasterBO.setMainAccount(actionForm.getMainAccount());
    glMasterBO.setTransactionAmount(new BigDecimal(actionForm.getAmount()));
    glMasterBO.setAmountAction(amountActionList.get(0));
    glMasterBO.setTransactionNarration(actionForm.getNotes());
    glMasterBO.setGlDetailBOList(glDetailBOList);
    // default value
    glMasterBO.setStatus("");
    // default value
    glMasterBO.setTransactionBy(0);
    glMasterBO.setStage(stage);
    glMasterBO.setMemberId(actionForm.getMemberId());
    glMasterBO.setCreatedBy(getUserContext(request).getId());
    glMasterBO.setCreatedDate(DateUtils.getCurrentDateWithoutTimeStamp());
    if (stage == 0) {
        accountingServiceFacade.savingStageAccountingTransactions(glMasterBO);
    } else {
        accountingServiceFacade.savingAccountingTransactions(glMasterBO);
    }
}
Also used : GlMasterBO(org.mifos.application.accounting.business.GlMasterBO) BigDecimal(java.math.BigDecimal) GlDetailBO(org.mifos.application.accounting.business.GlDetailBO)

Example 5 with GlMasterBO

use of org.mifos.application.accounting.business.GlMasterBO 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)

Aggregations

GlMasterBO (org.mifos.application.accounting.business.GlMasterBO)12 GlDetailBO (org.mifos.application.accounting.business.GlDetailBO)11 BigDecimal (java.math.BigDecimal)10 ParseException (java.text.ParseException)2 HttpSession (javax.servlet.http.HttpSession)2 ViewStageTransactionActionForm (org.mifos.accounting.struts.actionform.ViewStageTransactionActionForm)2 GLCodeDto (org.mifos.dto.domain.GLCodeDto)2 GlDetailDto (org.mifos.dto.domain.GlDetailDto)2 OfficeGlobalDto (org.mifos.dto.domain.OfficeGlobalDto)2 ViewStageTransactionsDto (org.mifos.dto.domain.ViewStageTransactionsDto)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 VoucherBranchMappingActionForm (org.mifos.accounting.struts.actionform.VoucherBranchMappingActionForm)1 PersistenceException (org.mifos.framework.exceptions.PersistenceException)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1