Search in sources :

Example 16 with OfficeGlobalDto

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

the class OpenBalanceAction method loadOffices.

public ActionForward loadOffices(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    OpenBalanceActionForm actionForm = (OpenBalanceActionForm) form;
    List<OfficeGlobalDto> officeDetailsDtos = null;
    if (actionForm.getOfficeHierarchy().equals("")) {
        officeDetailsDtos = null;
    } else if (actionForm.getOfficeHierarchy().equals("6")) {
        officeDetailsDtos = accountingServiceFacade.loadCustomerForLevel(new Short("3"));
    } else if (actionForm.getOfficeHierarchy().equals("7")) {
        officeDetailsDtos = accountingServiceFacade.loadCustomerForLevel(new Short("2"));
    } else {
        officeDetailsDtos = accountingServiceFacade.loadOfficesForLevel(Short.valueOf(actionForm.getOfficeHierarchy()));
    }
    storingSession(request, "OfficesOnHierarchy", officeDetailsDtos);
    return mapping.findForward(ActionForwards.load_success.toString());
}
Also used : OfficeGlobalDto(org.mifos.dto.domain.OfficeGlobalDto) OpenBalanceActionForm(org.mifos.accounting.struts.actionform.OpenBalanceActionForm)

Example 17 with OfficeGlobalDto

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

the class ProcessAccountingTransactionsAction method load.

public ActionForward load(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    ProcessAccountingTransactionsActionForm actionForm = (ProcessAccountingTransactionsActionForm) form;
    UserContext context = getUserContext(request);
    actionForm.setOfficeLevelId(String.valueOf(context.getOfficeLevelId()));
    actionForm.setOffice("");
    List<OfficesList> offices = new ArrayList<OfficesList>();
    List<DynamicOfficeDto> listOfOffices = null;
    listOfOffices = accountingServiceFacade.getOfficeDetails(String.valueOf(context.getBranchId()), String.valueOf(context.getOfficeLevelId()));
    OfficesList officesList = null;
    OfficeGlobalDto officeGlobalDto = null;
    for (DynamicOfficeDto officeDto : listOfOffices) {
        if (officeDto.getOfficeLevelId() == 5) {
            officesList = new OfficesList(officeDto.getOfficeId(), officeDto.displayName, officeDto.officeLevelId, officeDto.globalOfficeNumber);
            offices.add(officesList);
        }
    }
    if ("1".equals(String.valueOf(getUserContext(request).getOfficeLevelId()))) {
        storingSession(request, "officeLevelId", actionForm.getOfficeLevelId());
        storingSession(request, "DynamicOfficesOnHierarchy", offices);
    } else if ("5".equals(String.valueOf(getUserContext(request).getOfficeLevelId()))) {
        if (offices.size() > 0 && (offices.get(0) != null)) {
            officeGlobalDto = new OfficeGlobalDto(offices.get(0).globalOfficeNumber, offices.get(0).displayName);
        }
        actionForm.setOffice(offices.get(0).globalOfficeNumber);
        storingSession(request, "officeLevelId", actionForm.getOfficeLevelId());
        storingSession(request, "DynamicOfficesOnHierarchy", officeGlobalDto);
        actionForm.setLastProcessDate(accountingServiceFacade.getLastProcessUpdatedDate(getUserContext(request).getBranchGlobalNum()));
    } else {
        storingSession(request, "DynamicOfficesOnHierarchy", offices);
    }
    return mapping.findForward(ActionForwards.load_success.toString());
}
Also used : OfficeGlobalDto(org.mifos.dto.domain.OfficeGlobalDto) OfficesList(org.mifos.dto.domain.OfficesList) UserContext(org.mifos.security.util.UserContext) ArrayList(java.util.ArrayList) DynamicOfficeDto(org.mifos.dto.domain.DynamicOfficeDto) ProcessAccountingTransactionsActionForm(org.mifos.accounting.struts.actionform.ProcessAccountingTransactionsActionForm)

Example 18 with OfficeGlobalDto

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

Example 19 with OfficeGlobalDto

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

the class AuditTransactionAction method audit.

public ActionForward audit(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());
    short s = new Integer(actionForm.getStageOfficeHierarchy()).shortValue();
    GlDetailDto glDetailDto = accountingServiceFacade.getChequeDetails(stageTransactionNo);
    if (!actionForm.getStageTrxnType().equals("CP") || !actionForm.getStageTrxnType().equals("CR")) {
        actionForm.setStageChequeNo(glDetailDto.getChequeNo());
        if (glDetailDto.getChequeDate() != null) {
            actionForm.setChequeDate(changeDateFormat(glDetailDto.getChequeDate().toString()));
        }
        actionForm.setStageBankName(glDetailDto.getBankName());
        actionForm.setStageankBranch(glDetailDto.getBankBranch());
    }
    // 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();
    }
    // else if (actionForm.getStageTrxnType().equals("BR")
    // || actionForm.getStageTrxnType().equals("BP")) {
    // accountingDtos = accountingServiceFacade.mainAccountForBank();
    //
    // }else if (actionForm.getStageTrxnType().equals("JV")){
    // accountingDtos = accountingServiceFacade.mainAccountForCash();
    // }
    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("audit_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

OfficeGlobalDto (org.mifos.dto.domain.OfficeGlobalDto)19 GLCodeDto (org.mifos.dto.domain.GLCodeDto)9 ArrayList (java.util.ArrayList)8 ViewStageTransactionActionForm (org.mifos.accounting.struts.actionform.ViewStageTransactionActionForm)6 OfficesList (org.mifos.dto.domain.OfficesList)6 UserContext (org.mifos.security.util.UserContext)6 GlDetailDto (org.mifos.dto.domain.GlDetailDto)5 ViewStageTransactionsDto (org.mifos.dto.domain.ViewStageTransactionsDto)5 DynamicOfficeDto (org.mifos.dto.domain.DynamicOfficeDto)4 BigDecimal (java.math.BigDecimal)2 ParseException (java.text.ParseException)2 Date (java.util.Date)2 CoaBranchMappingActionForm (org.mifos.accounting.struts.actionform.CoaBranchMappingActionForm)2 InterOfficeTransferActionForm (org.mifos.accounting.struts.actionform.InterOfficeTransferActionForm)2 GlDetailBO (org.mifos.application.accounting.business.GlDetailBO)2 GlMasterBO (org.mifos.application.accounting.business.GlMasterBO)2 ConsolidatedTransactionActionForm (org.mifos.accounting.struts.actionform.ConsolidatedTransactionActionForm)1 JournalVoucherActionForm (org.mifos.accounting.struts.actionform.JournalVoucherActionForm)1 MultipleGeneralLedgerActionForm (org.mifos.accounting.struts.actionform.MultipleGeneralLedgerActionForm)1 OpenBalanceActionForm (org.mifos.accounting.struts.actionform.OpenBalanceActionForm)1