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

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

public class AssetTransferServiceImpl
extends Object
implements AssetTransferService


Nested Class Summary
protected static class AssetTransferServiceImpl.AmountCategory
           
 
Constructor Summary
AssetTransferServiceImpl()
           
 
Method Summary
protected  AssetGlpeSourceDetail createAssetGlpePostable(AssetTransferDocument document, Account plantAccount, AssetPayment assetPayment, boolean isSource, AssetTransferServiceImpl.AmountCategory amountCategory)
          Creates an instance of AssetGlpeSourceDetail depending on the source flag
 void createGLPostables(AssetTransferDocument document)
          Creates GL Postables using the source plant account number and target plant account number
protected  Integer createNewPayments(AssetTransferDocument document, List<org.kuali.rice.kns.bo.PersistableBusinessObject> persistableObjects, List<AssetPayment> originalPayments, Integer maxSequence)
          Creates new payment records for new organization account
protected  Integer createOffsetPayments(AssetTransferDocument document, List<org.kuali.rice.kns.bo.PersistableBusinessObject> persistableObjects, List<AssetPayment> originalPayments)
          Creates offset payment copying the details from original payments and reversing the amounts
protected  void createSourceGLPostables(AssetTransferDocument document, List<AssetPayment> assetPayments, boolean movableAsset)
          Creates GL Postables for the source organization
protected  void createTargetGLPostables(AssetTransferDocument document, List<AssetPayment> assetPayments, boolean movableAsset)
          Creates target GL Postable for the receiving organization
 AssetLocationService getAssetLocationService()
          Gets the assetLocationService attribute.
 AssetObjectCodeService getAssetObjectCodeService()
           
 AssetPaymentService getAssetPaymentService()
           
 AssetService getAssetService()
           
 org.kuali.rice.kns.service.BusinessObjectService getBusinessObjectService()
           
 org.kuali.rice.kns.service.DateTimeService getDateTimeService()
          Gets the dateTimeService attribute.
 UniversityDateService getUniversityDateService()
           
protected  boolean isGLPostable(AssetTransferDocument document, Asset asset, boolean movableAsset)
          Checks if it is ready for GL Posting by validating the accounts and plant account numbers
 void saveApprovedChanges(AssetTransferDocument document)
          This method is called when the work flow document is reached its final approval Gets the latest asset details from DB Save asset owner data Save location changes Save organization changes Create offset payments Create new payments Update original payments
protected  void saveAssetOwnerData(AssetTransferDocument document, Asset saveAsset)
          Updates organization data for the asset
protected  void saveLocationChanges(AssetTransferDocument document, Asset saveAsset)
          Updates location details to the asset
protected  void saveOrganizationChanges(AssetTransferDocument document, Asset saveAsset)
          Updates organization changes
 void setAssetLocationService(AssetLocationService assetLocationService)
          Sets the assetLocationService attribute.
 void setAssetObjectCodeService(AssetObjectCodeService assetObjectCodeService)
           
 void setAssetPaymentService(AssetPaymentService assetPaymentService)
           
 void setAssetService(AssetService assetService)
           
 void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)
           
 void setDateTimeService(org.kuali.rice.kns.service.DateTimeService dateTimeService)
          Sets the dateTimeService attribute value.
 void setUniversityDateService(UniversityDateService universityDateService)
           
protected  void updateOriginalPayments(List<org.kuali.rice.kns.bo.PersistableBusinessObject> persistableObjects, List<AssetPayment> originalPayments)
          Updates original payment records
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssetTransferServiceImpl

public AssetTransferServiceImpl()
Method Detail

createAssetGlpePostable

protected AssetGlpeSourceDetail createAssetGlpePostable(AssetTransferDocument document,
                                                        Account plantAccount,
                                                        AssetPayment assetPayment,
                                                        boolean isSource,
                                                        AssetTransferServiceImpl.AmountCategory amountCategory)
Creates an instance of AssetGlpeSourceDetail depending on the source flag

Parameters:
universityDateService - University Date Service
plantAccount - Plant account for the organization
assetPayment - Payment record for which postable is created
isSource - Indicates if postable is for source organization
Returns:
GL Postable source detail

createGLPostables

public void createGLPostables(AssetTransferDocument document)
Description copied from interface: AssetTransferService
Creates GL Postables using the source plant account number and target plant account number

Specified by:
createGLPostables in interface AssetTransferService
See Also:
AssetTransferService.createGLPostables(org.kuali.kfs.module.cam.document.AssetTransferDocument)

createNewPayments

