src-db/database/model/triggers/C_TAXPAYMENT_TRG.xml
author Juan Pablo Aroztegi <juanpablo.aroztegi@openbravo.com>
Mon, 28 Apr 2008 09:28:08 +0000
changeset 785 8dba91261590
parent 781 d68cf344696f
child 2078 cf88ca44cdd2
permissions -rw-r--r--
Fix last update of copyright years in database files
juanpablo@728
     1
<?xml version="1.0"?>
juanpablo@728
     2
  <database name="TRIGGER C_TAXPAYMENT_TRG">
juanpablo@728
     3
    <trigger name="C_TAXPAYMENT_TRG" table="C_TAXPAYMENT" fires="before" insert="true" update="true" delete="true" foreach="row">
eduardo@723
     4
      <body><![CDATA[
juanpablo@771
     5
    /*************************************************************************
juanpablo@771
     6
    * The contents of this file are subject to the Compiere Public
juanpablo@771
     7
    * License 1.1 ("License"); You may not use this file except in
juanpablo@771
     8
    * compliance with the License. You may obtain a copy of the License in
juanpablo@771
     9
    * the legal folder of your Openbravo installation.
eduardo@723
    10
    * Software distributed under the License is distributed on an
eduardo@723
    11
    * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
eduardo@723
    12
    * implied. See the License for the specific language governing rights
eduardo@723
    13
    * and limitations under the License.
juanpablo@778
    14
    * The Original Code is  Compiere  ERP &  Business Solution
juanpablo@771
    15
    * The Initial Developer of the Original Code is Jorg Janke and ComPiere, Inc.
eduardo@723
    16
    * Portions created by Jorg Janke are Copyright (C) 1999-2001 Jorg Janke,
eduardo@723
    17
    * parts created by ComPiere are Copyright (C) ComPiere, Inc.;
eduardo@723
    18
    * All Rights Reserved.
eduardo@723
    19
    * Contributor(s): Openbravo SL
juanpablo@785
    20
    * Contributions are Copyright (C) 2001-2008 Openbravo, S.L.
juanpablo@771
    21
    *
juanpablo@771
    22
    * Specifically, this derivative work is based upon the following Compiere
juanpablo@771
    23
    * file and version.
eduardo@723
    24
    *************************************************************************
eduardo@723
    25
    * Insert Translation
antonio@737
    26
    */
antonio@737
    27
eduardo@723
    28
    BEGIN
eduardo@723
    29
    IF UPDATING
eduardo@723
    30
    THEN  IF (:OLD.PROCESSED)='Y' AND (:OLD.processing) = 'N' and (:OLD.processing)=(:new.processing)
eduardo@723
    31
    THEN  RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted') ;
eduardo@723
    32
    END IF;
eduardo@723
    33
  END IF;
eduardo@723
    34
  IF(INSERTING) THEN
eduardo@723
    35
   IF(:NEW.PROCESSED='Y') AND (:new.processing= 'N') THEN
eduardo@723
    36
     RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted') ;
eduardo@723
    37
   END IF;
eduardo@723
    38
  END IF;
eduardo@723
    39
  IF(DELETING) THEN
eduardo@723
    40
   IF(:OLD.PROCESSED='Y') AND (:OLD.processing= 'N') THEN
eduardo@723
    41
     RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted') ;
eduardo@723
    42
   END IF;
eduardo@723
    43
  END IF;
antonio@735
    44
END C_TAXPAYMENT_TRG
juanpablo@728
    45
]]></body>
juanpablo@728
    46
    </trigger>
juanpablo@728
    47
  </database>