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

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

@Transactional
public class IncomeDistributionForPooledFundServiceImpl
extends Object
implements IncomeDistributionForPooledFundService


Field Summary
protected  org.kuali.rice.kns.service.BusinessObjectService businessObjectService
           
protected  org.kuali.rice.kns.service.DocumentService documentService
           
protected  HoldingTaxLotService holdingTaxLotService
           
protected  IncomeDistributionForPooledFundDao incomeDistributionForPooledFundDao
           
protected  ReportWriterService incomeDistributionForPooledFundExceptionReportWriterService
           
protected  ReportWriterService incomeDistributionForPooledFundTotalReportWriterService
           
protected  KEMService kemService
           
protected  org.kuali.rice.kns.service.KualiRuleService kualiRuleService
           
protected static org.apache.log4j.Logger LOG
           
protected  org.kuali.rice.kns.service.ParameterService parameterService
           
protected  PooledFundValueService pooledFundValueService
           
 
Constructor Summary
IncomeDistributionForPooledFundServiceImpl()
           
 
Method Summary
protected  void addSecurityDetailToECI(CashIncreaseDocument cashIncreaseDocument, String typeCode, String securityId, String registrationCode)
          Adds security to ECI
protected  void addSecurityDetailToECT(CashTransferDocument cashTransferDocument, String securityId, String registrationCode)
          Adds security to ECT
protected  void addTransactionLinesToECI(CashIncreaseDocument cashIncreaseDocument, List<CashTransferDocument> cashTransferDocumentList, List<HoldingTaxLot> holdingTaxLotList, Date effectiveDate)
          Adds transaction lines and create ECT if necessary
protected  void addTransactionLinesToECT(List<CashTransferDocument> cashTransferDocumentList, CashTransferDocument cashTransferDocument, HoldingTaxLot holdingTaxLot, List<KemidPayoutInstruction> kemidPayoutInstructionList, org.kuali.rice.kns.util.KualiDecimal toalTransactionAmount)
          Adds transaction lines to ECT
protected  boolean createECI(String securityId, Date effectiveDate, String registrationCode, List<HoldingTaxLot> holdingTaxLotList)
          Creates an ECI per security id and registration code
protected  CashTransferDocument createECT(HoldingTaxLot holdingTaxLot, org.kuali.rice.kns.util.KualiDecimal transactionAmount, List<CashTransferDocument> cashTransferDocumentList, List<KemidPayoutInstruction> kemidPayoutInstructionList)
          Creates ECT
 boolean createIncomeDistributionForPooledFund()
          This batch creates pooled fund distribution transactions
protected  org.kuali.rice.kns.util.KualiDecimal getTransactionAmount(List<HoldingTaxLot> holdingTaxLotList, Date effectiveDate)
          Calculates the total of holding units * distribution amount
protected  void groupHoldingTaxLot(List<HoldingTaxLot> holdingTaxLotList, Map<String,Map<String,List<HoldingTaxLot>>> kemidMap)
          Groups holdingTaxLotList by kemid and incomePrincipalIndicator where the value of holding units > 0
protected
<C extends EndowmentSecurityDetailsDocumentBase>
C
initializeCashDocument(String documentType, int counter)
          Initialize a cash document.
protected  void initializeReports(String documentType)
          Initialize reports
 boolean isNoRoute(String paramNoRouteInd)
          checks no route indicator
protected  void prepareTotalReport(org.kuali.rice.kns.util.KualiDecimal transactionAmount, org.kuali.rice.kns.util.KualiDecimal units)
          Adds income and units
protected
<C extends EndowmentSecurityDetailsDocumentBase>
void
resetExceptionlReport(C cashDocument)
          Resets the exception report
protected
<C extends EndowmentSecurityDetailsDocumentBase>
void
resetTotalReport(C cashDocument)
          Resets the total report
 void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)
          Sets the businessObjectService attribute value.
 void setDocumentService(org.kuali.rice.kns.service.DocumentService documentService)
          Sets the documentService attribute value.
