Modify soft trigger disabilitation for PG
authorAsier Lostalé <asier.lostale@openbravo.com>
Mon, 24 Nov 2008 16:45:42 +0000
changeset 2084 5081e251a384
parent 2083 e39c7f292107
child 2085 27c888efbd39
Modify soft trigger disabilitation for PG
src-db/database/model/prescript-Oracle.sql
src-db/database/model/prescript-PostgreSql.sql
src-db/database/model/triggers/AD_ACCOUNTINGRPT_ELEMENT_TRG.xml
src-db/database/model/triggers/AD_ALERTRECIPIENT_TRG.xml
src-db/database/model/triggers/AD_ALERTRULE_TRG.xml
src-db/database/model/triggers/AD_AUXILIARINPUT_MOD_TRG.xml
src-db/database/model/triggers/AD_CALLOUT_MOD_TRG.xml
src-db/database/model/triggers/AD_CALLOUT_TRG.xml
src-db/database/model/triggers/AD_CLIENT_TRG.xml
src-db/database/model/triggers/AD_COLUMN_MOD_TRG.xml
src-db/database/model/triggers/AD_COLUMN_TRG.xml
src-db/database/model/triggers/AD_COLUMN_TRG2.xml
src-db/database/model/triggers/AD_DATASET_COLUMN_MOD_TRG.xml
src-db/database/model/triggers/AD_DATASET_MOD_TRG.xml
src-db/database/model/triggers/AD_DATASET_TABLE_MOD_TRG.xml
src-db/database/model/triggers/AD_ELEMENT_MOD_TRG.xml
src-db/database/model/triggers/AD_ELEMENT_TRG.xml
src-db/database/model/triggers/AD_ELEMENT_TRL_TRG.xml
src-db/database/model/triggers/AD_FIELDGROUP_MOD_TRG.xml
src-db/database/model/triggers/AD_FIELDGROUP_TRG.xml
src-db/database/model/triggers/AD_FIELD_MOD_TRG.xml
src-db/database/model/triggers/AD_FIELD_TRG.xml
src-db/database/model/triggers/AD_FORM_MOD_TRG.xml
src-db/database/model/triggers/AD_FORM_TRG.xml
src-db/database/model/triggers/AD_FORM_TRG2.xml
src-db/database/model/triggers/AD_IMPFORMAT_MOD_TRG.xml
src-db/database/model/triggers/AD_IMPFORMAT_ROW_MOD_TRG.xml
src-db/database/model/triggers/AD_MENU_MOD_TRG.xml
src-db/database/model/triggers/AD_MENU_TRG.xml
src-db/database/model/triggers/AD_MESSAGE_MOD_TRG.xml
src-db/database/model/triggers/AD_MESSAGE_TRG.xml
src-db/database/model/triggers/AD_MODEL_OBJECT_MOD_TRG.xml
src-db/database/model/triggers/AD_MODOBJMAPPING_MOD_TRG.xml
src-db/database/model/triggers/AD_MODULE_DBPREFIX_MOD_TRG.xml
src-db/database/model/triggers/AD_MODULE_DBPREFIX_TRG.xml
src-db/database/model/triggers/AD_MODULE_DENPENDENCY_TRG.xml
src-db/database/model/triggers/AD_MODULE_DEPENDENCY_MOD_TRG.xml
src-db/database/model/triggers/AD_MODULE_TRG.xml
src-db/database/model/triggers/AD_ORGTYPE_TRG.xml
src-db/database/model/triggers/AD_ORG_STLE_TRG.xml
src-db/database/model/triggers/AD_ORG_TRG.xml
src-db/database/model/triggers/AD_PACKAGE_MOD_TRG.xml
src-db/database/model/triggers/AD_PROCESS_MOD_TRG.xml
src-db/database/model/triggers/AD_PROCESS_PARA_MOD_TRG.xml
src-db/database/model/triggers/AD_PROCESS_PARA_TRG.xml
src-db/database/model/triggers/AD_PROCESS_REQUEST_TRG.xml
src-db/database/model/triggers/AD_PROCESS_TRG.xml
src-db/database/model/triggers/AD_PROCESS_TRL_TRG.xml
src-db/database/model/triggers/AD_REFERENCE_MOD_TRG.xml
src-db/database/model/triggers/AD_REFERENCE_TRG.xml
src-db/database/model/triggers/AD_REFERENCE_TRG2.xml
src-db/database/model/triggers/AD_REFERENCE_TRG3.xml
src-db/database/model/triggers/AD_REF_LIST_MOD_TRG.xml
src-db/database/model/triggers/AD_REF_LIST_TRG.xml
src-db/database/model/triggers/AD_REF_SEARCH_COLUMN_MOD_TRG.xml
src-db/database/model/triggers/AD_REF_SEARCH_MOD_TRG.xml
src-db/database/model/triggers/AD_REF_TABLE_MOD_TRG.xml
src-db/database/model/triggers/AD_REGISTRATION_INFO_TRG.xml
src-db/database/model/triggers/AD_ROLE_ORGACCESS_TRG.xml
src-db/database/model/triggers/AD_ROLE_TRG.xml
src-db/database/model/triggers/AD_SYSTEM_INFO_TRG.xml
src-db/database/model/triggers/AD_SYSTEM_INFO_TRG2.xml
src-db/database/model/triggers/AD_TABLE_MOD_TRG.xml
src-db/database/model/triggers/AD_TABLE_TRG.xml
src-db/database/model/triggers/AD_TAB_MOD_TRG.xml
src-db/database/model/triggers/AD_TAB_TRG.xml
src-db/database/model/triggers/AD_TAB_TRG2.xml
src-db/database/model/triggers/AD_TASK_TRG.xml
src-db/database/model/triggers/AD_TASK_TRG2.xml
src-db/database/model/triggers/AD_TEXTINTERFACES_MOD_TRG.xml
src-db/database/model/triggers/AD_TEXTINTERFACES_TRG.xml
src-db/database/model/triggers/AD_TREENODE_MOD_TRG.xml
src-db/database/model/triggers/AD_TREENODE_TRG.xml
src-db/database/model/triggers/AD_TREE_TRG.xml
src-db/database/model/triggers/AD_VAL_RULE_MOD_TRG.xml
src-db/database/model/triggers/AD_WF_NODENEXT_MOD_TRG.xml
src-db/database/model/triggers/AD_WF_NODE_MOD_TRG.xml
src-db/database/model/triggers/AD_WF_NODE_TRG.xml
src-db/database/model/triggers/AD_WINDOW_MOD_TRG.xml
src-db/database/model/triggers/AD_WINDOW_TRG.xml
src-db/database/model/triggers/AD_WINDOW_TRG2.xml
src-db/database/model/triggers/AD_WINDOW_TRL_TRG.xml
src-db/database/model/triggers/AD_WORKFLOW_MOD_TRG.xml
src-db/database/model/triggers/AD_WORKFLOW_TRG.xml
src-db/database/model/triggers/AT_COMMAND_TRG.xml
src-db/database/model/triggers/A_AMORTIZATIONLINE_TRG.xml
src-db/database/model/triggers/A_AMORTIZATIONLINE_TRG2.xml
src-db/database/model/triggers/A_AMORTIZATION_TRG.xml
src-db/database/model/triggers/A_ASSET_GROUP_TRG.xml
src-db/database/model/triggers/A_ASSET_GROUP_TRG2.xml
src-db/database/model/triggers/A_ASSET_TRG.xml
src-db/database/model/triggers/A_ASSET_TRG2.xml
src-db/database/model/triggers/C_ACCTSCHEMADEL_TRG.xml
src-db/database/model/triggers/C_ACCTSCHEMA_ELEMENT_TRG.xml
src-db/database/model/triggers/C_ACCTSCHEMA_TRG.xml
src-db/database/model/triggers/C_BANKACCOUNTIBAN_TRG.xml
src-db/database/model/triggers/C_BANKACCOUNT_TRG.xml
src-db/database/model/triggers/C_BANKCOUNTRY_TRG.xml
src-db/database/model/triggers/C_BANKSTATEMENTLINE_TRG.xml
src-db/database/model/triggers/C_BANKSTATEMENT_TRG.xml
src-db/database/model/triggers/C_BPARTNER_LOCATION_TRG.xml
src-db/database/model/triggers/C_BPARTNER_TRG.xml
src-db/database/model/triggers/C_BP_BANKACCOUNTIBAN_TRG.xml
src-db/database/model/triggers/C_BP_GROUP_TRG.xml
src-db/database/model/triggers/C_BP_SALCATEGORY_TRG.xml
src-db/database/model/triggers/C_BP_SALCATEGORY_TRG2.xml
src-db/database/model/triggers/C_BSTMTLINE_CHK_RESTRICT_TRG.xml
src-db/database/model/triggers/C_BSTMT_CHK_RESTRICTIONS_TRG.xml
src-db/database/model/triggers/C_BUDGETLINE_TRG.xml
src-db/database/model/triggers/C_CASHBOOK_TRG.xml
src-db/database/model/triggers/C_CASHLINE_CHK_RESTRICT_TRG.xml
src-db/database/model/triggers/C_CASHLINE_TRG.xml
src-db/database/model/triggers/C_CASH_CHK_RESTRICTIONS_TRG.xml
src-db/database/model/triggers/C_CASH_TRG.xml
src-db/database/model/triggers/C_CHARGE_TRG.xml
src-db/database/model/triggers/C_COMMISSIONAMT_TRG.xml
src-db/database/model/triggers/C_COMMISSIONDETAIL_TRG.xml
src-db/database/model/triggers/C_CONVERSION_RATE_TRG.xml
src-db/database/model/triggers/C_CONVERSION_RATE_TRG2.xml
src-db/database/model/triggers/C_COUNTRY_TRG.xml
src-db/database/model/triggers/C_CURRENCY_TRG.xml
src-db/database/model/triggers/C_DEBT_PAYMENT_BAL_TRG.xml
src-db/database/model/triggers/C_DEBT_PAYMENT_TRG.xml
src-db/database/model/triggers/C_DOCTYPE_TRG.xml
src-db/database/model/triggers/C_DPMLINE_CHK_RESTRICTIONS_TRG.xml
src-db/database/model/triggers/C_DP_MANAGEMENTLINE_TRG.xml
src-db/database/model/triggers/C_DP_MANAGEMENT_CHK_RESTR_TRG.xml
src-db/database/model/triggers/C_ELEMENTVALUE_TRG.xml
src-db/database/model/triggers/C_GREETING_TRG.xml
src-db/database/model/triggers/C_INVLINE_CHK_RESTRICTIONS_TRG.xml
src-db/database/model/triggers/C_INVOICEDISCOUNT_TRG.xml
src-db/database/model/triggers/C_INVOICELINE_TRG.xml
src-db/database/model/triggers/C_INVOICELINE_TRG2.xml
src-db/database/model/triggers/C_INVOICELINE_TRG3.xml
src-db/database/model/triggers/C_INVOICETAX_TRG.xml
src-db/database/model/triggers/C_INVOICETAX_TRG2.xml
src-db/database/model/triggers/C_INVOICE_TRG.xml
src-db/database/model/triggers/C_INVOICE_TRG2.xml
src-db/database/model/triggers/C_INVTAX_CHK_RESTRICTIONS_TRG.xml
src-db/database/model/triggers/C_LOCATION_TRG.xml
src-db/database/model/triggers/C_ORDERLINE2_TRG.xml
src-db/database/model/triggers/C_ORDERLINE_TRG.xml
src-db/database/model/triggers/C_ORDERLINE_TRG2.xml
src-db/database/model/triggers/C_ORDERTAX_TRG.xml
src-db/database/model/triggers/C_ORDER_CHK_RESTRINCTIONS_TRG.xml
src-db/database/model/triggers/C_ORDER_TRG.xml
src-db/database/model/triggers/C_ORDER_TRG2.xml
src-db/database/model/triggers/C_ORDLINE_CHK_RESTRICTIONS_TRG.xml
src-db/database/model/triggers/C_PAYMENTTERM_TRG.xml
src-db/database/model/triggers/C_PERIOD_TRG.xml
src-db/database/model/triggers/C_PERIOD_TRG2.xml
src-db/database/model/triggers/C_PROJECTLINE_TRG.xml
src-db/database/model/triggers/C_PROJECTLINE_TRG2.xml
src-db/database/model/triggers/C_PROJECTPHASE_TRG.xml
src-db/database/model/triggers/C_PROJECTPROPOSALTASK_TRG.xml
src-db/database/model/triggers/C_PROJECT_TRG.xml
src-db/database/model/triggers/C_PROJECT_TRG2.xml
src-db/database/model/triggers/C_PROJECT_TRG3.xml
src-db/database/model/triggers/C_REMITTANCELINE_TRG.xml
src-db/database/model/triggers/C_REMITTANCE_TRG.xml
src-db/database/model/triggers/C_REVENUERECOGNITION_PLAN_TRG.xml
src-db/database/model/triggers/C_SALESREGION_TRG.xml
src-db/database/model/triggers/C_SETTLEMENT_TRG.xml
src-db/database/model/triggers/C_TAXCATEGORY_TRG.xml
src-db/database/model/triggers/C_TAXPAYMENT_TRG.xml
src-db/database/model/triggers/C_TAXREGISTERLINE_TRG.xml
src-db/database/model/triggers/C_TAXREGISTER_TRG.xml
src-db/database/model/triggers/C_TAX_REPORT_TRG.xml
src-db/database/model/triggers/C_TAX_TRG.xml
src-db/database/model/triggers/C_UOM_TRG.xml
src-db/database/model/triggers/C_VALIDCOMBINATION_TRG.xml
src-db/database/model/triggers/C_WITHHOLDING_TRG.xml
src-db/database/model/triggers/GL_JL_CHK_RESTRICTIONS_TRG.xml
src-db/database/model/triggers/GL_JOURNALLINE2_TRG.xml
src-db/database/model/triggers/GL_JOURNALLINE_TRG.xml
src-db/database/model/triggers/GL_JOURNAL_CHK_RESTRICT_TRG.xml
src-db/database/model/triggers/GL_JOURNAL_TRG.xml
src-db/database/model/triggers/M_ATTRIBUTEVALUE_TRG.xml
src-db/database/model/triggers/M_INOUTLINE_TRG.xml
src-db/database/model/triggers/M_INOUT_CHK_RESTRICTIONS_TRG.xml
src-db/database/model/triggers/M_INOUT_TRG_PROV.xml
src-db/database/model/triggers/M_INTERNAL_CONSUMPTIONLINE_TRG.xml
src-db/database/model/triggers/M_INVENTORYLINE2_TRG.xml
src-db/database/model/triggers/M_INVENTORYLINE_TRG.xml
src-db/database/model/triggers/M_INVENTORY_TRG.xml
src-db/database/model/triggers/M_IOLINE_CHK_RESTRICTIONS_TRG.xml
src-db/database/model/triggers/M_MATCHPO_TRG.xml
src-db/database/model/triggers/M_MOVEMENTLINE_TRG.xml
src-db/database/model/triggers/M_MOVEMENT_TRG.xml
src-db/database/model/triggers/M_PRODUCTIONLINE_TRG.xml
src-db/database/model/triggers/M_PRODUCTIONPLAN_TRG.xml
src-db/database/model/triggers/M_PRODUCTION_TRG.xml
src-db/database/model/triggers/M_PRODUCT_BOM_TRG.xml
src-db/database/model/triggers/M_PRODUCT_CATEGORY_TRG.xml
src-db/database/model/triggers/M_PRODUCT_TRG.xml
src-db/database/model/triggers/M_RAPPEL_INVOICE_TRG.xml
src-db/database/model/triggers/M_REQUISITIONLINE_TRG.xml
src-db/database/model/triggers/M_REQUISITIONORDER_TRG.xml
src-db/database/model/triggers/M_REQUISITION_TRG.xml
src-db/database/model/triggers/M_TRANSACTION_TRG.xml
src-db/database/model/triggers/M_WAREHOUSE_TRG.xml
src-db/database/model/triggers/S_EXPENSETYPE_TRG.xml
src-db/database/model/triggers/S_RESOURCEASSIGNMENT_TRG.xml
src-db/database/model/triggers/S_RESOURCETYPE_TRG.xml
src-db/database/model/triggers/S_RESOURCEUNAVAILABLE_TRG.xml
src-db/database/model/triggers/S_RESOURCE_TRG.xml
src-db/database/model/triggers/S_TIMEEXPENSELINE_TRG.xml
src-db/database/model/triggers/S_TIMEEXPENSE_TRG.xml
src-db/src/com/openbravo/db/OpenbravoExcludeFilter.java
--- a/src-db/database/model/prescript-Oracle.sql	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/prescript-Oracle.sql	Mon Nov 24 16:45:42 2008 +0000
@@ -41,6 +41,49 @@
    ON COMMIT PRESERVE ROWS
 /-- END 
 
