org.kuali.kfs.module.cam.document.service.impl
Class AssetRetirementServiceImpl

java.lang.Object
  extended by org.kuali.kfs.module.cam.document.service.impl.AssetRetirementServiceImpl
All Implemented Interfaces:
AssetRetirementService

public class AssetRetirementServiceImpl
extends Object
implements AssetRetirementService


Nested Class Summary
protected static class AssetRetirementServiceImpl.AmountCategory
           
 
Constructor Summary
AssetRetirementServiceImpl()
           
 
Method Summary
 void createGLPostables(AssetRetirementGlobal assetRetirementGlobal, CamsGeneralLedgerPendingEntrySourceBase assetRetirementGlPoster)
          Creates GL Postables
protected  void createNewPostable(AssetRetirementServiceImpl.AmountCategory category, Asset asset, AssetPayment assetPayment, String documentNumber, Account plantAccount, List<GeneralLedgerPendingEntrySourceDetail> postables)
          This method creates one postable and sets the values.
 String generateCalculatedTotal(String salePrice, String handlingFeeAmount, String preventiveMaintenanceAmount)
          This method generates the calculatedTotal amount based on salePrice + handlingFeeAmount + preventiveMaintenanceAmount.
protected  List<GeneralLedgerPendingEntrySourceDetail> generateGlPostablesForOnePayment(String documentNumber, CamsGeneralLedgerPendingEntrySourceBase assetRetirementGlPoster, Asset asset, AssetPayment assetPayment)
          Generate a collection of Postables for each payment.
 Integer generateNewPaymentForTarget(Asset targetAsset, Asset sourceAsset, List<org.kuali.rice.kns.bo.PersistableBusinessObject> persistables, Integer maxSequenceNo, String currentDocumentNumber)
          This method generates new payments from sourceAsset for targetAsset.
 void generateOffsetPaymentsForEachSource(Asset sourceAsset, List<org.kuali.rice.kns.bo.PersistableBusinessObject> persistables, String currentDocumentNumber)
          This method generates offset payments for each sourceAsset.
protected  AssetObjectCode getAssetObjectCode(Asset asset, AssetPayment assetPayment)
           
 AssetObjectCodeService getAssetObjectCodeService()
           
 AssetPaymentService getAssetPaymentService()
           
 String getAssetRetirementReasonName(AssetRetirementGlobal assetRetirementGlobal)
           
 AssetService getAssetService()
           
 org.kuali.rice.kns.service.BusinessObjectService getBusinessObjectService()
           
 ObjectCode getOffsetFinancialObject(String chartOfAccountsCode)
          Get the offset Object Code.
 org.kuali.rice.kns.service.ParameterService getParameterService()
           
protected  Account getPlantFundAccount(Asset asset, AssetPayment payment)
          Get the corresponding Plant Fund Account object based on the payment's financialObjectSubTypeCode.
 UniversityDateService getUniversityDateService()
           
 boolean isAllowedRetireMultipleAssets(org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
          Check if the retirement reason code allows to retire multiple assets
 boolean isAssetRetiredByAuction(AssetRetirementGlobal assetRetirementGlobal)
           
 boolean isAssetRetiredByExternalTransferOrGift(AssetRetirementGlobal assetRetirementGlobal)
           
 boolean isAssetRetiredByMerged(AssetRetirementGlobal assetRetirementGlobal)
           
 boolean isAssetRetiredBySold(AssetRetirementGlobal assetRetirementGlobal)
           
 boolean isAssetRetiredByTheft(AssetRetirementGlobal assetRetirementGlobal)
           
 boolean isRetirementReasonCodeInGroup(String reasonCodeGroup, String reasonCode)
          Check if reasonCode is in reasonCodeGroup
 void setAssetObjectCodeService(AssetObjectCodeService assetObjectCodeService)
           
 void setAssetPaymentService(AssetPaymentService assetPaymentService)
           
 void setAssetService(AssetService assetService)
           
 void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)
           
 void setParameterService(org.kuali.rice.kns.service.ParameterService parameterService)
           
 void setUniversityDateService(UniversityDateService universityDateService)
           
