Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0023159Openbravo ERP09. Financial managementpublic2013-02-25 17:022013-03-05 09:30
mirurita 
mirurita 
highmajorN/A
closedfixed 
20Community Appliance
pi 
 
dmiguelez
Core
No
0023159: Replace A_Asset_Post (Create amortization) stored procedure by a Java process
Replace A_Asset_Post (Create amortization) stored procedure by a Java process.

Implement the ability to define whether all months should be considered equal (30 day months) or different (January 31 days, ...).

Implement the ability to define whether all years should be considered equal (365 days) or taking in account leap-years.
/************** Testing Plan I **************/
1) Review all new application dictionary elements are properly documented (description & help)

/************** Testing Plan II **************/
1) Create a new asset group
  * Check Depreciate flag
  * Select Time calculate type
  * Check 'Every Month is 30 Days' flag
2) Create a new asset and select previous asset group. the callout should inherit 'Every Month is 30 Days' flag.
3) Create a new asset group
  * Check Depreciate flag
  * Select Time calculate type
  * Do not check 'Every Month is 30 Days' flag
4) Create a new asset and select previous asset group. the callout should inherit 'Every Month is 30 Days' flag.

/************** Testing Plan III **************/
1) Create a new asset and try to run the create amortization process with invalid or missing parameters
* Depreciation amount: mandatory and > 0
* In case of monthly depreciation, Usable life monts: mandatory and > 0
* In case of yearly depreciation, Usable life years: mandatory and > 0
* In case of percentage depreciation, annual depreciation %: mandatory and > 0
* Depreciation start date: mandatory

/************** Testing Plan IV **************/
1) Do not apply the patch
2) Create some assets
3) Apply the patch and compile
4) Realize that existing assets have 'Every Month is 30 Days' = 'Y'

Note:
 * Monthly before applying the patch == Monthly + Every Month is 30 Days after applying the patch
 * Yearly before applying the patch == Yearly + Every Month is 30 Days after applying the patch

/************** Testing Plan V (Monthly) **************/
Use two instances to compare:
 * Instance 1 (i1): patch not applied
 * Instance 2 (i2): patch applied

1) Monthly - 1 month - 100€ - 15/02/2013 - Every Month is 30 Days
Expected result:
50€ - 50%
25€ - 25%
25€ - 25%

2) Monthly - 1 month - 100€ - 14/02/2013 - Every Month is 30 Days
Expected result:
46.43€ - 46.43%
53.57€ - 53.57%
 2.1) Remove amortization line of 46.43€
 2.2) Recalculte amortization.
       * i1: fails
       * i2: ok

3) Monthly - 5 month - 50€ - 01/01/2013 - Every Month is 30 Days
Expected result:
20.00€ - 20.00%
20.00€ - 20.00%
20.00€ - 20.00%
20.00€ - 20.00%
20.00€ - 20.00%

4) Monthly - 5 month - 50€ - 01/01/2013 - NOT Every Month is 30 Days
Expected result:
20.53€ - 20.53%
18.54€ - 18.54%
20.53€ - 20.53%
19.87€ - 19.87%
20.53€ - 20.53%

5) Monthly - 3 month - 100€ - 01/01/2013 - Every Month is 30 Days
Expected result:
33.33€ - 33.33%
33.33€ - 33.33%
33.34€ - 33.34%

6) Monthly - 3 month - 100€ - 15/01/2013 - Every Month is 30 Days
Expected result:
18.28€ - 18.28%
33.33€ - 33.33%
33.33€ - 33.33%
15.06€ - 15.06%

 6.1) Remove amortization line of 15.06€
 6.2) Recalculte amortization.
       * i1: fails
       * i2: ok

7) Monthly - 3 month - 100€ - 15/01/2013 - Every Month is 30 Days
Expected result:
18.28€ - 18.28%
33.33€ - 33.33%
33.33€ - 33.33%
15.06€ - 15.06%

 7.1) Remove amortization line of 15.06€
 7.2) Useble Life - Months: 4
 7.3) Recalculte amortization.
18.28€ - 18.28%
33.33€ - 33.33%
33.33€ - 33.33%
10.37€ - 10.37%
4.69€ - 4.69%

8) Monthly - 1 month - depreciation amt: 100€ - previously depreciated amt: 25 - 01/01/2013 - Every Month is 30 Days
Expected result:
25€ - 33.33%
25€ - 33.33%
25€ - 33.34%


/************** Testing Plan VI (Yearly) **************/
1) Yearly - 3 year - 100€ - 01/01/2013 - Every Month is 30 Days
33.33€ - 33.33%
33.33€ - 33.33%
33.34€ - 33.34%

2) Yearly - 4 year - 100€ - 01/01/2013 - Every Month is 30 Days
25€ - 25%
25€ - 25%
25€ - 25%
25€ - 25%

3) Yearly - 4 year - 100€ - 01/01/2013 - NOT Every Month is 30 Days
24.98€ - 24.98%
24.98€ - 24.98%
24.98€ - 24.98%
25.06€ - 25.06%

