org.kuali.kfs.gl.batch.service.impl
Class PostExpenditureTransaction

java.lang.Object
  extended by org.kuali.kfs.gl.batch.service.impl.PostExpenditureTransaction
All Implemented Interfaces:
IndirectCostRecoveryService, PostTransaction

@Transactional
public class PostExpenditureTransaction
extends Object
implements IndirectCostRecoveryService, PostTransaction

This implementation of PostTransaction creates ExpenditureTransactions, temporary records used for ICR generation


Constructor Summary
PostExpenditureTransaction()
          Creates a PostExpenditureTransaction instance
 
Method Summary
protected  boolean excludedByAccount(Account account, ObjectCode objectCode, boolean selfAndTopLevelOnly)
          Determine if the given account and object code have an exclusion by account associated which should prevent this transaction from posting an ExpenditureTransaction
protected  boolean excludedByType(String indirectCostRecoveryTypeCode, ObjectCode objectCode, boolean selfAndTopLevelOnly)
          Determines if there's an exclusion by type record existing for the given ICR type code and object code or object codes within the object code's reportsTo hierarchy
 String getDestinationName()
          The name of the destination for the post (ie, the database table name where resultant records will be posted)
 org.kuali.rice.kns.service.ParameterService getParameterService()
          Gets the parameterService attribute.
protected  ObjectCode getReportsToObjectCode(ObjectCode objectCode)
          Uses the caching DAO instead of regular OJB to find the reports-to object code
protected  boolean hasExclusionByAccount(Account account, ObjectCode objectCode)
          Determines if there's an exclusion by account record for the given account and object code
protected  boolean hasExclusionByType(String indirectCostRecoveryTypeCode, ObjectCode objectCode)
          Determines if the given object code and indirect cost recovery type code have an exclusion by type record associated with them
protected  boolean hasValidObjectCodeReportingHierarchy(ObjectCode objectCode)
          Determines if the given object code has a valid reports-to hierarchy
protected  boolean hasValidReportsToFields(ObjectCode objectCode)
          Determines if the given object code has all the fields it would need for a strong and healthy reports to hierarchy
 boolean isIcrTransaction(Transaction transaction, ReportWriterService reportWriterService)
          This will determine if this transaction is an ICR eligible transaction
 String post(Transaction t, int mode, Date postDate, ReportWriterService posterReportWriterService)
          If the transaction is a valid ICR transaction, posts an expenditure transaction record for the transaction
protected  String postTransaction(Transaction t, int mode)
          Actually posts the transaction to the appropriate expenditure transaction record
 void setAccountingCycleCachingService(AccountingCycleCachingService accountingCycleCachingService)
           
 void setIndirectCostRecoveryExclusionAccountDao(IndirectCostRecoveryExclusionAccountDao icrea)
           
 void setIndirectCostRecoveryExclusionTypeDao(IndirectCostRecoveryExclusionTypeDao icrea)
           
 void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
          Sets the parameterService attribute value.
 void setPersistenceStructureService(org.kuali.rice.kns.service.PersistenceStructureService persistenceStructureService)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PostExpenditureTransaction

public PostExpenditureTransaction()
Creates a PostExpenditureTransaction instance

Method Detail

setIndirectCostRecoveryExclusionAccountDao

public void setIndirectCostRecoveryExclusionAccountDao(IndirectCostRecoveryExclusionAccountDao icrea)

setIndirectCostRecoveryExclusionTypeDao

public void setIndirectCostRecoveryExclusionTypeDao(IndirectCostRecoveryExclusionTypeDao icrea)

isIcrTransaction

public boolean isIcrTransaction(Transaction transaction,
                                ReportWriterService reportWriterService)
This will determine if this transaction is an ICR eligible transaction

Specified by:
isIcrTransaction in interface IndirectCostRecoveryService
Parameters:
transaction - the transaction which is being determined to be ICR or not
objectType - the object type of the transaction
account - the account of the transaction
objectCode - the object code of the transaction
Returns:
true if the transaction is an ICR transaction and therefore should have an expenditure transaction created for it; false if otherwise

excludedByType

protected boolean excludedByType(String indirectCostRecoveryTypeCode,
                                 ObjectCode objectCode,
                                 boolean selfAndTopLevelOnly)