protected  void setDocumentTypeForReport(String documentType)
          Set the document type to reports
 void setHoldingTaxLotService(HoldingTaxLotService holdingTaxLotService)
          Sets the holdingTaxLotService attribute value.
 void setIncomeDistributionForPooledFundDao(IncomeDistributionForPooledFundDao incomeDistributionForPooledFundDao)
          Sets the incomeDistributionForPooledFundDao attribute value.
 void setIncomeDistributionForPooledFundExceptionReportWriterService(ReportWriterService incomeDistributionForPooledFundExceptionReportWriterService)
          Sets the incomeDistributionForPooledFundExceptionReportWriterService attribute value.
 void setIncomeDistributionForPooledFundTotalReportWriterService(ReportWriterService incomeDistributionForPooledFundTotalReportWriterService)
          Sets the incomeDistributionForPooledFundTotalReportWriterService attribute value.
 void setKemService(KEMService kemService)
          Sets the kemService attribute value.
 void setKualiRuleService(org.kuali.rice.kns.service.KualiRuleService kualiRuleService)
          Sets the kualiRuleService attribute value.
 void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
          Sets the parameterService attribute value.
 void setPooledFundValueService(PooledFundValueService pooledFundValueService)
          Sets the pooledFundValueService attribute value.
protected
<T extends EndowmentSecurityDetailsDocumentBase>
void
submitCashDocument(T cashDocument, String documentType, String noRouteInd)
          Submits Cash document
protected  boolean validateECI(CashIncreaseDocument cashIncreaseDocument)
          validates the ECI business rules
protected  boolean validateECT(CashTransferDocument cashTransferDocument)
          validates the ECT business rules
protected
<C extends EndowmentSecurityDetailsDocumentBase,T extends EndowmentTransactionLineBase>
boolean
validateTransactionLine(C cashDocument, T endowmentTransactionLine, String trnsactionPropertyName)
          Validates Cash Transaction line
protected  void writeExceptionReport(String kemid, org.kuali.rice.kns.util.KualiDecimal transactionAmount, org.kuali.rice.kns.util.KualiDecimal units)
          Write exception errors
protected
<T extends EndowmentSecurityDetailsDocumentBase>
void
writeSubmitError(T cashDocument, String documentType)
          Write errors that occur during the submission
protected  void writeValidationErrorReason()
          Writes the validation errors
 
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

businessObjectService

protected org.kuali.rice.kns.service.BusinessObjectService businessObjectService

documentService

protected org.kuali.rice.kns.service.DocumentService documentService

parameterService

protected org.kuali.rice.kns.service.ParameterService parameterService

kualiRuleService

protected org.kuali.rice.kns.service.KualiRuleService kualiRuleService

kemService

protected KEMService kemService

holdingTaxLotService

protected HoldingTaxLotService holdingTaxLotService

pooledFundValueService

protected PooledFundValueService pooledFundValueService

incomeDistributionForPooledFundDao

protected IncomeDistributionForPooledFundDao incomeDistributionForPooledFundDao

incomeDistributionForPooledFundExceptionReportWriterService

protected ReportWriterService incomeDistributionForPooledFundExceptionReportWriterService

incomeDistributionForPooledFundTotalReportWriterService

protected ReportWriterService incomeDistributionForPooledFundTotalReportWriterService
Constructor Detail

IncomeDistributionForPooledFundServiceImpl

public IncomeDistributionForPooledFundServiceImpl()
Method Detail

createIncomeDistributionForPooledFund

public boolean createIncomeDistributionForPooledFund()
This batch creates pooled fund distribution transactions

Specified by:
createIncomeDistributionForPooledFund in interface IncomeDistributionForPooledFundService
Returns:
boolean
See Also:
IncomeDistributionForPooledFundService.createIncomeDistributionForPooledFund()

createECI

protected boolean createECI(String securityId,
                            Date effectiveDate,
                            String registrationCode,
                            List<HoldingTaxLot> holdingTaxLotList)
Creates an ECI per security id and registration code

Parameters:
securityId -
registrationCode -
holdingTaxLotList -

addTransactionLinesToECI