+
+create or replace FUNCTION AD_isTriggerEnabled RETURN CHAR
+
+AS
+/*************************************************************************
+* The contents of this file are subject to the Openbravo  Public  License
+* Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
+* Version 1.1  with a permitted attribution clause; you may not  use this
+* file except in compliance with the License. You  may  obtain  a copy of
+* the License at http://www.openbravo.com/legal/license.html
+* Software distributed under the License  is  distributed  on  an "AS IS"
+* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+* License for the specific  language  governing  rights  and  limitations
+* under the License.
+* The Original Code is Openbravo ERP.
+* The Initial Developer of the Original Code is Openbravo SL
+* All portions are Copyright (C) 2008 Openbravo SL
+* All Rights Reserved.
+* Contributor(s):  ______________________________________.
+************************************************************************/
+ v_aux number;
+BEGIN
+ SELECT COUNT(*) 
+   INTO v_aux
+   FROM AD_ENABLE_TRIGGERS
+  WHERE ISENABLED='N';
+  
+  IF v_Aux>0 THEN
+    RETURN 'N';
+  ELSE
+    RETURN 'Y';
+  END IF;
+  
+  
+EXCEPTION
+WHEN OTHERS THEN
+  RETURN 'Y';
+END AD_isTriggerEnabled
+;
+/-- END
+
+
+
 CREATE OR REPLACE FUNCTION C_CREATE_TEMPORARY_TABLES RETURN VARCHAR2
 AS
 /*************************************************************************
--- a/src-db/database/model/prescript-PostgreSql.sql	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/prescript-PostgreSql.sql	Mon Nov 24 16:45:42 2008 +0000
@@ -1287,12 +1287,16 @@
 $BODY$ 
 BEGIN
  -- create temporary tables
- drop table if exists AD_ENABLE_TRIIGERS;
- CREATE GLOBAL TEMPORARY TABLE AD_ENABLE_TRIGGERS
+
+DROP TABLE IF EXISTS AD_ENABLE_TRIGGERS;
+
+ CREATE TABLE AD_ENABLE_TRIGGERS
  (
-   ISENABLED CHARACTER(1)             NOT NULL
- )
-  ON COMMIT PRESERVE ROWS;
+  SESSION_ID NUMERIC, 
+  ISENABLED CHARACTER(1)             NOT NULL
+);
+
+
 
  drop table if exists C_TEMP_SELECTION;
  CREATE GLOBAL TEMPORARY TABLE C_TEMP_SELECTION
@@ -1315,3 +1319,51 @@
 $BODY$
   LANGUAGE 'plpgsql' VOLATILE
 /-- END
+
+SELECT * FROM c_create_temporary_tables()
+/-- END
+
+DROP FUNCTION c_create_temporary_tables()
+/-- END
+
+
+
+
+CREATE OR REPLACE FUNCTION AD_isTriggerEnabled()
+  RETURNS varchar AS
+$BODY$ DECLARE 
+/*************************************************************************
+* The contents of this file are subject to the Openbravo  Public  License
+* Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
+* Version 1.1  with a permitted attribution clause; you may not  use this
+* file except in compliance with the License. You  may  obtain  a copy of
+* the License at http://www.openbravo.com/legal/license.html
+* Software distributed under the License  is  distributed  on  an "AS IS"
+* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+* License for the specific  language  governing  rights  and  limitations
+* under the License.
+* The Original Code is Openbravo ERP.
+* The Initial Developer of the Original Code is Openbravo SL
+* All portions are Copyright (C) 2008 Openbravo SL
+* All Rights Reserved.
+* Contributor(s):  ______________________________________.
+************************************************************************/
+  -- Logistice
+v_aux numeric;
+v_session numeric; 
+BEGIN
+  v_session = pg_backend_pid();
+  select count(*)
+    into v_aux
+    from ad_enable_triggers
+   where session_id = v_session
+     and isEnabled ='N';
+
+    if v_Aux>0 then 
+      return 'N';
+    else
+      return 'Y';
+    end if;
+END ; $BODY$
+  LANGUAGE 'plpgsql' VOLATILE;
+/-- END
--- a/src-db/database/model/triggers/AD_ACCOUNTINGRPT_ELEMENT_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_ACCOUNTINGRPT_ELEMENT_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -25,10 +25,10 @@
   v_xTree_ID VARCHAR2(32);
   v_xParent_ID VARCHAR2(32);
   v_NextNo     VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_ALERTRECIPIENT_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_ALERTRECIPIENT_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
     * Contributor(s):  ______________________________________.
     ************************************************************************/
       n NUMBER;
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_ALERTRULE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_ALERTRULE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -26,10 +26,10 @@
       TYPE RECORD IS REF CURSOR;
       Cur_Role RECORD;
       recipient_ID VARCHAR2(32);
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_AUXILIARINPUT_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_AUXILIARINPUT_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_CALLOUT_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_CALLOUT_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_CALLOUT_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_CALLOUT_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -26,10 +26,10 @@
   v_ID_MAP     VARCHAR2(32) ;
   v_WindowName VARCHAR2(60) ;
   v_ClassName  VARCHAR2(60) ;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_CLIENT_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_CLIENT_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -31,10 +31,10 @@
     TYPE RECORD IS REF CURSOR;
   CUR_DSequence RECORD;
   v_NextNo VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_COLUMN_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_COLUMN_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_COLUMN_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_COLUMN_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -28,10 +28,10 @@
     * Description:
     *   Syncronize Name, .. with Field, if centrally maintained
     ************************************************************************/
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_COLUMN_TRG2.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_COLUMN_TRG2.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   v_TableName VARCHAR2(40);
   v_NextNo VARCHAR2(32);
   v_Aux NUMBER;
