org.kuali.kfs.module.cam.batch.service.impl
Class AssetDepreciationServiceImpl

java.lang.Object
  extended by org.kuali.kfs.module.cam.batch.service.impl.AssetDepreciationServiceImpl
All Implemented Interfaces:
AssetDepreciationService

@Transactional
public class AssetDepreciationServiceImpl
extends Object
implements AssetDepreciationService

This class is a service that calculates the depreciation amount for each asset that has a eligible asset payment.

When an error occurs running this process, a pdf file will be created with the error message. However, this doesn't mean that this process automatically leaves all the records as they were right before running the program. If the process fails, is suggested to do the following before trying to run the process again: a.)Delete gl pending entry depreciation entries: DELETE FROM GL_PENDING_ENTRY_T WHERE FDOC_TYP_CD = 'DEPR' b.)Substract from the accumulated depreciation amount the depreciation calculated for the fiscal month that was ran, and then reset the depreciation amount field for the fiscal month that was ran. ex: Assuming that the fiscal month = 8 then: UPDATE CM_AST_PAYMENT_T SET AST_ACUM_DEPR1_AMT = AST_ACUM_DEPR1_AMT - AST_PRD8_DEPR1_AMT, AST_PRD8_DEPR1_AMT=0


Constructor Summary
AssetDepreciationServiceImpl()
           
 
Method Summary
protected  Map<String,AssetObjectCode> buildChartObjectToCapitalizationObjectMap()
          Builds map between object code to corresponding asset object code
protected  SortedMap<String,AssetDepreciationTransaction> calculateDepreciation(Collection<AssetPaymentInfo> depreciableAssetsCollection, Calendar depreciationDate)
          This method calculates the depreciation of each asset payment, creates the depreciation transactions that will be stored in the general ledger pending entry table
protected  String createNewDepreciationDocument()
           
 org.kuali.rice.kns.service.DataDictionaryService getDataDictionaryService()
           
 DepreciationBatchDao getDepreciationBatchDao()
          Gets the depreciationBatchDao attribute.
protected  ObjectCode getDepreciationObjectCode(Map<String,ObjectCode> capObjectCodesCache, AssetPaymentInfo assetPaymentInfo, String capitalizationFinancialObjectCode)
          Depreciation object code is returned from cache or from DB
protected  void populateDepreciationTransaction(AssetPaymentInfo assetPayment, String transactionType, String plantCOA, String plantAccount, ObjectCode deprObjectCode, SortedMap<String,AssetDepreciationTransaction> depreciationTransactionSummary)
          This method stores in a collection of business objects the depreciation transaction that later on will be passed to the processGeneralLedgerPendingEntry method in order to store the records in gl pending entry table
protected  void processGeneralLedgerPendingEntry(SortedMap<String,AssetDepreciationTransaction> trans)
          This method stores the depreciation transactions in the general pending entry table and creates a new documentHeader entry.
 void runDepreciation()
          This method runs depreciation process
 void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)
           
 void setCamsReportService(ReportService reportService)
           
 void setDataDictionaryService(org.kuali.rice.kns.service.DataDictionaryService dataDictionaryService)
           
 void setDateTimeService(org.kuali.rice.kns.service.DateTimeService dateTimeService)
           
 void setDepreciableAssetsDao(DepreciableAssetsDao depreciableAssetsDao)
           
 void setDepreciationBatchDao(DepreciationBatchDao depreciationBatchDao)
          Sets the depreciationBatchDao attribute value.
 void setGeneralLedgerPendingEntryService(GeneralLedgerPendingEntryService generalLedgerPendingEntryService)
           
 void setKualiConfigurationService(org.kuali.rice.kns.service.KualiConfigurationService kcs)
           
 void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
           
 void setUniversityDateDao(UniversityDateDao universityDateDao)
           
 void setWorkflowDocumentService(org.kuali.rice.kns.workflow.service.WorkflowDocumentService workflowDocumentService)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssetDepreciationServiceImpl

