Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0028691Openbravo ERP07. Sales managementpublic2015-01-20 13:202015-02-24 23:09
caristu 
reinaldoguerra 
urgentmajoralways
closedfixed 
5
pi 
3.0PR15Q2 
aferraz
Core
No
0028691: It is possible to add discounts to documents already processed
It is possible to add discounts to documents already processed. The C_ORDERDISCOUNT_TRG trigger is prepared to handle this situation but the trigger is not configured to be executed on insert.
1) Go to the [Sales Order] window
2) Select an already processed order
3) Go to the [Basic Discounts] tab. Notice that it is possible to add a new record.
Configure the C_ORDERDISCOUNT_TRG to be executed ON INSERT
No tags attached.
Issue History
2015-01-20 13:20caristuNew Issue
2015-01-20 13:20caristuAssigned To => dmiguelez
2015-01-20 13:20caristuModules => Core
2015-01-20 13:20caristuResolution time => 1424646000
2015-01-20 13:20caristuTriggers an Emergency Pack => No
2015-01-20 13:20caristuIssue Monitored: networkb
2015-01-20 13:21caristuAssigned Todmiguelez => AtulOpenbravo
2015-01-30 15:38reinaldoguerraAssigned ToAtulOpenbravo => reinaldoguerra
2015-01-30 15:38reinaldoguerraStatusnew => scheduled
2015-02-03 14:26reinaldoguerraNote Added: 0074031
2015-02-23 09:48SandrahuguetReview Assigned To => Sandrahuguet
2015-02-23 11:03SandrahuguetReview Assigned ToSandrahuguet => aferraz
2015-02-23 15:20hgbotCheckin
2015-02-23 15:20hgbotNote Added: 0074807
2015-02-23 15:20hgbotStatusscheduled => resolved
2015-02-23 15:20hgbotResolutionopen => fixed
2015-02-23 15:20hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/b699e6284720b0d5690633863231c9c4db132283 [^]
2015-02-23 15:23aferrazNote Added: 0074808
2015-02-23 15:23aferrazStatusresolved => closed
2015-02-24 23:09hudsonbotCheckin
2015-02-24 23:09hudsonbotNote Added: 0074890

Notes
(0074031)
reinaldoguerra   
2015-02-03 14:26   
Test plan used:
1- Go to the [Sales Order] window
2- Select an already processed order
3- Go to the [Basic Discounts] tab. Notice that it is not possible to add a new record: An error message is shown
(0074807)
hgbot   
2015-02-23 15:20   
Repository: erp/devel/pi
Changeset: b699e6284720b0d5690633863231c9c4db132283
Author: Reinaldo Guerra <reinaldo.guerra <at> peoplewalking.com>
Date: Mon Feb 02 16:24:12 2015 -0500
URL: http://code.openbravo.com/erp/devel/pi/rev/b699e6284720b0d5690633863231c9c4db132283 [^]

Fixed bug 28691: It is possible to add discounts to documents already processed.

One possible solution for this issue would be to configure the C_ORDERDISCOUNT_TRG to be executed ON INSERT action, but this trigger is launched also when inserting orders for business partners with discounts defined, so the trigger logic causes a "mutating table" oracle's error.
In this case a new event handler is developed, to launch an error message, when trying to insert discounts for a sales order already processed. This change also affects the following windows: Purchase Order, Return from Customer, Return to Vendor and Sales Quotation.

---
A src/org/openbravo/event/OrderDiscountEventHandler.java
---
(0074808)
aferraz   
2015-02-23 15:23   
Code review + Testing OK
(0074890)
hudsonbot   
2015-02-24 23:09   
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/6c8e140b31ec [^]
Maturity status: Test