Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0015888Openbravo ERP07. Sales managementpublic2011-02-09 10:112011-04-05 00:00
maite 
jonalegriaesarte 
urgentmajoralways
closedfixed 
5
2.50MP26 
2.50MP27 
Core
No
0015888: Wrong "adjusted price" when using price adjustments
"Adjusted price" of Price Adjustments tab is recalculated by m_get_offer_std_price function when saving order line. If working with decimals "adjusted price" could be different to order line price due to rounding.
"Adjusted price" should be directly copy from order line instead of recalculated again to avoid this difference
1. Master Data Management || Pricing || Price Adjustments || Adjustments:
  starting date= 08/02/2011
  Discount %= 30
  Included Business Partners= Only those defined --> Add "mafalda" in BP tab
  Included Products = Only those defined --> Add "hammer" in BP tab
2. Master Data Management || Product || Product >> Price : search for hammer and set 3 prices for "Mafalda price list" to 3.75
3. Sales Management || Transactions || Sales Order || Header : create order for mafalda
4. Sales Management || Transactions || Sales Order || Header >> Lines : add line for hammer and save.
5. Navigate to Sales Management || Transactions || Sales Order || Header >> Lines >> Price Adjustments : realize that "Adjusted Price" is 3.76 instead of 3.75

Problem is in function m_get_offer_std_price (which is called from c_orderline_trg2): it performs arithmetic operation and return number with several decimals, which is again rounded causing the error.
No tags attached.
related to defect 00166133.0RC6 closed jonalegriaesarte Wrong "adjusted price" when using price adjustments 
diff 15888.diff (774) 2011-03-22 11:48
https://issues.openbravo.com/file_download.php?file_id=3728&type=bug
Issue History
2011-02-09 10:11maiteNew Issue
2011-02-09 10:11maiteAssigned To => adrianromero
2011-02-09 10:11maiteModules => Core
2011-03-18 09:32jonalegriaesarteAssigned Toadrianromero => jonalegriaesarte
2011-03-18 09:33jonalegriaesarteStatusnew => scheduled
2011-03-18 09:33jonalegriaesartefix_in_branch => pi
2011-03-22 11:48jonalegriaesarteFile Added: 15888.diff
2011-03-22 11:48jonalegriaesarteNote Added: 0035140
2011-03-22 11:48jonalegriaesarteStatusscheduled => resolved
2011-03-22 11:48jonalegriaesarteFixed in Version => 2.50MP29
2011-03-22 11:48jonalegriaesarteFixed in SCM revision => in attached diff
2011-03-22 11:48jonalegriaesarteResolutionopen => fixed
2011-04-01 18:00jonalegriaesarteRelationship addedrelated to 0016613
2011-04-01 18:06hgbotCheckin
2011-04-01 18:06hgbotNote Added: 0035481
2011-04-01 18:06hgbotFixed in SCM revisionin attached diff => http://code.openbravo.com/erp/stable/2.50/rev/944b0da4c10e03877b2ce01709e0031e84212830 [^]
2011-04-04 10:34maiteNote Added: 0035512
2011-04-04 10:35maiteStatusresolved => closed
2011-04-04 10:35maiteFixed in Version2.50MP29 =>
2011-04-05 00:00anonymoussf_bug_id0 => 3274924

Notes
(0035140)
jonalegriaesarte   
2011-03-22 11:48   
Attached the diff file to the issue because the repository is frozen.
(0035481)
hgbot   
2011-04-01 18:06   
Repository: erp/stable/2.50
Changeset: 944b0da4c10e03877b2ce01709e0031e84212830
Author: Egoitz Castillo <egoitz.castillo <at> openbravo.com>
Date: Fri Apr 01 18:05:39 2011 +0200
URL: http://code.openbravo.com/erp/stable/2.50/rev/944b0da4c10e03877b2ce01709e0031e84212830 [^]

Fixes issue 0015888: Wrong "adjusted price" when using price adjustments
Now the difference is calculated based on the price standard.

---
M src-db/database/model/triggers/C_ORDERLINE_TRG2.xml
M src/org/openbravo/erpCommon/ad_callouts/SL_Order_Amt.java
---
(0035512)
maite   
2011-04-04 10:34   
verified