Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0011226Openbravo ERPA. Platformpublic2009-10-30 12:282009-11-05 12:22
psarobe 
dbaz 
immediatemajoralways
closedfixed 
5
2.40MP5 
2.40MP11 
Core
No
0011226: Decimal format: Amounts not well calculate if decimal rounds is not properly setup
If you are working with 3 or 4 decimal for pricing but the format.xml is not properly setup in order to allow to have 3 or 4 decimal then there is an inconsistent between price x quantity and the result amount

Scenario
========
Format.xml setup for just having 2 decimals. You create a sales invoice and you enter the price: 1.888; quantity:55 amount:103.84
But after leaving the focus in the price field you have 1.89. So finally you have in the DB:
price:1.89
quantity:55
amount:103.84
But 1.89 x 55= 103.95

So the inconsistency is clear
1. Login as Openbravo/openbravo
2. Create a sales invoice
3. Move to lines and enter for quantity 55
4. Enter for price 1.888
5. the amount will be 1.888x55

But as in the DB will be stored 1.89 (because of the format.xml) the amount should be 1.89x55
The call-out should take into the format and what the final quantity, price will be.

Review and fix all the call-outs in the ERP
No tags attached.
blocks defect 0011188 closed dbaz Decimal format: Amounts not well calculate if decimal rounds is not properly setup 
jpg issue11226.JPG (187,590) 2009-11-05 07:44
https://issues.openbravo.com/file_download.php?file_id=1915&type=bug
jpg
Issue History
2009-11-03 10:00iperdomoTypedefect => backport
2009-11-03 10:00iperdomofix_in_branchpi => 2.40
2009-11-03 14:04hgbotCheckin
2009-11-03 14:04hgbotNote Added: 0021536
2009-11-03 14:04hgbotStatusscheduled => resolved
2009-11-03 14:04hgbotResolutionopen => fixed
2009-11-03 14:04hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/0c8232e70ac9d8f9e676db2690627aa3e2ddbf28 [^] => http://code.openbravo.com/erp/stable/2.40/rev/4758a74e4f76463fe70e6782c5ef7c8cf3563844 [^]
2009-11-05 07:43arunkumarStatusresolved => new
2009-11-05 07:43arunkumarResolutionfixed => open
2009-11-05 07:43arunkumarNote Added: 0021575
2009-11-05 07:44arunkumarFile Added: issue11226.JPG
2009-11-05 08:15rafarodaStatusnew => scheduled
2009-11-05 08:15rafarodaversion => 2.40MP5
2009-11-05 11:35dbazNote Added: 0021594
2009-11-05 11:35dbazAssigned Todbaz => plujan
2009-11-05 11:39plujanAssigned Toplujan => dbaz
2009-11-05 11:46dbazStatusscheduled => resolved
2009-11-05 11:46dbazResolutionopen => fixed
2009-11-05 11:46dbazNote Added: 0021595
2009-11-05 12:19plujanNote Added: 0021600
2009-11-05 12:22arunkumarStatusresolved => closed
2009-11-05 12:22arunkumarNote Added: 0021601
2009-11-05 12:22arunkumarFixed in Version => 2.40MP11

Notes
(0021536)
hgbot   
2009-11-03 14:04   
Repository: erp/stable/2.40
Changeset: 4758a74e4f76463fe70e6782c5ef7c8cf3563844
Author: David Baz Fayos <david.baz <at> openbravo.com>
Date: Tue Nov 03 14:04:29 2009 +0100
URL: http://code.openbravo.com/erp/stable/2.40/rev/4758a74e4f76463fe70e6782c5ef7c8cf3563844 [^]

Fixed issue 11226: Now callout math operations are consistent

---
M src/org/openbravo/erpCommon/security/Login_F1.html
M web/js/utils.js
---
(0021575)
arunkumar   
2009-11-05 07:43   
I followed the steps to reproduce. But still I am seeing the issue.

I created a sales invoice with line Invoiced quantity as 55 and Unit price as 1.888. Due to the format.xml it has been rounded into two decimals and it displayed me as 1.89.

But the Line net amount is displayed as 1.888*55=103.84. As Pablo told it should be 1.89*55=103.95.

Can you please confirm me whether the steps which I followed are correct? Please refer the screenshot.
(0021594)
dbaz   
2009-11-05 11:35   
It works for me.

Reassigning to plujan.
(0021595)
dbaz   
2009-11-05 11:46   
It works for me
(0021600)
plujan   
2009-11-05 12:19   
It was reopened by mistake. Javascript libraries using during verification were outdated.
(0021601)
arunkumar   
2009-11-05 12:22   
Tested & working fine.