Fixes bug 17076: G/L Item. When a tax is defined as default
authorEduardo Argal Guibert <eduardo.argal@openbravo.com>
Tue, 10 May 2011 10:08:35 +0200
changeset 12074 af85d0df177c
parent 12073 d5af22c77778
child 12075 b4a9106936d9
Fixes bug 17076: G/L Item. When a tax is defined as default
src-db/database/model/triggers/C_GLITEM_TRG.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/triggers/C_GLITEM_TRG.xml	Tue May 10 10:08:35 2011 +0200
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+  <database name="TRIGGER C_GLITEM_TRG">
+    <trigger name="C_GLITEM_TRG" table="C_GLITEM" fires="before" insert="true" update="false" delete="false" foreach="row">
+      <body><![CDATA[
+    /*************************************************************************
+    * The contents of this file are subject to the Openbravo  Public  License
+    * Version  1.1  (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 SLU
+    * All portions are Copyright (C) 2001-2009 Openbravo SLU
+    * All Rights Reserved.
+    * Contributor(s):  ______________________________________.
+    ************************************************************************/
+        
+BEGIN
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
+    END IF;
+
+    IF INSERTING THEN
+     :NEW.C_TAX_ID := NULL;
+    END IF;
+
+END C_GLITEM_TRG
+]]></body>
+    </trigger>
+  </database>