Openbravo Issue Tracking System - Openbravo ERP | ||||||||||||
View Issue Details | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||||
0007323 | Openbravo ERP | 07. Sales management | public | 2009-02-02 18:19 | 2009-03-25 10:28 | |||||||
Reporter | rafaroda | |||||||||||
Assigned To | rafaroda | |||||||||||
Priority | high | Severity | minor | Reproducibility | always | |||||||
Status | closed | Resolution | no change required | |||||||||
Platform | OS | 20 | OS Version | Ubuntu 7.10 | ||||||||
Product Version | 2.35 | |||||||||||
Target Version | Fixed in Version | |||||||||||
Merge Request Status | ||||||||||||
Review Assigned To | ||||||||||||
OBNetwork customer | No | |||||||||||
Web browser | ||||||||||||
Modules | Core | |||||||||||
Support ticket | ||||||||||||
Regression level | ||||||||||||
Regression date | ||||||||||||
Regression introduced in release | ||||||||||||
Regression introduced by commit | ||||||||||||
Triggers an Emergency Pack | No | |||||||||||
Summary | 0007323: Discount is not correctly calculated when Price Adjustments are applied | |||||||||||
Description | Discount field inside in the lines of Sales or Purchase Orders is not correctly calculated when Price Adjustments are applied. | |||||||||||
Steps To Reproduce | 1) Create a price adjustment in 'Master Data Management || Pricing || Price Adjustments || Adjustments' with values: * Starting date = 01-01-2000 * Discount % = 50 * Min Quantity = 499 * Business Partner = All Selected * Product = All Selected 2) Move to Business Partner tab and select one business partner 3) Move to Product tab and select one product 4) Create a new Sales or Purchase Order for the business partner of the price adjustment 5) Create one line for the product of the price adjustment. Notice that the Discount field is correctly calculated as: * Unit Price = UP * List Price = LP * Discount = D = 100*(1-(UP/LP)) 6) Save this line 7) Change quantity to 500. Unit Price should have half amount But notice that the Discount remains the same. 8) Change Unit Price to the same value that the List Price. Discount should be 0 but is calculated as -100. | |||||||||||
Proposed Solution | Review https://dev.openbravo.com/websvn/openbravo/trunk/src/org/openbravo/erpCommon/ad_callouts/SL_Order_Product.java [^] specially the lines where it says: BigDecimal discount = new BigDecimal(0.0); if (priceList.compareTo(discount) != 0) { discount = (((priceList.subtract(priceStd)).divide(priceList, 12, BigDecimal.ROUND_HALF_EVEN)) .multiply(new BigDecimal("100"))).setScale(2, BigDecimal.ROUND_HALF_UP); } Should the discount be calculated using the unit price instead of the price std? | |||||||||||
Additional Information | ||||||||||||
Tags | No tags attached. | |||||||||||
Relationships |
| |||||||||||
Attached Files | ||||||||||||
Issue History | ||||||||||||
Date Modified | Username | Field | Change | |||||||||
2009-02-02 18:19 | rafaroda | New Issue | ||||||||||
2009-02-02 18:19 | rafaroda | Assigned To | => galderromo | |||||||||
2009-02-02 18:19 | rafaroda | sf_bug_id | 0 => 2557615 | |||||||||
2009-02-02 18:19 | rafaroda | OBNetwork customer | => No | |||||||||
2009-02-02 18:19 | rafaroda | Regression testing | => No | |||||||||
2009-02-02 19:01 | galderromo | Issue Monitored: galderromo | ||||||||||
2009-02-03 21:34 | galderromo | Note Added: 0013111 | ||||||||||
2009-02-03 21:35 | galderromo | Assigned To | galderromo => rafaroda | |||||||||
2009-02-10 10:51 | psarobe | Status | new => feedback | |||||||||
2009-02-19 14:16 | rafaroda | Severity | major => minor | |||||||||
2009-02-20 09:16 | pjuvara | Issue Monitored: psarobe | ||||||||||
2009-02-20 09:16 | pjuvara | Note Added: 0013789 | ||||||||||
2009-02-23 13:07 | rafaroda | Relationship added | related to 0007098 | |||||||||
2009-03-25 10:28 | rafaroda | Status | feedback => closed | |||||||||
2009-03-25 10:28 | rafaroda | Note Added: 0014932 | ||||||||||
2009-03-25 10:28 | rafaroda | Resolution | open => no change required |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|