Search in sources :

Example 6 with FinancialYearBO

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

the class AccountingDaoHibernate method findLastProcessingDateFirstTime.

@Override
public String findLastProcessingDateFirstTime(String namedQueryString) {
    String lastProcessingDate = null;
    Query query = createdNamedQuery(namedQueryString);
    List<FinancialYearBO> list = query.list();
    if (list.size() > 0) {
        FinancialYearBO bo = list.get(0);
        lastProcessingDate = DateUtils.format(bo.getFinancialYearStartDate());
    }
    return lastProcessingDate;
}
Also used : Query(org.hibernate.Query) FinancialYearBO(org.mifos.application.accounting.business.FinancialYearBO)

Example 7 with FinancialYearBO

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

the class AccountingServiceFacadeWebTier method processingFinancialYear.

public FinancialYearBO processingFinancialYear(UserContext userContext, FinancialYearBO oldFinancialYearBO) {
    FinancialYearBO newFinancialYearBO = null;
    oldFinancialYearBO.setStatus(SimpleAccountingConstants.INACTIVE);
    newFinancialYearBO = updateFinancialYear(oldFinancialYearBO, userContext);
    return newFinancialYearBO;
}
Also used : FinancialYearBO(org.mifos.application.accounting.business.FinancialYearBO)

Example 8 with FinancialYearBO

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

the class AccountingServiceFacadeWebTier method getResultantGlBalancesBOForAccountingTransactions.

public GlBalancesBO getResultantGlBalancesBOForAccountingTransactions(GlBalancesBO fromDatabase, BigDecimal amount, String action) {
    FinancialYearBO financialYearBO = getFinancialYear();
    fromDatabase.setFinancialYearBO(financialYearBO);
    if (action.equals("debit"))
        fromDatabase.setTransactionDebitSum(fromDatabase.getTransactionDebitSum().add(amount));
    else if (action.equals("credit"))
        fromDatabase.setTransactionCreditSum(fromDatabase.getTransactionCreditSum().add(amount));
    BigDecimal result = fromDatabase.getTransactionDebitSum().subtract(fromDatabase.getTransactionCreditSum());
    fromDatabase.setClosingBalance((fromDatabase.getOpeningBalance().add(result)));
    return fromDatabase;
}
Also used : FinancialYearBO(org.mifos.application.accounting.business.FinancialYearBO) BigDecimal(java.math.BigDecimal)

Example 9 with FinancialYearBO

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

Aggregations

FinancialYearBO (org.mifos.application.accounting.business.FinancialYearBO)9 Query (org.hibernate.Query)2 MifosRuntimeException (org.mifos.core.MifosRuntimeException)2 BigDecimal (java.math.BigDecimal)1 Calendar (java.util.Calendar)1 GregorianCalendar (java.util.GregorianCalendar)1 OpenBalanceActionForm (org.mifos.accounting.struts.actionform.OpenBalanceActionForm)1 GlBalancesBO (org.mifos.application.accounting.business.GlBalancesBO)1 InvalidDateException (org.mifos.application.admin.servicefacade.InvalidDateException)1 GLCodeDto (org.mifos.dto.domain.GLCodeDto)1