Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0008161Openbravo ERP07. Sales managementpublic2009-03-17 16:532009-07-03 14:26
jaimetorre 
gmauleon 
urgentmajoralways
closedfixed 
5
pi 
2.50MP1 
Core
No
0008161: Not possible not to apply price adjustments for a specific order line
When one enters an order line and a price adjustment applies for it, a new register is entered in Price Adjustments tab. There is no possibility to say that for this line, even if price adjustments applies, we do not want the price adjustment to be calculated.
1) Create a price adjustment in 'Master Data Management || Pricing || Price Adjustments || Adjustments' with values:
* Starting date = 01-01-2000
* Discount % = 50
* 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:
* Standard Price = SP (hidden)
* List Price = LP
* Discount = D = 100*(1-(SP/LP))

6) Save this line

7) Go to price adjustment tabs and see that the price adjustment has been correctly applied.
Short summary on different prices:
* List price: price used as reference in a Price list
* Standard price: price applied to customers after discount in Price list (this price is not shown in the sales order window, it is hidden)
* Discount: percentage (List price - Standard price)/List price
* Unit price: price finally applied after price adjustments
* Price adjustments: zero, one or many changes in the price applied in an order line. All of them together are the difference between Standard Price and Unit price

For further clarification see attached PricesRelations.png
 
From a technical perspective:
* There is no need to decouple price adjustments and order completion since they are already decoupled. Price adjustments are calculated when the line is entered through a trigger (c_orderline_trg2).
* Currently it is not possible to cancel (not to apply) price adjustments
* To achieve it, add a new column and a make a change to change c_orderline_trg2 trigger.
* This will be implemented using a check box in the order line ("Cancel Price Adjustments"), by default set to false (N).
* If the user wants avoid applying price adjustments in a particular line he has to check this check-box and save the line.
* The trigger would remove all the changes over the standard price through price adjustements.
* Visibility of price adjustments will also be improved by showing 'Standard Price' right-only field. Right now Standard price is hidden, so it is not easy to understand how the numbers are calculated. It will be clearer for the user how the discount is calculated and what lines have price adjustements (Unit price different from Standard Price)
 
Eg.
List price: 10
Unit price: 5
Discount: 20%
Standard price: 8 (not shown)

The distribution of fields in Order Lines would be like OrderLines.png.
* 'Standard Price' text field would display below 'Unit Price' field and will be read-only.
* 'Cancel Price Adjustment' check-box would display below Currency' field.
* These two fields will be shown based on the following display logic: UP != SP OR CPA = Y (UP = Unit Price; SP = Standard Price; CPA = Cancel Price Adjustments)
tictech
related to defect 0008275 acknowledged jonalegriaesarte Correctly document Prices relations 
related to feature request 0009005pi acknowledged rmorley Delete one Price Adjustment for Sales Order line 
related to feature request 0029623 new Triage Omni OMS It would be fine to have the Cancel Promotions option in invoice lines not to apply the Price Adjustments 
png PricesRelation.png (19,705) 2009-03-25 10:17
https://issues.openbravo.com/file_download.php?file_id=1061&type=bug
png

png OrderLines.png (83,362) 2009-03-25 10:17
https://issues.openbravo.com/file_download.php?file_id=1062&type=bug
png
Issue History
2009-03-17 16:53jaimetorreNew Issue
2009-03-17 16:53jaimetorreAssigned To => rafaroda
2009-03-17 16:53jaimetorreRegression testing => No
2009-03-17 17:07jaimetorreTag Attached: tictech
2009-03-25 09:38rafarodaRelationship addedrelated to 0008275
2009-03-25 10:17rafarodaAssigned Torafaroda => gmauleon
2009-03-25 10:17rafarodaStatusnew => acknowledged
2009-03-25 10:17rafarodaSummaryNot possible to deactivate price adjustments for a specific order line => Not possible not to apply price adjustments for a specific order line
2009-03-25 10:17rafarodaDescription Updated
2009-03-25 10:17rafarodaProposed Solution updated
2009-03-25 10:17rafarodaSteps to Reproduce Updated
2009-03-25 10:17rafarodaFile Added: PricesRelation.png
2009-03-25 10:17rafarodaFile Added: OrderLines.png
2009-04-01 15:47gmauleonversion => pi
2009-04-01 16:51gmauleonStatusacknowledged => scheduled
2009-04-01 16:51gmauleonfix_in_branch => pi
2009-04-01 16:53hgbotCheckin
2009-04-01 16:53hgbotNote Added: 0015115
2009-04-01 16:53hgbotStatusscheduled => resolved
2009-04-01 16:53hgbotResolutionopen => fixed
2009-04-01 16:53hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/0342347da77fe894ee3253dd0897057dc17bba24 [^]
2009-04-22 16:20hgbotCheckin
2009-04-22 16:20hgbotNote Added: 0015545
2009-04-22 16:20hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/0342347da77fe894ee3253dd0897057dc17bba24 [^] => http://code.openbravo.com/erp/devel/pi/rev/db44a8f264fecd0cae7f76cc56c5e966638240d6 [^]
2009-05-12 14:04rafarodaRelationship addedrelated to 0009005
2009-06-05 18:53pjuvaraStatusresolved => closed
2009-06-06 00:00anonymoussf_bug_id0 => 2802024
2009-07-03 14:26pjuvaraPriorityimmediate => urgent
2015-04-17 13:27ngarciaRelationship addedrelated to 0029623

Notes
(0015115)
hgbot   
2009-04-01 16:53   
Repository: erp/devel/pi
Changeset: 0342347da77fe894ee3253dd0897057dc17bba24
Author: Gorka Mauleon <gorka.mauleon <at> openbravo.com>
Date: Wed Apr 01 16:52:58 2009 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/0342347da77fe894ee3253dd0897057dc17bba24 [^]

fixes 0008161: Not possible not to apply price adjustments for a specific order line

---
M src-db/database/model/tables/C_ORDERLINE.xml
M src-db/database/model/triggers/C_ORDERLINE_TRG2.xml
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_ELEMENT.xml
M src-db/database/sourcedata/AD_FIELD.xml
M src/org/openbravo/erpCommon/ad_callouts/SL_Order_Amt.java
M src/org/openbravo/erpCommon/ad_callouts/SL_Order_Product.java
---
(0015545)
hgbot   
2009-04-22 16:20   
Repository: erp/devel/pi
Changeset: db44a8f264fecd0cae7f76cc56c5e966638240d6
Author: Gorka Mauleon <gorka.mauleon <at> openbravo.com>
Date: Wed Apr 22 16:20:10 2009 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/db44a8f264fecd0cae7f76cc56c5e966638240d6 [^]

fixes bug 0008161: Not possible not to apply price adjustments for a specific order line

---
M referencedata/sampledata/Accounting_Test.xml
M referencedata/sampledata/SmallBazaar.xml
M src-db/database/model/tables/C_ORDERLINE.xml
---