4) Yearly - 2 year - 100€ - 01/01/2013 - Every Month is 30 Days
50€ - 50%
50€ - 50%
 
  4.1) Remove line number 20
  4.2) Change usable life to 6 years
50€ - 50%
10€ - 10%
10€ - 10%
10€ - 10%
10€ - 10%
10€ - 10%

5) Yearly - 4 year - 100€ - 01/01/2013 - Every Month is 30 Days
25€ - 25%
25€ - 25%
25€ - 25%
25€ - 25%

  5.1) Remove last two lines
  5.2) Change depreciation amount to = 200
25€ - 12.5%
25€ - 12.5%
37.5€ - 75%
37.5€ - 75%

6) Yearly - 2 year - 100€ - 15/01/2013 - Every Month is 30 Days
48.08 - 48.08%
50 - 50.00%
1.92 - 1.92%

  5.1) Remove last line
  5.2) Change usable life years to 3
48.08 - 48.08%
50 - 50.00%
1.85€ - 1.85%
0.07€ - 0.07%


/************** Testing Plan VII (Percentage) **************/
1) Percentage - Annual Deprecaition 20% - 100€ - 01/01/2013
20.00€ - 20.00%
20.00€ - 20.00%
20.00€ - 20.00%
20.00€ - 20.00%
20.00€ - 20.00%

2) Percentage - Annual Deprecaition 15% - 100€ - 01/01/2013
15€ - 15%
15€ - 15%
15€ - 15%
15€ - 15%
15€ - 15%
15€ - 15%
10€ - 10%

  2.1) Remove last two records
  2.2) Recalculte amortization, you should get the same info.

3) Percentage - Annual Deprecaition 20% - 100€ - 15/01/2013
24.04 - 24.04
25.00 - 25.00
25.00 - 25.00
25.00 - 25.00
0.96 - 0.96

  3.1) Remove last two records
  3.2) Recalculte amortization, you should get the same info.

4) Percentage - Annual Deprecaition 33% - 100€ - 01/01/2013
33 - 33
33 - 33
33 - 33
1 - 1

  4.1) Remove last two records
  4.2) Modify percentage to 12
33 - 33
33 - 33
12 - 12
12 - 12
10 - 10


/************** Testing Plan VIII **************/
Verify issues resolved during las months are still working.
1) Issue 22807
   Yearly - 2 years - 17040€ - 31/12/2012
2) Issue 20828
       * i1: fails. changes amounts from 62.5 to 62.44
3) Issue 21656
       * i1: 20.67
       * i2: 20.68
4) Issue 22004
       * i1: regression.
5) Issue 21901
6) Issue 21441
7) Issue 20316
8) Issue 11178
9) Issue 18707
10) Issue 18612


/************** Testing Plan IX **************/
1) Clean previous data. Remove all assets and amortizations.
2) Run the following amortization plan: España Norte - Monthly - 12 month - 100€ - 01/01/2013 - Every Month is 30 Days
3) Realize that 12 amortizations (Amortization window) are created, one per month (from January 13 to December 13)
4) Run again the same amortization for other asset: España Norte - Monthly - 12 month - 100€ - 01/01/2013 - Every Month is 30 Days
5) Check that there are the same 12 amortizations (Amortization window), but each one with 2 lines
6) Run amortization of step 2) but change the organization to España.
7) Realize that now there are new 12 months, in total 24.
8) Run again the same amortization of step 6): España - Monthly - 12 month - 100€ - 01/01/2013 - Every Month is 30 Days
9) Check that there are the same 24 amortizations (Amortization window). The amortizations of España should have now 2 lines.

In general the rule is: for the same org, start date, end date, project there should be only one amortization.
No tags attached.
blocks feature request 0024561 closed caristu Modules When importing Assets, the call to A_ASSET_POST function should be replaced with the Java function 
Issue History
2013-02-25 17:02miruritaNew Issue
2013-02-25 17:02miruritaAssigned To => mirurita
2013-02-25 17:02miruritaModules => Core
2013-02-25 17:02miruritaTriggers an Emergency Pack => No
2013-02-26 09:52miruritaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=4450#r4450
2013-02-26 09:58miruritaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=4451#r4451
2013-03-01 13:28hgbotCheckin
2013-03-01 13:28hgbotNote Added: 0056894
2013-03-01 13:28hgbotStatusnew => resolved
2013-03-01 13:28hgbotResolutionopen => fixed
2013-03-01 13:28hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/79424448942ac7bf36053cdf276c8b1491f126c8 [^]
2013-03-01 13:28hgbotCheckin
2013-03-01 13:28hgbotNote Added: 0056895
2013-03-01 13:48hgbotCheckin
2013-03-01 13:48hgbotNote Added: 0056898
2013-03-01 13:53dmiguelezReview Assigned To => dmiguelez
2013-03-01 13:53dmiguelezNote Added: 0056900
2013-03-01 13:53dmiguelezStatusresolved => closed
2013-03-01 15:29hgbotCheckin
2013-03-01 15:29hgbotNote Added: 0056904
2013-03-02 05:48hudsonbotCheckin
2013-03-02 05:48hudsonbotNote Added: 0056945
2013-03-02 05:48hudsonbotCheckin
2013-03-02 05:48hudsonbotNote Added: 0056946
2013-03-02 05:48hudsonbotCheckin
2013-03-02 05:48hudsonbotNote Added: 0056949
2013-03-04 14:01hgbotCheckin
2013-03-04 14:01hgbotNote Added: 0057009
2013-03-05 09:30hudsonbotCheckin
2013-03-05 09:30hudsonbotNote Added: 0057028
2013-08-22 12:54ngarciaRelationship addedblocks 0024561

