Class MDepreciation

All Implemented Interfaces:
Serializable, Cloneable, Comparator<Object>, I_A_Depreciation, I_Persistent, Evaluatee, ImmutablePOSupport

public class MDepreciation extends X_A_Depreciation implements ImmutablePOSupport
Depreciation Method (eg. SL, ARH_VAR ...). Note that only SL (straight line) method have been implemented.
Author:
Teo Sarca, SC ARHIPAC SERVICE SRL
See Also:
  • Constructor Details

    • MDepreciation

      public MDepreciation(Properties ctx, String A_Depreciation_UU, String trxName)
      UUID based Constructor
      Parameters:
      ctx - Context
      A_Depreciation_UU - UUID key
      trxName - Transaction
    • MDepreciation

      public MDepreciation(Properties ctx, int A_Depreciation_ID, String trxName)
      Parameters:
      ctx -
      A_Depreciation_ID -
      trxName -
    • MDepreciation

      public MDepreciation(Properties ctx, ResultSet rs, String trxName)
      Load Constructor
      Parameters:
      ctx - context
      rs - result set record
    • MDepreciation

      public MDepreciation(MDepreciation copy)
      Copy constructor
      Parameters:
      copy -
    • MDepreciation

      public MDepreciation(Properties ctx, MDepreciation copy)
      Copy constructor
      Parameters:
      ctx -
      copy -
    • MDepreciation

      public MDepreciation(Properties ctx, MDepreciation copy, String trxName)
      Copy constructor
      Parameters:
      ctx -
      copy -
      trxName -
  • Method Details

    • get

      public static MDepreciation get(int A_Depreciation_ID)
      Get Depreciation method from cache
      Parameters:
      A_Depreciation_ID - depreciation id
    • get

      public static MDepreciation get(Properties ctx, int A_Depreciation_ID)
      Get Depreciation method from cache
      Parameters:
      ctx -
      A_Depreciation_ID - depreciation id
    • get

      public static MDepreciation get(String depreciationType)
      Get Depreciation method
      Parameters:
      depreciationType - depreciation type (e.g. SL)
    • get

      public static MDepreciation get(Properties ctx, String depreciationType)
      Get Depreciation method (immutable)
      Parameters:
      ctx -
      depreciationType - depreciation type (e.g. SL)
    • getPrecision

      public static int getPrecision()
      Returns the precision of calculation of depreciation
      Returns:
      accuracy of calculation of depreciation
    • requireLastPeriodAdjustment

      public boolean requireLastPeriodAdjustment()
      Returns:
      true if needs to be adjusted in last month's amortization
    • invoke

      public BigDecimal invoke(MDepreciationWorkfile assetwk, MAssetAcct assetAcct, int A_Current_Period, BigDecimal Accum_Dep, IDepreciationMethod depreciationMethod)
      Calculate the value of depreciation over time
      Parameters:
      assetwk - - Depreciation work sheet
      assetAcct - - FA default accounting elements
      A_Current_Period - - current period
      Accum_Dep - accumulated depreciation until present period
      depreciationMethod -
      Returns:
      amortized value
    • canInvoke

      public boolean canInvoke(MDepreciationWorkfile assetwk, MAssetAcct assetAcct, int A_Current_Period, BigDecimal Accum_Dep)
      Check if the method can be invoked to give parameters.
      Not fully implemented - always return true now.
      Parameters:
      assetwk -
      assetAcct -
      A_Current_Period - between 0 to UseLifeMonths - 1
      Accum_Dep -
      Returns:
      true if can invoke depreciation
    • getPeriodExp

      protected BigDecimal getPeriodExp(int A_Current_Period, BigDecimal amtPerYear)
      Calculate the value of depreciation over a month (period). In the last month of the year we add errors from the adjustment calculation.
      Parameters:
      A_Current_Period - current month's index
      amtPerYear - value of depreciation per year
      Returns:
      rounded value to the nearest month/decimal getPrecision ()
    • getFixMonthOffset

      public int getFixMonthOffset()
      Returns:
      always return 0
    • markImmutable

      public MDepreciation markImmutable()
      Description copied from interface: ImmutablePOSupport
      mark PO as immutable
      Specified by:
      markImmutable in interface ImmutablePOSupport
      Returns:
      PO