Class MDepreciation

    • Constructor Detail

      • MDepreciation

        public MDepreciation​(Properties ctx,
                             int A_Depreciation_ID,
                             String trxName)
        Standard Constructor
      • MDepreciation

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

        public MDepreciation​(MDepreciation copy)
        Parameters:
        copy -
    • Method Detail

      • 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()
        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 - - Fixed Assets worksheet
        assetAcct - - FA default accounting elements
        A_Current_Period - - current period
        Accum_Dep - accumulated depreciation until present period
        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
        Parameters:
        assetwk -
        assetAcct -
        A_Current_Period - between 0 to UseLifeMonths - 1
        Accum_Dep -
      • 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()