Search in sources :

Example 1 with CuBalanceDao

use of edu.cornell.kfs.gl.dataaccess.CuBalanceDao in project cu-kfs by CU-CommunityApps.

the class CuBalanceServiceImpl method findReversionBalancesForFiscalYear.

/**
 * Returns all of the balances to be forwarded for the organization reversion process
 * @param year the year of balances to find
 * @param endOfYear whether the organization reversion process is running end of year (before the fiscal year change over) or
 *        beginning of year (after the fiscal year change over)
 * @return an iterator of balances to put through the strenuous organization reversion process
 * @see org.kuali.kfs.gl.service.BalanceService#findOrganizationReversionBalancesForFiscalYear(java.lang.Integer, boolean)
 */
public Iterator<Balance> findReversionBalancesForFiscalYear(Integer year, boolean endOfYear) {
    SystemOptions options = SpringContext.getBean(OptionsService.class).getOptions(year);
    List<ParameterEvaluator> parameterEvaluators = new ArrayList<ParameterEvaluator>();
    int i = 1;
    boolean moreParams = true;
    while (moreParams) {
        if (parameterService.parameterExists(Reversion.class, PARAMETER_PREFIX + i)) {
            ParameterEvaluator parameterEvaluator = /*REFACTORME*/
            SpringContext.getBean(ParameterEvaluatorService.class).getParameterEvaluator(Reversion.class, PARAMETER_PREFIX + i);
            parameterEvaluators.add(parameterEvaluator);
        } else {
            moreParams = false;
        }
        i++;
    }
    return ((CuBalanceDao) balanceDao).findReversionBalancesForFiscalYear(year, endOfYear, options, parameterEvaluators);
}
Also used : OptionsService(org.kuali.kfs.sys.service.OptionsService) ArrayList(java.util.ArrayList) SystemOptions(org.kuali.kfs.sys.businessobject.SystemOptions) ParameterEvaluator(org.kuali.rice.core.api.parameter.ParameterEvaluator) ParameterEvaluatorService(org.kuali.rice.core.api.parameter.ParameterEvaluatorService) CuBalanceDao(edu.cornell.kfs.gl.dataaccess.CuBalanceDao)

Aggregations

CuBalanceDao (edu.cornell.kfs.gl.dataaccess.CuBalanceDao)1 ArrayList (java.util.ArrayList)1 SystemOptions (org.kuali.kfs.sys.businessobject.SystemOptions)1 OptionsService (org.kuali.kfs.sys.service.OptionsService)1 ParameterEvaluator (org.kuali.rice.core.api.parameter.ParameterEvaluator)1 ParameterEvaluatorService (org.kuali.rice.core.api.parameter.ParameterEvaluatorService)1