Determines if there's an exclusion by type record existing for the given ICR type code and object code or object codes within the object code's reportsTo hierarchy

Parameters:
indirectCostRecoveryTypeCode - the ICR type code to check
objectCode - the object code to check for, as well as check the reports-to hierarchy
selfAndTopLevelOnly - whether only the given object code and the top level object code should be checked
Returns:
true if the transaction with the given ICR type code and object code have an exclusion by type record, false otherwise

hasExclusionByType

protected boolean hasExclusionByType(String indirectCostRecoveryTypeCode,
                                     ObjectCode objectCode)
Determines if the given object code and indirect cost recovery type code have an exclusion by type record associated with them

Parameters:
indirectCostRecoveryTypeCode - the indirect cost recovery type code to check
objectCode - the object code to check
Returns:
true if there's an exclusion by type record for this type code and object code

excludedByAccount

protected boolean excludedByAccount(Account account,
                                    ObjectCode objectCode,
                                    boolean selfAndTopLevelOnly)
Determine if the given account and object code have an exclusion by account associated which should prevent this transaction from posting an ExpenditureTransaction

Parameters:
account - account to check
objectCode - object code to check
selfAndTopLevelOnly - if only the given object code and the top level object code should seek exclusion by account records or not
Returns:
true if the given account and object code have an associated exclusion by account, false otherwise

hasExclusionByAccount

protected boolean hasExclusionByAccount(Account account,
                                        ObjectCode objectCode)
Determines if there's an exclusion by account record for the given account and object code

Parameters:
account - the account to check
objectCode - the object code to check
Returns:
true if the given account and object code have an exclusion by account record, false otherwise

hasValidObjectCodeReportingHierarchy

protected boolean hasValidObjectCodeReportingHierarchy(ObjectCode objectCode)
Determines if the given object code has a valid reports-to hierarchy

Parameters:
objectCode - the object code to check
Returns:
true if the object code has a valid reports-to hierarchy with no nulls; false otherwise

hasValidReportsToFields

protected boolean hasValidReportsToFields(ObjectCode objectCode)
Determines if the given object code has all the fields it would need for a strong and healthy reports to hierarchy

Parameters:
objectCode - the object code to give a little check
Returns:
true if everything is good, false if the object code has a bad, rotted reports to hierarchy

getReportsToObjectCode

protected ObjectCode getReportsToObjectCode(ObjectCode objectCode)
Uses the caching DAO instead of regular OJB to find the reports-to object code

Parameters:
objectCode - the object code to get the reporter of
Returns:
the reports to object code, or, if that is impossible, null

post

public String post(Transaction t,
                   int mode,
                   Date postDate,
                   ReportWriterService posterReportWriterService)
If the transaction is a valid ICR transaction, posts an expenditure transaction record for the transaction

Specified by:
post in interface PostTransaction
Parameters:
t - the transaction which is being posted
mode - the mode the poster is currently running in
postDate - the date this transaction should post to
posterReportWriterService - the writer service where the poster is writing its report
Returns:
the accomplished post type
See Also:
org.kuali.kfs.gl.batch.service.PostTransaction#post(org.kuali.kfs.gl.businessobject.Transaction, int, java.util.Date)

postTransaction

protected String postTransaction(Transaction t,
                                 int mode)
Actually posts the transaction to the appropriate expenditure transaction record

Parameters:
t - the transaction to post
mode - the mode of the poster as it is currently running
Returns:
the accomplished post type

getDestinationName

public String getDestinationName()
Description copied from interface: PostTransaction
The name of the destination for the post (ie, the database table name where resultant records will be posted)

Specified by:
getDestinationName in interface PostTransaction
Returns:
name
See Also:
PostTransaction.getDestinationName()

setAccountingCycleCachingService

public void setAccountingCycleCachingService(AccountingCycleCachingService accountingCycleCachingService)

setPersistenceStructureService

public void setPersistenceStructureService(org.kuali.rice.kns.service.PersistenceStructureService persistenceStructureService)

getParameterService

public org.kuali.rice.kns.service.ParameterService getParameterService()
Gets the parameterService attribute.

Returns:
Returns the parameterService.

setParameterService

public void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
Sets the parameterService attribute value.

Parameters:
parameterService - The parameterService to set.


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