Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0021923Openbravo ERP07. Sales managementpublic2012-10-11 19:102012-11-12 10:45
psarobe 
dmiguelez 
normalmajoralways
closedfixed 
5
 
 
dmiguelez
Core
No
0021923: When the "net unit price" is changed or "gross unit price" the discount should change and the base unit price and gross
When you change the net unit price the base unit price is not changing so the discount remains the same:

discount = Net price list - Base net unit price

discount of promotions = Base unit price - net unit price

See http://forge.openbravo.com/plugins/mwiki/index.php/Priceadperline/Specifications [^]

So if you change the net unit price the discount remains the same. This what we want to fix. The solution must be:

Scenario:
* Net Price list: 10
* Base net unit price:8
* Net unit price: 6

Discount=20%
Promotions: -2

If you change the net unit price to 5 it should work like this:
* Net Price list: 10
* Base net unit price:7
* Net unit price: 5

So finally the discount would be: 30% and promotion -2
1. Go Sales order window and click new and save the header with a price list with out price including taxes and with the configuration describe above
2. Select a line and the product
* Net Price list: 10
* Base net unit price:8
* Net unit price: 6
3. Change the net unit price to 5
Notice the discount remains the same: 20%. Wrong It should be 30%
No tags attached.
related to defect 00222393.0MP17 closed alostale PIT: When you change the discount field, the gross unit price changes but net unit price is not recalculated again 
Issue History
2012-10-11 19:10psarobeNew Issue
2012-10-11 19:10psarobeAssigned To => dmiguelez
2012-10-11 19:10psarobeModules => Core
2012-10-30 08:16hgbotCheckin
2012-10-30 08:16hgbotNote Added: 0053777
2012-10-30 08:16hgbotStatusnew => resolved
2012-10-30 08:16hgbotResolutionopen => fixed
2012-10-30 08:16hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/8ca012977061798716f14f8cb62322d0ad930d7d [^]
2012-10-31 13:31hudsonbotCheckin
2012-10-31 13:31hudsonbotNote Added: 0053935
2012-11-08 17:17alostaleRelationship addedrelated to 0022239
2012-11-12 10:45dmiguelezReview Assigned To => dmiguelez
2012-11-12 10:45dmiguelezNote Added: 0054154
2012-11-12 10:45dmiguelezStatusresolved => closed

Notes
(0053777)
hgbot   
2012-10-30 08:16   
Repository: erp/devel/pi
Changeset: 8ca012977061798716f14f8cb62322d0ad930d7d
Author: Asier Lostalé <asier.lostale <at> openbravo.com>
Date: Thu Oct 25 12:47:36 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/8ca012977061798716f14f8cb62322d0ad930d7d [^]

[discount] Fixed price actual price standard calculation when manually changed
fixed bug 21923

---
M src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Amt.java
M src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Product.java
M src/org/openbravo/erpCommon/ad_callouts/SL_Order_Amt.java
M src/org/openbravo/erpCommon/ad_callouts/SL_Order_Product.java
M src/org/openbravo/erpCommon/ad_callouts/SL_Order_Product_data.xsql
---
(0053935)
hudsonbot   
2012-10-31 13: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/9e773cbcb723 [^]

Maturity status: Test
(0054154)
dmiguelez   
2012-11-12 10:45   
There was an issue, but is now fixed: 0022239

Code Review + Testing OK