details:   https://code.openbravo.com/erp/devel/pi/rev/43053d247d61
changeset: 34251:43053d247d61
user:      Atul Gaware <atul.gaware <at> openbravo.com>
date:      Thu Jun 28 12:17:43 2018 +0530
summary:   Fixes Issue 0038767: Should not be possible to save record with
same currency from and currency to in Exchange Rate tab

Avoid same currency conversion rate for the invoice and payment
document

diffstat:

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

diffs (24 lines):

diff -r 25f89f3e6667 -r 43053d247d61 
src-db/database/model/triggers/C_CONVERSION_RATE_DOCUMENT_TRG.xml
--- a/src-db/database/model/triggers/C_CONVERSION_RATE_DOCUMENT_TRG.xml Thu Jun 
28 16:24:40 2018 +0200
+++ b/src-db/database/model/triggers/C_CONVERSION_RATE_DOCUMENT_TRG.xml Thu Jun 
28 12:17:43 2018 +0530
@@ -19,7 +19,7 @@
     * under the License.
     * The Original Code is Openbravo ERP.
     * The Initial Developer of the Original Code is Openbravo SLU
-    * All portions are Copyright (C) 2001-2015 Openbravo SLU
+    * All portions are Copyright (C) 2001-2018 Openbravo SLU
     * All Rights Reserved.
     * Contributor(s):  ______________________________________.
     ************************************************************************/
@@ -35,6 +35,11 @@
     IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
+    IF (UPDATING OR INSERTING) THEN
+      IF :NEW.c_currency_id = :NEW.c_currency_id_to then
+        RAISE_APPLICATION_ERROR(-20000, '@SameCurrency@');
+      END IF;
+    END IF;
 
     -- If invoice is posted, CRUD is not allowed
     IF INSERTING

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to