Search in sources :

Example 6 with SystemOptions

use of org.kuali.kfs.sys.businessobject.SystemOptions in project cu-kfs by CU-CommunityApps.

the class ConcurStandardAccountingExtractCollectorBatchBuilder method getActualFinancialBalanceTypeCodeForCollectorBatch.

protected String getActualFinancialBalanceTypeCodeForCollectorBatch() {
    Integer fiscalYear = Integer.valueOf(collectorBatch.getUniversityFiscalYear());
    SystemOptions fiscalYearOptions = optionsService.getOptions(fiscalYear);
    return fiscalYearOptions.getActualFinancialBalanceTypeCd();
}
Also used : SystemOptions(org.kuali.kfs.sys.businessobject.SystemOptions)

Example 7 with SystemOptions

use of org.kuali.kfs.sys.businessobject.SystemOptions 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)

Example 8 with SystemOptions

use of org.kuali.kfs.sys.businessobject.SystemOptions in project cu-kfs by CU-CommunityApps.

the class ScrubberValidatorImpl method validateFiscalYear.

/**
 * Validates the fiscal year of the origin entry
 *
 * @param originEntry       the origin entry being scrubbed
 * @param workingEntry      the scrubbed version of the origin entry
 * @param universityRunDate the university date when this scrubber process is being run
 * @return a Message if an error was encountered, otherwise null
 */
protected Message validateFiscalYear(OriginEntryInformation originEntry, OriginEntryInformation workingEntry, UniversityDate universityRunDate, AccountingCycleCachingService accountingCycleCachingService) {
    LOG.debug("validateFiscalYear() started");
    if ((originEntry.getUniversityFiscalYear() == null) || (originEntry.getUniversityFiscalYear().intValue() == 0)) {
        // commented out for KULLAB-627
        // if (!originEntry.getFinancialBalanceTypeCode().equals(KFSConstants.BALANCE_TYPE_A21)){
        workingEntry.setUniversityFiscalYear(universityRunDate.getUniversityFiscalYear());
        workingEntry.setUniversityFiscalPeriodCode(universityRunDate.getUniversityFiscalAccountingPeriod());
        // TODO:- to display updated values on report
        // TODO:- need to check because below two lines are commented out in validateUniversityFiscalPeriodCode
        originEntry.setUniversityFiscalYear(universityRunDate.getUniversityFiscalYear());
        originEntry.setUniversityFiscalPeriodCode(universityRunDate.getUniversityFiscalAccountingPeriod());
    } else {
        workingEntry.setUniversityFiscalYear(originEntry.getUniversityFiscalYear());
    }
    SystemOptions originEntryOption = accountingCycleCachingService.getSystemOptions(workingEntry.getUniversityFiscalYear());
    if (originEntryOption == null) {
        return MessageBuilder.buildMessage(KFSKeyConstants.ERROR_UNIV_FISCAL_YR_NOT_FOUND, originEntry.getUniversityFiscalYear() + "", Message.TYPE_FATAL);
    }
    return null;
}
Also used : SystemOptions(org.kuali.kfs.sys.businessobject.SystemOptions)

Example 9 with SystemOptions

use of org.kuali.kfs.sys.businessobject.SystemOptions in project cu-kfs by CU-CommunityApps.

the class ConcurStandardAccountingExtractCollectorBatchBuilderTest method buildMockOptionsService.

protected OptionsService buildMockOptionsService() {
    return buildMockService(OptionsService.class, (service) -> {
        SystemOptions testOptions = new SystemOptions();
        testOptions.setActualFinancialBalanceTypeCd(BalanceTypeService.ACTUAL_BALANCE_TYPE);
        EasyMock.expect(service.getOptions(EasyMock.anyObject())).andStubReturn(testOptions);
    });
}
Also used : SystemOptions(org.kuali.kfs.sys.businessobject.SystemOptions)

Aggregations

SystemOptions (org.kuali.kfs.sys.businessobject.SystemOptions)9 Timestamp (java.sql.Timestamp)3 GeneralLedgerPendingEntry (org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntry)3 Message (org.kuali.kfs.sys.Message)2 CuBalanceDao (edu.cornell.kfs.gl.dataaccess.CuBalanceDao)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 A21SubAccount (org.kuali.kfs.coa.businessobject.A21SubAccount)1 BalanceType (org.kuali.kfs.coa.businessobject.BalanceType)1 OffsetDefinition (org.kuali.kfs.coa.businessobject.OffsetDefinition)1 ScrubberStep (org.kuali.kfs.gl.batch.ScrubberStep)1 OriginEntryFull (org.kuali.kfs.gl.businessobject.OriginEntryFull)1 ScrubberProcessTransactionError (org.kuali.kfs.gl.businessobject.ScrubberProcessTransactionError)1 Transaction (org.kuali.kfs.gl.businessobject.Transaction)1 InvalidFlexibleOffsetException (org.kuali.kfs.sys.exception.InvalidFlexibleOffsetException)1 OptionsService (org.kuali.kfs.sys.service.OptionsService)1 KfsParameterConstants (org.kuali.kfs.sys.service.impl.KfsParameterConstants)1 ParameterEvaluator (org.kuali.rice.core.api.parameter.ParameterEvaluator)1