-      v_ADEnabledTriggers NUMBER;
+      
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_DATASET_COLUMN_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_DATASET_COLUMN_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_DATASET_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_DATASET_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_DATASET_TABLE_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_DATASET_TABLE_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_ELEMENT_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_ELEMENT_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_ELEMENT_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_ELEMENT_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -29,10 +29,10 @@
     *  synchronize PrintInfo
     *  reset Translation flag
     ************************************************************************/
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_ELEMENT_TRL_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_ELEMENT_TRL_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -28,10 +28,10 @@
 * Description:
 *   Synchronize name,... with  Field if centrally maintained
 ************************************************************************/
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_FIELDGROUP_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_FIELDGROUP_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_FIELDGROUP_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_FIELDGROUP_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -25,10 +25,10 @@
     * Insert AD_Menu Trigger
     *  for Translation
     */
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
    IF INSERTING
--- a/src-db/database/model/triggers/AD_FIELD_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_FIELD_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_FIELD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_FIELD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -25,10 +25,10 @@
     * Insert AD_Field Trigger
     *  for Translation
     */
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
   IF INSERTING
--- a/src-db/database/model/triggers/AD_FORM_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_FORM_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_FORM_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_FORM_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -26,10 +26,10 @@
     *  for Translation
     *  Access
     */
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
    IF INSERTING
