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

java.lang.Object
  extended by org.kuali.kfs.gl.batch.service.impl.PosterServiceImpl
All Implemented Interfaces:
PosterService

@Transactional
public class PosterServiceImpl
extends Object
implements PosterService

The base implementation of PosterService


Field Summary
static BigDecimal BDONEHUNDRED
           
static String DATE_FORMAT_STRING
           
static DecimalFormat DFAMT
           
static DecimalFormat DFPCT
           
static org.kuali.rice.kns.util.KualiDecimal ONEHUNDRED
           
static org.kuali.rice.kns.util.KualiDecimal WARNING_MAX_DIFFERENCE
           
 
Fields inherited from interface org.kuali.kfs.gl.batch.service.PosterService
MODE_ENTRIES, MODE_ICR, MODE_REVERSAL
 
Constructor Summary
PosterServiceImpl()
           
 
Method Summary
protected  void addReporting(Map reporting, String destination, String operation)
          Increments a named count holding statistics about posted transactions
protected  void createOutputEntry(Transaction entry, PrintStream group)
           
protected  String determineIcrOffsetBalanceSheetObjectCodeNumber(OriginEntryInformation offsetEntry, ExpenditureTransaction et, IndirectCostRecoveryRateDetail icrRateDetail)
           
 void generateIcrTransactions()
          This step reads the expenditure table and uses the data to generate Indirect Cost Recovery transactions.
protected  void generateTransactions(ExpenditureTransaction et, IndirectCostRecoveryRateDetail icrRateDetail, org.kuali.rice.kns.util.KualiDecimal generatedTransactionAmount, Date runDate, PrintStream group, IndirectCostRecoveryGenerationMetadata icrGenerationMetadata)
          Generate a transfer transaction and an offset transaction
 AccountingCycleCachingService getAccountingCycleCachingService()
           
protected  org.kuali.rice.kns.service.BusinessObjectService getBusinessObjectService()
           
protected  String getChargeDescription(BigDecimal rate, String objectCode, String type, org.kuali.rice.kns.util.KualiDecimal amount)
          Generates the description of a charge
protected  org.kuali.rice.kns.service.DataDictionaryService getDataDictionaryService()
           
protected  String getOffsetDescription(BigDecimal rate, org.kuali.rice.kns.util.KualiDecimal amount, String chartOfAccountsCode, String accountNumber)
          Returns the description of a debit origin entry created by generateTransactions
protected  org.kuali.rice.kns.util.KualiDecimal getPercentage(org.kuali.rice.kns.util.KualiDecimal amount, BigDecimal percent)
          Generates a percent of a KualiDecimal amount (great for finding out how much of an origin entry should be recouped by indirect cost recovery)
 org.kuali.rice.kns.service.PersistenceStructureService getPersistenceStructureService()
          Gets the persistenceStructureService attribute.
 RunDateService getRunDateService()
           
protected  void postEntries(int mode, FileReader INPUT_GLE_FILE, PrintStream OUTPUT_GLE_FILE_ps, File OUTPUT_ERR_FILE)
          Actually post the entries.
 void postIcrEntries()
          Post ICR GL entries to GL tables.
 void postMainEntries()
          Post scrubbed GL entries to GL tables.
 void postReversalEntries()
          Post reversal GL entries to GL tables.
protected  boolean postTransaction(Transaction tran, int mode, Map<String,Integer> reportSummary, LedgerSummaryReport ledgerSummaryReport, PrintStream invalidGroup, UniversityDate runUniversityDate, String line, PrintStream OUTPUT_GLE_FILE_ps)
          Runs the given transaction through each transaction posting algorithms associated with this instance
protected  IndirectCostRecoveryGenerationMetadata retrieveAccountIndirectCostRecoveryMetadata(ExpenditureTransaction et)
           
