Anonymous | Login
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
TypeCategorySeverityReproducibilityDate SubmittedLast Update
backport[Openbravo ERP] 09. Financial managementmajoralways2020-09-04 22:312020-09-10 13:21
ReporterlbressanView Statuspublic 
Assigned Toinigo_lerga 
PriorityhighResolutionfixedFixed in VersionPR20Q3.1
StatusclosedFix in branchFixed in SCM revision
ProjectionnoneETAnoneTarget VersionPR20Q3.1
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionpiSCM revision 
Review Assigned To
Web browser
Regression level
Regression date2019-08-22
Regression introduced in release3.0PR19Q4
Regression introduced by commit [^]
Triggers an Emergency PackNo

0045017: Error in the Recalculate Amortization process

DescriptionFrom the assets window, when we select an asset record and click on the "Recalculate amortization" button, this process deletes the records associated an X amortization, including records of that amortization that correspond to other assets.

Steps To ReproduceIn the Assets window:
1. Create a record with the following data:
        Organization: F&B España, S.A
        Search Key: coche1
        Name: coche1
        Asset Category: Vehiculos
        Document No.: 10000006
        Currency: EUR
        Depreciate: true
        Depreciation Type: Linear
        Calculate Type: Time
        Usable Life - Months: 120
        Every Month Is 30Days: true
        Amortize: Monthly
        Depreciation Start Date : 01-03-2013
        Asset Value: 23000
        Residual Asset Value : 0.00
        Depreciation Amt: 23000
        Previously Depreciated Amt : 0.00

2. Then click on the button "Create Amortization"
3. Create another record idem to the previous one:

        Organization: F&B España, S.A
        Search Key: coche2
        Name: coche2
        Asset Category: Vehiculos
        Document No.: 10000007
        Currency: EUR
        Depreciate: true
        Depreciation Type: Linear
        Calculate Type: Time
        Usable Life - Months: 120
        Every Month Is 30Days: true
        Amortize: Monthly
        Depreciation Start Date : 01-03-2013
        Asset Value: 23000
        Residual Asset Value : 0.00
        Depreciation Amt: 23000
        Previously Depreciated Amt : 0.00

4. Repeat step 2.

Navigate to the Amortization window:

     1. Filter the records by the date field with value "30-07-2020"
     2. Observe that there are two records in the lines of that amortization, one corresponds to the first asset and the other to the second asset.

In the Assets window:

    1. Select the record that corresponds to the second asset created and click on the "Recalculate Amortization" button.
    2. Navigate to the Amortization window and refresh the previously filtered record.
    3. There it can be seen that the lines corresponding to the other asset have disappeared.

In conclusion, when an asset is recalculated, only the records that correspond to the depreciation of that asset should be deleted.

We attach a video with the aforementioned example.
Proposed SolutionOnly delete records that correspond to the asset that is being recalculated.
Code where the error occurs:

Line numer: from 143

    // Remove unprocessed Amortization and its line when recalculating
    final List<AmortizationLine> amortizationLineListToRemove = new ArrayList<>();
    for (AmortizationLine al : amortizationLineList) {
      final Amortization amortization = OBDal.getInstance()
          .get(Amortization.class, al.getAmortization().getId());
      if (StringUtils.equals(amortization.getProcessed(), "N")) {

It's important to have on mind:
After solving this bug, it will be necessary to have a script or method to correct the missing amounts of the records that have been eliminated from assets that were not associated with the asset in question, bearing in mind that the accounting periods have already been closed.
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
blocks defect 0044996 closedinigo_lerga Error in the Recalculate Amortization process 

-  Notes
hgbot (developer)
2020-09-10 12:26

Merge Request created: [^]
hgbot (developer)
2020-09-10 13:21

Merge request merged: [^]
hgbot (developer)
2020-09-10 13:21

Directly closing issue as related merge request is already approved.

Repository: [^]
Changeset: 2b0f972fd8534ce16ced5c071b923f054771ec10
Author: inigo_lerga <>
Date: 2020-09-10T12:24:41+02:00
URL: [^]

fixes BUG-45017:Explicit deletion of Amortization lines

When an Asset's Amortization is recalculated, only its Amortization
records need to be deleted.

Backport of Regression 44996.

M src/org/openbravo/erpCommon/ad_process/assets/

- Issue History
Date Modified Username Field Change
2020-09-09 16:14 dmiguelez Type defect => backport
2020-09-09 16:14 dmiguelez Target Version => PR20Q3.1
2020-09-10 12:26 hgbot Note Added: 0122917
2020-09-10 13:21 hgbot Resolution open => fixed
2020-09-10 13:21 hgbot Status scheduled => closed
2020-09-10 13:21 hgbot Note Added: 0122918
2020-09-10 13:21 hgbot Fixed in Version => PR20Q3.1
2020-09-10 13:21 hgbot Note Added: 0122919

Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker