Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0024378Openbravo ERP07. Sales managementpublic2013-07-18 18:542013-08-26 12:23
jonalegriaesarte 
pramakrishnan 
normalmajorhave not tried
closedfixed 
5
 
3.0MP273.0MP27 
jonalegriaesarte
Core
No
0024378: Taxes are not correctly calculate in some cases
Taxes are not correctly calculate in some cases
- Change tarifa de ventas to price including taxes
- Create a new sales order with one line to the first product in the list
- Notice that the values calculated are:

Unit price = 1.27
Tax = 0.26
Gross = 1.53

Notice that: 1.27*1.21 (applying 21%) = 1.5367 (rounded) = 1.54

How it should work:

Gross = 1.53
Unit price = gross/taxrate = 1.26
Tax = gross - unit = 0.27
Moved from MP26 to MP27
related to defect 00243853.0MP27 closed pramakrishnan Manual discounts are not properly applied in certain cases 
related to design defect 0032265 closed aferraz [SER QA 1434] Taxes at document level are not properly calculated in some cases 
patch tax-calculation.patch (953) 2013-07-18 19:06
https://issues.openbravo.com/file_download.php?file_id=6274&type=bug
Issue History
2013-07-18 18:54jonalegriaesarteNew Issue
2013-07-18 18:54jonalegriaesarteAssigned To => gorkaion
2013-07-18 18:54jonalegriaesarteModules => Core
2013-07-18 18:54jonalegriaesarteTriggers an Emergency Pack => No
2013-07-18 19:06gorkaionFile Added: tax-calculation.patch
2013-07-18 19:10gorkaionNote Added: 0060105
2013-07-18 19:10gorkaionAssigned Togorkaion => dmiguelez
2013-07-18 19:17gorkaionNote Edited: 0060105bug_revision_view_page.php?bugnote_id=0060105#r4903
2013-07-19 13:36gorkaionRelationship addedrelated to 0024385
2013-07-29 09:52dmiguelezAssigned Todmiguelez => jonalegriaesarte
2013-08-01 09:51jonalegriaesarteTarget Version3.0MP26 => 3.0MP27
2013-08-01 09:52jonalegriaesarteTag Attached: Moved from MP26 to MP27
2013-08-01 09:53jonalegriaesarteAssigned Tojonalegriaesarte => pramakrishnan
2013-08-04 09:48pramakrishnanStatusnew => scheduled
2013-08-04 09:48pramakrishnanfix_in_branch => pi
2013-08-05 11:17hgbotCheckin
2013-08-05 11:17hgbotNote Added: 0060497
2013-08-05 11:18hgbotStatusscheduled => resolved
2013-08-05 11:18hgbotResolutionopen => fixed
2013-08-05 11:18hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/cb5dd42e39375802065ba6c031cdb3b81c6918fc [^]
2013-08-14 15:38pramakrishnanNote Added: 0060594
2013-08-14 15:38pramakrishnanStatusresolved => new
2013-08-14 15:38pramakrishnanResolutionfixed => open
2013-08-14 15:38pramakrishnanReview Assigned To => jonalegriaesarte
2013-08-14 15:38pramakrishnanfix_in_branchpi =>
2013-08-14 15:39pramakrishnanStatusnew => scheduled
2013-08-14 15:39pramakrishnanfix_in_branch => pi
2013-08-14 15:39pramakrishnanStatusscheduled => resolved
2013-08-14 15:39pramakrishnanResolutionopen => fixed
2013-08-16 20:31hudsonbotCheckin
2013-08-16 20:31hudsonbotNote Added: 0060626
2013-08-26 12:23jonalegriaesarteNote Added: 0060769
2013-08-26 12:23jonalegriaesarteStatusresolved => closed
2013-08-26 12:23jonalegriaesarteFixed in Version => 3.0MP27
2017-01-13 11:09aferrazRelationship addedrelated to 0032265

Notes
(0060105)
gorkaion   
2013-07-18 19:10   
(edited on: 2013-07-18 19:17)
Because how taxes are calculated there is always a chance of differences due to rounding.

However it is possible to reduce them. The C_GET_NET_PRICE_FROM_GROSS procedure calculates the net price from the gross price. To do this it calculates a Tax Amount. This tax amount is being rounded to the Price Precision. Changing this rounding to a higher number results in more accurate results. Attached a patch that rounds to at least 50 digits the tax amount. It has only be tested with the given example in Oracle.

(0060497)
hgbot   
2013-08-05 11:17   
Repository: erp/devel/pi
Changeset: cb5dd42e39375802065ba6c031cdb3b81c6918fc
Author: Pandeeswari Ramakrishnan <pandeeswari.ramakrishnan <at> openbravo.com>
Date: Sun Aug 04 18:01:41 2013 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/cb5dd42e39375802065ba6c031cdb3b81c6918fc [^]

Fixes Issue 24378: Taxes are not correctly calculate in some cases

---
M src-db/database/model/functions/C_GET_NET_PRICE_FROM_GROSS.xml
---
(0060594)
pramakrishnan   
2013-08-14 15:38   
Reopened to update review assigned to
(0060626)
hudsonbot   
2013-08-16 20:31   
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/59a1180e7f4f [^]

Maturity status: Test
(0060769)
jonalegriaesarte   
2013-08-26 12:23   
Working fine