[Production-Development] Movement Date in Production Run Window
authorrafaeldemiguel <rdm@openbravo.com>
Thu, 29 Sep 2011 14:05:13 +0200
changeset 14989 ed28c805c700
parent 14988 40d69a126446
child 14990 f2b310e1b65a
[Production-Development] Movement Date in Production Run Window
src-db/database/model/tables/M_PRODUCTIONPLAN.xml
src-db/database/model/triggers/M_PRODUCTIONPLAN_TRG2.xml
src-db/database/model/triggers/M_PRODUCTION_TRG2.xml
src-db/database/sourcedata/AD_COLUMN.xml
src-db/database/sourcedata/AD_FIELD.xml
--- a/src-db/database/model/tables/M_PRODUCTIONPLAN.xml	Wed Sep 28 16:26:13 2011 +0200
+++ b/src-db/database/model/tables/M_PRODUCTIONPLAN.xml	Thu Sep 29 14:05:13 2011 +0200
@@ -133,6 +133,10 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="MOVEMENTDATE" primaryKey="false" required="false" type="TIMESTAMP" size="7" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
       <foreign-key foreignTable="AD_CLIENT" name="M_PRODUCTIONPLAN_AD_CLIENT">
         <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
       </foreign-key>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/triggers/M_PRODUCTIONPLAN_TRG2.xml	Thu Sep 29 14:05:13 2011 +0200
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+  <database name="TRIGGER M_PRODUCTIONPLAN_TRG2">
+    <trigger name="M_PRODUCTIONPLAN_TRG2" table="M_PRODUCTIONPLAN" fires="before" insert="true" update="false" delete="false" 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) 2011 Openbravo, S.L.U.
+  *
+  * Specifically, this derivative work is based upon the following Compiere
+  * file and version.
+  *************************************************************************/
+
+      v_MovementDate timestamp without time zone;
+      
+BEGIN
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
+    END IF;
+
+    IF (INSERTING) THEN
+	    SELECT MOVEMENTDATE
+	    INTO v_MovementDate
+	    FROM M_PRODUCTION
+	    WHERE M_PRODUCTION_ID = :NEW.M_PRODUCTION_ID;
+
+    -- RAISE_APPLICATION_ERROR(-20000, v_MovementDate);
+
+	    :NEW.MOVEMENTDATE := v_MovementDate;
+    END IF;
+
+END M_PRODUCTIONPLAN_TRG2
+]]></body>
+    </trigger>
+  </database>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/triggers/M_PRODUCTION_TRG2.xml	Thu Sep 29 14:05:13 2011 +0200
@@ -0,0 +1,39 @@
+<?xml version="1.0"?>
+  <database name="TRIGGER M_PRODUCTION_TRG2">
+    <trigger name="M_PRODUCTION_TRG2" table="M_PRODUCTION" fires="after" insert="false" update="true" 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) 2011 Openbravo SLU
+    * All Rights Reserved.
+    * Contributor(s):  ______________________________________.
+    ************************************************************************/
+
+v_DateNull DATE := TO_DATE('01-01-1900', 'DD-MM-YYYY');
+    
+BEGIN
+    
+    IF AD_isTriggerEnabled()='N' THEN RETURN;
+    END IF;
+
+    IF (UPDATING) AND(
+     (COALESCE(:old.MOVEMENTDATE, v_DateNull) <> COALESCE(:new.MOVEMENTDATE, v_DateNull))) THEN
+        UPDATE M_PRODUCTIONPLAN
+	SET MOVEMENTDATE = :new.MOVEMENTDATE
+        WHERE M_PRODUCTION_ID = :new.M_PRODUCTION_ID;
+    END IF;
+ 
+END M_PRODUCTION_TRG2
+]]></body>
+    </trigger>
+  </database>
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Wed Sep 28 16:26:13 2011 +0200
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Thu Sep 29 14:05:13 2011 +0200
@@ -259560,6 +259560,39 @@
 <!--AD58859226F648569B51EA63B05DE83D-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
 <!--AD58859226F648569B51EA63B05DE83D--></AD_COLUMN>
 