protected  IndirectCostRecoveryGenerationMetadata retrieveSubAccountIndirectCostRecoveryMetadata(ExpenditureTransaction et)
          Returns ICR Generation Metadata based on SubAccount information if the SubAccount on the expenditure transaction is properly set up for ICR
 void setAccountingCycleCachingService(AccountingCycleCachingService accountingCycleCachingService)
           
 void setAccountingPeriodService(AccountingPeriodService aps)
           
 void setBatchFileDirectoryName(String batchFileDirectoryName)
           
 void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)
           
 void setConfigurationService(org.kuali.rice.kns.service.KualiConfigurationService configurationService)
           
 void setDataDictionaryService(org.kuali.rice.kns.service.DataDictionaryService dataDictionaryService)
           
 void setDateTimeService(org.kuali.rice.kns.service.DateTimeService dts)
          Sets the dateTimeAttribute of the service
 void setErrorListingReportWriterService(ReportWriterService errorListingReportWriterService)
           
 void setExpenditureTransactionDao(ExpenditureTransactionDao etd)
           
 void setFlexibleOffsetAccountService(FlexibleOffsetAccountService flexibleOffsetAccountService)
           
 void setIndirectCostRecoveryRateDetailDao(IndirectCostRecoveryRateDetailDao iaed)
           
 void setLedgerSummaryReportWriterService(ReportWriterService ledgerSummaryReportWriterService)
           
 void setObjectCodeService(ObjectCodeService ocs)
           
 void setOffsetDefinitionService(OffsetDefinitionService offsetDefinitionService)
           
 void setOriginEntryGroupService(OriginEntryGroupService oes)
           
 void setOriginEntryService(OriginEntryService oes)
           
 void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
           
 void setPersistenceStructureService(org.kuali.rice.kns.service.PersistenceStructureService persistenceStructureService)
           
 void setReportWriterService(ReportWriterService reportWriterService)
           
 void setReversalDao(ReversalDao red)
           
 void setReversalReportWriterService(ReportWriterService reversalReportWriterService)
           
 void setRunDateService(RunDateService runDateService)
           
 void setSubAccountService(SubAccountService subAccountService)
           
 void setTransactionPosters(List p)
           
 void setUniversityDateDao(UniversityDateDao udd)
           
 void setVerifyTransaction(VerifyTransaction vt)
           
protected  boolean shouldIgnoreExpenditureTransaction(ExpenditureTransaction et)
           
protected  void writeErrorEntry(String line, PrintStream invaliGroup)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WARNING_MAX_DIFFERENCE

public static final org.kuali.rice.kns.util.KualiDecimal WARNING_MAX_DIFFERENCE

DATE_FORMAT_STRING

public static final String DATE_FORMAT_STRING
See Also:
Constant Field Values

ONEHUNDRED

public static final org.kuali.rice.kns.util.KualiDecimal ONEHUNDRED

DFPCT

public static final DecimalFormat DFPCT

DFAMT

public static final DecimalFormat DFAMT

BDONEHUNDRED

public static final BigDecimal BDONEHUNDRED
Constructor Detail

PosterServiceImpl

public PosterServiceImpl()
Method Detail

postMainEntries

public void postMainEntries()
Post scrubbed GL entries to GL tables.

Specified by:
postMainEntries in interface PosterService

postReversalEntries

public void postReversalEntries()
Post reversal GL entries to GL tables.

Specified by:
postReversalEntries in interface PosterService

postIcrEntries

public void postIcrEntries()
Post ICR GL entries to GL tables.

Specified by:
postIcrEntries in interface PosterService

postEntries

protected void postEntries(int mode,
                           FileReader INPUT_GLE_FILE,
                           PrintStream OUTPUT_GLE_FILE_ps,
                           File OUTPUT_ERR_FILE)
                    throws FileNotFoundException
Actually post the entries. The mode variable decides which entries to post.

Parameters:
mode - the poster's current run mode
Throws:
FileNotFoundException

postTransaction