Notes
(0056894)
hgbot   
2013-03-01 13:28   
Repository: erp/devel/pi
Changeset: 79424448942ac7bf36053cdf276c8b1491f126c8
Author: Mikel Irurita <mikel.irurita <at> openbravo.com>
Date: Tue Feb 26 09:54:17 2013 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/79424448942ac7bf36053cdf276c8b1491f126c8 [^]

Fixes issue 23159: Replace A_Asset_Post stored procedure by a Java process

---
M src-db/database/model/tables/A_ASSET.xml
M src-db/database/model/tables/A_ASSET_GROUP.xml
M src-db/database/sourcedata/AD_CALLOUT.xml
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_ELEMENT.xml
M src-db/database/sourcedata/AD_FIELD.xml
M src-db/database/sourcedata/AD_MESSAGE.xml
M src-db/database/sourcedata/AD_MODEL_OBJECT.xml
M src-db/database/sourcedata/AD_PROCESS.xml
M src/org/openbravo/erpCommon/ad_callouts/SL_Depreciate.java
A src/org/openbravo/erpCommon/ad_process/assets/AssetLinearDepreciationMethodProcess.java
---
(0056895)
hgbot   
2013-03-01 13:28   
Repository: erp/devel/pi
Changeset: d292f59ef8c5ca65077487ebfa2fcacbb2d4f06f
Author: Mikel Irurita <mikel.irurita <at> openbravo.com>
Date: Fri Mar 01 13:07:52 2013 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/d292f59ef8c5ca65077487ebfa2fcacbb2d4f06f [^]

Related to issue 23159. Fixes issue 22807. A_asset_post

---
M src-db/database/sourcedata/AD_FIELD.xml
M src-db/database/sourcedata/AD_TAB.xml
M src/org/openbravo/erpCommon/ad_process/assets/AssetLinearDepreciationMethodProcess.java
---
(0056898)
hgbot   
2013-03-01 13:48   
Repository: erp/devel/api-checks
Changeset: 78bff79b769c7444fc0046c342de5aaad93ca089
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Fri Mar 01 13:47:58 2013 +0100
URL: http://code.openbravo.com/erp/devel/api-checks/rev/78bff79b769c7444fc0046c342de5aaad93ca089 [^]

Related to Issue 23159. Fixes false API postive. Removes unused
callout.

---
M model/src-db/database/sourcedata/AD_CALLOUT.xml
---
(0056900)
dmiguelez   
2013-03-01 13:53   
Code Review + Testing OK
(0056904)
hgbot   
2013-03-01 15:29   
Repository: erp/devel/pi
Changeset: 56d1d98c95cbdfd5b1525fa400444fbbd6b2c0ba
Author: Mikel Irurita <mikel.irurita <at> openbravo.com>
Date: Fri Mar 01 15:29:14 2013 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/56d1d98c95cbdfd5b1525fa400444fbbd6b2c0ba [^]

Related to issue 23159: fixes int-dbcons-oracle - Build 0003731

---
M src-db/database/sourcedata/AD_MESSAGE.xml
---
(0056945)
hudsonbot   
2013-03-02 05:48   
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/f5db629e7058 [^]

Maturity status: Test
(0056946)
hudsonbot   
2013-03-02 05:48   
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/f5db629e7058 [^]

Maturity status: Test
(0056949)
hudsonbot   
2013-03-02 05:48   
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/f5db629e7058 [^]

Maturity status: Test
(0057009)
hgbot   
2013-03-04 14:01   
Repository: erp/devel/pi
Changeset: 5b0c0bf9cb86e826d2b9229fa0799c64cf58104b
Author: Mikel Irurita <mikel.irurita <at> openbravo.com>
Date: Mon Mar 04 14:00:58 2013 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/5b0c0bf9cb86e826d2b9229fa0799c64cf58104b [^]

Related to issue 23159: apply feedback

---
M src-db/database/model/tables/A_ASSET.xml
M src-db/database/model/tables/A_ASSET_GROUP.xml
M src/org/openbravo/erpCommon/ad_process/assets/AssetLinearDepreciationMethodProcess.java
---
(0057028)
hudsonbot   
2013-03-05 09:30   
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/e5bdfce74ee2 [^]

Maturity status: Test