Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0012386Openbravo ERP01. General setuppublic2010-02-22 13:362010-03-12 22:40
networkb 
harikrishnan 
urgentmajoralways
closedopen 
5
2.50MP11 
2.50MP142.50MP14 
Core
No
0012386: Price Precision error
You modify your Format.xml file to be able to show 4 decimals in prices (and also your Price Precision in the application is set to 4), and then set a price with 4 decimals for a certain product.
When you create a purchase order line using this product the Unit, Standard and Price List prices are rounded to 2 decimals (which is standard precision, not price precision) instead of 4.

The problem is in c_currency_round function, where StdPrecision is always taken instead of PricePrecision, in this case.
1. Modify Format.xml to set priceRelation and priceEdition fields with 4 decimals.
2. Compile application: ant compile.development -Dtab=xxx
3. Go to General Setup || Application || Currency and realize that
Standard Precision=2
Price Precision=4
Cost Precision=4
4. Go to Master Data Management || Product || Product >> Price : set any price to '1.1234'
5. Procurement Management || Transactions || Purchase Order: create new record and go to its lines
6. Procurement Management || Transactions || Purchase Order || Header >> Lines : add a new line choosing the certain product and realize that Unit Price is set to '1.1200' (instead of '1.1234')
No tags attached.
Issue History
2010-02-22 13:36networkbNew Issue
2010-02-22 13:36networkbAssigned To => adrianromero
2010-02-22 13:49adrianromeroStatusnew => scheduled
2010-02-22 13:49adrianromerofix_in_branch => pi
2010-02-26 13:25harikrishnanAssigned Toadrianromero => harikrishnan
2010-02-26 13:32hgbotCheckin
2010-02-26 13:32hgbotNote Added: 0024867
2010-02-26 13:32hgbotStatusscheduled => resolved
2010-02-26 13:32hgbotResolutionopen => fixed
2010-02-26 13:32hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/825d188f527d6a6beb46abcacc45193d74150ff4 [^]
2010-02-26 13:39harikrishnanNote Added: 0024868
2010-03-02 08:20sureshbabuNote Added: 0024926
2010-03-02 08:20sureshbabuStatusresolved => new
2010-03-02 08:20sureshbabuResolutionfixed => open
2010-03-02 12:41harikrishnanNote Added: 0024936
2010-03-02 12:41harikrishnanNote Edited: 0024936bug_revision_view_page.php?bugnote_id=0024936#r97
2010-03-02 13:09sureshbabuNote Added: 0024940
2010-03-02 13:09sureshbabuStatusnew => acknowledged
2010-03-02 13:16adrianromeroStatusacknowledged => scheduled
2010-03-02 13:16adrianromerofix_in_branchpi =>
2010-03-02 13:16adrianromeroStatusscheduled => resolved
2010-03-02 13:17sureshbabuNote Added: 0024941
2010-03-02 13:17sureshbabuStatusresolved => closed
2010-03-02 13:17sureshbabuFixed in Version => 2.50MP13
2010-03-08 16:04jpabloaeFixed in Version2.50MP13 => 2.50MP14
2010-03-08 16:05jpabloaeTarget Version2.50MP13 => 2.50MP14
2010-03-10 17:24anonymoussf_bug_id0 =>
2010-03-10 18:30anonymoussf_bug_id => 2968093
2010-03-12 22:40hudsonbotCheckin
2010-03-12 22:40hudsonbotNote Added: 0025348

Notes
(0024867)
hgbot   
2010-02-26 13:32   
Repository: erp/devel/pi
Changeset: 825d188f527d6a6beb46abcacc45193d74150ff4
Author: Harikrishnan Raja <harikrishnan.raja <at> openbravo.com>
Date: Fri Feb 26 18:03:54 2010 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/825d188f527d6a6beb46abcacc45193d74150ff4 [^]

Fixes Issue 12386: Price Precision error.

---
M src-db/database/model/functions/M_BOM_PRICELIMIT.xml
M src-db/database/model/functions/M_BOM_PRICELIST.xml
M src-db/database/model/functions/M_BOM_PRICESTD.xml
A src-db/database/model/functions/C_GET_CURRENCY_PRECISION.xml
---
(0024868)
harikrishnan   
2010-02-26 13:39   
Steps to Test:

* Go to file Format.xml in workspace/config/Format.xml and change the values as given below.
    <Number name="priceRelation"
       decimal="." grouping="," formatOutput="#,##0.0000" formatInternal="#0.0000" />
   <Number name="priceEdition"
       decimal="." grouping="," formatOutput="#0.0000" formatInternal="#0.0000" />
*Then run the ant task ant compile.development -Dtab="xxx"

*Then go to Product (Master Data Management || Product || Product ) and then to Price(Master Data Management || Product || Product >> Price ), change the price to four decimal points for example " product = "hat" List price=35.1234 similar way do it for other two prices also".
*Then go to purchase order(Procurement Management || Transactions || Purchase Order || Header ) and create a new header.Then go to lines and select a product that we changed above.In this case the product will be "Hat".You can notice the four digits will be displayed in net unit price.
(0024926)
sureshbabu   
2010-03-02 08:20   
Hi Hari,

I am still finding the same issue, i tried to reproduce the issue by modifying the Format.xml to set priceRelation and priceEdition fields with 6 decimals instead of 4 decimal places. Then i entered the product price as 2.123456. When i used the product in transaction window i am finding the price as 2.123500 instead of 2.123456.

Kindly let me know if you are not able to reproduce the issue.
(0024936)
harikrishnan   
2010-03-02 12:41   
Steps to Test:

* Go to file Format.xml in workspace/config/Format.xml and change the values as given below.
    <Number name="priceRelation"
       decimal="." grouping="," formatOutput="#,##0.0000" formatInternal="#0.0000" />
   <Number name="priceEdition"
       decimal="." grouping="," formatOutput="#0.0000" formatInternal="#0.0000" />
*Then run the ant task ant compile.development -Dtab="xxx"
*Change the price precision in Currency(General Setup || Application || Currency || Currency ) according to the precision you want.In this case you want update to 6.
*Then go to Product (Master Data Management || Product || Product ) and then to Price(Master Data Management || Product || Product >> Price ), change the price to four decimal points for example " product = "hat" List price=35.1234 similar way do it for other two prices also".
*Then go to purchase order(Procurement Management || Transactions || Purchase Order || Header ) and create a new header.Then go to lines and select a product that we changed above.In this case the product will be "Hat".You can notice the four digits will be displayed in net unit price.

(0024940)
sureshbabu   
2010-03-02 13:09   
i have retested as per the updated steps, its working fine.
(0024941)
sureshbabu   
2010-03-02 13:17   
i have retested as per the updated steps, its working fine.
(0025348)
hudsonbot   
2010-03-12 22:40   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/825d188f527d [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/631c626866c1 [^]
Tests: http://builds.openbravo.com/view/devel-int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.16685.obx [^]