Search in sources :

Example 1 with SingleGeneralLedgerActionForm

use of org.mifos.accounting.struts.actionform.SingleGeneralLedgerActionForm in project head by mifos.

the class SingleGeneralLedgerAction method loadMainAccounts.

public ActionForward loadMainAccounts(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    SingleGeneralLedgerActionForm actionForm = (SingleGeneralLedgerActionForm) form;
    List<GLCodeDto> accountingDtos = null;
    if (actionForm.getTrxnType().equals("CR") || actionForm.getTrxnType().equals("CP")) {
        accountingDtos = accountingServiceFacade.mainAccountForCash();
    } else if (actionForm.getTrxnType().equals("BR") || actionForm.getTrxnType().equals("BP")) {
        accountingDtos = accountingServiceFacade.mainAccountForBank();
    }
    storingSession(request, "MainAccountGlCodes", accountingDtos);
    return mapping.findForward(ActionForwards.load_success.toString());
}
Also used : SingleGeneralLedgerActionForm(org.mifos.accounting.struts.actionform.SingleGeneralLedgerActionForm) GLCodeDto(org.mifos.dto.domain.GLCodeDto)

Example 2 with SingleGeneralLedgerActionForm

use of org.mifos.accounting.struts.actionform.SingleGeneralLedgerActionForm in project head by mifos.

the class SingleGeneralLedgerAction method submit.

public ActionForward submit(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    SingleGeneralLedgerActionForm actionForm = (SingleGeneralLedgerActionForm) form;
    int stage = 1;
    /*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);
		glMasterBO.setStatus("");// default value
		glMasterBO.setTransactionBy(0); // default value
		glMasterBO.setCreatedBy(getUserContext(request).getId());
		glMasterBO.setCreatedDate(DateUtils.getCurrentDateWithoutTimeStamp());
		accountingServiceFacade.savingAccountingTransactions(glMasterBO);*/
    insertionSaveAndStage(actionForm, request, stage);
    return mapping.findForward("submit_success");
}
Also used : SingleGeneralLedgerActionForm(org.mifos.accounting.struts.actionform.SingleGeneralLedgerActionForm)

Example 3 with SingleGeneralLedgerActionForm

use of org.mifos.accounting.struts.actionform.SingleGeneralLedgerActionForm in project head by mifos.

the class SingleGeneralLedgerAction method loadAccountHeads.

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

Example 4 with SingleGeneralLedgerActionForm

use of org.mifos.accounting.struts.actionform.SingleGeneralLedgerActionForm in project head by mifos.

the class SingleGeneralLedgerAction method preview.

public ActionForward preview(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    SingleGeneralLedgerActionForm actionForm = (SingleGeneralLedgerActionForm) form;
    storingSession(request, "SingleGeneralLedgerActionForm", actionForm);
    monthClosingServiceFacade.validateTransactionDate(DateUtils.getDate(actionForm.getTrxnDate()));
    return mapping.findForward(ActionForwards.preview_success.toString());
}
Also used : SingleGeneralLedgerActionForm(org.mifos.accounting.struts.actionform.SingleGeneralLedgerActionForm)

Example 5 with SingleGeneralLedgerActionForm

use of org.mifos.accounting.struts.actionform.SingleGeneralLedgerActionForm in project head by mifos.

the class SingleGeneralLedgerAction method load.

public ActionForward load(ActionMapping mapping, ActionForm form, HttpServletRequest request, @SuppressWarnings("unused") HttpServletResponse response) throws Exception {
    List<RolesActivityDto> rolesactivitydto = null;
    SingleGeneralLedgerActionForm actionForm = (SingleGeneralLedgerActionForm) form;
    java.util.Date trxnDate = DateUtils.getCurrentDateWithoutTimeStamp();
    actionForm.setTrxnDate(trxnDate);
    rolesactivitydto = accountingServiceFacade.glloadRolesActivity();
    actionForm.setMemberId("");
    boolean generalledgersave = rolesactivitydto.isEmpty();
    UserContext context = getUserContext(request);
    actionForm.setOfficeLevelId(String.valueOf(context.getOfficeLevelId()));
    List listOfOfficeHierarchyObject = getOfficeLevels(actionForm);
    storingSession(request, "listOfOffices", listOfOfficeHierarchyObject);
    storingSession(request, "officeLevelId", actionForm.getOfficeLevelId());
    storingSession(request, "glsave", generalledgersave);
    storingSession(request, "OfficesOnHierarchy", null);
    storingSession(request, "MainAccountGlCodes", null);
    storingSession(request, "AccountHeadGlCodes", null);
    storingSession(request, "DynamicOfficesOnHierarchy", null);
    return mapping.findForward(ActionForwards.load_success.toString());
}
Also used : SingleGeneralLedgerActionForm(org.mifos.accounting.struts.actionform.SingleGeneralLedgerActionForm) UserContext(org.mifos.security.util.UserContext) ArrayList(java.util.ArrayList) OfficesList(org.mifos.dto.domain.OfficesList) List(java.util.List) RolesActivityDto(org.mifos.dto.domain.RolesActivityDto)

Aggregations

SingleGeneralLedgerActionForm (org.mifos.accounting.struts.actionform.SingleGeneralLedgerActionForm)7 ArrayList (java.util.ArrayList)2 GLCodeDto (org.mifos.dto.domain.GLCodeDto)2 OfficesList (org.mifos.dto.domain.OfficesList)2 UserContext (org.mifos.security.util.UserContext)2 List (java.util.List)1 DynamicOfficeDto (org.mifos.dto.domain.DynamicOfficeDto)1 OfficeGlobalDto (org.mifos.dto.domain.OfficeGlobalDto)1 RolesActivityDto (org.mifos.dto.domain.RolesActivityDto)1