org.kuali.kfs.module.endow.batch.service.impl
Class AccrualProcessingServiceImpl

java.lang.Object
  extended by org.kuali.kfs.module.endow.batch.service.impl.AccrualProcessingServiceImpl
All Implemented Interfaces:
AccrualProcessingService

@Transactional
public class AccrualProcessingServiceImpl
extends Object
implements AccrualProcessingService


Field Summary
protected static org.apache.log4j.Logger LOG
           
 
Constructor Summary
AccrualProcessingServiceImpl()
           
 
Method Summary
protected  long getNumberOfDaysSinceLastDateIncomeWasPaid(String incomePayFrequency, Date nextIncomePayDate)
          Gets the number of days since the last date the income was paid based on a frequency code and the next payment date.
protected  List<Security> getSecuritiesToProcess()
          Gets all the securities for which the class code has an accrual method of Automated Cash Management, Time Deposits, Treasury Notes and Bonds or Dividends.
protected  void initializeTotalReportLine(String securityId, String accrualMethod)
          Creates a new AccrualsProcessingTotalReportLine.
protected  void processAccrualForAutomatedCashManagement(Security security)
          Processes the accrual for securities that have SEC_ACRL_MTHD equal to A.
protected  void processAccrualForDividends(Security security)
          Processes accruals for securities with SEC_ACRL_MTHD equal to D.
protected  void processAccrualForTimeDeposits(Security security)
          Processes accrual for securities with SEC_ACRL_MTHD equal to M.
protected  void processAccrualForTreasuryNotesAndBonds(Security security)
          Processes accrual for securities with SEC_ACRL_MTHD equal to T.
 boolean processAccruals()
           
 void setAccrualProcessingReportWriterService(ReportWriterService accrualProcessingReportWriterService)
          Sets the accrualProcessingReportWriterService.
 void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)
          Sets the businessObjectService.
 void setClassCodeService(ClassCodeService classCodeService)
          Sets the classCodeService.
 void setHoldingTaxLotService(HoldingTaxLotService holdingTaxLotService)
          Sets the holdingTaxLotService.
 void setKemService(KEMService kemService)
          Sets the kemService.
 void setSecurityService(SecurityService securityService)
          Sets the securityService.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static org.apache.log4j.Logger LOG
Constructor Detail

AccrualProcessingServiceImpl

public AccrualProcessingServiceImpl()
Method Detail

processAccruals

public boolean processAccruals()
Specified by:
processAccruals in interface AccrualProcessingService
See Also:
AccrualProcessingService.processAccruals()

getSecuritiesToProcess

protected List<Security> getSecuritiesToProcess()
Gets all the securities for which the class code has an accrual method of Automated Cash Management, Time Deposits, Treasury Notes and Bonds or Dividends.

Returns:
all securities that meet the criteria

processAccrualForAutomatedCashManagement

protected void processAccrualForAutomatedCashManagement(Security security)
Processes the accrual for securities that have SEC_ACRL_MTHD equal to A. Captures the END_SEC_T: SEC_RT for the security record. For each END_HLDG_TAX_LOT_T record for the security where the HLDG_UNITS are greater than zero calculates the accrual amount as (END_HLDG_TAX_LOT_T: HLDG_UNITS times END_SEC_T: SEC_RT) divided by the number of days in the calendar year (365 or 366) Add the calculated accrual amount to the value in END_HLDG_TAX_LOT_T: HLDG_ACCRD-INC_DUE.

Parameters:
security -

processAccrualForTimeDeposits

protected void processAccrualForTimeDeposits(Security security)
Processes accrual for securities with SEC_ACRL_MTHD equal to M. Capture the END_SEC_T: SEC_RT for the security record. For each END_HLDG_TAX_LOT_T record for the security where the HLDG_UNITS are greater than zero calculate the accrual amount as (END_HLDG_TAX_LOT_T: HLDG_UNITS times END_SEC_T: SEC_RT) divided by the number of days in the calendar year (365 or 366) Add the calculated accrual amount to the value in END_HLDG_TAX_LOT_T: HLDG_ACCRD-INC_DUE.

Parameters:
security -

processAccrualForTreasuryNotesAndBonds

protected void processAccrualForTreasuryNotesAndBonds(Security security)
Processes accrual for securities with SEC_ACRL_MTHD equal to T. From the END_SEC_T: record, 1. Capture the END_SEC_T: SEC_RT for the security record 2. Establish the calculation interval by counting the number of days between the last date income was paid until the next (END_SEC_T: SEC_INC_PAY_DT) using the frequency code for the security (END_SEC_T: SEC_INC_PAY_FREQ). For each END_HLDG_TAX_LOT_T record for the security where the HLDG_UNITS are greater than zero calculate the accrual amount as (END_HLDG_TAX_LOT_T: HLDG_UNITS) times [(END_SEC_T: SEC_RT) divided by 2) divided by the number of days in the calculation interval. Add the calculated accrual amount to the value in END_HLDG_TAX_LOT_T: HLDG_ACCRD-INC_DUE.

Parameters:
security -

getNumberOfDaysSinceLastDateIncomeWasPaid

protected long getNumberOfDaysSinceLastDateIncomeWasPaid(String incomePayFrequency,
                                                         Date nextIncomePayDate)
Gets the number of days since the last date the income was paid based on a frequency code and the next payment date.

Parameters:
frequencyCode -
nextIncomePayDate -
Returns:
number of days since the last date the income was paid

processAccrualForDividends

protected void processAccrualForDividends(Security security)
Processes accruals for securities with SEC_ACRL_MTHD equal to D. Select END_SEC_T: records where SEC_EX_DVDND_DT is equal to the current date. From the END_SEC_T: record, capture the SEC_DVDND_AMT. For each END_HLDG_TAX_LOT_T record for the security where the HLDG_UNITS are greater than zero calculate the accrual amount as (END_HLDG_TAX_LOT_T: HLDG_UNITS) times (END_SEC_T: SEC_DVDND_AMT). Add the calculated accrual amount to the value in END_HLDG_TAX_LOT_T: HLDG_ACCRD-INC_DUE.

Parameters:
security -

setClassCodeService

public void setClassCodeService(ClassCodeService classCodeService)
Sets the classCodeService.

Parameters:
classCodeService -

setHoldingTaxLotService

public void setHoldingTaxLotService(HoldingTaxLotService holdingTaxLotService)
Sets the holdingTaxLotService.

Parameters:
holdingTaxLotService -

setKemService

public void setKemService(KEMService kemService)
Sets the kemService.

Parameters:
kemService -

setBusinessObjectService

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

Parameters:
businessObjectService -

setSecurityService

public void setSecurityService(SecurityService securityService)
Sets the securityService.

Parameters:
securityService -

setAccrualProcessingReportWriterService

public void setAccrualProcessingReportWriterService(ReportWriterService accrualProcessingReportWriterService)
Sets the accrualProcessingReportWriterService.

Parameters:
accrualProcessingReportWriterService -

initializeTotalReportLine

protected void initializeTotalReportLine(String securityId,
                                         String accrualMethod)
Creates a new AccrualsProcessingTotalReportLine.

Parameters:
securityId -
accrualMethod -


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