protected  org.kuali.rice.kns.util.KualiDecimal toKualiDecimal(String amount)
          This method converts a String to a KualiDecimal via Double.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssetRetirementServiceImpl

public AssetRetirementServiceImpl()
Method Detail

getParameterService

public org.kuali.rice.kns.service.ParameterService getParameterService()

setParameterService

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

getAssetService

public AssetService getAssetService()

setAssetService

public void setAssetService(AssetService assetService)

getUniversityDateService

public UniversityDateService getUniversityDateService()

setUniversityDateService

public void setUniversityDateService(UniversityDateService universityDateService)

getAssetObjectCodeService

public AssetObjectCodeService getAssetObjectCodeService()

setAssetObjectCodeService

public void setAssetObjectCodeService(AssetObjectCodeService assetObjectCodeService)

getBusinessObjectService

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

setBusinessObjectService

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

getAssetPaymentService

public AssetPaymentService getAssetPaymentService()

setAssetPaymentService

public void setAssetPaymentService(AssetPaymentService assetPaymentService)

isAssetRetiredByAuction

public boolean isAssetRetiredByAuction(AssetRetirementGlobal assetRetirementGlobal)
Specified by:
isAssetRetiredByAuction in interface AssetRetirementService
See Also:
org.kuali.kfs.module.cam.document.service.AssetRetirementService#isAssetRetiredBySoldOrAuction(org.kuali.kfs.module.cam.businessobject.AssetRetirementGlobal)

isAssetRetiredBySold

public boolean isAssetRetiredBySold(AssetRetirementGlobal assetRetirementGlobal)
Specified by:
isAssetRetiredBySold in interface AssetRetirementService
See Also:
AssetRetirementService.isAssetRetiredBySold(org.kuali.kfs.module.cam.businessobject.AssetRetirementGlobal)

isAssetRetiredByExternalTransferOrGift

public boolean isAssetRetiredByExternalTransferOrGift(AssetRetirementGlobal assetRetirementGlobal)
Specified by:
isAssetRetiredByExternalTransferOrGift in interface AssetRetirementService
See Also:
AssetRetirementService.isAssetRetiredByExternalTransferOrGift(org.kuali.kfs.module.cam.businessobject.AssetRetirementGlobal)

isAssetRetiredByMerged

public boolean isAssetRetiredByMerged(AssetRetirementGlobal assetRetirementGlobal)
Specified by:
isAssetRetiredByMerged in interface AssetRetirementService
See Also:
AssetRetirementService.isAssetRetiredByMerged(org.kuali.kfs.module.cam.businessobject.AssetRetirementGlobal)

isAssetRetiredByTheft

public boolean isAssetRetiredByTheft(AssetRetirementGlobal assetRetirementGlobal)
Specified by:
isAssetRetiredByTheft in interface AssetRetirementService
See Also:
AssetRetirementService.isAssetRetiredByTheft(org.kuali.kfs.module.cam.businessobject.AssetRetirementGlobal)

getAssetRetirementReasonName

public String getAssetRetirementReasonName(AssetRetirementGlobal assetRetirementGlobal)
Specified by:
getAssetRetirementReasonName in interface AssetRetirementService
See Also:
AssetRetirementService.getAssetRetirementReasonName(org.kuali.kfs.module.cam.businessobject.AssetRetirementGlobal)

generateOffsetPaymentsForEachSource

public void generateOffsetPaymentsForEachSource(Asset sourceAsset,
                                                List<org.kuali.rice.kns.bo.PersistableBusinessObject> persistables,
                                                String currentDocumentNumber)
Description copied from interface: AssetRetirementService
This method generates offset payments for each sourceAsset.

Specified by:
generateOffsetPaymentsForEachSource in interface AssetRetirementService
See Also:
AssetRetirementService.generateOffsetPaymentsForEachSource(org.kuali.kfs.module.cam.businessobject.Asset, java.util.List, java.lang.String)

generateNewPaymentForTarget

public Integer generateNewPaymentForTarget(Asset targetAsset,
                                           Asset sourceAsset,
                                           List<org.kuali.rice.kns.bo.PersistableBusinessObject> persistables,
                                           Integer maxSequenceNo,
                                           String currentDocumentNumber)
Description copied from interface: AssetRetirementService
This method generates new payments from sourceAsset for targetAsset.