+<!--AE46D0846378449596CE97242E4A0035--><AD_COLUMN>
+<!--AE46D0846378449596CE97242E4A0035-->  <AD_COLUMN_ID><![CDATA[AE46D0846378449596CE97242E4A0035]]></AD_COLUMN_ID>
+<!--AE46D0846378449596CE97242E4A0035-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AE46D0846378449596CE97242E4A0035-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AE46D0846378449596CE97242E4A0035-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AE46D0846378449596CE97242E4A0035-->  <NAME><![CDATA[Movement Date]]></NAME>
+<!--AE46D0846378449596CE97242E4A0035-->  <DESCRIPTION><![CDATA[The date that a certain item is moved from one location to another.]]></DESCRIPTION>
+<!--AE46D0846378449596CE97242E4A0035-->  <HELP><![CDATA[The Movement Date indicates the date that a product moved in or out of inventory.  This is the result of a shipment, receipt or inventory movement.]]></HELP>
+<!--AE46D0846378449596CE97242E4A0035-->  <COLUMNNAME><![CDATA[Movementdate]]></COLUMNNAME>
+<!--AE46D0846378449596CE97242E4A0035-->  <AD_TABLE_ID><![CDATA[385]]></AD_TABLE_ID>
+<!--AE46D0846378449596CE97242E4A0035-->  <AD_REFERENCE_ID><![CDATA[15]]></AD_REFERENCE_ID>
+<!--AE46D0846378449596CE97242E4A0035-->  <FIELDLENGTH><![CDATA[19]]></FIELDLENGTH>
+<!--AE46D0846378449596CE97242E4A0035-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--AE46D0846378449596CE97242E4A0035-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--AE46D0846378449596CE97242E4A0035-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--AE46D0846378449596CE97242E4A0035-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--AE46D0846378449596CE97242E4A0035-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--AE46D0846378449596CE97242E4A0035-->  <SEQNO><![CDATA[242]]></SEQNO>
+<!--AE46D0846378449596CE97242E4A0035-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--AE46D0846378449596CE97242E4A0035-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--AE46D0846378449596CE97242E4A0035-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--AE46D0846378449596CE97242E4A0035-->  <AD_ELEMENT_ID><![CDATA[1037]]></AD_ELEMENT_ID>
+<!--AE46D0846378449596CE97242E4A0035-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--AE46D0846378449596CE97242E4A0035-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--AE46D0846378449596CE97242E4A0035-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--AE46D0846378449596CE97242E4A0035-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--AE46D0846378449596CE97242E4A0035-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--AE46D0846378449596CE97242E4A0035-->  <POSITION><![CDATA[35]]></POSITION>
+<!--AE46D0846378449596CE97242E4A0035-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--AE46D0846378449596CE97242E4A0035-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--AE46D0846378449596CE97242E4A0035-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--AE46D0846378449596CE97242E4A0035--></AD_COLUMN>
+
 <!--B03312E5CE4446EABE1179DC075FA773--><AD_COLUMN>
 <!--B03312E5CE4446EABE1179DC075FA773-->  <AD_COLUMN_ID><![CDATA[B03312E5CE4446EABE1179DC075FA773]]></AD_COLUMN_ID>
 <!--B03312E5CE4446EABE1179DC075FA773-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_FIELD.xml	Wed Sep 28 16:26:13 2011 +0200
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Thu Sep 29 14:05:13 2011 +0200
@@ -177693,6 +177693,33 @@
 <!--68BFB03020DB4D599CD407BDB8B09AA1-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
 <!--68BFB03020DB4D599CD407BDB8B09AA1--></AD_FIELD>
 
