Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0012487Openbravo ERP04. Warehouse managementpublic2010-02-26 14:212010-04-16 00:00
networkb 
gorkaion 
immediatemajoralways
closedfixed 
5
2.50MP11 
2.50MP14 
Core
No
0012487: m_generate_average_costs doesn't round to Cost Precision
In an application with:
* Format.xml showing 5 decimals
* Currency precisions set to: StandardPrecision=2; CostPrecision=3; PricePrecision=4.
* Currency Conversion from EUR to CUP and CUP to EUR
* PriceList with currency=CUP and any price for a certain product with 4 decimals

If you have a Goods Receipt and its associated Purchase Invoice, and you run "Generate Average cost" process, cost and price values are calculated using 2 decimals (StdPrecision) instead of 3 (CostPrecision).

The problem is function C_Currency_Convert (which is called by M_Generate_Average_Costs) calls function C_Currency_Round with last parameter 'p_costing' always set to NULL. Due to that, C_Currency_Round takes StandardPrecision instead of CostPrecision.
1. Modify Format.xml to set euroRelation,euroEdition,priceRelation,priceEdition fields with 5 decimals.
2. Compile application: ant compile.development -Dtab=xxx
3. Logged as System Administrator, Go to General Setup || Application || Currency and set EUR to
Standard Precision=2
Price Precision=4
Cost Precision=3
4. General Setup || Application || Conversion Rates:
EUR - CUP Validfrom= 01-01-2006 validto=31-12-2006 Multiply=2
CUP - EUR Validfrom= 01-01-2006 validto=31-12-2006 Multiply=0.5
5. Master Data Management || Pricing || Price List: create price list in CUP setting; Price list version valid from 01-01-2006; Product Price for Hammer product as 1.12345
6. Procurement Management || Transactions || Goods Receipt:
date= 03-05-2006
partner=mcgiver
product=hammer
qty=1
complete
7. Procurement Management || Transactions || Purchase Invoice:
date=03-05-2006
partner=mcgiver
pricelist=cup
create lines from good receipt already created
go to line and ensure that price=1.12345
complete
8. Warehouse Management and run "Generate Average Cost" process.
9. Master Data Management || Product || Product >> Costing : check that price is 0.56 instead of 0.562 (as it should be taken 3 decimals instead of 2)
No tags attached.
Issue History
2010-02-26 14:21networkbNew Issue
2010-02-26 14:21networkbAssigned To => adrianromero
2010-02-26 16:26networkbAssigned Toadrianromero => dalsasua
2010-02-26 16:26networkbPriorityurgent => immediate
2010-02-26 16:46dalsasuaAssigned Todalsasua => gorkaion
2010-02-26 18:57hgbotCheckin
2010-02-26 18:57hgbotNote Added: 0024879
2010-02-26 18:57hgbotStatusnew => resolved
2010-02-26 18:57hgbotResolutionopen => fixed
2010-02-26 18:57hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/f718ec3e327c7548843652384ea64e2b9dcbab61 [^]
2010-03-08 16:05jpabloaeTarget Version2.50MP13 => 2.50MP14
2010-03-12 22:40hudsonbotCheckin
2010-03-12 22:40hudsonbotNote Added: 0025356
2010-04-15 13:52sureshbabuNote Added: 0026258
2010-04-15 13:52sureshbabuStatusresolved => closed
2010-04-16 00:00anonymoussf_bug_id0 => 2987959

Notes
(0024879)
hgbot   
2010-02-26 18:57   
Repository: erp/devel/pi
Changeset: f718ec3e327c7548843652384ea64e2b9dcbab61
Author: Gorka Ion Damián <gorkaion.damian <at> openbravo.com>
Date: Fri Feb 26 18:58:16 2010 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/f718ec3e327c7548843652384ea64e2b9dcbab61 [^]

Fixes issue 12487. m_generate_average_costs doesn't round to Cost Precision

---
M src-db/database/model/functions/C_CURRENCY_CONVERT.xml
M src-db/database/model/functions/M_GENERATE_AVERAGE_COSTS.xml
A src-db/database/model/functions/C_CURRENCY_CONVERT_PRECISION.xml
---
(0025356)
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/f718ec3e327c [^]
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 [^]
(0026258)
sureshbabu   
2010-04-15 13:52   
Tested working fine