protected Integer createNewPayments(AssetTransferDocument document,
                                    List<org.kuali.rice.kns.bo.PersistableBusinessObject> persistableObjects,
                                    List<AssetPayment> originalPayments,
                                    Integer maxSequence)
Creates new payment records for new organization account

Parameters:
document - Current document
persistableObjects - Saved objects list
originalPayments - Original payments for the asset
maxSequence - Payment sequence number
Returns:
Incremented sequence number

createOffsetPayments

protected Integer createOffsetPayments(AssetTransferDocument document,
                                       List<org.kuali.rice.kns.bo.PersistableBusinessObject> persistableObjects,
                                       List<AssetPayment> originalPayments)
Creates offset payment copying the details from original payments and reversing the amounts

Parameters:
document - Current Document
persistableObjects - List of update objects
originalPayments - Original list of payments
Returns:
Incremented sequence number

createSourceGLPostables

protected void createSourceGLPostables(AssetTransferDocument document,
                                       List<AssetPayment> assetPayments,
                                       boolean movableAsset)
Creates GL Postables for the source organization

Parameters:
universityDateService - University Date Service to get the current fiscal year and period
assetPayments - Payments for which GL entries needs to be created

createTargetGLPostables

protected void createTargetGLPostables(AssetTransferDocument document,
                                       List<AssetPayment> assetPayments,
                                       boolean movableAsset)
Creates target GL Postable for the receiving organization

Parameters:
universityDateService - University Date Service to get the current fiscal year and period
assetPayments - Payments for which GL entries needs to be created

getAssetPaymentService

public AssetPaymentService getAssetPaymentService()

getAssetService

public AssetService getAssetService()

getBusinessObjectService

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

getUniversityDateService

public UniversityDateService getUniversityDateService()

isGLPostable

protected boolean isGLPostable(AssetTransferDocument document,
                               Asset asset,
                               boolean movableAsset)
Checks if it is ready for GL Posting by validating the accounts and plant account numbers

Returns:
true if all accounts are valid

saveApprovedChanges

public void saveApprovedChanges(AssetTransferDocument document)
Description copied from interface: AssetTransferService
This method is called when the work flow document is reached its final approval
  1. Gets the latest asset details from DB
  2. Save asset owner data
  3. Save location changes
  4. Save organization changes
  5. Create offset payments
  6. Create new payments
  7. Update original payments

Specified by:
saveApprovedChanges in interface AssetTransferService
See Also:
AssetTransferService.saveApprovedChanges(org.kuali.kfs.module.cam.document.AssetTransferDocument)

saveAssetOwnerData

protected void saveAssetOwnerData(AssetTransferDocument document,
                                  Asset saveAsset)
Updates organization data for the asset

Parameters:
document - Current document
saveAsset - Asset

saveLocationChanges

protected void saveLocationChanges(AssetTransferDocument document,
                                   Asset saveAsset)
Updates location details to the asset

Parameters:
document - Current document
saveAsset - Asset

saveOrganizationChanges

protected void saveOrganizationChanges(AssetTransferDocument document,
                                       Asset saveAsset)
Updates organization changes

Parameters:
document - Current document
saveAsset - Asset

setAssetPaymentService

public void setAssetPaymentService(AssetPaymentService assetPaymentService)

setAssetService

public void setAssetService(AssetService assetService)

setBusinessObjectService

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

setUniversityDateService

public void setUniversityDateService(UniversityDateService universityDateService)

updateOriginalPayments

protected void updateOriginalPayments(List<org.kuali.rice.kns.bo.PersistableBusinessObject> persistableObjects,
                                      List<AssetPayment> originalPayments)
Updates original payment records

Parameters:
persistableObjects - List of saveable objects
originalPayments - Original payments list

getAssetObjectCodeService

public AssetObjectCodeService getAssetObjectCodeService()

setAssetObjectCodeService

public void setAssetObjectCodeService(AssetObjectCodeService assetObjectCodeService)

getDateTimeService

public org.kuali.rice.kns.service.DateTimeService getDateTimeService()
Gets the dateTimeService attribute.

Returns:
Returns the dateTimeService.

setDateTimeService

public void setDateTimeService(org.kuali.rice.kns.service.DateTimeService dateTimeService)
Sets the dateTimeService attribute value.

Parameters:
dateTimeService - The dateTimeService to set.

getAssetLocationService

public AssetLocationService getAssetLocationService()
Gets the assetLocationService attribute.

Returns:
Returns the assetLocationService

setAssetLocationService

public void setAssetLocationService(AssetLocationService assetLocationService)
Sets the assetLocationService attribute.

Parameters:
assetLocationService - The assetLocationService to set


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