protected void addTransactionLinesToECI(CashIncreaseDocument cashIncreaseDocument,
                                        List<CashTransferDocument> cashTransferDocumentList,
                                        List<HoldingTaxLot> holdingTaxLotList,
                                        Date effectiveDate)
Adds transaction lines and create ECT if necessary

Parameters:
cashIncreaseDocument -
cashTransferDocumentList -
holdingTaxLotList -

createECT

protected CashTransferDocument createECT(HoldingTaxLot holdingTaxLot,
                                         org.kuali.rice.kns.util.KualiDecimal transactionAmount,
                                         List<CashTransferDocument> cashTransferDocumentList,
                                         List<KemidPayoutInstruction> kemidPayoutInstructionList)
Creates ECT

Parameters:
holdingTaxLot -
transactionAmount -
cashTransferDocumentList -

addTransactionLinesToECT

protected void addTransactionLinesToECT(List<CashTransferDocument> cashTransferDocumentList,
                                        CashTransferDocument cashTransferDocument,
                                        HoldingTaxLot holdingTaxLot,
                                        List<KemidPayoutInstruction> kemidPayoutInstructionList,
                                        org.kuali.rice.kns.util.KualiDecimal toalTransactionAmount)
Adds transaction lines to ECT

Parameters:
cashTransferDocumentList -
cashTransferDocument -
holdingTaxLot -
kemidPayoutInstructionList -
toalTransactionAmount -

getTransactionAmount

protected org.kuali.rice.kns.util.KualiDecimal getTransactionAmount(List<HoldingTaxLot> holdingTaxLotList,
                                                                    Date effectiveDate)
Calculates the total of holding units * distribution amount

Parameters:
holdingTaxLotList -
Returns:
KualiDecimal(totalTransactionAmount)

addSecurityDetailToECI

protected void addSecurityDetailToECI(CashIncreaseDocument cashIncreaseDocument,
                                      String typeCode,
                                      String securityId,
                                      String registrationCode)
Adds security to ECI

Parameters:
cashIncreaseDocument -
typeCode -
securityId -
registrationCode -

addSecurityDetailToECT

protected void addSecurityDetailToECT(CashTransferDocument cashTransferDocument,
                                      String securityId,
                                      String registrationCode)
Adds security to ECT

Parameters:
cashTransferDocument -
typeCode -
securityId -
registrationCode -

initializeCashDocument

protected <C extends EndowmentSecurityDetailsDocumentBase> C initializeCashDocument(String documentType,
                                                                                    int counter)
Initialize a cash document. If fails, try as many times as EndowConstants.MAXMUM_NUMBER_OF_EDOC_INITILIZATION_TRY.

Type Parameters:
C -
Parameters:
documentType -
counter -
Returns:

submitCashDocument

protected <T extends EndowmentSecurityDetailsDocumentBase> void submitCashDocument(T cashDocument,
                                                                                   String documentType,
                                                                                   String noRouteInd)
Submits Cash document

Type Parameters:
T -
Parameters:
cashDocument -

groupHoldingTaxLot

protected void groupHoldingTaxLot(List<HoldingTaxLot> holdingTaxLotList,
                                  Map<String,Map<String,List<HoldingTaxLot>>> kemidMap)
Groups holdingTaxLotList by kemid and incomePrincipalIndicator where the value of holding units > 0

Parameters:
holdingTaxLotList -
kemidMap -

validateTransactionLine

protected <C extends EndowmentSecurityDetailsDocumentBase,T extends EndowmentTransactionLineBase> boolean validateTransactionLine(C cashDocument,
                                                                                                                                  T endowmentTransactionLine,
                                                                                                                                  String trnsactionPropertyName)
Validates Cash Transaction line

Type Parameters:
C -
T -
Parameters:
cashDocument -
endowmentTransactionLine -
trnsactionPropertyName -
Returns:

validateECI

protected boolean validateECI(CashIncreaseDocument cashIncreaseDocument)
validates the ECI business rules

Parameters:
cashIncreaseDocument -
Returns:
boolean

validateECT

protected boolean validateECT(CashTransferDocument cashTransferDocument)
validates the ECT business rules

Parameters:
cashTransferDocument -
Returns:
boolean

