details:   /erp/devel/pi/rev/ef2cfd4b2a7a
changeset: 6963:ef2cfd4b2a7a
user:      Sivaraman Rajagopal <sivaraman.rajagopal <at> openbravo.com>
date:      Fri Apr 09 14:05:03 2010 +0530
summary:   Fixes issue 12387: It is possible to add some records when a Work 
effort is processed

diffstat:

 src-db/database/model/triggers/MA_PL_EMPLOYEE_TRG.xml    |   69 +++++++++
 src-db/database/model/triggers/MA_PL_IC_TRG.xml          |   68 +++++++++
 src-db/database/model/triggers/MA_PL_INVOICELINE_TRG.xml |   70 +++++++++
 src-db/database/model/triggers/MA_PL_MACHINE_TRG.xml     |   69 +++++++++
 src-db/database/model/triggers/MA_TOOLSETUSED_TRG.xml    |   69 +++++++++
 src-db/database/sourcedata/AD_AUXILIARINPUT.xml          |  110 +++++++++++++++
 src-db/database/sourcedata/AD_COLUMN.xml                 |   21 ++
 7 files changed, 476 insertions(+), 0 deletions(-)

diffs (truncated from 719 to 300 lines):

diff -r 511757e230d2 -r ef2cfd4b2a7a 
src-db/database/model/triggers/MA_PL_EMPLOYEE_TRG.xml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/triggers/MA_PL_EMPLOYEE_TRG.xml     Fri Apr 09 
14:05:03 2010 +0530
@@ -0,0 +1,69 @@
+<?xml version="1.0"?>
+  <database name="TRIGGER MA_PL_EMPLOYEE_TRG">
+    <trigger name="MA_PL_EMPLOYEE_TRG" table="MA_PL_EMPLOYEE" fires="after" 
insert="true" update="true" delete="true" foreach="row">
+      <body><![CDATA[
+    /*************************************************************************
+    * The contents of this file are subject to the Compiere Public
+    * License 1.1 ("License"); You may not use this file except in
+    * compliance with the License. You may obtain a copy of the License in
+    * the legal folder of your Openbravo installation.
+    * 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  Compiere  ERP &  Business Solution
+    * The Initial Developer of the Original Code is Jorg Janke and ComPiere, 
Inc.
+    * Portions created by Jorg Janke are Copyright (C) 1999-2001 Jorg Janke,
+    * parts created by ComPiere are Copyright (C) ComPiere, Inc.;
+    * All Rights Reserved.
+    * Contributor(s): Openbravo SLU
+    * Contributions are Copyright (C) 2010 Openbravo, S.L.U.
+    *
+    * Specifically, this derivative work is based upon the following Compiere
+    * file and version.
+    *************************************************************************/
+v_ID VARCHAR2(32);
+v_RO NUMBER;
+v_New_Plan_ID VARCHAR2(32);
+v_Old_Plan_ID VARCHAR2(32);
+    
+BEGIN
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
+    END IF;
+
+  v_New_Plan_ID:=:new.M_ProductionPlan_ID;
+  v_Old_Plan_ID:=:old.M_ProductionPlan_ID;
+  -- Get ID
+  IF(UPDATING OR INSERTING) THEN
+    SELECT mp.M_Production_ID INTO v_ID FROM M_ProductionPlan mp WHERE 
mp.M_ProductionPlan_ID = v_New_Plan_ID;
+  ELSE
+    SELECT mp.M_Production_ID INTO v_ID FROM M_ProductionPlan mp WHERE 
mp.M_ProductionPlan_ID = v_Old_Plan_ID;
+  END IF;
+  -- ReadOnly Check
+  SELECT COUNT(*)
+  INTO v_RO
+  FROM M_Production
+  WHERE M_Production_ID=v_ID
+    AND(Processed='Y'
+    OR Posted='Y') ;
+  IF (v_RO > 0) THEN
+    IF (DELETING OR INSERTING) THEN
+      RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted') ;
+    END IF;
+    IF (UPDATING) THEN
+      IF (:new.AD_CLIENT_ID <> :old.AD_CLIENT_ID
+         OR :new.AD_ORG_ID <> :old.AD_ORG_ID
+         OR :new.M_PRODUCTIONPLAN_ID <> :old.M_PRODUCTIONPLAN_ID
+         OR :new.ISACTIVE <> :old.ISACTIVE
+         OR :new.C_SALARY_CATEGORY_ID <> :old.C_SALARY_CATEGORY_ID
+         OR :new.QUANTITY <> :old.QUANTITY
+        ) THEN
+        RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted') ;
+      END IF;
+    END IF;
+  END IF;
+END MA_PL_EMPLOYEE_TRG
+]]></body>
+    </trigger>
+  </database>
diff -r 511757e230d2 -r ef2cfd4b2a7a 
src-db/database/model/triggers/MA_PL_IC_TRG.xml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/triggers/MA_PL_IC_TRG.xml   Fri Apr 09 14:05:03 
2010 +0530
@@ -0,0 +1,68 @@
+<?xml version="1.0"?>
+  <database name="TRIGGER MA_PL_IC_TRG">
+    <trigger name="MA_PL_IC_TRG" table="MA_PL_IC" fires="after" insert="true" 
update="true" delete="true" foreach="row">
+      <body><![CDATA[
+    /*************************************************************************
+    * The contents of this file are subject to the Compiere Public
+    * License 1.1 ("License"); You may not use this file except in
+    * compliance with the License. You may obtain a copy of the License in
+    * the legal folder of your Openbravo installation.
+    * 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  Compiere  ERP &  Business Solution
+    * The Initial Developer of the Original Code is Jorg Janke and ComPiere, 
Inc.
+    * Portions created by Jorg Janke are Copyright (C) 1999-2001 Jorg Janke,
+    * parts created by ComPiere are Copyright (C) ComPiere, Inc.;
+    * All Rights Reserved.
+    * Contributor(s): Openbravo SLU
+    * Contributions are Copyright (C) 2010 Openbravo, S.L.U.
+    *
+    * Specifically, this derivative work is based upon the following Compiere
+    * file and version.
+    *************************************************************************/
+v_ID VARCHAR2(32);
+v_RO NUMBER;
+v_New_Plan_ID VARCHAR2(32);
+v_Old_Plan_ID VARCHAR2(32);
+    
+BEGIN
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
+    END IF;
+
+  v_New_Plan_ID:=:new.M_ProductionPlan_ID;
+  v_Old_Plan_ID:=:old.M_ProductionPlan_ID;
+  -- Get ID
+  IF(UPDATING OR INSERTING) THEN
+    SELECT mp.M_Production_ID INTO v_ID FROM M_ProductionPlan mp WHERE 
mp.M_ProductionPlan_ID = v_New_Plan_ID;
+  ELSE
+    SELECT mp.M_Production_ID INTO v_ID FROM M_ProductionPlan mp WHERE 
mp.M_ProductionPlan_ID = v_Old_Plan_ID;
+  END IF;
+  -- ReadOnly Check
+  SELECT COUNT(*)
+  INTO v_RO
+  FROM M_Production
+  WHERE M_Production_ID=v_ID
+    AND(Processed='Y'
+    OR Posted='Y') ;
+  IF (v_RO > 0) THEN
+    IF (DELETING OR INSERTING) THEN
+      RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted') ;
+    END IF;
+    IF (UPDATING) THEN
+      IF (:new.AD_CLIENT_ID <> :old.AD_CLIENT_ID
+         OR :new.AD_ORG_ID <> :old.AD_ORG_ID
+         OR :new.M_PRODUCTIONPLAN_ID <> :old.M_PRODUCTIONPLAN_ID
+         OR :new.ISACTIVE <> :old.ISACTIVE
+         OR :new.MA_INDIRECT_COST_ID <> :old.MA_INDIRECT_COST_ID
+        ) THEN
+        RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted') ;
+      END IF;
+    END IF;
+  END IF;
+END MA_PL_IC_TRG
+]]></body>
+    </trigger>
+  </database>
diff -r 511757e230d2 -r ef2cfd4b2a7a 
src-db/database/model/triggers/MA_PL_INVOICELINE_TRG.xml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/triggers/MA_PL_INVOICELINE_TRG.xml  Fri Apr 09 
14:05:03 2010 +0530
@@ -0,0 +1,70 @@
+<?xml version="1.0"?>
+  <database name="TRIGGER MA_PL_INVOICELINE_TRG">
+    <trigger name="MA_PL_INVOICELINE_TRG" table="MA_PL_INVOICELINE" 
fires="after" insert="true" update="true" delete="true" foreach="row">
+      <body><![CDATA[
+    /*************************************************************************
+    * The contents of this file are subject to the Compiere Public
+    * License 1.1 ("License"); You may not use this file except in
+    * compliance with the License. You may obtain a copy of the License in
+    * the legal folder of your Openbravo installation.
+    * 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  Compiere  ERP &  Business Solution
+    * The Initial Developer of the Original Code is Jorg Janke and ComPiere, 
Inc.
+    * Portions created by Jorg Janke are Copyright (C) 1999-2001 Jorg Janke,
+    * parts created by ComPiere are Copyright (C) ComPiere, Inc.;
+    * All Rights Reserved.
+    * Contributor(s): Openbravo SLU
+    * Contributions are Copyright (C) 2001-2008 Openbravo, S.L.U.
+    *
+    * Specifically, this derivative work is based upon the following Compiere
+    * file and version.
+    *************************************************************************/
+v_ID VARCHAR2(32);
+v_RO NUMBER;
+v_New_Plan_ID VARCHAR2(32);
+v_Old_Plan_ID VARCHAR2(32);
+    
+BEGIN
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
+    END IF;
+
+  v_New_Plan_ID:=:new.M_ProductionPlan_ID;
+  v_Old_Plan_ID:=:old.M_ProductionPlan_ID;
+  -- Get ID
+  IF(UPDATING OR INSERTING) THEN
+    SELECT mp.M_Production_ID INTO v_ID FROM M_ProductionPlan mp WHERE 
mp.M_ProductionPlan_ID = v_New_Plan_ID;
+  ELSE
+    SELECT mp.M_Production_ID INTO v_ID FROM M_ProductionPlan mp WHERE 
mp.M_ProductionPlan_ID = v_Old_Plan_ID;
+  END IF;
+  -- ReadOnly Check
+  SELECT COUNT(*)
+  INTO v_RO
+  FROM M_Production
+  WHERE M_Production_ID=v_ID
+    AND(Processed='Y'
+    OR Posted='Y') ;
+  IF (v_RO > 0) THEN
+    IF (DELETING OR INSERTING) THEN
+      RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted') ;
+    END IF;
+    IF (UPDATING) THEN
+      IF (:new.AD_CLIENT_ID <> :old.AD_CLIENT_ID
+         OR :new.AD_ORG_ID <> :old.AD_ORG_ID
+         OR :new.M_PRODUCTIONPLAN_ID <> :old.M_PRODUCTIONPLAN_ID
+         OR :new.ISACTIVE <> :old.ISACTIVE
+         OR :new.C_INVOICELINE_ID <> :old.C_INVOICELINE_ID
+         OR :new.C_INVOICELINE_ID IS NULL
+         OR :new.COST <> :old.COST
+        ) THEN
+        RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted') ;
+      END IF;
+    END IF;
+  END IF;
+END MA_PL_INVOICELINE_TRG
+]]></body>
+    </trigger>
+  </database>
diff -r 511757e230d2 -r ef2cfd4b2a7a 
src-db/database/model/triggers/MA_PL_MACHINE_TRG.xml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/triggers/MA_PL_MACHINE_TRG.xml      Fri Apr 09 
14:05:03 2010 +0530
@@ -0,0 +1,69 @@
+<?xml version="1.0"?>
+  <database name="TRIGGER MA_PL_MACHINE_TRG">
+    <trigger name="MA_PL_MACHINE_TRG" table="MA_PL_MACHINE" fires="after" 
insert="true" update="true" delete="true" foreach="row">
+      <body><![CDATA[
+    /*************************************************************************
+    * The contents of this file are subject to the Compiere Public
+    * License 1.1 ("License"); You may not use this file except in
+    * compliance with the License. You may obtain a copy of the License in
+    * the legal folder of your Openbravo installation.
+    * 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  Compiere  ERP &  Business Solution
+    * The Initial Developer of the Original Code is Jorg Janke and ComPiere, 
Inc.
+    * Portions created by Jorg Janke are Copyright (C) 1999-2001 Jorg Janke,
+    * parts created by ComPiere are Copyright (C) ComPiere, Inc.;
+    * All Rights Reserved.
+    * Contributor(s): Openbravo SLU
+    * Contributions are Copyright (C) 2010 Openbravo, S.L.U.
+    *
+    * Specifically, this derivative work is based upon the following Compiere
+    * file and version.
+    *************************************************************************/
+v_ID VARCHAR2(32);
+v_RO NUMBER;
+v_New_Plan_ID VARCHAR2(32);
+v_Old_Plan_ID VARCHAR2(32);
+    
+BEGIN
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
+    END IF;
+
+  v_New_Plan_ID:=:new.M_ProductionPlan_ID;
+  v_Old_Plan_ID:=:old.M_ProductionPlan_ID;
+  -- Get ID
+  IF(UPDATING OR INSERTING) THEN
+    SELECT mp.M_Production_ID INTO v_ID FROM M_ProductionPlan mp WHERE 
mp.M_ProductionPlan_ID = v_New_Plan_ID;
+  ELSE
+    SELECT mp.M_Production_ID INTO v_ID FROM M_ProductionPlan mp WHERE 
mp.M_ProductionPlan_ID = v_Old_Plan_ID;
+  END IF;
+  -- ReadOnly Check
+  SELECT COUNT(*)
+  INTO v_RO
+  FROM M_Production
+  WHERE M_Production_ID=v_ID
+    AND(Processed='Y'
+    OR Posted='Y') ;
+  IF (v_RO > 0) THEN
+    IF (DELETING OR INSERTING) THEN
+      RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted') ;
+    END IF;
+    IF (UPDATING) THEN
+      IF (:new.AD_CLIENT_ID <> :old.AD_CLIENT_ID
+         OR :new.AD_ORG_ID <> :old.AD_ORG_ID
+         OR :new.M_PRODUCTIONPLAN_ID <> :old.M_PRODUCTIONPLAN_ID
+         OR :new.ISACTIVE <> :old.ISACTIVE
+         OR :new.MA_MACHINE_ID <> :old.MA_MACHINE_ID
+         OR :new.USE <> :old.USE
+        ) THEN
+        RAISE_APPLICATION_ERROR(-20501, 'Document processed/posted') ;
+      END IF;
+    END IF;
+  END IF;
+END MA_PL_MACHINE_TRG
+]]></body>
+    </trigger>
+  </database>
diff -r 511757e230d2 -r ef2cfd4b2a7a 
src-db/database/model/triggers/MA_TOOLSETUSED_TRG.xml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/triggers/MA_TOOLSETUSED_TRG.xml     Fri Apr 09 
14:05:03 2010 +0530
@@ -0,0 +1,69 @@
+<?xml version="1.0"?>
+  <database name="TRIGGER MA_TOOLSETUSED_TRG">
+    <trigger name="MA_TOOLSETUSED_TRG" table="MA_TOOLSETUSED" fires="after" 
insert="true" update="true" delete="true" foreach="row">
+      <body><![CDATA[

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to