org.kuali.kfs.module.cam.util
Class AssetSeparatePaymentDistributor

java.lang.Object
  extended by org.kuali.kfs.module.cam.util.AssetSeparatePaymentDistributor

public class AssetSeparatePaymentDistributor
extends Object

This class is a calculator which will distribute the amounts and balance them by ratio. Inputs received are

  • Source Asset
  • Source Payments
  • Current max of payment number used by source Asset
  • AssetGlobal Document performing the separate action
  • List of new assets to be created for this separate request document
  • Logic is best explained as below
  • Compute the ratio of amounts to be removed from source payments
  • Compute the ratio by which each new asset should receive the allocated amount
  • Separate the allocate amount from the source payment using ratio computed above
  • Apply the allocate amount by ratio to each new asset
  • Adjust the last payment to round against the source from which split is done
  • Adjust the account charge amount of each asset by rounding the last payment with reference to user input separate amount
  • Create offset payments for the source asset
  • Compute accumulated depreciation amount for each payment, including offsets

  • Constructor Summary
    AssetSeparatePaymentDistributor(Asset sourceAsset, List<AssetPayment> sourcePayments, Integer maxPaymentSeqNo, AssetGlobal assetGlobal, List<Asset> newAssets)
              Constructs a AssetSeparatePaymentDistributor.java.
     
    Method Summary
     void distribute()
               
     double[] getAssetAllocateRatios()
              Gets the assetAllocateRatios attribute.
     AssetGlobal getAssetGlobal()
              Gets the assetGlobal attribute.
     List<Asset> getNewAssets()
              Gets the newAssets attribute.
     List<AssetPayment> getOffsetPayments()
              Gets the offsetPayments attribute.
     List<AssetPayment> getRemainingPayments()
              Gets the remainingPayments attribute.
     double getRetainRatio()
              Gets the retainRatio attribute.
     List<AssetPayment> getSeparatedPayments()
              Gets the separatedPayments attribute.
     double getSeparateRatio()
              Gets the separateRatio attribute.
     List<AssetPayment> getSourcePayments()
              Gets the sourcePayments attribute.
     void negatePaymentAmounts(AssetPayment assetPayment)
              Utility method which will negate the payment amounts for a given payment
     void setAssetAllocateRatios(double[] assetAllocateRatios)
              Sets the assetAllocateRatios attribute value.
     void setAssetGlobal(AssetGlobal assetGlobal)
              Sets the assetGlobal attribute value.
     void setNewAssets(List<Asset> newAssets)
              Sets the newAssets attribute value.
     void setOffsetPayments(List<AssetPayment> offsetPayments)
              Sets the offsetPayments attribute value.
     void setRemainingPayments(List<AssetPayment> remainingPayments)
              Sets the remainingPayments attribute value.
     void setRetainRatio(double retainRatio)
              Sets the retainRatio attribute value.
     void setSeparatedPayments(List<AssetPayment> separatedPayments)
              Sets the separatedPayments attribute value.
     void setSeparateRatio(double separateRatio)
              Sets the separateRatio attribute value.
     void setSourcePayments(List<AssetPayment> sourcePayments)
              Sets the sourcePayments attribute value.
    static org.kuali.rice.kns.util.KualiDecimal sumPeriodicDepreciationAmounts(AssetPayment currPayment)
              Sums up periodic amounts for a payment
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    AssetSeparatePaymentDistributor

    public AssetSeparatePaymentDistributor(Asset sourceAsset,
                                           List<AssetPayment> sourcePayments,
                                           Integer maxPaymentSeqNo,
                                           AssetGlobal assetGlobal,
                                           List<Asset> newAssets)
    Constructs a AssetSeparatePaymentDistributor.java.

    Parameters:
    sourceAsset - Source Asset
    sourcePayments - Source Payments
    maxPaymentSeqNo - Current max of payment number used by source Asset
    assetGlobal - AssetGlobal Document performing the separate action
    newAssets - List of new assets to be created for this separate request document
    Method Detail

    distribute

    public void distribute()

    negatePaymentAmounts

    public void negatePaymentAmounts(AssetPayment assetPayment)
    Utility method which will negate the payment amounts for a given payment

    Parameters:
    assetPayment - Payment to be negated

    sumPeriodicDepreciationAmounts

    public static org.kuali.rice.kns.util.KualiDecimal sumPeriodicDepreciationAmounts(AssetPayment currPayment)
    Sums up periodic amounts for a payment

    Parameters:
    currPayment - Payment
    Returns:
    Sum of payment

    getRemainingPayments

    public List<AssetPayment> getRemainingPayments()
    Gets the remainingPayments attribute.

    Returns:
    Returns the remainingPayments.

    setRemainingPayments

    public void setRemainingPayments(List<AssetPayment> remainingPayments)
    Sets the remainingPayments attribute value.

    Parameters:
    remainingPayments - The remainingPayments to set.

    getOffsetPayments

    public List<AssetPayment> getOffsetPayments()
    Gets the offsetPayments attribute.

    Returns:
    Returns the offsetPayments.

    setOffsetPayments

    public void setOffsetPayments(List<AssetPayment> offsetPayments)
    Sets the offsetPayments attribute value.

    Parameters:
    offsetPayments - The offsetPayments to set.

    getSeparatedPayments

    public List<AssetPayment> getSeparatedPayments()
    Gets the separatedPayments attribute.

    Returns:
    Returns the separatedPayments.

    setSeparatedPayments

    public void setSeparatedPayments(List<AssetPayment> separatedPayments)
    Sets the separatedPayments attribute value.

    Parameters:
    separatedPayments - The separatedPayments to set.

    getAssetGlobal

    public AssetGlobal getAssetGlobal()
    Gets the assetGlobal attribute.

    Returns:
    Returns the assetGlobal.

    setAssetGlobal

    public void setAssetGlobal(AssetGlobal assetGlobal)
    Sets the assetGlobal attribute value.

    Parameters:
    assetGlobal - The assetGlobal to set.

    getNewAssets

    public List<Asset> getNewAssets()
    Gets the newAssets attribute.

    Returns:
    Returns the newAssets.

    setNewAssets

    public void setNewAssets(List<Asset> newAssets)
    Sets the newAssets attribute value.

    Parameters:
    newAssets - The newAssets to set.

    getAssetAllocateRatios

    public double[] getAssetAllocateRatios()
    Gets the assetAllocateRatios attribute.

    Returns:
    Returns the assetAllocateRatios.

    setAssetAllocateRatios

    public void setAssetAllocateRatios(double[] assetAllocateRatios)
    Sets the assetAllocateRatios attribute value.

    Parameters:
    assetAllocateRatios - The assetAllocateRatios to set.

    getSeparateRatio

    public double getSeparateRatio()
    Gets the separateRatio attribute.

    Returns:
    Returns the separateRatio.

    setSeparateRatio

    public void setSeparateRatio(double separateRatio)
    Sets the separateRatio attribute value.

    Parameters:
    separateRatio - The separateRatio to set.

    getRetainRatio

    public double getRetainRatio()
    Gets the retainRatio attribute.

    Returns:
    Returns the retainRatio.

    setRetainRatio

    public void setRetainRatio(double retainRatio)
    Sets the retainRatio attribute value.

    Parameters:
    retainRatio - The retainRatio to set.

    getSourcePayments

    public List<AssetPayment> getSourcePayments()
    Gets the sourcePayments attribute.

    Returns:
    Returns the sourcePayments.

    setSourcePayments

    public void setSourcePayments(List<AssetPayment> sourcePayments)
    Sets the sourcePayments attribute value.

    Parameters:
    sourcePayments - The sourcePayments to set.


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