use of org.kuali.kfs.gl.businessobject.TransientBalanceInquiryAttributes in project cu-kfs by CU-CommunityApps.
the class CurrentFundsLookupableHelperServiceImpl method buildCosolidatedCurrentFundsCollection.
/**
* Builds the current funds collection with consolidation option from an iterator
*
* @param iterator
* @param pendingEntryOption the selected pending entry option
* @return the consolidated current funds collection
*/
private Collection<AccountStatusCurrentFunds> buildCosolidatedCurrentFundsCollection(Collection collection, String pendingEntryOption) {
Collection<AccountStatusCurrentFunds> retval = new ArrayList<AccountStatusCurrentFunds>();
for (Object collectionEntry : collection) {
if (collectionEntry.getClass().isArray()) {
int i = 0;
Object[] array = (Object[]) collectionEntry;
AccountStatusCurrentFunds cf = new AccountStatusCurrentFunds();
LOG.debug("element length " + array.length);
for (Object element : array) {
LOG.debug("I found this element " + element);
}
if (AccountStatusCurrentFunds.class.isAssignableFrom(getBusinessObjectClass())) {
try {
cf = (AccountStatusCurrentFunds) getBusinessObjectClass().newInstance();
} catch (Exception e) {
LOG.warn("Using " + AccountStatusCurrentFunds.class + " for results because I couldn't instantiate the " + getBusinessObjectClass());
}
} else {
LOG.warn("Using " + AccountStatusCurrentFunds.class + " for results because I couldn't instantiate the " + getBusinessObjectClass());
}
cf.setUniversityFiscalYear(new Integer(array[i++].toString()));
cf.setChartOfAccountsCode(array[i++].toString());
cf.setAccountNumber(array[i++].toString());
String subAccountNumber = Constant.CONSOLIDATED_SUB_ACCOUNT_NUMBER;
cf.setSubAccountNumber(subAccountNumber);
cf.setBalanceTypeCode(array[i++].toString());
cf.setFinancialObjectCode(array[i++].toString());
cf.setEmplid(array[i++].toString());
cf.setPositionNumber(array[i++].toString());
cf.setFinancialSubObjectCode(Constant.CONSOLIDATED_SUB_OBJECT_CODE);
cf.setObjectTypeCode(Constant.CONSOLIDATED_OBJECT_TYPE_CODE);
cf.setAccountLineAnnualBalanceAmount(new KualiDecimal(array[i++].toString()));
cf.setBeginningBalanceLineAmount(new KualiDecimal(array[i++].toString()));
cf.setContractsGrantsBeginningBalanceAmount(new KualiDecimal(array[i++].toString()));
cf.setMonth1Amount(new KualiDecimal(array[i++].toString()));
cf.setDummyBusinessObject(new TransientBalanceInquiryAttributes());
cf.getDummyBusinessObject().setPendingEntryOption(pendingEntryOption);
cf.setOutstandingEncum(getOutstandingEncum(cf));
cf.getDummyBusinessObject().setPendingEntryOption(pendingEntryOption);
cf.getDummyBusinessObject().setConsolidationOption(Constant.CONSOLIDATION);
retval.add(cf);
}
}
return retval;
}
use of org.kuali.kfs.gl.businessobject.TransientBalanceInquiryAttributes in project cu-kfs by CU-CommunityApps.
the class CurrentFundsLookupableHelperServiceImpl method buildDetailedCurrentFundsCollection.
/**
* Builds the current funds collection with detail option from an iterator
*
* @param iterator the current funds iterator
* @param pendingEntryOption the selected pending entry option
* @return the detailed balance collection
*/
private Collection<AccountStatusCurrentFunds> buildDetailedCurrentFundsCollection(Collection collection, String pendingEntryOption) {
Collection<AccountStatusCurrentFunds> retval = new ArrayList<AccountStatusCurrentFunds>();
for (LedgerBalance balance : ((Collection<LedgerBalance>) collection)) {
AccountStatusCurrentFunds cf = new AccountStatusCurrentFunds();
ObjectUtil.buildObject(cf, balance);
cf.setDummyBusinessObject(new TransientBalanceInquiryAttributes());
cf.getDummyBusinessObject().setPendingEntryOption(pendingEntryOption);
cf.setOutstandingEncum(getOutstandingEncum(cf));
cf.getDummyBusinessObject().setPendingEntryOption(pendingEntryOption);
cf.getDummyBusinessObject().setConsolidationOption(Constant.DETAIL);
retval.add(cf);
}
return retval;
}
Aggregations