Search in sources :

Example 6 with GlMasterBO

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

the class InterOfficeTransferAction method submitSaveAndStage.

public void submitSaveAndStage(InterOfficeTransferActionForm 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.getFromOfficeHierarchy()));
    glMasterBO.setFromOfficeId(actionForm.getFromOffice());
    glMasterBO.setToOfficeLevel(new Integer(actionForm.getToOfficeHierarchy()));
    glMasterBO.setToOfficeId(actionForm.getFromOffice());
    glMasterBO.setMainAccount(actionForm.getDebitAccountHead());
    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.setCreatedBy(getUserContext(request).getId());
    glMasterBO.setCreatedDate(DateUtils.getCurrentDateWithoutTimeStamp());
    conditionForSaving(glMasterBO, stage);
    List<GlDetailBO> interOfficeGLDetailBOList = getInterOfficeGlDetailBOList(actionForm, amountActionList);
    GlMasterBO interOfficeGlMasterBO = new GlMasterBO();
    interOfficeGlMasterBO.setTransactionDate(DateUtils.getDate(actionForm.getTrxnDate()));
    interOfficeGlMasterBO.setTransactionType(actionForm.getTrxnType());
    interOfficeGlMasterBO.setFromOfficeLevel(new Integer(actionForm.getToOfficeHierarchy()));
    interOfficeGlMasterBO.setFromOfficeId(actionForm.getToOffice());
    interOfficeGlMasterBO.setToOfficeLevel(new Integer(actionForm.getFromOfficeHierarchy()));
    interOfficeGlMasterBO.setToOfficeId(actionForm.getToOffice());
    interOfficeGlMasterBO.setMainAccount("11301");
    interOfficeGlMasterBO.setTransactionAmount(new BigDecimal(actionForm.getAmount()));
    interOfficeGlMasterBO.setAmountAction(amountActionList.get(0));
    interOfficeGlMasterBO.setTransactionNarration(actionForm.getNotes());
    interOfficeGlMasterBO.setGlDetailBOList(interOfficeGLDetailBOList);
    // default value
    interOfficeGlMasterBO.setStatus("");
    // default value
    interOfficeGlMasterBO.setTransactionBy(0);
    interOfficeGlMasterBO.setCreatedBy(getUserContext(request).getId());
    interOfficeGlMasterBO.setCreatedDate(DateUtils.getCurrentDateWithoutTimeStamp());
    conditionForSaving(interOfficeGlMasterBO, stage);
}
Also used : GlMasterBO(org.mifos.application.accounting.business.GlMasterBO) BigDecimal(java.math.BigDecimal) GlDetailBO(org.mifos.application.accounting.business.GlDetailBO)

Example 7 with GlMasterBO

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

the class MultipleGeneralLedgerAction method insertionSaveAndStage.

public void insertionSaveAndStage(MultipleGeneralLedgerActionForm actionForm, HttpServletRequest request, int stage) {
    String[] amounts = actionForm.getAmount1();
    String[] trannotes = actionForm.getNotes1();
    String[] accountHeads = actionForm.getAccountHead1();
    List<String> amountActionList = getAmountAction(actionForm);
    List<GlDetailBO> glDetailBOList = getGlDetailBOList(actionForm, amountActionList);
    //
    double totalcheck = Double.parseDouble(actionForm.getTotal());
    /*if(totalcheck != 0)
				{
					if(amounts.length==accountHeads.length)
					{
						if(accountHeads[0].isEmpty() !=true)
						{*/
    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(totalcheck));
    glMasterBO.setAmountAction(amountActionList.get(0));
    glMasterBO.setTransactionNarration("success");
    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 8 with GlMasterBO

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

the class AccountingDaoHibernate method updateStage.

// Hugo Technologies approve stage transaction
@Override
public void updateStage(int transactionNO, int stage) {
    final Map<String, Object> queryparameters = new HashMap<String, Object>();
    GlMasterBO glMasterBo = null;
    queryparameters.put("STAGE", stage);
    queryparameters.put("TRANSACTION_NO", transactionNO);
    try {
        executeNamedQueryForUpdate("ChartOfAccountsForMifos.updateStageTransactions", queryparameters);
    } catch (PersistenceException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
Also used : HashMap(java.util.HashMap) GlMasterBO(org.mifos.application.accounting.business.GlMasterBO) PersistenceException(org.mifos.framework.exceptions.PersistenceException)

Example 9 with GlMasterBO

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

Example 10 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)

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