details:   https://code.openbravo.com/erp/devel/pi/rev/4ddcfa6e2e4c
changeset: 21929:4ddcfa6e2e4c
user:      Eduardo Argal Guibert <eduardo.argal <at> openbravo.com>
date:      Fri Feb 07 12:53:48 2014 +0100
summary:   Fixes bug 25683: c_order_trg is doing updates to c_invoice when not 
needed

diffstat:

 src-db/database/model/triggers/C_ORDER_TRG.xml |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (23 lines):

diff -r 553e45dab0ea -r 4ddcfa6e2e4c 
src-db/database/model/triggers/C_ORDER_TRG.xml
--- a/src-db/database/model/triggers/C_ORDER_TRG.xml    Fri Feb 07 12:52:04 
2014 +0100
+++ b/src-db/database/model/triggers/C_ORDER_TRG.xml    Fri Feb 07 12:53:48 
2014 +0100
@@ -54,11 +54,14 @@
     )
     THEN  RAISE_APPLICATION_ERROR(-20000, '@20501@') ;
     END IF;
-  -- Propagate Description changes
-  UPDATE C_Invoice
-   SET Description=:new.Description,
-   POReference=:new.POReference
-  WHERE C_Order_ID=:new.C_Order_ID;
+    IF (COALESCE(:old.POReference, '.') <> COALESCE(:NEW.POReference, '.')
+    OR COALESCE(:old.Description, '0') <> COALESCE(:NEW.Description, '0')) THEN
+                 -- Propagate Description changes
+                 UPDATE C_Invoice
+                  SET Description=:new.Description,
+                  POReference=:new.POReference
+                 WHERE C_Order_ID=:new.C_Order_ID;
+               END IF;
   END IF;
  END IF;
 END C_ORDER_TRG

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to