--- a/src-db/database/model/triggers/AD_FORM_TRG2.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_FORM_TRG2.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -26,10 +26,10 @@
   v_ID_MAP     VARCHAR2(32) ;
   v_WindowName VARCHAR2(60):='ad_forms';
   v_ClassName  VARCHAR2(60) ;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_IMPFORMAT_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_IMPFORMAT_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_IMPFORMAT_ROW_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_IMPFORMAT_ROW_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_MENU_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_MENU_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_MENU_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_MENU_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -28,10 +28,10 @@
   v_xTree_ID VARCHAR2(32);
   v_xParent_ID VARCHAR2(32);
   v_NextNo     VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_MESSAGE_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_MESSAGE_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_MESSAGE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_MESSAGE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -28,10 +28,10 @@
 * Description:
 ************************************************************************/
  v_aux NUMBER;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_MODEL_OBJECT_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_MODEL_OBJECT_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -30,10 +30,10 @@
   v_AD_FORM_ID      VARCHAR2(32);
   v_AD_REFERENCE_ID VARCHAR2(32);
   v_AD_CALLOUT_ID   VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_MODOBJMAPPING_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_MODOBJMAPPING_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -31,10 +31,10 @@
   v_AD_FORM_ID      VARCHAR2(32);
   v_AD_REFERENCE_ID VARCHAR2(32);
   v_AD_CALLOUT_ID   VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_MODULE_DBPREFIX_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_MODULE_DBPREFIX_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_MODULE_DBPREFIX_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_MODULE_DBPREFIX_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -21,10 +21,10 @@
   V_Char char;
   v_isregistered char(1);
   v_old_name varchar(60);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_MODULE_DENPENDENCY_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_MODULE_DENPENDENCY_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -20,10 +20,10 @@
   ************************************************************************/
   v_Type CHAR(1);
   v_name VARCHAR2(60);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_MODULE_DEPENDENCY_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_MODULE_DEPENDENCY_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_MODULE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_MODULE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -19,10 +19,10 @@
   * Contributor(s):  ______________________________________.
   ************************************************************************/
   V_Char char;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_ORGTYPE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_ORGTYPE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -19,10 +19,10 @@
 * Contributor(s):  ______________________________________.
 ************************************************************************/
   v_num NUMBER; 
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_ORG_STLE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_ORG_STLE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -19,10 +19,10 @@
 * Contributor(s):  ______________________________________.
 ************************************************************************/
   v_num NUMBER; 
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_ORG_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_ORG_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -27,10 +27,10 @@
   TYPE RECORD IS REF CURSOR;
     CUR_PeriodControl RECORD;
   
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_PACKAGE_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_PACKAGE_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_PROCESS_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_PROCESS_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_PROCESS_PARA_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_PROCESS_PARA_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_PROCESS_PARA_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_PROCESS_PARA_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -28,10 +28,10 @@
 * Description:
 *   Translation
 ************************************************************************/
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_PROCESS_REQUEST_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_PROCESS_REQUEST_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -20,10 +20,10 @@
 * Contributor(s):  ______________________________________.
 ************************************************************************/
 
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_PROCESS_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_PROCESS_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -29,10 +29,10 @@
 *   Synchronize Names and Translation
 *   Sync IsActive with Menu / Field
 ************************************************************************/
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_PROCESS_TRL_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_PROCESS_TRL_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -25,10 +25,10 @@
 * AD_Process_Trl update trigger
 *  synchronize name,... with  Field if centrally maintained
 */
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_REFERENCE_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_REFERENCE_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_REFERENCE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_REFERENCE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
 * file and version.
 *************************************************************************
 */
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_REFERENCE_TRG2.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_REFERENCE_TRG2.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -26,10 +26,10 @@
  v_ID_MAP      VARCHAR2(32);
  v_WindowName     VARCHAR2(60):= 'info';
  v_ClassName     VARCHAR2(60);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_REFERENCE_TRG3.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_REFERENCE_TRG3.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
 * Contributor(s):  ______________________________________.
 ************************************************************************/
  
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_REF_LIST_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_REF_LIST_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_REF_LIST_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_REF_LIST_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -27,10 +27,10 @@
     * Title: Ref List Translation
     * Description:
     ************************************************************************/
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_REF_SEARCH_COLUMN_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_REF_SEARCH_COLUMN_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_REF_SEARCH_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_REF_SEARCH_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_REF_TABLE_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_REF_TABLE_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_REGISTRATION_INFO_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_REGISTRATION_INFO_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -20,10 +20,10 @@
 * Contributor(s):  ______________________________________.
 ************************************************************************/
   v_Count NUMBER:= 0;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_ROLE_ORGACCESS_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_ROLE_ORGACCESS_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -34,10 +34,10 @@
   v_ClientList VARCHAR2(2000):='';
   v_OrgList    VARCHAR2(2000):='';
   v_Client_ID VARCHAR2(32):=-1;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_ROLE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_ROLE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -29,10 +29,10 @@
 * - Create Role_OrgAccess + User_Roles
 * - Insert Access for Role
 ************************************************************************/
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_SYSTEM_INFO_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_SYSTEM_INFO_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -20,10 +20,10 @@
 * Contributor(s):  ______________________________________.
 ************************************************************************/
   v_Count NUMBER:= 0;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_SYSTEM_INFO_TRG2.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_SYSTEM_INFO_TRG2.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -24,10 +24,10 @@
 indTempName NVARCHAR2(50) := 'System Customization';
 indTempPackage NVARCHAR2(50) := 'mySystem.CustomizationTemplate';
 
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_TABLE_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_TABLE_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_TABLE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_TABLE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -21,10 +21,10 @@
 ************************************************************************/
   v_Aux NUMBER;
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_TAB_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_TAB_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_TAB_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_TAB_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -22,10 +22,10 @@
     * Specifically, this derivative work is based upon the following Compiere
     * file and version.
     *************************************************************************/
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_TAB_TRG2.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_TAB_TRG2.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -29,10 +29,10 @@
  v_IsActive      CHAR(1) := 'Y';
  v_Count       NUMBER(10);
  v_JavaPackage VARCHAR2(315);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_TASK_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_TASK_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -24,10 +24,10 @@
     *************************************************************************
     * Insert Translation
     */
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
   IF INSERTING