isNoRoute

public boolean isNoRoute(String paramNoRouteInd)
checks no route indicator

Returns:
boolean

resetTotalReport

protected <C extends EndowmentSecurityDetailsDocumentBase> void resetTotalReport(C cashDocument)
Resets the total report

Type Parameters:
C -
Parameters:
cashDocument -

prepareTotalReport

protected void prepareTotalReport(org.kuali.rice.kns.util.KualiDecimal transactionAmount,
                                  org.kuali.rice.kns.util.KualiDecimal units)
Adds income and units

Parameters:
transactionAmount -
units -

resetExceptionlReport

protected <C extends EndowmentSecurityDetailsDocumentBase> void resetExceptionlReport(C cashDocument)
Resets the exception report

Type Parameters:
C -
Parameters:
cashDocument -

writeExceptionReport

protected void writeExceptionReport(String kemid,
                                    org.kuali.rice.kns.util.KualiDecimal transactionAmount,
                                    org.kuali.rice.kns.util.KualiDecimal units)
Write exception errors

Parameters:
kemid -
transactionAmount -
units -

initializeReports

protected void initializeReports(String documentType)
Initialize reports

Parameters:
documentType -
securityId -

setDocumentTypeForReport

protected void setDocumentTypeForReport(String documentType)
Set the document type to reports

Parameters:
documentType -

writeValidationErrorReason

protected void writeValidationErrorReason()
Writes the validation errors


writeSubmitError

protected <T extends EndowmentSecurityDetailsDocumentBase> void writeSubmitError(T cashDocument,
                                                                                 String documentType)
Write errors that occur during the submission

Type Parameters:
T -
Parameters:
cashDocument -
documentType -

setBusinessObjectService

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

Parameters:
businessObjectService - The businessObjectService to set.

setDocumentService

public void setDocumentService(org.kuali.rice.kns.service.DocumentService documentService)
Sets the documentService attribute value.

Parameters:
documentService - The documentService to set.

setParameterService

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

Parameters:
parameterService - The parameterService to set.

setKualiRuleService

public void setKualiRuleService(org.kuali.rice.kns.service.KualiRuleService kualiRuleService)
Sets the kualiRuleService attribute value.

Parameters:
kualiRuleService - The kualiRuleService to set.

setKemService

public void setKemService(KEMService kemService)
Sets the kemService attribute value.

Parameters:
kemService - The kemService to set.

setHoldingTaxLotService

public void setHoldingTaxLotService(HoldingTaxLotService holdingTaxLotService)
Sets the holdingTaxLotService attribute value.

Parameters:
holdingTaxLotService - The holdingTaxLotService to set.

setPooledFundValueService

public void setPooledFundValueService(PooledFundValueService pooledFundValueService)
Sets the pooledFundValueService attribute value.

Parameters:
pooledFundValueService - The pooledFundValueService to set.

setIncomeDistributionForPooledFundDao

public void setIncomeDistributionForPooledFundDao(IncomeDistributionForPooledFundDao incomeDistributionForPooledFundDao)
Sets the incomeDistributionForPooledFundDao attribute value.

Parameters:
incomeDistributionForPooledFundDao - The incomeDistributionForPooledFundDao to set.

setIncomeDistributionForPooledFundExceptionReportWriterService

public void setIncomeDistributionForPooledFundExceptionReportWriterService(ReportWriterService incomeDistributionForPooledFundExceptionReportWriterService)
Sets the incomeDistributionForPooledFundExceptionReportWriterService attribute value.

Parameters:
incomeDistributionForPooledFundExceptionReportWriterService - The incomeDistributionForPooledFundExceptionReportWriterService to set.

setIncomeDistributionForPooledFundTotalReportWriterService

public void setIncomeDistributionForPooledFundTotalReportWriterService(ReportWriterService incomeDistributionForPooledFundTotalReportWriterService)
Sets the incomeDistributionForPooledFundTotalReportWriterService attribute value.

Parameters:
incomeDistributionForPooledFundTotalReportWriterService - The incomeDistributionForPooledFundTotalReportWriterService to set.


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