+<!--6950A67F214947E9ADFB7A67F09D3014--><AD_FIELD>
+<!--6950A67F214947E9ADFB7A67F09D3014-->  <AD_FIELD_ID><![CDATA[6950A67F214947E9ADFB7A67F09D3014]]></AD_FIELD_ID>
+<!--6950A67F214947E9ADFB7A67F09D3014-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--6950A67F214947E9ADFB7A67F09D3014-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--6950A67F214947E9ADFB7A67F09D3014-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--6950A67F214947E9ADFB7A67F09D3014-->  <NAME><![CDATA[Movement Date]]></NAME>
+<!--6950A67F214947E9ADFB7A67F09D3014-->  <DESCRIPTION><![CDATA[The date that a certain item is moved from one location to another.]]></DESCRIPTION>
+<!--6950A67F214947E9ADFB7A67F09D3014-->  <HELP><![CDATA[The Movement Date indicates the date that a product moved in or out of inventory.  This is the result of a shipment, receipt or inventory movement.]]></HELP>
+<!--6950A67F214947E9ADFB7A67F09D3014-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--6950A67F214947E9ADFB7A67F09D3014-->  <AD_TAB_ID><![CDATA[C9B5394DBA8C465C9CE26A361696B06E]]></AD_TAB_ID>
+<!--6950A67F214947E9ADFB7A67F09D3014-->  <AD_COLUMN_ID><![CDATA[AE46D0846378449596CE97242E4A0035]]></AD_COLUMN_ID>
+<!--6950A67F214947E9ADFB7A67F09D3014-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--6950A67F214947E9ADFB7A67F09D3014-->  <DISPLAYLENGTH><![CDATA[19]]></DISPLAYLENGTH>
+<!--6950A67F214947E9ADFB7A67F09D3014-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--6950A67F214947E9ADFB7A67F09D3014-->  <SEQNO><![CDATA[7]]></SEQNO>
+<!--6950A67F214947E9ADFB7A67F09D3014-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--6950A67F214947E9ADFB7A67F09D3014-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--6950A67F214947E9ADFB7A67F09D3014-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--6950A67F214947E9ADFB7A67F09D3014-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--6950A67F214947E9ADFB7A67F09D3014-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--6950A67F214947E9ADFB7A67F09D3014-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--6950A67F214947E9ADFB7A67F09D3014-->  <GRID_SEQNO><![CDATA[7]]></GRID_SEQNO>
+<!--6950A67F214947E9ADFB7A67F09D3014-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--6950A67F214947E9ADFB7A67F09D3014-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--6950A67F214947E9ADFB7A67F09D3014-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--6950A67F214947E9ADFB7A67F09D3014--></AD_FIELD>
+
 <!--69E5B4C314D149728ACB78A496645D9E--><AD_FIELD>
 <!--69E5B4C314D149728ACB78A496645D9E-->  <AD_FIELD_ID><![CDATA[69E5B4C314D149728ACB78A496645D9E]]></AD_FIELD_ID>
 <!--69E5B4C314D149728ACB78A496645D9E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -178058,6 +178085,33 @@
 <!--6D7F683367699D7AE040007F01015A4A-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
 <!--6D7F683367699D7AE040007F01015A4A--></AD_FIELD>
 
+<!--6D9E39589F30405986392727D0B34E8E--><AD_FIELD>
+<!--6D9E39589F30405986392727D0B34E8E-->  <AD_FIELD_ID><![CDATA[6D9E39589F30405986392727D0B34E8E]]></AD_FIELD_ID>
+<!--6D9E39589F30405986392727D0B34E8E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--6D9E39589F30405986392727D0B34E8E-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--6D9E39589F30405986392727D0B34E8E-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--6D9E39589F30405986392727D0B34E8E-->  <NAME><![CDATA[Estimated Cost]]></NAME>
+<!--6D9E39589F30405986392727D0B34E8E-->  <DESCRIPTION><![CDATA[A theoretically calculated cost associated with this specific tab.]]></DESCRIPTION>
+<!--6D9E39589F30405986392727D0B34E8E-->  <HELP><![CDATA[Is the calculated cost amount.]]></HELP>
+<!--6D9E39589F30405986392727D0B34E8E-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--6D9E39589F30405986392727D0B34E8E-->  <AD_TAB_ID><![CDATA[C9B5394DBA8C465C9CE26A361696B06E]]></AD_TAB_ID>
+<!--6D9E39589F30405986392727D0B34E8E-->  <AD_COLUMN_ID><![CDATA[58494889CFB714F2E040007F0100577D]]></AD_COLUMN_ID>
+<!--6D9E39589F30405986392727D0B34E8E-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--6D9E39589F30405986392727D0B34E8E-->  <DISPLAYLENGTH><![CDATA[12]]></DISPLAYLENGTH>
+<!--6D9E39589F30405986392727D0B34E8E-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--6D9E39589F30405986392727D0B34E8E-->  <SEQNO><![CDATA[32]]></SEQNO>
+<!--6D9E39589F30405986392727D0B34E8E-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--6D9E39589F30405986392727D0B34E8E-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--6D9E39589F30405986392727D0B34E8E-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--6D9E39589F30405986392727D0B34E8E-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--6D9E39589F30405986392727D0B34E8E-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--6D9E39589F30405986392727D0B34E8E-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--6D9E39589F30405986392727D0B34E8E-->  <GRID_SEQNO><![CDATA[32]]></GRID_SEQNO>
+<!--6D9E39589F30405986392727D0B34E8E-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--6D9E39589F30405986392727D0B34E8E-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--6D9E39589F30405986392727D0B34E8E-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--6D9E39589F30405986392727D0B34E8E--></AD_FIELD>
+
 <!--6DC91D0B52B5FC05E040007F01012E35--><AD_FIELD>
 <!--6DC91D0B52B5FC05E040007F01012E35-->  <AD_FIELD_ID><![CDATA[6DC91D0B52B5FC05E040007F01012E35]]></AD_FIELD_ID>
 <!--6DC91D0B52B5FC05E040007F01012E35-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>