Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0018612
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 09. Financial managementminoralways2011-09-26 13:462011-12-01 18:17
ReportermiruritaView Statuspublic 
Assigned ToioritzCia 
PrioritynormalResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revision45ee9420aa7b
ProjectionnoneETAnoneTarget Version3.0MP6
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned To
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0018612: Assets - create amortization process not calculating properly percetages/amounts

DescriptionWhen defining a linear depreciation type with percentage and the start date is not the first day of the year (01-01-YYYY) the amounts and percentages are not properly calculated.
Steps To Reproduce1) Go to Assets window
2) Create new Asset
 - Search Key: XX
 - Name: XX
 - Asset Category: Buildings
 - Depreciate: Yes
 - Depreciation Type: Linear
 - Calculate Type: Percentage
 - Annual Depreciation %: 50
 - Purchase Date: 29-01-2010
 - Depreciation Start Date: 29-01-2010
 - Asset Value: 41064
 - Depreciation Amt.: 41064
 - Residual Asset Value: 0
 - Previously Depreciated Amt: 0
3) Click on 'Create Amortization' button
4) See the Asset Amortization tab

2010 - 46.15 % - 18952.62
2011 - 50 % - 20532
2012 - 3.85 % - 1579.38

when it should be

2010 - 46.03 % - 18900.69
2011 - 50 % - 20532
2012 - 3.97 % - 1631.31
Proposed SolutionSELECT TO_DATE('31-12-2010', 'DD-MM-YYYY') - TO_DATE('01-01-2010', 'DD-MM-YYYY')
from dual;
-- returns 364

Number of days of the year:

SELECT TO_DATE('01-01-2011', 'DD-MM-YYYY') - TO_DATE('01-01-2010', 'DD-MM-YYYY')
from dual;
-- returns 365

Change Line 215
v_Percentage:=to_number(to_number(TO_DATE('31-12-'||to_char(v_AMORTIZATIONSTARTDATE, 'YYYY'), 'DD-MM-YYYY') -v_AMORTIZATIONSTARTDATE) / (TO_DATE('01-01-'||to_char(to_number(to_char(v_AMORTIZATIONSTARTDATE, 'YYYY')) + 1), 'DD-MM-YYYY') -TO_DATE('01-01-'||to_char(v_AMORTIZATIONSTARTDATE, 'YYYY'), 'DD-MM-YYYY'))) * v_PercentageGeneral;
TagsNo tags attached.
Attached Filespng file icon Asset - create amortization.png [^] (91,944 bytes) 2011-09-26 13:46

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0043141)
hgbot (developer)
2011-11-24 10:34

Repository: erp/devel/pi
Changeset: 45ee9420aa7bfe4d415e84edfcab146aa0432c65
Author: Ioritz Cia <ioritz.cia <at> openbravo.com>
Date: Tue Nov 22 11:54:06 2011 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/45ee9420aa7bfe4d415e84edfcab146aa0432c65 [^]

Fixes issue 18612: Assets - create amortization process
not calculating properly percetages/amounts.

---
M src-db/database/model/functions/A_ASSET_POST.xml
---
(0043158)
ioritzCia (developer)
2011-11-24 13:28

Test Plan:

- Follow the steps to reproduce.
- Try with other quantities and dates, insist on border dates as the first and the last days of the month and the dates around that ones.
- Check that the percentage lost in the roundings gets recovered in the line of the last amortization.
(0043434)
hudsonbot (developer)
2011-11-30 12:29

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/01809c7b3135 [^]

Maturity status: Test
(0043660)
mirurita (developer)
2011-12-01 18:17

Verified on revision 14787:d63e0b9b9bcc

- Issue History
Date Modified Username Field Change
2011-09-26 13:46 mirurita New Issue
2011-09-26 13:46 mirurita Assigned To => jonalegriaesarte
2011-09-26 13:46 mirurita File Added: Asset - create amortization.png
2011-09-26 13:46 mirurita Modules => Core
2011-09-26 13:46 mirurita Resolution time => 1322694000
2011-09-26 16:09 mirurita Target Version => 3.0MP6
2011-09-26 17:22 mirurita Proposed Solution updated
2011-11-17 16:08 jonalegriaesarte Assigned To jonalegriaesarte => ioritzCia
2011-11-24 10:34 hgbot Checkin
2011-11-24 10:34 hgbot Note Added: 0043141
2011-11-24 10:34 hgbot Status new => resolved
2011-11-24 10:34 hgbot Resolution open => fixed
2011-11-24 10:34 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/45ee9420aa7bfe4d415e84edfcab146aa0432c65 [^]
2011-11-24 13:28 ioritzCia Note Added: 0043158
2011-11-30 12:29 hudsonbot Checkin
2011-11-30 12:29 hudsonbot Note Added: 0043434
2011-12-01 18:17 mirurita Note Added: 0043660
2011-12-01 18:17 mirurita Status resolved => closed


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker