details:   /erp/stable/2.50/rev/7aa0c5da0436
changeset: 9336:7aa0c5da0436
user:      Adrián Romero <adrianromero <at> openbravo.com>
date:      Mon Apr 04 11:12:26 2011 +0200
summary:   Issue 0016056: A sales order with discount cannot be reactivated nor 
closed
It has been disabled the recalculation of discounts when closing orders because 
this is the origin of the error. The recalculation of discounts when closing an 
order is not necessary because discounts of a completed order are properly 
calculated yet.

diffstat:

 src-db/database/model/functions/C_ORDER_POST1.xml |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (25 lines):

diff -r eb0cbea36e1a -r 7aa0c5da0436 
src-db/database/model/functions/C_ORDER_POST1.xml
--- a/src-db/database/model/functions/C_ORDER_POST1.xml Mon Apr 04 10:55:52 
2011 +0200
+++ b/src-db/database/model/functions/C_ORDER_POST1.xml Mon Apr 04 11:12:26 
2011 +0200
@@ -618,8 +618,12 @@
     END IF;--END_PROCESSING
     IF(NOT FINISH_PROCESS AND NOT END_PROCESSING) THEN
      
/**************************************************************************
-        * Calculate Discounts
+        * Calculate Discounts only when processing the document.
         
*************************************************************************/
+
+      -- AProove, COmplete, PRocess
+      IF(v_DocAction IN('AP', 'CO', 'PR')) THEN
+
         -- Delete first previous discounts if any and then recalculate them
         DELETE
         FROM C_ORDERLINE
@@ -706,6 +710,7 @@
           END LOOP;
           v_Line:=v_Line + 10;
         END LOOP;
+        END IF;
     END IF;
     
     IF(NOT END_PROCESSING AND NOT FINISH_PROCESS) THEN

------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to