--- a/src-db/database/model/triggers/AD_TASK_TRG2.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_TASK_TRG2.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -26,10 +26,10 @@
   v_ID_MAP     VARCHAR2(32) ;
   v_WindowName VARCHAR2(60):='ad_tasks';
   v_ClassName  VARCHAR2(60) ;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_TEXTINTERFACES_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_TEXTINTERFACES_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_TEXTINTERFACES_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_TEXTINTERFACES_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -22,10 +22,10 @@
 * All Rights Reserved.
 * Contributor(s):  ______________________________________.
 ************************************************************************/
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_TREENODE_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_TREENODE_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -24,10 +24,10 @@
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
   currentTree VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_TREENODE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_TREENODE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -27,10 +27,10 @@
   v_EqualAcctSchema NUMBER;
   v_TreeType VARCHAR2(2);
   v_IsReady AD_ORG.ISREADY%TYPE;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_TREE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_TREE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -27,10 +27,10 @@
     */
   v_NextNo VARCHAR2(32);
   v_Tree_ID VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_VAL_RULE_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_VAL_RULE_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_WF_NODENEXT_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_WF_NODENEXT_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_WF_NODE_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_WF_NODE_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_WF_NODE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_WF_NODE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
     * file and version.
     *************************************************************************
     */
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_WINDOW_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_WINDOW_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_WINDOW_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_WINDOW_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -30,10 +30,10 @@
     *   - Sync Name (Workflow, Menu)
     *   - Active State (Menu)
     ************************************************************************/
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_WINDOW_TRG2.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_WINDOW_TRG2.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -25,10 +25,10 @@
     TYPE RECORD IS REF CURSOR;
   CUR_DATA RECORD;
   v_JavaPackage VARCHAR2(60);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_WINDOW_TRL_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_WINDOW_TRL_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -28,10 +28,10 @@
     * Description:
     *   - Update Translation in Menu + Workflow
     ************************************************************************/
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_WORKFLOW_MOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_WORKFLOW_MOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   devModule   CHAR(1);
   cuerrentID  VARCHAR2(32);
   cuerrentModuleID  VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AD_WORKFLOW_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AD_WORKFLOW_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
     * file and version.
     *************************************************************************
     */
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/AT_COMMAND_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/AT_COMMAND_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -22,10 +22,10 @@
 * All Rights Reserved.
 * Contributor(s):  ______________________________________.
 ************************************************************************/
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/A_AMORTIZATIONLINE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/A_AMORTIZATIONLINE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -25,10 +25,10 @@
   v_Processed CHAR(1) ;
   v_Posted CHAR(1) ;
   v_AmortizationID varchar2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/A_AMORTIZATIONLINE_TRG2.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/A_AMORTIZATIONLINE_TRG2.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -6,10 +6,10 @@
 
 
 
-      v_ADEnabledTriggers NUMBER;
+      
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
  null;
--- a/src-db/database/model/triggers/A_AMORTIZATION_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/A_AMORTIZATION_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -27,10 +27,10 @@
     * Title: Check in deleting, invoice not processed
     ************************************************************************/
     v_DateNull DATE := TO_DATE('31-12-9999','DD-MM-YYYY');
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/A_ASSET_GROUP_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/A_ASSET_GROUP_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -20,10 +20,10 @@
 ************************************************************************/
     TYPE RECORD IS REF CURSOR;
   Cur_Defaults RECORD;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/A_ASSET_GROUP_TRG2.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/A_ASSET_GROUP_TRG2.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -22,10 +22,10 @@
     * All Rights Reserved.
     * Contributor(s):  ______________________________________.
     ************************************************************************/
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/A_ASSET_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/A_ASSET_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -22,10 +22,10 @@
   TYPE RECORD IS REF CURSOR;
   v_Acct_ID VARCHAR2(32);
   Cur_Defaults RECORD;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/A_ASSET_TRG2.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/A_ASSET_TRG2.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -22,10 +22,10 @@
 * All Rights Reserved.
 * Contributor(s):  ______________________________________.
 ************************************************************************/
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_ACCTSCHEMADEL_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_ACCTSCHEMADEL_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -22,10 +22,10 @@
     * Contributor(s):  ______________________________________.
     ************************************************************************/
 
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_ACCTSCHEMA_ELEMENT_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_ACCTSCHEMA_ELEMENT_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -26,10 +26,10 @@
     * when element becomes mandatory
     **/
     v_UpdateIt BOOLEAN:=FALSE;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_ACCTSCHEMA_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_ACCTSCHEMA_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -25,10 +25,10 @@
   TYPE RECORD IS REF CURSOR;
   cur_tables RECORD;
   v_AcctSchema_Table_ID VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_BANKACCOUNTIBAN_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_BANKACCOUNTIBAN_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -27,10 +27,10 @@
   v_CountryId NVARCHAR2(2);
   v_BankName NVARCHAR2(60);
   v_Length NUMBER;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_BANKACCOUNT_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_BANKACCOUNT_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -29,10 +29,10 @@
     ************************************************************************/
     TYPE RECORD IS REF CURSOR;
   Cur_Defaults RECORD;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_BANKCOUNTRY_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_BANKCOUNTRY_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -21,10 +21,10 @@
 
   v_Count NUMBER;
 
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_BANKSTATEMENTLINE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_BANKSTATEMENTLINE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -30,10 +30,10 @@
   v_Difference NUMBER:=0;
   v_ID VARCHAR2(32);
   v_RO NUMBER;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_BANKSTATEMENT_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_BANKSTATEMENT_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -27,10 +27,10 @@
     * Title: RO check
     * Description:
     ************************************************************************/
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
   IF(:old.Processed='Y')
--- a/src-db/database/model/triggers/C_BPARTNER_LOCATION_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_BPARTNER_LOCATION_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -36,10 +36,10 @@
     --v_Address2   VARCHAR2(60);
     v_name VARCHAR2(60) ;
     v_DateNull DATE := TO_DATE('01-01-1900', 'DD-MM-YYYY');
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_BPARTNER_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_BPARTNER_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -38,10 +38,10 @@
   v_xParent_ID      varchar2(32);
   v_BP_Acct_ID    varchar2(32);
 
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_BP_BANKACCOUNTIBAN_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_BP_BANKACCOUNTIBAN_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -35,10 +35,10 @@
   v_DigitBank NVARCHAR2(1);
   v_CountryId NVARCHAR2(2);
   v_Length NUMBER;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_BP_GROUP_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_BP_GROUP_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -30,10 +30,10 @@
     TYPE RECORD IS REF CURSOR;
   Cur_Defaults RECORD;
   v_acc_ID VARCHAR2(32) ;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_BP_SALCATEGORY_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_BP_SALCATEGORY_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
 v_isCostApplied CHAR(1);
 v_count NUMBER;
 
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_BP_SALCATEGORY_TRG2.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_BP_SALCATEGORY_TRG2.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -26,10 +26,10 @@
   TYPE RECORD IS REF CURSOR;
   Cur_Employees RECORD;
 
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_BSTMTLINE_CHK_RESTRICT_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_BSTMTLINE_CHK_RESTRICT_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -27,10 +27,10 @@
   v_Posted             CHAR(1) ;
   v_C_BANKSTATEMENT_ID VARCHAR2(32) ;
   v_DateNull DATE := TO_DATE('01-01-1900', 'DD-MM-YYYY');
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_BSTMT_CHK_RESTRICTIONS_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_BSTMT_CHK_RESTRICTIONS_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -25,10 +25,10 @@
 ************************************************************************/
 v_Count NUMBER;
 v_DateNull DATE := TO_DATE('01-01-1900', 'DD-MM-YYYY');
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_BUDGETLINE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_BUDGETLINE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -29,10 +29,10 @@
     *    - create default Account records
     ************************************************************************/
   v_Type CHAR(1);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_CASHBOOK_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_CASHBOOK_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -29,10 +29,10 @@
     ************************************************************************/
     TYPE RECORD IS REF CURSOR;
   Cur_Defaults RECORD;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_CASHLINE_CHK_RESTRICT_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_CASHLINE_CHK_RESTRICT_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -25,10 +25,10 @@
     ************************************************************************/
   v_Processed CHAR(1) ;
   v_C_CASH_ID VARCHAR2(32) ;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_CASHLINE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_CASHLINE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -51,10 +51,10 @@
  v_RO     NUMBER;
  --
  v_Trace     VARCHAR2(2000) := 'CashLine: ';
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_CASH_CHK_RESTRICTIONS_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_CASH_CHK_RESTRICTIONS_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -24,10 +24,10 @@
     * Contributor(s):  ______________________________________.
     ************************************************************************/
     v_DateNull DATE := TO_DATE('01-01-1900','DD-MM-YYYY');
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
   IF UPDATING