protected boolean postTransaction(Transaction tran,
                                  int mode,
                                  Map<String,Integer> reportSummary,
                                  LedgerSummaryReport ledgerSummaryReport,
                                  PrintStream invalidGroup,
                                  UniversityDate runUniversityDate,
                                  String line,
                                  PrintStream OUTPUT_GLE_FILE_ps)
Runs the given transaction through each transaction posting algorithms associated with this instance

Parameters:
tran - a transaction to post
mode - the mode the poster is running in
reportSummary - a Map of summary counts generated by the posting process
ledgerSummaryReport - for summary reporting
invalidGroup - the group to save invalid entries to
runUniversityDate - the university date of this poster run
line -
Returns:
whether the transaction was posted or not. Useful if calling class attempts to report on the transaction

generateIcrTransactions

public void generateIcrTransactions()
This step reads the expenditure table and uses the data to generate Indirect Cost Recovery transactions.

Specified by:
generateIcrTransactions in interface PosterService

generateTransactions

protected void generateTransactions(ExpenditureTransaction et,
                                    IndirectCostRecoveryRateDetail icrRateDetail,
                                    org.kuali.rice.kns.util.KualiDecimal generatedTransactionAmount,
                                    Date runDate,
                                    PrintStream group,
                                    IndirectCostRecoveryGenerationMetadata icrGenerationMetadata)
Generate a transfer transaction and an offset transaction

Parameters:
et - an expenditure transaction
icrEntry - the indirect cost recovery entry
generatedTransactionAmount - the amount of the transaction
runDate - the transaction date for the newly created origin entry
group - the group to save the origin entry to

retrieveSubAccountIndirectCostRecoveryMetadata

protected IndirectCostRecoveryGenerationMetadata retrieveSubAccountIndirectCostRecoveryMetadata(ExpenditureTransaction et)
Returns ICR Generation Metadata based on SubAccount information if the SubAccount on the expenditure transaction is properly set up for ICR

Parameters:
et -
reportErrors -
Returns:
null if the ET does not have a SubAccount properly set up for ICR

retrieveAccountIndirectCostRecoveryMetadata

protected IndirectCostRecoveryGenerationMetadata retrieveAccountIndirectCostRecoveryMetadata(ExpenditureTransaction et)

getPercentage

protected org.kuali.rice.kns.util.KualiDecimal getPercentage(org.kuali.rice.kns.util.KualiDecimal amount,
                                                             BigDecimal percent)
Generates a percent of a KualiDecimal amount (great for finding out how much of an origin entry should be recouped by indirect cost recovery)

Parameters:
amount - the original amount
percent - the percentage of that amount to calculate
Returns:
the percent of the amount

getChargeDescription

protected String getChargeDescription(BigDecimal rate,
                                      String objectCode,
                                      String type,
                                      org.kuali.rice.kns.util.KualiDecimal amount)
Generates the description of a charge

Parameters:
rate - the ICR rate for this entry
objectCode - the object code of this entry
type - the ICR type code of this entry's account
amount - the amount of this entry
Returns:
a description for the charge entry

getOffsetDescription

protected String getOffsetDescription(BigDecimal rate,
                                      org.kuali.rice.kns.util.KualiDecimal amount,
                                      String chartOfAccountsCode,
                                      String accountNumber)
Returns the description of a debit origin entry created by generateTransactions

Parameters:
rate - the ICR rate that relates to this entry
amount - the amount of this entry
chartOfAccountsCode - the chart codce of the debit entry
accountNumber - the account number of the debit entry
Returns:
a description for the debit entry

addReporting

protected void addReporting(Map reporting,
                            String destination,
                            String operation)
Increments a named count holding statistics about posted transactions

Parameters:
reporting - a Map of counts generated by this process
destination - the destination of a given transaction
operation - the operation being performed on the transaction

determineIcrOffsetBalanceSheetObjectCodeNumber

