Search in sources :

Example 11 with AccountReversion

use of edu.cornell.kfs.coa.businessobject.AccountReversion in project cu-kfs by CU-CommunityApps.

the class AccountReversionTrickleDownInactivationServiceImpl method createAccountReversionChunk.

/**
 * Creates a String for the given account reversions.
 *
 * @param listOfAccountReversions
 * @param startIndex
 * @param endIndex
 * @return
 */
protected String createAccountReversionChunk(List<AccountReversion> listOfAccountReversions, int startIndex, int endIndex) {
    StringBuilder buf = new StringBuilder();
    for (int i = startIndex; i < endIndex && i < listOfAccountReversions.size(); i++) {
        AccountReversion accountReversion = listOfAccountReversions.get(i);
        buf.append(accountReversion.getUniversityFiscalYear()).append(" - ").append(accountReversion.getChartOfAccountsCode()).append(" - ").append(accountReversion.getAccountNumber());
        if (i + 1 < endIndex && i + 1 < listOfAccountReversions.size()) {
            buf.append(", ");
        }
    }
    return buf.toString();
}
Also used : AccountReversion(edu.cornell.kfs.coa.businessobject.AccountReversion)

Example 12 with AccountReversion

use of edu.cornell.kfs.coa.businessobject.AccountReversion in project cu-kfs by CU-CommunityApps.

the class AccountReversionImportServiceImplTest method testImportAccountReversions.

public void testImportAccountReversions() {
    accountReversionImportService.importAccountReversions(dataFileSrc);
    Map<String, String> pks = new HashMap<String, String>();
    pks.put("universityFiscalYear", accountReversion.getUniversityFiscalYear().toString());
    pks.put("chartOfAccountsCode", accountReversion.getChartOfAccountsCode());
    pks.put("accountNumber", accountReversion.getAccountNumber());
    AccountReversion accountReversionDB = businessObjectService.findByPrimaryKey(AccountReversion.class, pks);
    assertTrue(ObjectUtils.isNotNull(accountReversionDB));
    assertEquals(accountReversion.getBudgetReversionChartOfAccountsCode(), accountReversionDB.getBudgetReversionChartOfAccountsCode());
    assertEquals(accountReversion.getBudgetReversionAccountNumber(), accountReversionDB.getBudgetReversionAccountNumber());
    assertEquals(accountReversion.getCashReversionFinancialChartOfAccountsCode(), accountReversionDB.getCashReversionFinancialChartOfAccountsCode());
    assertEquals(accountReversion.getCashReversionChartCashObjectCode(), accountReversionDB.getCashReversionChartCashObjectCode());
    assertEquals(accountReversion.getCashReversionAccountNumber(), accountReversionDB.getCashReversionAccountNumber());
    assertEquals(accountReversion.isCarryForwardByObjectCodeIndicator(), accountReversionDB.isCarryForwardByObjectCodeIndicator());
}
Also used : AccountReversion(edu.cornell.kfs.coa.businessobject.AccountReversion) HashMap(java.util.HashMap)

Aggregations

AccountReversion (edu.cornell.kfs.coa.businessobject.AccountReversion)12 HashMap (java.util.HashMap)4 AccountReversionDetail (edu.cornell.kfs.coa.businessobject.AccountReversionDetail)3 AccountReversionService (edu.cornell.kfs.coa.service.AccountReversionService)3 ReversionCategory (edu.cornell.kfs.coa.businessobject.ReversionCategory)2 ArrayList (java.util.ArrayList)2 Maintainable (org.kuali.kfs.kns.maintenance.Maintainable)2 MaintenanceLock (org.kuali.kfs.krad.maintenance.MaintenanceLock)2 CSVReader (au.com.bytecode.opencsv.CSVReader)1 FileReader (java.io.FileReader)1 Map (java.util.Map)1 Criteria (org.apache.ojb.broker.query.Criteria)1 QueryByCriteria (org.apache.ojb.broker.query.QueryByCriteria)1 Account (org.kuali.kfs.coa.businessobject.Account)1 Note (org.kuali.kfs.krad.bo.Note)1 BusinessObjectService (org.kuali.kfs.krad.service.BusinessObjectService)1