org.kuali.kfs.gl.service.impl
Class SufficientFundsServiceImpl

java.lang.Object
  extended by org.kuali.kfs.gl.service.impl.SufficientFundsServiceImpl
All Implemented Interfaces:
SufficientFundsService, SufficientFundsServiceConstants

@Transactional
public class SufficientFundsServiceImpl
extends Object
implements SufficientFundsService, SufficientFundsServiceConstants

The base implementation of SufficientFundsService


Nested Class Summary
protected  class SufficientFundsServiceImpl.PendingAmounts
          An inner class to hold summary totals of pending ledger entry amounts
 
Field Summary
 
Fields inherited from interface org.kuali.kfs.gl.service.SufficientFundsServiceConstants
KUALI_TRANSACTION_PROCESSING_SUFFICIENT_FUNDS_SECURITY_GROUPING, SUFFICIENT_FUNDS_OBJECT_CODE_CASH_IN_BANK, SUFFICIENT_FUNDS_OBJECT_CODE_SPECIALS
 
Constructor Summary
SufficientFundsServiceImpl()
          Default constructor
 
Method Summary
 List<SufficientFundsItem> checkSufficientFunds(GeneralLedgerPostingDocument document)
          Checks for sufficient funds on a single document
 List<SufficientFundsItem> checkSufficientFunds(List<? extends Transaction> transactions)
          Checks for sufficient funds on a list of transactions
protected  SufficientFundsServiceImpl.PendingAmounts getPendingBalanceAmount(SufficientFundsItem item)
          Totals the amounts of actual, encumbrance, and budget amounts from related pending entries
protected  SufficientFundsServiceImpl.PendingAmounts getPriorYearSufficientFundsBalanceAmount(SufficientFundsItem item)
          Given a sufficient funds item to check, gets the prior year sufficient funds balance to check against
 String getSufficientFundsObjectCode(ObjectCode financialObject, String accountSufficientFundsCode)
          This operation derives the acct_sf_finobj_cd which is used to populate the General Ledger Pending entry table, so that later we can do Suff Fund checking against that entry
protected  boolean hasSufficientFundsOnItem(SufficientFundsItem item)
          Given a sufficient funds item record, determines if there are sufficient funds available for the transaction
protected  boolean isYearEndDocument(Class documentClass)
          checks to see if a document is a YearEndDocument
 void purgeYearByChart(String chart, int year)
          Purge the sufficient funds balance table by year/chart
 void setAccountService(AccountService accountService)
           
 void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)
           
 void setGeneralLedgerPendingEntryService(GeneralLedgerPendingEntryService generalLedgerPendingEntryService)
           
 void setKualiConfigurationService(org.kuali.rice.kns.service.KualiConfigurationService kualiConfigurationService)
           
 void setObjectLevelService(ObjectLevelService objectLevelService)
           
 void setOptionsService(OptionsService optionsService)
           
 void setSufficientFundBalancesDao(SufficientFundBalancesDao sufficientFundBalancesDao)
           
 void setSufficientFundsDao(SufficientFundsDao sufficientFundsDao)
           
protected  List<SufficientFundsItem> summarizeTransactions(List<? extends Transaction> transactions)
          For each transaction, fetches the appropriate sufficient funds item to check against
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SufficientFundsServiceImpl

public SufficientFundsServiceImpl()
Default constructor

Method Detail

getSufficientFundsObjectCode

public String getSufficientFundsObjectCode(ObjectCode financialObject,
                                           String accountSufficientFundsCode)
This operation derives the acct_sf_finobj_cd which is used to populate the General Ledger Pending entry table, so that later we can do Suff Fund checking against that entry

Specified by:
getSufficientFundsObjectCode in interface SufficientFundsService
Parameters:
financialObject - the object code being checked against
accountSufficientFundsCode - the kind of sufficient funds checking turned on in this system
Returns:
the object code that should be used for the sufficient funds inquiry, or a blank String
See Also:
SufficientFundsService.getSufficientFundsObjectCode(org.kuali.kfs.coa.businessobject.ObjectCode, java.lang.String)

checkSufficientFunds

public List<SufficientFundsItem> checkSufficientFunds(GeneralLedgerPostingDocument document)
Checks for sufficient funds on a single document

Specified by:
checkSufficientFunds in interface SufficientFundsService
Parameters:
document - document to check
Returns:
Empty List if has sufficient funds for all accounts, List of SufficientFundsItem if not
See Also:
org.kuali.kfs.gl.service.SufficientFundsService#checkSufficientFunds(org.kuali.rice.kns.document.FinancialDocument)

isYearEndDocument

protected boolean isYearEndDocument(Class documentClass)
checks to see if a document is a YearEndDocument

Parameters:
documentClass - the class of a Document to check
Returns:
true if the class implements YearEndDocument

checkSufficientFunds

public List<SufficientFundsItem> checkSufficientFunds(List<? extends Transaction> transactions)
Checks for sufficient funds on a list of transactions

Specified by:
checkSufficientFunds in interface SufficientFundsService
Parameters:
transactions - list of transactions
Returns:
Empty List if has sufficient funds for all accounts, List of SufficientFundsItem if not
See Also:
SufficientFundsService.checkSufficientFunds(java.util.List)

summarizeTransactions

protected List<SufficientFundsItem> summarizeTransactions(List<? extends Transaction> transactions)
For each transaction, fetches the appropriate sufficient funds item to check against

Parameters:
transactions - a list of Transactions
Returns:
a List of corresponding SufficientFundsItem

hasSufficientFundsOnItem

protected boolean hasSufficientFundsOnItem(SufficientFundsItem item)
Given a sufficient funds item record, determines if there are sufficient funds available for the transaction

Parameters:
item - the item to check
Returns:
true if there are sufficient funds available, false otherwise

getPriorYearSufficientFundsBalanceAmount

protected SufficientFundsServiceImpl.PendingAmounts getPriorYearSufficientFundsBalanceAmount(SufficientFundsItem item)
Given a sufficient funds item to check, gets the prior year sufficient funds balance to check against

Parameters:
item - the sufficient funds item to check against
Returns:
a PendingAmounts record with the pending budget and encumbrance

getPendingBalanceAmount

protected SufficientFundsServiceImpl.PendingAmounts getPendingBalanceAmount(SufficientFundsItem item)
Totals the amounts of actual, encumbrance, and budget amounts from related pending entries

Parameters:
item - a sufficient funds item to find pending amounts for
Returns:
the totals encapsulated in a PendingAmounts object

purgeYearByChart

public void purgeYearByChart(String chart,
                             int year)
Purge the sufficient funds balance table by year/chart

Specified by:
purgeYearByChart in interface SufficientFundsService
Parameters:
chart - the chart of sufficient fund balances to purge
year - the fiscal year of sufficient fund balances to purge

setAccountService

public void setAccountService(AccountService accountService)

setGeneralLedgerPendingEntryService

public void setGeneralLedgerPendingEntryService(GeneralLedgerPendingEntryService generalLedgerPendingEntryService)

setKualiConfigurationService

public void setKualiConfigurationService(org.kuali.rice.kns.service.KualiConfigurationService kualiConfigurationService)

setObjectLevelService

public void setObjectLevelService(ObjectLevelService objectLevelService)

setOptionsService

public void setOptionsService(OptionsService optionsService)

setSufficientFundBalancesDao

public void setSufficientFundBalancesDao(SufficientFundBalancesDao sufficientFundBalancesDao)

setSufficientFundsDao

public void setSufficientFundsDao(SufficientFundsDao sufficientFundsDao)

setBusinessObjectService

public void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.