--- a/src-db/database/model/triggers/C_CASH_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_CASH_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -29,10 +29,10 @@
     *  Truncate Statement Date
     *  Update Statement Balances when Beginning Balance chages
     ************************************************************************/
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_CHARGE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_CHARGE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -26,10 +26,10 @@
     */
     TYPE RECORD IS REF CURSOR;
     Cur_Defaults RECORD;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_COMMISSIONAMT_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_COMMISSIONAMT_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -33,10 +33,10 @@
   v_IsPositiveOnly CHAR(1) ;
   --
   v_Result NUMBER;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_COMMISSIONDETAIL_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_COMMISSIONDETAIL_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -27,10 +27,10 @@
     */
   v_C_Currency_ID VARCHAR2(32);
   v_ConvDate DATE;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_CONVERSION_RATE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_CONVERSION_RATE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -29,10 +29,10 @@
     * If there is no valid ToDate set it to arbitrary end date
     ************************************************************************/
       v_Count NUMBER;
-      v_ADEnabledTriggers NUMBER;
+      
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_CONVERSION_RATE_TRG2.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_CONVERSION_RATE_TRG2.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
 * Contributor(s):  ______________________________________.
 ************************************************************************/
   v_Count NUMBER;
-       v_ADEnabledTriggers NUMBER;
+       
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_COUNTRY_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_COUNTRY_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -19,10 +19,10 @@
 * Contributor(s):  ______________________________________.
 ************************************************************************/
 
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
   IF INSERTING
--- a/src-db/database/model/triggers/C_CURRENCY_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_CURRENCY_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -19,10 +19,10 @@
 * Contributor(s):  ______________________________________.
 ************************************************************************/
 
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
   IF INSERTING
--- a/src-db/database/model/triggers/C_DEBT_PAYMENT_BAL_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_DEBT_PAYMENT_BAL_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -25,10 +25,10 @@
   v_Qty NUMBER:=0;
   v_Processed         CHAR(1) ;
   v_C_DEBT_PAYMENT_ID VARCHAR2(32) ;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_DEBT_PAYMENT_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_DEBT_PAYMENT_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -37,10 +37,10 @@
  v_Oldmultiplier NUMBER:=1;
  v_Processed CHAR(1);
  v_Aux NUMBER;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_DOCTYPE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_DOCTYPE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
     * file and version.
     *************************************************************************
     */
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_DPMLINE_CHK_RESTRICTIONS_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_DPMLINE_CHK_RESTRICTIONS_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -25,10 +25,10 @@
     ************************************************************************/
   v_Processed CHAR(1) ;
   v_C_dp_ID VARCHAR2(32) ;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_DP_MANAGEMENTLINE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_DP_MANAGEMENTLINE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -22,10 +22,10 @@
 * All Rights Reserved.
 * Contributor(s):  ______________________________________.
 ************************************************************************/
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_DP_MANAGEMENT_CHK_RESTR_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_DP_MANAGEMENT_CHK_RESTR_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -24,10 +24,10 @@
 * Contributor(s):  ______________________________________.
 ************************************************************************/
 v_DateNull DATE := TO_DATE('01-01-1900','DD-MM-YYYY');
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_ELEMENTVALUE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_ELEMENTVALUE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -25,10 +25,10 @@
   v_xTree_ID VARCHAR2(32);
   v_xParent_ID VARCHAR2(32);
   v_NextNo     VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_GREETING_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_GREETING_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -24,10 +24,10 @@
 *************************************************************************
 * Insert Translation
 */
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_INVLINE_CHK_RESTRICTIONS_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_INVLINE_CHK_RESTRICTIONS_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -26,10 +26,10 @@
   v_C_INVOICE_ID VARCHAR2(32) ;
   v_Prec NUMBER:=2;
   v_Currency     VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_INVOICEDISCOUNT_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_INVOICEDISCOUNT_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -25,10 +25,10 @@
   v_ID VARCHAR2(32);
   v_RO        NUMBER;
   v_Processed CHAR(1) ;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_INVOICELINE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_INVOICELINE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -38,10 +38,10 @@
  v_LineNetAmt  NUMBER;
  v_CinvoiceTaxID varchar2(32);
 
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_INVOICELINE_TRG2.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_INVOICELINE_TRG2.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -37,10 +37,10 @@
   v_DateInvoiced DATE;
   v_Precision NUMBER;
   v_PriceList_ID VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_INVOICELINE_TRG3.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_INVOICELINE_TRG3.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -43,10 +43,10 @@
 vwithholdingtax NUMBER;
 vwithid varchar2(32);
 finish_process BOOLEAN := FALSE;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_INVOICETAX_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_INVOICETAX_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -30,10 +30,10 @@
   v_ID VARCHAR2(32);
   v_RO        NUMBER;
   v_Processed CHAR(1) ;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_INVOICETAX_TRG2.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_INVOICETAX_TRG2.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -41,10 +41,10 @@
 whamountnew NUMBER;
 vwithid varchar2(32);
 finish_process BOOLEAN := FALSE;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_INVOICE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_INVOICE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -27,10 +27,10 @@
     * Title: Check in deleting, invoice not processed
     ************************************************************************/
    v_n NUMBER;
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_INVOICE_TRG2.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_INVOICE_TRG2.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -25,10 +25,10 @@
    TYPE RECORD IS REF CURSOR;
   Cur_Discounts RECORD;
   v_Key VARCHAR2(32) ;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_INVTAX_CHK_RESTRICTIONS_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_INVTAX_CHK_RESTRICTIONS_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -25,10 +25,10 @@
 ************************************************************************/
   v_Processed CHAR(1) ;
   v_C_INVOICE_ID VARCHAR2(32) ;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_LOCATION_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_LOCATION_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -22,10 +22,10 @@
   cur_Bank RECORD;
   cur_BankAccount RECORD;
   v_IBANCount NUMBER;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_ORDERLINE2_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_ORDERLINE2_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -26,10 +26,10 @@
   v_QtyReserved      NUMBER;
   v_QtyOrderReserved NUMBER;
   V_STOCKED          NUMBER;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_ORDERLINE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_ORDERLINE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -37,10 +37,10 @@
   v_UOM_ID    VARCHAR2(32);
   v_IsSOTrx CHAR(1);
   v_Count NUMBER;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_ORDERLINE_TRG2.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_ORDERLINE_TRG2.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -37,10 +37,10 @@
   v_Insert BOOLEAN :=FALSE;
   v_Precision NUMBER;
   v_PriceList_ID VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_ORDERTAX_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_ORDERTAX_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -32,10 +32,10 @@
   v_Processed  CHAR(1) ;
   v_C_ORDER_ID VARCHAR2(32) ;
   v_Docaction NVARCHAR2(2) ;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_ORDER_CHK_RESTRINCTIONS_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_ORDER_CHK_RESTRINCTIONS_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -15,10 +15,10 @@
 v_amt NUMBER;
 v_DateNull DATE := TO_DATE('01-01-1900','DD-MM-YYYY');
 
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_ORDER_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_ORDER_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -29,10 +29,10 @@
     *  Update potentially existing Invoices with Payment Info
     *  Sync Header Changes to Lines
     ************************************************************************/
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
   IF(UPDATING)
--- a/src-db/database/model/triggers/C_ORDER_TRG2.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_ORDER_TRG2.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
     * Contributor(s):  ______________________________________.
     ************************************************************************/
     v_DateNull DATE := TO_DATE('01-01-1900','DD-MM-YYYY');
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
   IF(UPDATING)
