Class MDepreciationWorkfile

    • Constructor Detail

      • MDepreciationWorkfile

        public MDepreciationWorkfile​(Properties ctx,
                                     int A_Depreciation_Workfile_ID,
                                     String trxName)
        Default Constructor
        Parameters:
        ctx - context
        A_Depreciation_Workfile_ID - line
        trxName -
      • MDepreciationWorkfile

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

      • getAsset

        public MAsset getAsset()
        Get Asset
      • getAsset

        public MAsset getAsset​(boolean requery)
        Get asset using this trxName
        Parameters:
        requery - requery asset
        Returns:
        parent asset
      • setAsset

        public void setAsset​(MAsset asset)
        Set asset
        Parameters:
        asset -
      • getAssetServiceDate

        public Timestamp getAssetServiceDate()
        Gets asset's service date (commissioning)
        Specified by:
        getAssetServiceDate in interface org.idempiere.fa.feature.UseLife
        Returns:
        asset service date
      • afterSave

        protected boolean afterSave​(boolean newRecord)
        After save
        Parameters:
        newRecord -
        Returns:
        true on success
      • beforeSave

        protected boolean beforeSave​(boolean newRecord)
        Description copied from class: PO
        Called before Save for Pre-Save Operation
        Overrides:
        beforeSave in class PO
        Parameters:
        newRecord - new record
        Returns:
        true if record can be saved
      • isFullyDepreciated

        public boolean isFullyDepreciated()
        Asset is fully depreciated
        • If PostingType != ACTUAL then return false
        • Do not check your current asset
        Returns:
        true if the asset is fully depreciated, false otherwise
      • get

        public static MDepreciationWorkfile get​(Properties ctx,
                                                int A_Asset_ID,
                                                String postingType,
                                                String trxName)
        Get/load workfile from cache (if trxName is null)
        Parameters:
        ctx -
        A_Asset_ID -
        postingType -
        trxName -
        Returns:
        workfile
      • getLastActionDate

        public Timestamp getLastActionDate()
        Returns the date of the last action
      • isDepreciated

        public boolean isDepreciated​(Timestamp date)
        Check if the asset is depreciated at the specified date
        Parameters:
        date -
        Returns:
        true if you amortized until the specified date, otherwise false
      • getA_AssetAcct

        public MAssetAcct getA_AssetAcct​(Timestamp dateAcct,
                                         String trxName)
        Get Asset Accounting for this workfile
        Returns:
        asset accounting model
      • getActualCost

        public BigDecimal getActualCost()
        Returns the current cost of FAs. It is calculated as the difference between acquisition value and the value that you (A_Salvage_Value)
        Returns:
        the current cost of FAs
      • adjustCost

        public void adjustCost​(BigDecimal deltaAmt,
                               BigDecimal deltaQty,
                               boolean reset)
        Parameters:
        deltaAmt -
        deltaQty -
        reset -
      • adjustAccumulatedDepr

        public boolean adjustAccumulatedDepr​(BigDecimal amt,
                                             BigDecimal amt_F,
                                             boolean reset)
        Adjust Accumulated depreciation
        Parameters:
        amt -
        amt_F -
        reset -
        Returns:
      • adjustUseLife

        public void adjustUseLife​(int deltaUseLifeYears,
                                  int deltaUseLifeYears_F,
                                  boolean reset)
        Adjust use life years
      • getUseLifeMonths

        public int getUseLifeMonths​(boolean fiscal)
      • getA_Accumulated_Depr

        public BigDecimal getA_Accumulated_Depr​(boolean fiscal)
      • getAccumulatedCost

        public BigDecimal getAccumulatedCost()
      • getReevaluationCost

        public BigDecimal getReevaluationCost()
      • getRemainingCost

        public BigDecimal getRemainingCost​(BigDecimal accumAmt,
                                           boolean fiscal)
        Returns the residual (remaining) value
      • getRemainingCost

        public BigDecimal getRemainingCost​(BigDecimal accumAmt)
        Returns the residual (remaining) value
      • getRemainingPeriods

        public int getRemainingPeriods​(int A_Current_Period,
                                       MDepreciation method)
      • getRemainingPeriods

        public int getRemainingPeriods​(int A_Current_Period)
      • isFiscal

        public boolean isFiscal()
      • setFiscal

        public void setFiscal​(boolean fiscal)
        Set fiscal flag (temporary - is not modifing the workfile)
        Parameters:
        fiscal -
      • incA_Current_Period

        public void incA_Current_Period()
        Increment the current period (A_Current_Period) 1, and a month DateAcct
      • setA_Current_Period

        public void setA_Current_Period()
        Set A Current Period (and Data Act) processed just after the last expense. Do not save.
      • buildDepreciation

        public void buildDepreciation()
        Build depreciation (A_Depreciation_Exp) entries. More exactly, is deleting not Processed entries. and create new ones again. WARNING: IS NOT modifying workfile (this)
      • truncDepreciation

        public void truncDepreciation()
        Truncate not processed depreciation entries. IS NOT modifying workfile.
      • updateFinantare

        public static void updateFinantare​(SetGetModel m,
                                           String changedColumnName)
        Update Founding Mode related fields
        Parameters:
        m - model
        changedColumnName - column name that has been changed