Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0032280Openbravo ERP09. Financial managementpublic2016-02-18 17:342016-03-17 10:56
ngarcia 
AtulOpenbravo 
urgentmajoralways
closedfixed 
5
 
 
vmromanos
Core
No
0032280: Amortization Process / Unprocess should only update Fully Depreciated field of the assets included on it and need the update
Amortization Process / Unprocess should only update Fully Depreciated field of the assets included on it and need the update. Currently it is updating all of them
As group admin role:
   Create three assets: Depreciated, NotDepreciated and Amortized
   Configure the depreciation of Depreciated and Amortized and create its amortization
   Update through database the IsFullyDepreciated to 'N' to the NotDepreciated asset (in order to see the update done by the process)
   Update through database the IsFullyDepreciated to 'Y' to the Depreciated asset (in order to see the update done by the process)

   Navigate to the amortization of one of the lines of the Amortized asset
   Process it and check the IsFullyDepreciated field has changed for the other two assets: Depreciated ('N') and Not Depreciated ('Y')
Add a filter to the following two updates to update only the assets included in the amortization being processed and also to update the ones that have different value in the isfullydepreciated field than the one set:

      UPDATE a_asset
        SET IsFullyDepreciated='Y',Updated=TO_DATE(NOW()),UpdatedBy='100'
      WHERE COALESCE(DepreciatedPlan, -1)=COALESCE(DepreciatedValue, -2) ;

      
      UPDATE a_asset
        SET IsFullyDepreciated='N',Updated=TO_DATE(NOW()),UpdatedBy='100'
      WHERE DepreciatedPlan<>DepreciatedValue;
No tags attached.
related to defect 0029091 closed jorge-garcia Fully depreciated field is not updated when unprocessing an asset amortization 
Issue History
2016-02-18 17:34ngarciaNew Issue
2016-02-18 17:34ngarciaAssigned To => Triage Finance
2016-02-18 17:34ngarciaModules => Core
2016-02-18 17:34ngarciaTriggers an Emergency Pack => No
2016-02-18 17:34ngarciaIssue Monitored: networkb
2016-02-18 17:35ngarciaResolution time => 1458774000
2016-02-18 17:44ngarciaRelationship addedrelated to 0029091
2016-02-23 11:38AtulOpenbravoNote Added: 0084419
2016-02-23 11:38AtulOpenbravoNote Edited: 0084419bug_revision_view_page.php?bugnote_id=0084419#r11204
2016-02-23 11:43AtulOpenbravoAssigned ToTriage Finance => AtulOpenbravo
2016-02-23 11:43AtulOpenbravoStatusnew => scheduled
2016-02-24 09:55psanjuanNote Added: 0084453
2016-02-24 10:21psanjuanNote Added: 0084454
2016-02-24 10:22psanjuanNote Edited: 0084454bug_revision_view_page.php?bugnote_id=0084454#r11214
2016-02-24 15:33hgbotCheckin
2016-02-24 15:33hgbotNote Added: 0084466
2016-02-24 15:33hgbotStatusscheduled => resolved
2016-02-24 15:33hgbotResolutionopen => fixed
2016-02-24 15:33hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/216fb4e6048c4546b3ade9e36c58dc27f810d900 [^]
2016-02-24 15:33vmromanosReview Assigned To => vmromanos
2016-02-24 15:33vmromanosNote Added: 0084467
2016-02-24 15:33vmromanosStatusresolved => closed
2016-03-17 10:56hudsonbotCheckin
2016-03-17 10:56hudsonbotNote Added: 0085166

Notes
(0084419)
AtulOpenbravo   
2016-02-23 11:38   
Test Plan
- Login as F&B International Group admin role.
- Create three assets: Depreciated, NotDepreciated and Amortized
- Configure the depreciation of Depreciated and Amortized and create its amortization.
- Update through database the IsFullyDepreciated to 'N' to the NotDepreciated asset (in order to see the update done by the process).
- Update through database the IsFullyDepreciated to 'Y' to the Depreciated asset (in order to see the update done by the process).
- Navigate to the amortization of one of the lines of the Amortized asset.
- Process it.
- Check the IsFullyDepreciated field for "Not Depreciated" asset is not updated and it is same as ('N') previous value.

(0084453)
psanjuan   
2016-02-24 09:55   
Issue Verified.
(0084454)
psanjuan   
2016-02-24 10:21   
(edited on: 2016-02-24 10:22)
Test Plan above verified

Values does not change now in the database, after running amortization for other assets than 2 ones below.

select value, isfullydepreciated, depreciatedplan, depreciatedvalue, updated
from a_asset
where a_asset_id in
('EE21580379FB4D5889059A46A6DE59FF',
'221DB1350A974132930164537D8B81D2')

update a_asset
set isfullydepreciated = 'N'
where a_asset_id =
'EE21580379FB4D5889059A46A6DE59FF'

update a_asset
set isfullydepreciated = 'Y'
where a_asset_id =
'221DB1350A974132930164537D8B81D2'

Records keep as:
"NotDepreciated";"N";0;0
"Depreciated";"Y";10000;0

Issue can be code reviewed and closed.

(0084466)
hgbot   
2016-02-24 15:33   
Repository: erp/devel/pi
Changeset: 216fb4e6048c4546b3ade9e36c58dc27f810d900
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Tue Feb 23 16:05:13 2016 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/216fb4e6048c4546b3ade9e36c58dc27f810d900 [^]

Fixes Issue 32280:Amortization Process / Unprocess should only update Fully
Depreciated field of the assets included on it and need the update

Condition added in update query to only update those assets record on which
amortization process is being called

---
M src-db/database/model/functions/A_AMORTIZATION_PROCESS.xml
---
(0084467)
vmromanos   
2016-02-24 15:33   
Code review + testing OK
(0085166)
hudsonbot   
2016-03-17 10:56   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/b22fb0500156 [^]
Maturity status: Test