Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0025084Openbravo ERP05. Production managementpublic2013-11-05 17:232013-12-26 18:03
VictorVillar 
AtulOpenbravo 
urgentmajoralways
closedfixed 
5
pi 
3.0MP31 
VictorVillar
Core
No
0025084: ma_standard_cost does not round to the Cost Precision
ma_standard_cost does not round to the 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

After creating a process plan with products checked as production with purchase price list asigned.
you run "Calculate Standard 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 ma_standard_cost) calls function C_Currency_conver_precision with last parameter 'p_costing' always set to A. Due to that, C_Currency_conver_precision takes StandardPrecision instead of CostPrecision.
The problem is function C_Currency_Convert (which is called by ma_standard_cost || m_get_product_price_date) calls function C_Currency_conver_precision with last parameter 'p_costing' always set to A. Due to that, C_Currency_conver_precision takes StandardPrecision instead of CostPrecision.

It would be fine to have the same code as in the m_generate_average_costs, calling the C_Currency_conver_precision directly with 'C' as precision parameter.
No tags attached.
Issue History
2013-11-05 17:23VictorVillarNew Issue
2013-11-05 17:23VictorVillarAssigned To => dmiguelez
2013-11-05 17:23VictorVillarModules => Core
2013-11-05 17:23VictorVillarResolution time => 1388444400
2013-11-05 17:23VictorVillarTriggers an Emergency Pack => No
2013-11-05 17:24VictorVillarIssue Monitored: networkb
2013-11-08 12:08dmiguelezAssigned Todmiguelez => jonalegriaesarte
2013-11-25 10:32jonalegriaesarteAssigned Tojonalegriaesarte => pramakrishnan
2013-12-02 09:55jonalegriaesarteTarget Version3.0MP30 => 3.0MP31
2013-12-05 07:20AtulOpenbravoNote Added: 0062541
2013-12-11 09:53pramakrishnanAssigned Topramakrishnan => AtulOpenbravo
2013-12-12 12:52AtulOpenbravoStatusnew => scheduled
2013-12-12 12:52AtulOpenbravofix_in_branch => pi
2013-12-12 12:52AtulOpenbravoReview Assigned To => VictorVillar
2013-12-12 12:52AtulOpenbravofix_in_branchpi =>
2013-12-13 10:37hgbotCheckin
2013-12-13 10:37hgbotNote Added: 0062720
2013-12-13 10:37hgbotStatusscheduled => resolved
2013-12-13 10:37hgbotResolutionopen => fixed
2013-12-13 10:37hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/75d9faa915adc32039e56c9c8239aa1eafe1a4d7 [^]
2013-12-19 12:31hudsonbotCheckin
2013-12-19 12:31hudsonbotNote Added: 0062850
2013-12-26 18:03VictorVillarNote Added: 0063088
2013-12-26 18:03VictorVillarStatusresolved => closed

Notes
(0062541)
AtulOpenbravo   
2013-12-05 07:20   
Test Plan
- Use 4 or 5 Decimals in Format.xml for Price.
- Set Base Currency precision as Standard Precision = 2, Cost Precision = 3, Price Precision = 4. For F&B International Group Base Currency = USD.
- Create a Purchase List List. Set currency as CUP, mark Default = yes.
- Set Conversion Rates for CUP to USD, USD to CUP.
- Create products and mark Production = yes which are to used in the Process Plan >> Version >> Operation >> I/O Product Tab. Add the product with 4 decimal prices in the above price list.
- Define a Cost Center, with Valid Version and define the cost in it.
- Cost = 1, Uom = Per Produced Units. Define Machine Cost, Employee Cost, Indirect Cost as applicable.
- Define a Activity and attach Cost Center to it.
- Define a Process Plan. Create a Valid Version for Process Plan. Define Operation and set activity as defined above. Define I/O Products, their Production Type ( - or +), Quantity.
- Run a Calculate Standard Costs process.
- Check the cost calculated in Process Plan >> Version >> Operation >> I/O Products Tab >> Cost Field in the Grid View is calculated using Cost Precision of the Base Currency i.e 3.

Note: Base currency is set in Client >> Currency Field.
(0062720)
hgbot   
2013-12-13 10:37   
Repository: erp/devel/pi
Changeset: 75d9faa915adc32039e56c9c8239aa1eafe1a4d7
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Wed Dec 11 12:04:48 2013 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/75d9faa915adc32039e56c9c8239aa1eafe1a4d7 [^]

Fixes Issue 0025084: ma_standard_cost does not round
                     to the Cost Precision

---
M src-db/database/model/functions/MA_STANDARD_COST_SEQUENCE.xml
M src-db/database/model/functions/M_GET_PRODUCT_PRICE_DATE.xml
---
(0062850)
hudsonbot   
2013-12-19 12: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/b878bb51dc09 [^]

Maturity status: Test
(0063088)
VictorVillar   
2013-12-26 18:03   
verified