Fixes bug 0018315
authorEduardo Argal Guibert <eduardo.argal@openbravo.com>
Tue, 06 Sep 2011 11:28:56 +0200
changeset 13663 4c5cd48e2467
parent 13662 b92b2fa9d8ea
child 13664 54ed9a0b2c83
Fixes bug 0018315
modules/org.openbravo.advpaymentmngt/src-db/database/model/triggers/APRM_C_BANKSTATEMENT_TRG.xml
modules/org.openbravo.advpaymentmngt/src-db/database/model/triggers/APRM_C_CASH_TRG.xml
modules/org.openbravo.advpaymentmngt/src-db/database/model/triggers/APRM_C_DP_MANAGEMENT_TRG.xml
modules/org.openbravo.advpaymentmngt/src-db/database/model/triggers/APRM_C_REMITTANCE_TRG.xml
modules/org.openbravo.advpaymentmngt/src-db/database/model/triggers/APRM_C_SETTLEMENT_TRG.xml
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/model/triggers/APRM_C_BANKSTATEMENT_TRG.xml	Mon Sep 05 19:33:03 2011 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/model/triggers/APRM_C_BANKSTATEMENT_TRG.xml	Tue Sep 06 11:28:56 2011 +0200
@@ -25,9 +25,20 @@
   FROM DUAL
   WHERE EXISTS (SELECT 1 FROM ad_preference WHERE attribute = 'APRM_Ready');
 
-  IF (v_count = 1) THEN
-    RAISE_APPLICATION_ERROR(-20000, '@APRM_OldFlowDisabled@');
+  IF(v_count = 1) THEN
+   IF(DELETING) THEN
+     RAISE_APPLICATION_ERROR(-20501, '@APRM_OldFlowDisabled@') ;
+   END IF;
+   IF(UPDATING) THEN
+     IF(:old.Processed <> :new.Processed) THEN
+       RAISE_APPLICATION_ERROR(-20501, '@APRM_OldFlowDisabled@') ;
+     END IF;
+   END IF;
+   IF(INSERTING) THEN
+     RAISE_APPLICATION_ERROR(-20501, '@APRM_OldFlowDisabled@') ;
+   END IF;
   END IF;
+
 END APRM_C_BANKSTATEMENT_TRG
 ]]></body>
     </trigger>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/model/triggers/APRM_C_CASH_TRG.xml	Mon Sep 05 19:33:03 2011 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/model/triggers/APRM_C_CASH_TRG.xml	Tue Sep 06 11:28:56 2011 +0200
@@ -25,9 +25,20 @@
   FROM DUAL
   WHERE EXISTS (SELECT 1 FROM ad_preference WHERE attribute = 'APRM_Ready');
 
-  IF (v_count = 1) THEN
-    RAISE_APPLICATION_ERROR(-20000, '@APRM_OldFlowDisabled@');
+  IF(v_count = 1) THEN
+   IF(DELETING) THEN
+     RAISE_APPLICATION_ERROR(-20501, '@APRM_OldFlowDisabled@') ;
+   END IF;
+   IF(UPDATING) THEN
+     IF(:old.Processed <> :new.Processed) THEN
+       RAISE_APPLICATION_ERROR(-20501, '@APRM_OldFlowDisabled@') ;
+     END IF;
+   END IF;
+   IF(INSERTING) THEN
+     RAISE_APPLICATION_ERROR(-20501, '@APRM_OldFlowDisabled@') ;
+   END IF;
   END IF;
+  
 END APRM_C_CASH_TRG
 ]]></body>
     </trigger>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/model/triggers/APRM_C_DP_MANAGEMENT_TRG.xml	Mon Sep 05 19:33:03 2011 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/model/triggers/APRM_C_DP_MANAGEMENT_TRG.xml	Tue Sep 06 11:28:56 2011 +0200
@@ -25,9 +25,20 @@
   FROM DUAL
   WHERE EXISTS (SELECT 1 FROM ad_preference WHERE attribute = 'APRM_Ready');
 
-  IF (v_count = 1) THEN
-    RAISE_APPLICATION_ERROR(-20000, '@APRM_OldFlowDisabled@');
+  IF(v_count = 1) THEN
+   IF(DELETING) THEN
+     RAISE_APPLICATION_ERROR(-20501, '@APRM_OldFlowDisabled@') ;
+   END IF;
+   IF(UPDATING) THEN
+     IF(:old.Processed <> :new.Processed) THEN
+       RAISE_APPLICATION_ERROR(-20501, '@APRM_OldFlowDisabled@') ;
+     END IF;
+   END IF;
+   IF(INSERTING) THEN
+     RAISE_APPLICATION_ERROR(-20501, '@APRM_OldFlowDisabled@') ;
+   END IF;
   END IF;
+  
 END APRM_C_DP_MANAGEMENT_TRG
 ]]></body>
     </trigger>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/model/triggers/APRM_C_REMITTANCE_TRG.xml	Mon Sep 05 19:33:03 2011 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/model/triggers/APRM_C_REMITTANCE_TRG.xml	Tue Sep 06 11:28:56 2011 +0200
@@ -25,9 +25,20 @@
   FROM DUAL
   WHERE EXISTS (SELECT 1 FROM ad_preference WHERE attribute = 'APRM_Ready');
 
-  IF (v_count = 1) THEN
-    RAISE_APPLICATION_ERROR(-20000, '@APRM_OldFlowDisabled@');
+  IF(v_count = 1) THEN
+   IF(DELETING) THEN
+     RAISE_APPLICATION_ERROR(-20501, '@APRM_OldFlowDisabled@') ;
+   END IF;
+   IF(UPDATING) THEN
+     IF(:old.Processed <> :new.Processed) THEN
+       RAISE_APPLICATION_ERROR(-20501, '@APRM_OldFlowDisabled@') ;
+     END IF;
+   END IF;
+   IF(INSERTING) THEN
+     RAISE_APPLICATION_ERROR(-20501, '@APRM_OldFlowDisabled@') ;
+   END IF;
   END IF;
+  
 END APRM_C_REMITTANCE_TRG
 ]]></body>
     </trigger>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/model/triggers/APRM_C_SETTLEMENT_TRG.xml	Mon Sep 05 19:33:03 2011 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/model/triggers/APRM_C_SETTLEMENT_TRG.xml	Tue Sep 06 11:28:56 2011 +0200
@@ -25,9 +25,20 @@
   FROM DUAL
   WHERE EXISTS (SELECT 1 FROM ad_preference WHERE attribute = 'APRM_Ready');
 
-  IF (v_count = 1) THEN
-    RAISE_APPLICATION_ERROR(-20000, '@APRM_OldFlowDisabled@');
+  IF(v_count = 1) THEN
+   IF(DELETING) THEN
+     RAISE_APPLICATION_ERROR(-20501, '@APRM_OldFlowDisabled@') ;
+   END IF;
+   IF(UPDATING) THEN
+     IF(:old.Processed <> :new.Processed) THEN
+       RAISE_APPLICATION_ERROR(-20501, '@APRM_OldFlowDisabled@') ;
+     END IF;
+   END IF;
+   IF(INSERTING) THEN
+     RAISE_APPLICATION_ERROR(-20501, '@APRM_OldFlowDisabled@') ;
+   END IF;
   END IF;
+  
 END APRM_C_SETTLEMENT_TRG
 ]]></body>
     </trigger>