Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0012704Openbravo ERP07. Sales managementpublic2010-03-17 09:452010-07-13 22:11
networkb 
adrianromero 
immediateminoralways
closedfixed 
5
2.50MP19 
2.50MP20 
Core
No
0012704: Error when a Price Adjustment is applied
On Sales Order, if a Price Adjustment is applied, the application does not calculate properly the Standard Price.

-Modify the Format.xml and the Standard Precision. The number's format must be 0.0000
-Modify the Format.xml and the Standard Precision.
* <Number name="euroRelation"
       decimal="." grouping="," formatOutput="#,##0.0000" formatInternal="#0.00" />
   <Number name="euroEdition"
       decimal="." grouping="," formatOutput="#0.0000" formatInternal="#0.00" />
* <Number name="priceRelation"
       decimal="." grouping="," formatOutput="#,##0.0000" formatInternal="#0.00" />
   <Number name="priceEdition"
       decimal="." grouping="," formatOutput="#0.0000" formatInternal="#0.00" />


The number's format must be 0.0000

-As Openbravo Admin go to Master Data Management || Product (Hammer)|| Product >> Price
- Select Price List Version: Sales 2006
    - List Price: 1.4200
    - Standard Price: 1.4200
    - Price Limit: 5.5000
-Save and go to Master Data Management || Pricing || Price Adjustments
-Create a new record:
    - Starting Date: 01-01-2010
    - Discount %: 47.80
    - Included Business Partners: All selected
-Go to Bisiness Partner and select Obelix Quarry SA.
-Save and go to Sales Management || Transactions || Sales Order
-Create a new record, select Obelix and go to Lines.
-Select hammer.
-Realize that the Standard Price is 1.4199
No tags attached.
Issue History
2010-03-17 09:45networkbNew Issue
2010-03-17 09:45networkbAssigned To => adrianromero
2010-03-17 09:47rafarodaIssue Monitored: rafaroda
2010-03-17 09:49rafarodaNote Added: 0025563
2010-03-17 17:41adrianromeroStatusnew => scheduled
2010-03-17 17:41adrianromerofix_in_branch => pi
2010-05-05 18:36adrianromeroNote Added: 0026966
2010-05-05 18:36adrianromeroStatusscheduled => feedback
2010-05-06 11:53adrianromeroNote Added: 0026980
2010-05-06 11:53adrianromeroStatusfeedback => closed
2010-05-06 11:53adrianromeroResolutionopen => unable to reproduce
2010-05-07 00:00anonymoussf_bug_id0 => 2997914
2010-05-11 18:19jpabloaeTarget Version2.50MP16 => 2.50MP17
2010-07-02 10:29networkbNote Added: 0028973
2010-07-02 10:29networkbStatusclosed => new
2010-07-02 10:29networkbResolutionunable to reproduce => open
2010-07-02 10:30networkbfix_in_branchpi =>
2010-07-02 10:30networkbSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=562#r562
2010-07-02 10:31networkbversion2.50MP13 => 2.50MP19
2010-07-02 10:31networkbTarget Version2.50MP17 => 2.50MP20
2010-07-05 13:08adrianromeroPriorityhigh => immediate
2010-07-05 13:08adrianromeroStatusnew => scheduled
2010-07-05 18:29hgbotCheckin
2010-07-05 18:29hgbotNote Added: 0029067
2010-07-05 18:29hgbotStatusscheduled => resolved
2010-07-05 18:29hgbotResolutionopen => fixed
2010-07-05 18:29hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/fd08978a94e6654e2014a646c210281c8af160c1 [^]
2010-07-05 18:35adrianromeroNote Added: 0029068
2010-07-07 12:38hudsonbotCheckin
2010-07-07 12:38hudsonbotNote Added: 0029111
2010-07-13 22:11sureshbabuNote Added: 0029274
2010-07-13 22:11sureshbabuStatusresolved => closed

Notes
(0025563)
rafaroda   
2010-03-17 09:49   
Have a look at this line when debugging https://code.openbravo.com/erp/devel/pi/file/tip/src/org/openbravo/erpCommon/ad_callouts/SL_Order_Amt.java#l152 [^]
(0026966)
adrianromero   
2010-05-05 18:36   
Cannot reproduce in pi. Kindly test this issue in pi and verify it.
(0026980)
adrianromero   
2010-05-06 11:53   
This issue cannot be reproduced in pi but it was reproduced in MP13.
(0028973)
networkb   
2010-07-02 10:29   
It is reproduced in MP19 and MP18.
(0029067)
hgbot   
2010-07-05 18:29   
Repository: erp/devel/pi
Changeset: fd08978a94e6654e2014a646c210281c8af160c1
Author: Adrián Romero <adrianromero <at> openbravo.com>
Date: Mon Jul 05 18:28:07 2010 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/fd08978a94e6654e2014a646c210281c8af160c1 [^]

Fixes issue 0012704: Error when a Price Adjustment is applied
It has been modified the callout that calculates the price to not to modify the priceStd when calculating discounts if it is not necesary. This is done in order to avoid differences due rounding

---
M src/org/openbravo/erpCommon/ad_callouts/SL_Order_Amt.java
---
(0029068)
adrianromero   
2010-07-05 18:35   
* Testing of the issue

Just follow the Steps to Reproduce section and notice that now the Standard Price is 1.4200 as expected.

* Other areas affected by the change

It only has been modified the callout function that calculates order prices.No other areas are affected.

Take into account that this issue is because of price calculation cannot be reversed because of rounding. Then the solution implemented is just not to modify the Net Standard Price if it is not required but if for example the Net Unit Price is manually changed to 0,7412, the Net Standard Price will be changed to 1.4199 that is the correct result of removing the discount to the 0.7412 price.
(0029111)
hudsonbot   
2010-07-07 12:38   
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/fd08978a94e6 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/d555a35070ee [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.17817.obx [^]
(0029274)
sureshbabu   
2010-07-13 22:11   
verified