Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0024385Openbravo ERP07. Sales managementpublic2013-07-19 13:362013-08-26 10:04
gorkaion 
pramakrishnan 
normalmajoralways
closedfixed 
20Gentoo
pi 
3.0MP273.0MP27 
jonalegriaesarte
Core
No
0024385: Manual discounts are not properly applied in certain cases
When a discount is applied manually in a Sales Order using the discount field the unit price is not properly calculated.
1. Create a sales order.
2. Insert a line of product with a List Price of 0.75 (Cola de Cereza for example).
3. Ensure that there is not any Promotion or Discount applied. Unit Price remains 0.75.
4. Change the discount to 10%
5. See that calculated unit price is 0.67, when we expect 0.68

(0.75 - 10% = 0.675 rounded to 0.68)
SL_Order_Amt.java callout is not rounding properly the discounted base unit price. Line 288. It is rounding in the division prior de subtract.

Fix: Do not round the division and use setScale to the resulting BigDecimal.

Patch supplied.
No tags attached.
related to defect 00243783.0MP27 closed pramakrishnan Taxes are not correctly calculate in some cases 
patch discount-round.patch (934) 2013-07-19 13:36
https://issues.openbravo.com/file_download.php?file_id=6278&type=bug
Issue History
2013-07-19 13:36gorkaionNew Issue
2013-07-19 13:36gorkaionAssigned To => dmiguelez
2013-07-19 13:36gorkaionFile Added: discount-round.patch
2013-07-19 13:36gorkaionModules => Core
2013-07-19 13:36gorkaionTriggers an Emergency Pack => No
2013-07-19 13:36gorkaionRelationship addedrelated to 0024378
2013-08-05 14:01jonalegriaesarteAssigned Todmiguelez => pramakrishnan
2013-08-05 14:02jonalegriaesarteTarget Version => 3.0MP27
2013-08-06 07:05pramakrishnanStatusnew => scheduled
2013-08-06 07:05pramakrishnanfix_in_branch => pi
2013-08-06 13:37hgbotCheckin
2013-08-06 13:37hgbotNote Added: 0060512
2013-08-06 13:37hgbotStatusscheduled => resolved
2013-08-06 13:37hgbotResolutionopen => fixed
2013-08-06 13:37hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/ee3b2cbc5d3b82f6979d9b8b23103380060f0e79 [^]
2013-08-14 15:36pramakrishnanNote Added: 0060593
2013-08-14 15:36pramakrishnanStatusresolved => new
2013-08-14 15:36pramakrishnanResolutionfixed => open
2013-08-14 15:36pramakrishnanReview Assigned To => jonalegriaesarte
2013-08-14 15:36pramakrishnanfix_in_branchpi =>
2013-08-14 15:36pramakrishnanStatusnew => scheduled
2013-08-14 15:36pramakrishnanfix_in_branch => pi
2013-08-14 15:37pramakrishnanStatusscheduled => resolved
2013-08-14 15:37pramakrishnanResolutionopen => fixed
2013-08-16 20:31hudsonbotCheckin
2013-08-16 20:31hudsonbotNote Added: 0060628
2013-08-26 10:04jonalegriaesarteNote Added: 0060761
2013-08-26 10:04jonalegriaesarteStatusresolved => closed
2013-08-26 10:04jonalegriaesarteFixed in Version => 3.0MP27

Notes
(0060512)
hgbot   
2013-08-06 13:37   
Repository: erp/devel/pi
Changeset: ee3b2cbc5d3b82f6979d9b8b23103380060f0e79
Author: Pandeeswari Ramakrishnan <pandeeswari.ramakrishnan <at> openbravo.com>
Date: Tue Aug 06 11:24:24 2013 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/ee3b2cbc5d3b82f6979d9b8b23103380060f0e79 [^]

Fixes Issue 24385: Manual discounts are not properly applied in certain cases

---
M src/org/openbravo/erpCommon/ad_callouts/SL_Order_Amt.java
---
(0060593)
pramakrishnan   
2013-08-14 15:36   
Reopened to update review assigned to
(0060628)
hudsonbot   
2013-08-16 20: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/59a1180e7f4f [^]

Maturity status: Test
(0060761)
jonalegriaesarte   
2013-08-26 10:04   
Patch is working fine