public AssetDepreciationServiceImpl()
Method Detail

runDepreciation

public void runDepreciation()
Description copied from interface: AssetDepreciationService
This method runs depreciation process

Specified by:
runDepreciation in interface AssetDepreciationService
See Also:
AssetDepreciationService.runDepreciation()

calculateDepreciation

protected SortedMap<String,AssetDepreciationTransaction> calculateDepreciation(Collection<AssetPaymentInfo> depreciableAssetsCollection,
                                                                               Calendar depreciationDate)
This method calculates the depreciation of each asset payment, creates the depreciation transactions that will be stored in the general ledger pending entry table

Parameters:
depreciableAssetsCollection - asset payments eligible for depreciation
Returns:
SortedMap with a list of depreciation transactions

populateDepreciationTransaction

protected void populateDepreciationTransaction(AssetPaymentInfo assetPayment,
                                               String transactionType,
                                               String plantCOA,
                                               String plantAccount,
                                               ObjectCode deprObjectCode,
                                               SortedMap<String,AssetDepreciationTransaction> depreciationTransactionSummary)
This method stores in a collection of business objects the depreciation transaction that later on will be passed to the processGeneralLedgerPendingEntry method in order to store the records in gl pending entry table

Parameters:
assetPayment - asset payment
transactionType - which can be [C]redit or [D]ebit
plantCOA - plant fund char of account code
plantAccount - plant fund char of account code
financialObject - char of account object code linked to the payment
depreciationTransactionSummary -

processGeneralLedgerPendingEntry

protected void processGeneralLedgerPendingEntry(SortedMap<String,AssetDepreciationTransaction> trans)
This method stores the depreciation transactions in the general pending entry table and creates a new documentHeader entry.

Parameters:
trans - SortedMap with the transactions

createNewDepreciationDocument

protected String createNewDepreciationDocument()
                                        throws org.kuali.rice.kew.exception.WorkflowException
Throws:
org.kuali.rice.kew.exception.WorkflowException

getDepreciationObjectCode

protected ObjectCode getDepreciationObjectCode(Map<String,ObjectCode> capObjectCodesCache,
                                               AssetPaymentInfo assetPaymentInfo,
                                               String capitalizationFinancialObjectCode)
Depreciation object code is returned from cache or from DB

Parameters:
capitalizationObjectCodes - collection cache
assetPaymentInfo -
capitalizationFinancialObjectCode -
Returns:

buildChartObjectToCapitalizationObjectMap

protected Map<String,AssetObjectCode> buildChartObjectToCapitalizationObjectMap()
Builds map between object code to corresponding asset object code

Returns:
Map

setParameterService

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

setDepreciableAssetsDao

public void setDepreciableAssetsDao(DepreciableAssetsDao depreciableAssetsDao)

setCamsReportService

public void setCamsReportService(ReportService reportService)

setKualiConfigurationService

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

setGeneralLedgerPendingEntryService

public void setGeneralLedgerPendingEntryService(GeneralLedgerPendingEntryService generalLedgerPendingEntryService)

setDateTimeService

public void setDateTimeService(org.kuali.rice.kns.service.DateTimeService dateTimeService)

setUniversityDateDao

public void setUniversityDateDao(UniversityDateDao universityDateDao)

setBusinessObjectService

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

setWorkflowDocumentService

public void setWorkflowDocumentService(org.kuali.rice.kns.workflow.service.WorkflowDocumentService workflowDocumentService)

getDataDictionaryService

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

setDataDictionaryService

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

getDepreciationBatchDao

public DepreciationBatchDao getDepreciationBatchDao()
Gets the depreciationBatchDao attribute.

Returns:
Returns the depreciationBatchDao.

setDepreciationBatchDao

public void setDepreciationBatchDao(DepreciationBatchDao depreciationBatchDao)
Sets the depreciationBatchDao attribute value.

Specified by:
setDepreciationBatchDao in interface AssetDepreciationService
Parameters:
depreciationBatchDao - The depreciationBatchDao to set.


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