Specified by:
generateNewPaymentForTarget in interface AssetRetirementService
Returns:
See Also:
AssetRetirementService.generateNewPaymentForTarget(org.kuali.kfs.module.cam.businessobject.Asset, org.kuali.kfs.module.cam.businessobject.Asset, java.util.List, java.lang.Integer, java.lang.String)

isRetirementReasonCodeInGroup

public boolean isRetirementReasonCodeInGroup(String reasonCodeGroup,
                                             String reasonCode)
Description copied from interface: AssetRetirementService
Check if reasonCode is in reasonCodeGroup

Specified by:
isRetirementReasonCodeInGroup in interface AssetRetirementService
Returns:
See Also:
AssetRetirementService.isRetirementReasonCodeInGroup(java.lang.String, java.lang.String)

isAllowedRetireMultipleAssets

public boolean isAllowedRetireMultipleAssets(org.kuali.rice.kns.document.MaintenanceDocument maintenanceDocument)
Description copied from interface: AssetRetirementService
Check if the retirement reason code allows to retire multiple assets

Specified by:
isAllowedRetireMultipleAssets in interface AssetRetirementService
Returns:
See Also:
org.kuali.kfs.module.cam.document.service.AssetRetirementService#isAllowedRetireMultipleAssets(java.lang.String)

createGLPostables

public void createGLPostables(AssetRetirementGlobal assetRetirementGlobal,
                              CamsGeneralLedgerPendingEntrySourceBase assetRetirementGlPoster)
Description copied from interface: AssetRetirementService
Creates GL Postables

Specified by:
createGLPostables in interface AssetRetirementService
See Also:
org.kuali.kfs.module.cam.document.service.AssetRetirementService#createGLPostables(org.kuali.kfs.module.cam.businessobject.AssetRetirementGlobal, org.kuali.module.cams.gl.CamsGlPosterBase)

generateGlPostablesForOnePayment

protected List<GeneralLedgerPendingEntrySourceDetail> generateGlPostablesForOnePayment(String documentNumber,
                                                                                       CamsGeneralLedgerPendingEntrySourceBase assetRetirementGlPoster,
                                                                                       Asset asset,
                                                                                       AssetPayment assetPayment)
Generate a collection of Postables for each payment.

Parameters:
documentNumber -
assetRetirementGlPoster -
asset -
assetPayment -
Returns:

createNewPostable

protected void createNewPostable(AssetRetirementServiceImpl.AmountCategory category,
                                 Asset asset,
                                 AssetPayment assetPayment,
                                 String documentNumber,
                                 Account plantAccount,
                                 List<GeneralLedgerPendingEntrySourceDetail> postables)
This method creates one postable and sets the values.

Parameters:
category -
asset -
assetPayment -
documentNumber -
plantAccount -

getAssetObjectCode

protected AssetObjectCode getAssetObjectCode(Asset asset,
                                             AssetPayment assetPayment)

getOffsetFinancialObject

public ObjectCode getOffsetFinancialObject(String chartOfAccountsCode)
Get the offset Object Code.

Specified by:
getOffsetFinancialObject in interface AssetRetirementService
Parameters:
asset -
Returns:

getPlantFundAccount

protected Account getPlantFundAccount(Asset asset,
                                      AssetPayment payment)
Get the corresponding Plant Fund Account object based on the payment's financialObjectSubTypeCode.

Parameters:
asset -
payment -
Returns:

generateCalculatedTotal

public String generateCalculatedTotal(String salePrice,
                                      String handlingFeeAmount,
                                      String preventiveMaintenanceAmount)
This method generates the calculatedTotal amount based on salePrice + handlingFeeAmount + preventiveMaintenanceAmount.

Specified by:
generateCalculatedTotal in interface AssetRetirementService
Parameters:
salePrice -
handlingFeeAmount -
preventiveMaintenanceAmount -
Returns:

toKualiDecimal

protected org.kuali.rice.kns.util.KualiDecimal toKualiDecimal(String amount)
This method converts a String to a KualiDecimal via Double. Or else returns a Zero to invoke proper error message and to avoid breaking DWR call

Parameters:
amount -
Returns:


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