--- a/src-db/database/model/triggers/C_ORDLINE_CHK_RESTRICTIONS_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_ORDLINE_CHK_RESTRICTIONS_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -22,10 +22,10 @@
   v_Processed CHAR(1) ;
   v_C_ORDER_ID VARCHAR2(32) ;
   v_Docaction NVARCHAR2(2) ;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_PAYMENTTERM_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_PAYMENTTERM_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
     * file and version.
     *************************************************************************
     */
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_PERIOD_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_PERIOD_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -27,10 +27,10 @@
     v_NextNo VARCHAR2(32);
   TYPE RECORD IS REF CURSOR;
     CUR_DocType RECORD;
-      v_ADEnabledTriggers NUMBER;
+      
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_PERIOD_TRG2.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_PERIOD_TRG2.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -25,10 +25,10 @@
     * Calculate End Date
     */
     v_DateNull DATE := TO_DATE('01-01-1900','DD-MM-YYYY');
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_PROJECTLINE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_PROJECTLINE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -31,10 +31,10 @@
     v_PriceLimit NUMBER:=NULL;
   v_PriceStd NUMBER:=NULL;
   v_PlannedMargin NUMBER:=NULL;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_PROJECTLINE_TRG2.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_PROJECTLINE_TRG2.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -2,10 +2,10 @@
   <database name="TRIGGER C_PROJECTLINE_TRG2">
     <trigger name="C_PROJECTLINE_TRG2" table="C_PROJECTLINE" fires="after" insert="true" update="true" delete="false" foreach="statement">
       <body><![CDATA[
-     v_ADEnabledTriggers NUMBER;
+     
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_PROJECTPHASE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_PROJECTPHASE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -21,10 +21,10 @@
 ************************************************************************
 */
 v_projecttaskid VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_PROJECTPROPOSALTASK_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_PROJECTPROPOSALTASK_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
     * Contributor(s):  ______________________________________.
     ************************************************************************/
   v_Project VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_PROJECT_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_PROJECT_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -34,10 +34,10 @@
   --
   TYPE RECORD IS REF CURSOR;
     Cur_Defaults RECORD;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_PROJECT_TRG2.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_PROJECT_TRG2.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -28,10 +28,10 @@
     * Description:
     ************************************************************************/
     v_Count NUMBER;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_PROJECT_TRG3.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_PROJECT_TRG3.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -25,10 +25,10 @@
   v_Count NUMBER;
   v_Tree_ID   varchar2(32);
   v_Parent_ID VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_REMITTANCELINE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_REMITTANCELINE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -27,10 +27,10 @@
   v_C_Remittance_ID VARCHAR2(32) ;
   v_Prec NUMBER:=2;
   v_Currency        VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_REMITTANCE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_REMITTANCE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -27,10 +27,10 @@
 * Title: Check in deleting, invoice not processed
 ************************************************************************/
 v_DateNull DATE := TO_DATE('31-12-9999','DD-MM-YYYY');
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_REVENUERECOGNITION_PLAN_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_REVENUERECOGNITION_PLAN_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -32,10 +32,10 @@
   v_NextNo       VARCHAR2(32);
   v_Qty          NUMBER;
   v_M_Product_ID VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_SALESREGION_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_SALESREGION_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -31,10 +31,10 @@
     v_Tree_ID VARCHAR2(32);
   v_Parent_ID VARCHAR2(32);
   --
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_SETTLEMENT_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_SETTLEMENT_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -24,10 +24,10 @@
  * Contributor(s):  ______________________________________.
  ************************************************************************/
 v_DateNull DATE := TO_DATE('01-01-1900', 'DD-MM-YYYY');
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_TAXCATEGORY_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_TAXCATEGORY_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -24,10 +24,10 @@
     *************************************************************************
     * Insert Translation
     */
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
   IF INSERTING
--- a/src-db/database/model/triggers/C_TAXPAYMENT_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_TAXPAYMENT_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -25,10 +25,10 @@
     * Insert Translation
     */
 
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_TAXREGISTERLINE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_TAXREGISTERLINE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -21,10 +21,10 @@
 V_PROCESSED VARCHAR2(1);
 V_PROCESSING VARCHAR2(1);
 
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_TAXREGISTER_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_TAXREGISTER_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -21,10 +21,10 @@
 V_PROCESSED VARCHAR2(1);
 V_PROCESSING VARCHAR2(1);
 
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_TAX_REPORT_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_TAX_REPORT_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -25,10 +25,10 @@
   v_xTree_ID VARCHAR2(32);
   v_xParent_ID VARCHAR2(32);
   v_NextNo     VARCHAR2(32);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_TAX_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_TAX_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -31,10 +31,10 @@
     ************************************************************************/
     TYPE RECORD IS REF CURSOR;
   Cur_Defaults RECORD;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_UOM_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_UOM_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -27,10 +27,10 @@
     * Title: UOM Translation
     * Description:
     ************************************************************************/
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_VALIDCOMBINATION_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_VALIDCOMBINATION_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -78,10 +78,10 @@
   FROM C_ElementValue WHERE C_ElementValue_ID=:new.User2_ID AND IsActive = 'Y';
  --
  v_change    BOOLEAN;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/C_WITHHOLDING_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/C_WITHHOLDING_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -26,10 +26,10 @@
     */
    TYPE RECORD IS REF CURSOR;
   Cur_Defaults RECORD;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/GL_JL_CHK_RESTRICTIONS_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/GL_JL_CHK_RESTRICTIONS_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -27,10 +27,10 @@
   v_Posted        CHAR(1) ;
   v_GL_JOURNAL_ID VARCHAR2(32) ;
   v_DateNull DATE :=TO_DATE('01-01-1900','DD-MM-YYYY');
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/GL_JOURNALLINE2_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/GL_JOURNALLINE2_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -28,10 +28,10 @@
   v_rate              NUMBER;
   v_CurrencyRate      NUMBER;
   v_CurrencyRateType  CHAR(1) ;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/GL_JOURNALLINE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/GL_JOURNALLINE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -30,10 +30,10 @@
     ************************************************************************/
     v_ID VARCHAR2(32);
   v_RO NUMBER;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/GL_JOURNAL_CHK_RESTRICT_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/GL_JOURNAL_CHK_RESTRICT_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -24,10 +24,10 @@
     * Contributor(s):  ______________________________________.
     ************************************************************************/
     v_DateNull DATE := TO_DATE('01-01-1900', 'DD-MM-YYYY');
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/GL_JOURNAL_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/GL_JOURNAL_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -25,10 +25,10 @@
     *  Journal
     * - Update Journal Batch Totals if exists (insert is always 0)
     */
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/M_ATTRIBUTEVALUE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/M_ATTRIBUTEVALUE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -28,10 +28,10 @@
   pos        NUMBER;
   TYPE RECORD IS REF CURSOR;
   CurSetInstance RECORD;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/M_INOUTLINE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/M_INOUTLINE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -29,10 +29,10 @@
  * Contributor(s): Openbravo SL
  * Contributions are Copyright (C) 2001-2006 Openbravo S.L.
  ******************************************************************************/
-     v_ADEnabledTriggers NUMBER;
+     
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/M_INOUT_CHK_RESTRICTIONS_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/M_INOUT_CHK_RESTRICTIONS_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -25,10 +25,10 @@
 
   v_DateNull DATE := TO_DATE('01-01-1900', 'DD-MM-YYYY');
 
-     v_ADEnabledTriggers NUMBER;
+     
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/M_INOUT_TRG_PROV.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/M_INOUT_TRG_PROV.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -27,10 +27,10 @@
     ************************************************************************/
   v_docType_ID VARCHAR2(32) ;
   v_movementType CHAR(2) ;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/M_INTERNAL_CONSUMPTIONLINE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/M_INTERNAL_CONSUMPTIONLINE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -27,10 +27,10 @@
 * All Rights Reserved.
 * Contributor(s):  ______________________________________.
 ************************************************************************/
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/M_INVENTORYLINE2_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/M_INVENTORYLINE2_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -22,10 +22,10 @@
 * All Rights Reserved.
 * Contributor(s):  ______________________________________.
 ************************************************************************/
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
  IF(UPDATING)
--- a/src-db/database/model/triggers/M_INVENTORYLINE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/M_INVENTORYLINE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   * Contributor(s): Openbravo SL
   * Contributions are Copyright (C) 2001-2006 Openbravo S.L.
   ******************************************************************************/
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/M_INVENTORY_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/M_INVENTORY_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
     * Contributor(s):  ______________________________________.
     ************************************************************************/
 v_DateNull DATE := TO_DATE('01-01-1900','DD-MM-YYYY');
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/M_IOLINE_CHK_RESTRICTIONS_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/M_IOLINE_CHK_RESTRICTIONS_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -25,10 +25,10 @@
 ************************************************************************/
   v_Processed CHAR(1) ;
   v_M_INOUT_ID VARCHAR2(32) ;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/M_MATCHPO_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/M_MATCHPO_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -27,10 +27,10 @@
   * Contributor(s): Openbravo SL
   * Contributions are Copyright (C) 2001-2006 Openbravo S.L.
   ******************************************************************************/
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/M_MOVEMENTLINE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/M_MOVEMENTLINE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
   * Contributor(s): Openbravo SL
   * Contributions are Copyright (C) 2001-2006 Openbravo S.L.
   ******************************************************************************/
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/M_MOVEMENT_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/M_MOVEMENT_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
     * Contributor(s):  ______________________________________.
     ************************************************************************/
 v_DateNull DATE := TO_DATE('01-01-1900', 'DD-MM-YYYY');
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/M_PRODUCTIONLINE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/M_PRODUCTIONLINE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -31,10 +31,10 @@
   * Specifically, this derivative work is based upon the following Compiere
   * file and version.
   *************************************************************************/
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/M_PRODUCTIONPLAN_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/M_PRODUCTIONPLAN_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -29,10 +29,10 @@
     ************************************************************************/
     v_ID VARCHAR2(32);
   v_RO NUMBER;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/M_PRODUCTION_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/M_PRODUCTION_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -23,10 +23,10 @@
     * Contributor(s):  ______________________________________.
     ************************************************************************/
 v_DateNull DATE := TO_DATE('01-01-1900', 'DD-MM-YYYY');
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/M_PRODUCT_BOM_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/M_PRODUCT_BOM_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -24,10 +24,10 @@
     *************************************************************************
     * Reset Verification flag of parent
     */
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
   IF(INSERTING)
--- a/src-db/database/model/triggers/M_PRODUCT_CATEGORY_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/M_PRODUCT_CATEGORY_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -26,10 +26,10 @@
     */
    TYPE RECORD IS REF CURSOR;
   Cur_Defaults RECORD;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/M_PRODUCT_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/M_PRODUCT_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -31,10 +31,10 @@
     v_NextNo      VARCHAR2(32);
     v_ControlNo NUMBER;
 
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/M_RAPPEL_INVOICE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/M_RAPPEL_INVOICE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -19,10 +19,10 @@
 * Contributor(s):  ______________________________________.
 ************************************************************************/
 
-     v_ADEnabledTriggers NUMBER;
+     
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/M_REQUISITIONLINE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/M_REQUISITIONLINE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -22,10 +22,10 @@
   v_ReqStatus CHAR(1);
   v_OrderedQty NUMBER;
 
-      v_ADEnabledTriggers NUMBER;
+      
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/M_REQUISITIONORDER_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/M_REQUISITIONORDER_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -22,10 +22,10 @@
     v_DocStatus CHAR(2);
     v_ReqStatus CHAR(1);
     v_Count     NUMBER;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/M_REQUISITION_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/M_REQUISITION_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -19,10 +19,10 @@
 * Contributor(s):  ______________________________________.
 ************************************************************************/
   v_DocStatus CHAR(2);
-      v_ADEnabledTriggers NUMBER;
+      
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/M_TRANSACTION_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/M_TRANSACTION_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -26,10 +26,10 @@
   v_UOM_ID VARCHAR2(32) ;
   v_ATTRIBUTESET_ID VARCHAR2(32);
   v_Name NVARCHAR2(60);
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/M_WAREHOUSE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/M_WAREHOUSE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -28,10 +28,10 @@
 
   TYPE RECORD IS REF CURSOR;
   Cur_Defaults RECORD;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/S_EXPENSETYPE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/S_EXPENSETYPE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -29,10 +29,10 @@
     *   Syncronize Resource with Product
     ************************************************************************/
     NextNo M_Product.M_Product_ID%TYPE;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/S_RESOURCEASSIGNMENT_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/S_RESOURCEASSIGNMENT_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -29,10 +29,10 @@
     *   Syncronize Resource Assugnment with Expense Reports
     ************************************************************************/
     v_Description NVARCHAR2(255) ;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/S_RESOURCETYPE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/S_RESOURCETYPE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -28,10 +28,10 @@
     * Description:
     *   Syncronize Resource Type with Product
     ************************************************************************/
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/S_RESOURCEUNAVAILABLE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/S_RESOURCEUNAVAILABLE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -29,10 +29,10 @@
     *   - Truncate + Fill date
     *   - Endure that start < end
     ************************************************************************/
-        v_ADEnabledTriggers NUMBER;
+        
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/S_RESOURCE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/S_RESOURCE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -32,10 +32,10 @@
   v_C_UOM_ID              M_Product.C_UOM_ID%TYPE;
   v_M_Product_Category_ID M_Product.M_Product_Category_ID%TYPE;
   v_C_TaxCategory_ID      M_Product.C_TaxCategory_ID%TYPE;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/S_TIMEEXPENSELINE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/S_TIMEEXPENSELINE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -26,10 +26,10 @@
   v_TimeExpense_ID VARCHAR2(32);
   v_RO NUMBER;
   v_need_verification BOOLEAN := true;
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/database/model/triggers/S_TIMEEXPENSE_TRG.xml	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/database/model/triggers/S_TIMEEXPENSE_TRG.xml	Mon Nov 24 16:45:42 2008 +0000
@@ -25,10 +25,10 @@
 * Contributor(s):  ______________________________________.
 ************************************************************************/
 
-    v_ADEnabledTriggers NUMBER;
+    
 BEGIN
-    SELECT COUNT(*) INTO v_ADEnabledTriggers FROM AD_ENABLE_TRIGGERS WHERE ISENABLED='N';
-    IF v_ADEnabledTriggers!=0 THEN RETURN;
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
     END IF;
 
 
--- a/src-db/src/com/openbravo/db/OpenbravoExcludeFilter.java	Mon Nov 24 16:41:48 2008 +0000
+++ b/src-db/src/com/openbravo/db/OpenbravoExcludeFilter.java	Mon Nov 24 16:45:42 2008 +0000
@@ -26,7 +26,8 @@
             "PLAN_TABLE", 
             "AD_SYSTEM_MODEL", 
             "C_TEMP_SELECTION",
-            "C_TEMP_SELECTION2"};
+            "C_TEMP_SELECTION2",
+            "AD_ENABLE_TRIGGERS"};
     }
     
     public String[] getExcludedViews() {
@@ -92,7 +93,8 @@
             "UUID_GENERATE_V1",
             "AD_ORG_CHK_DOCUMENTS",
             "AD_ORG_CHK_DOC_PAYMENTS",
-            "C_CREATE_TEMPORARY_TABLES"
+            "C_CREATE_TEMPORARY_TABLES",
+            "AD_ISTRIGGERENABLED"
             };
     }