Search in sources :

Example 11 with GlMasterBO

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

the class JournalVoucherAction method insertionSaveAndStage.

public void insertionSaveAndStage(JournalVoucherActionForm 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.getVoucherDate()));
    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.getDebitAccountHead());
    glMasterBO.setTransactionAmount(new BigDecimal(actionForm.getAmount()));
    glMasterBO.setAmountAction(amountActionList.get(0));
    glMasterBO.setTransactionNarration(actionForm.getVoucherNotes());
    glMasterBO.setGlDetailBOList(glDetailBOList);
    glMasterBO.setStatus("");
    glMasterBO.setStage(stage);
    glMasterBO.setTransactionBy(0);
    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 12 with GlMasterBO

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

the class ViewStageTransactionAction 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();
    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.setGlDetailBOList(glDetailBOList);
    // default value
    glMasterBO.setStatus("");
    // default value
    glMasterBO.setTransactionBy(0);
    glMasterBO.setCreatedBy(getUserContext(request).getId());
    glMasterBO.setCreatedDate(DateUtils.getCurrentDateWithoutTimeStamp());
    accountingServiceFacade.savingStageAccountingTransactions(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)

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