protected String determineIcrOffsetBalanceSheetObjectCodeNumber(OriginEntryInformation offsetEntry,
                                                                ExpenditureTransaction et,
                                                                IndirectCostRecoveryRateDetail icrRateDetail)

setVerifyTransaction

public void setVerifyTransaction(VerifyTransaction vt)

setTransactionPosters

public void setTransactionPosters(List p)

setOriginEntryService

public void setOriginEntryService(OriginEntryService oes)

setOriginEntryGroupService

public void setOriginEntryGroupService(OriginEntryGroupService oes)

setDateTimeService

public void setDateTimeService(org.kuali.rice.kns.service.DateTimeService dts)
Description copied from interface: PosterService
Sets the dateTimeAttribute of the service

Specified by:
setDateTimeService in interface PosterService
Parameters:
dts - the dateTimeService implementation to set

setReversalDao

public void setReversalDao(ReversalDao red)

setUniversityDateDao

public void setUniversityDateDao(UniversityDateDao udd)

setAccountingPeriodService

public void setAccountingPeriodService(AccountingPeriodService aps)

setExpenditureTransactionDao

public void setExpenditureTransactionDao(ExpenditureTransactionDao etd)

setIndirectCostRecoveryRateDetailDao

public void setIndirectCostRecoveryRateDetailDao(IndirectCostRecoveryRateDetailDao iaed)

setObjectCodeService

public void setObjectCodeService(ObjectCodeService ocs)

setConfigurationService

public void setConfigurationService(org.kuali.rice.kns.service.KualiConfigurationService configurationService)

setParameterService

public void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)

setFlexibleOffsetAccountService

public void setFlexibleOffsetAccountService(FlexibleOffsetAccountService flexibleOffsetAccountService)

getRunDateService

public RunDateService getRunDateService()

setRunDateService

public void setRunDateService(RunDateService runDateService)

createOutputEntry

protected void createOutputEntry(Transaction entry,
                                 PrintStream group)
                          throws IOException
Throws:
IOException

writeErrorEntry

protected void writeErrorEntry(String line,
                               PrintStream invaliGroup)
                        throws IOException
Throws:
IOException

getAccountingCycleCachingService

public AccountingCycleCachingService getAccountingCycleCachingService()

setAccountingCycleCachingService

public void setAccountingCycleCachingService(AccountingCycleCachingService accountingCycleCachingService)

setSubAccountService

public void setSubAccountService(SubAccountService subAccountService)

setOffsetDefinitionService

public void setOffsetDefinitionService(OffsetDefinitionService offsetDefinitionService)

getDataDictionaryService

protected org.kuali.rice.kns.service.DataDictionaryService getDataDictionaryService()

setDataDictionaryService

public void setDataDictionaryService(org.kuali.rice.kns.service.DataDictionaryService dataDictionaryService)

getBusinessObjectService

protected org.kuali.rice.kns.service.BusinessObjectService getBusinessObjectService()

setBusinessObjectService

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

shouldIgnoreExpenditureTransaction

protected boolean shouldIgnoreExpenditureTransaction(ExpenditureTransaction et)

setBatchFileDirectoryName

public void setBatchFileDirectoryName(String batchFileDirectoryName)

setPersistenceStructureService

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

getPersistenceStructureService

public org.kuali.rice.kns.service.PersistenceStructureService getPersistenceStructureService()
Gets the persistenceStructureService attribute.

Returns:
Returns the persistenceStructureService.

setReportWriterService

public void setReportWriterService(ReportWriterService reportWriterService)

setErrorListingReportWriterService

public void setErrorListingReportWriterService(ReportWriterService errorListingReportWriterService)

setReversalReportWriterService

public void setReversalReportWriterService(ReportWriterService reversalReportWriterService)

setLedgerSummaryReportWriterService

public void setLedgerSummaryReportWriterService(ReportWriterService ledgerSummaryReportWriterService)


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