Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0040275
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 02. Master data managementmajoralways2019-02-26 16:532019-03-28 14:56
ReporterLeyreView Statuspublic 
Assigned Tomarkmm82 
PrioritynormalResolutionfixedFixed in Version3.0PR19Q2
StatusclosedFix in branchFixed in SCM revision1d09b6a639cf
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned ToSandrahuguet
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0040275: Error when calculating the discount field in the lines of a Sales Order

DescriptionError when calculating the discount field in the lines of a Sales Order
Steps To ReproduceBACKEND:

1. Create a new discount:
    Discount/Promotion Type = Price Adjustment
    Discount % = 50
    Included Business Partners = Only those defined
        Business Partner = defined one

2. Modify the price list of a product, for example = 35.05

3. Modify the price list of another product, for example = 35.06

4. Create a new sales order, with the Partner defined previously

5. Add two lines to the sales order, with both products.

6. Verify in the lines, that, in the case of the product = 35.05, a discount of -0.03 is applied to the line.

PROBLEM:

PriceAdjustment.java class -> calculatePriceStd method

First calculated 35.05 / 2 = 17.525 -> precision 2 -> 17.53

Secondly calculate 17.53 / 2 = 35.06 and use this value to calculate the final discount: 35.05-35.06 = -0.01 -> -0.01 * 100 = -1 -> -1 / 35.05 = - 0.028 -> precision 2 -> -0.03
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0110112)
markmm82 (developer)
2019-02-27 20:26

Test Plan:
1. Create a new discount:
    Discount/Promotion Type = Price Adjustment
    Discount % = 50
    Included Business Partners = Only those defined
        Business Partner = defined one

2. Modify the price list of a product, for example = 35.05

3. Modify the price list of another product, for example = 35.06

4. Create a new sales order, with the Partner defined previously

5. Add two lines to the sales order, with both products.

6. Verify in the lines, that, in the case of the product = 35.05, a discount of 0 is applied to the line. Notice the same discount is applied in the other line.
(0110354)
hgbot (developer)
2019-03-11 15:44

Repository: erp/devel/pi
Changeset: 1d09b6a639cf80ebec8b69195de78233951d047a
Author: Mark Molina <mark.molina <at> doceleguas.com>
Date: Wed Feb 27 18:43:27 2019 -0300
URL: http://code.openbravo.com/erp/devel/pi/rev/1d09b6a639cf80ebec8b69195de78233951d047a [^]

Fixes issue 40275: Error when calculating the field "amount" discount

The discount was wrongly calculated because an incorrect rounding on its calculation.
When discounts are applied the ActualPrice is calculated from the standard price and rounded.
When the reverse process is made (calculate the Price Std from the Actual Price) could be
differences because the rounding previously done to the ActualPrice.
To avoid those differences first is divided by the price list and rounded and then multiplied
by 100 and rounded again when the discount is calculated.

---
M src/org/openbravo/erpCommon/ad_callouts/SL_Order_Amt.java
---
(0110355)
Sandrahuguet (developer)
2019-03-11 15:44

Code review + testing OK
(0110860)
hudsonbot (developer)
2019-03-28 14:56

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/b2fbc1588df4 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2019-02-26 16:53 Leyre New Issue
2019-02-26 16:53 Leyre Assigned To => Triage Finance
2019-02-26 16:53 Leyre Modules => Core
2019-02-26 16:53 Leyre Triggers an Emergency Pack => No
2019-02-26 17:02 Practics Issue Monitored: Practics
2019-02-26 17:33 Sandrahuguet Assigned To Triage Finance => markmm82
2019-02-27 03:00 markmm82 Status new => scheduled
2019-02-27 17:03 Leyre Summary Error when calculating the field "amount"discount => Error when calculating the discount field in the lines of a Sales Order
2019-02-27 17:03 Leyre Description Updated View Revisions
2019-02-27 17:03 Leyre Steps to Reproduce Updated View Revisions
2019-02-27 17:03 Leyre Proposed Solution updated
2019-02-27 20:26 markmm82 Note Added: 0110112
2019-03-11 15:44 hgbot Checkin
2019-03-11 15:44 hgbot Note Added: 0110354
2019-03-11 15:44 hgbot Status scheduled => resolved
2019-03-11 15:44 hgbot Resolution open => fixed
2019-03-11 15:44 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/1d09b6a639cf80ebec8b69195de78233951d047a [^]
2019-03-11 15:44 Sandrahuguet Review Assigned To => Sandrahuguet
2019-03-11 15:44 Sandrahuguet Note Added: 0110355
2019-03-11 15:44 Sandrahuguet Status resolved => closed
2019-03-11 15:44 Sandrahuguet Fixed in Version => 3.0PR19Q2
2019-03-28 14:56 hudsonbot Checkin
2019-03-28 14:56 hudsonbot Note Added: 0110860


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker