Search in sources :

Example 31 with GLCodeDto

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

the class ViewStageTransactionAction method loadAccountHeads.

public ActionForward loadAccountHeads(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    ViewStageTransactionActionForm actionForm = (ViewStageTransactionActionForm) form;
    List<GLCodeDto> accountingDtos = null;
    accountingDtos = accountingServiceFacade.accountHead(actionForm.getStageMainAccount());
    storingSession(request, "AccountHeadGlCodes", accountingDtos);
    return mapping.findForward("load_stage_success");
}
Also used : GLCodeDto(org.mifos.dto.domain.GLCodeDto) ViewStageTransactionActionForm(org.mifos.accounting.struts.actionform.ViewStageTransactionActionForm)

Example 32 with GLCodeDto

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

the class VoucherBranchMappingAction method preview.

public ActionForward preview(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    VoucherBranchMappingActionForm actionForm = (VoucherBranchMappingActionForm) form;
    String[] coanames = actionForm.getCoaname();
    String[] amounts = actionForm.getAmount();
    String[] notes = actionForm.getTransactionnotes();
    List<GLCodeDto> coaNameslist = null;
    int sno = 1;
    double total = 0;
    coaNameslist = new ArrayList<GLCodeDto>();
    for (int i = 0; i < coanames.length; i++) {
        total = total + Double.parseDouble(amounts[i]);
        GLCodeDto GLcodedto = new GLCodeDto();
        GLcodedto.setSno(sno);
        sno++;
        GLcodedto.setCoaName(coanames[i]);
        GLcodedto.setTrannotes(notes[i]);
        GLcodedto.setAmounts(amounts[i]);
        coaNameslist.add(GLcodedto);
    }
    actionForm.setTotal(String.format("%.2f", total));
    storingSession(request, "coaNamesList", coaNameslist);
    storingSession(request, "VoucherBranchMappingActionForm", actionForm);
    return mapping.findForward(ActionForwards.preview_success.toString());
}
Also used : GLCodeDto(org.mifos.dto.domain.GLCodeDto) VoucherBranchMappingActionForm(org.mifos.accounting.struts.actionform.VoucherBranchMappingActionForm)

Example 33 with GLCodeDto

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

the class MultipleGeneralLedgerAction method loadAccountHeads.

public ActionForward loadAccountHeads(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    MultipleGeneralLedgerActionForm actionForm = (MultipleGeneralLedgerActionForm) form;
    List<GLCodeDto> accountingDtos = null;
    accountingDtos = accountingServiceFacade.accountHead(actionForm.getMainAccount());
    List<GLCodeDto> snolist = null;
    snolist = new ArrayList<GLCodeDto>();
    int sno = 1;
    GLCodeDto gLcodeDto = new GLCodeDto();
    gLcodeDto.setSno(sno);
    snolist.add(gLcodeDto);
    storingSession(request, "SNoList", snolist);
    storingSession(request, "AccountHeadGlCodes", accountingDtos);
    return mapping.findForward(ActionForwards.load_success.toString());
}
Also used : GLCodeDto(org.mifos.dto.domain.GLCodeDto) MultipleGeneralLedgerActionForm(org.mifos.accounting.struts.actionform.MultipleGeneralLedgerActionForm)

Example 34 with GLCodeDto

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

the class OpenBalanceAction method load.

public ActionForward load(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    OpenBalanceActionForm actionForm = (OpenBalanceActionForm) form;
    FinancialYearBO financialYearBO = accountingServiceFacade.getFinancialYear();
    actionForm.setFinancialYear(DateUtils.format(financialYearBO.getFinancialYearStartDate()) + "-" + DateUtils.format(financialYearBO.getFinancialYearEndDate()));
    actionForm.setFinancialYearId(new Integer(financialYearBO.getFinancialYearId()).toString());
    List<GLCodeDto> accountingDtos = accountingServiceFacade.findTotalGlAccounts();
    storingSession(request, "TotalGlCodes", accountingDtos);
    return mapping.findForward(ActionForwards.load_success.toString());
}
Also used : GLCodeDto(org.mifos.dto.domain.GLCodeDto) OpenBalanceActionForm(org.mifos.accounting.struts.actionform.OpenBalanceActionForm) FinancialYearBO(org.mifos.application.accounting.business.FinancialYearBO)

Example 35 with GLCodeDto

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

the class ApproveTransactions method approve.

public ActionForward approve(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    ViewStageTransactionActionForm actionForm = (ViewStageTransactionActionForm) form;
    String stageTransactionNo = request.getParameter("txnNo");
    ViewStageTransactionsDto viewStageTransactionsDto = accountingServiceFacade.getstagedAccountingTransactions(stageTransactionNo);
    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());
    GlDetailDto glDetailDto = accountingServiceFacade.getChequeDetails(stageTransactionNo);
    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();
    //load offices
    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();
    }
    //		if (actionForm.getStageTrxnType().equals("CR")
    //				|| actionForm.getStageTrxnType().equals("CP")) {
    //			accountingDtos = accountingServiceFacade.mainAccountForCash();
    //		} else if (actionForm.getStageTrxnType().equals("BR")
    //				|| actionForm.getStageTrxnType().equals("BP")) {
    //			accountingDtos = accountingServiceFacade.mainAccountForBank();
    //
    //		}else if (actionForm.getStageTrxnType()== null){
    //			return mapping.findForward("in_progress");
    //		}
    storingSession(request, "MainAccountGlCodes", accountingDtos);
    storingSession(request, "stageTransactionNo", stageTransactionNo);
    actionForm.setTransactionDetailID(new Integer(viewStageTransactionsDto.getTransactionID()).toString());
    actionForm.setStageMainAccount(viewStageTransactionsDto.getMainAccount());
    actionForm.setStageAccountHead(viewStageTransactionsDto.getSubAccount());
    actionForm.setStageNotes(viewStageTransactionsDto.getNarration());
    actionForm.setStageAmount(viewStageTransactionsDto.getTransactionAmount());
    storingSession(request, "ViewStageTransactionsDto", viewStageTransactionsDto);
    List<GLCodeDto> accountingGlDtos = null;
    accountingGlDtos = accountingServiceFacade.accountHead(actionForm.getStageMainAccount());
    storingSession(request, "AccountHeadGlCodes", accountingGlDtos);
    return mapping.findForward("approve_success");
}
Also used : OfficeGlobalDto(org.mifos.dto.domain.OfficeGlobalDto) GLCodeDto(org.mifos.dto.domain.GLCodeDto) ViewStageTransactionActionForm(org.mifos.accounting.struts.actionform.ViewStageTransactionActionForm) GlDetailDto(org.mifos.dto.domain.GlDetailDto) ViewStageTransactionsDto(org.mifos.dto.domain.ViewStageTransactionsDto)

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