Project:
View Issue Details[ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
ID | ||||||||
0007323 | ||||||||
Type | Category | Severity | Reproducibility | Date Submitted | Last Update | |||
defect | [Openbravo ERP] 07. Sales management | minor | always | 2009-02-02 18:19 | 2009-03-25 10:28 | |||
Reporter | rafaroda | View Status | public | |||||
Assigned To | rafaroda | |||||||
Priority | high | Resolution | no change required | Fixed in Version | ||||
Status | closed | Fix in branch | Fixed in SCM revision | |||||
Projection | none | ETA | none | Target Version | ||||
OS | Linux 32 bit | Database | PostgreSQL | Java version | 1.5 | |||
OS Version | Ubuntu 7.10 | Database version | 8.3 | Ant version | 1.7 | |||
Product Version | 2.35 | SCM revision | ||||||
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? | |||||||
Tags | No tags attached. | |||||||
Attached Files | ||||||||
![]() |
||||||||
|
![]() |
|
(0013111) galderromo (viewer) 2009-02-03 21:34 |
In my opinion this is not a bug. It is different a price adjustment from a discount. Think you are the person who introduce the information on the application. And you have your customer on the phone. The customer wants 525 units of your product, and you comunicate there is a 50% off adjustment. The customer, does not agree with the adjustment because is a very special customer, and this adjustment applies to every customer. Is asking you for an extra personal discount, so you decide to give a extra 10% (you include it on discount field). So Unitprice, supposing price list is 100 Euros will be 100 - 50 - 5 = 45 Euros. This is why I think the behaviour is ok. Therefore is not a bug. |
(0013789) pjuvara (viewer) 2009-02-20 09:16 |
Reminder sent to: psarobe, rafaroda Rafa, Pablo, can you please review this defect and decide whether it is a defect or not? Please consider Galder's comment and his explanation of why this is not a defect. Thanks, Paolo |
(0014932) rafaroda (viewer) 2009-03-25 10:28 |
This is not a bug but the correct behavior of price adjustments: * Discount is calculated as (List Price - Standard Price)/List Price: CORRECT * When changing Unit Price, Standard Price is re-calculated: CORRECT For a better understanding of price adjustments have a look at documentation issue 0008275 For an improvement of price adjustments have a look at feature request 0008161 |
![]() |
|||
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 |
Copyright © 2000 - 2009 MantisBT Group |