details: /erp/stable/2.50/rev/3265d46b7a50
changeset: 9096:3265d46b7a50
user: Adrián Romero <adrianromero <at> openbravo.com>
date: Thu Dec 16 18:04:50 2010 +0100
summary: Fixes issue 0015030: Amounts and History panels in Project windows
All improvements and fixes proposed has been included
details: /erp/stable/2.50/rev/893fa01f48ba
changeset: 9097:893fa01f48ba
user: Adrián Romero <adrianromero <at> openbravo.com>
date: Fri Dec 17 09:46:04 2010 +0100
summary: merging
diffstat:
build.xml | 13 +
src-db/database/model/tables/FIN_FINACC_TRANSACTION.xml | 3 +
src-db/database/model/triggers/C_PROJECTLINE_TRG2.xml | 51 -----
src-db/database/model/triggers/C_PROJECTLINE_TRG3.xml | 100
++++++++++
src-db/database/model/triggers/C_PROJECT_TRG2.xml | 65
------
src-db/database/sourcedata/AD_ELEMENT.xml | 20 +-
src-db/database/sourcedata/AD_FIELD.xml | 64
+++---
src-db/database/sourcedata/AD_MESSAGE.xml | 34 +++
src-db/database/sourcedata/AD_MODULE.xml | 2 +-
src-wad/src/org/openbravo/wad/javasource.javaxml | 2 +
src/build.xml | 6 +-
src/org/openbravo/erpCommon/ad_forms/UpdateReferenceData.java | 31 ++-
src/org/openbravo/erpCommon/ad_forms/UpdateReferenceData_data.xsql | 2 +
13 files changed, 220 insertions(+), 173 deletions(-)
diffs (truncated from 740 to 300 lines):
diff -r 8a29e9d7b467 -r 893fa01f48ba build.xml
--- a/build.xml Thu Dec 16 11:07:42 2010 +0100
+++ b/build.xml Fri Dec 17 09:46:04 2010 +0100
@@ -208,6 +208,19 @@
</and>
</condition>
+ <!-- Minimal classpath used for executing Wad at compile time -->
+ <path id="wad.class.path">
+ <fileset dir="${base.lib}">
+ <include name="**/*.jar" />
+ </fileset>
+ <fileset dir="${build.core.lib}">
+ <include name="openbravo-core.jar" />
+ </fileset>
+ <fileset dir="${build.wad.lib}">
+ <include name="openbravo-wad.jar" />
+ </fileset>
+ </path>
+
<path id="project.class.path">
<dirset dir="${base.modules}">
<include name="*/build/classes/" />
diff -r 8a29e9d7b467 -r 893fa01f48ba
src-db/database/model/tables/FIN_FINACC_TRANSACTION.xml
--- a/src-db/database/model/tables/FIN_FINACC_TRANSACTION.xml Thu Dec 16
11:07:42 2010 +0100
+++ b/src-db/database/model/tables/FIN_FINACC_TRANSACTION.xml Fri Dec 17
09:46:04 2010 +0100
@@ -147,5 +147,8 @@
<foreign-key foreignTable="FIN_PAYMENT" name="FIN_PAYMENT_TRANSACTION">
<reference local="FIN_PAYMENT_ID" foreign="FIN_PAYMENT_ID"/>
</foreign-key>
+ <unique name="FIN_FINACC_TRANSACTION_UN">
+ <unique-column name="FIN_PAYMENT_ID"/>
+ </unique>
</table>
</database>
diff -r 8a29e9d7b467 -r 893fa01f48ba
src-db/database/model/triggers/C_PROJECTLINE_TRG2.xml
--- a/src-db/database/model/triggers/C_PROJECTLINE_TRG2.xml Thu Dec 16
11:07:42 2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-<?xml version="1.0"?>
- <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[
-
-BEGIN
-
- IF AD_isTriggerEnabled()='N' THEN RETURN;
- END IF;
-
-
- /*************************************************************************
- * 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.
- *************************************************************************
- * $Id: C_ProjectLine_Trg2.sql,v 1.2 2003/05/26 22:31:15 jjanke Exp $
- ***
- * Title: Trigger recalculation of all projects
- * Description:
- * Where lines were updated in the last minute
- ************************************************************************/
- UPDATE C_Project
- SET Updated=now()
- WHERE EXISTS
- (
- SELECT *
- FROM C_ProjectLine l
- WHERE C_Project.C_Project_ID=l.C_Project_ID
- AND Updated > now() -1/1440
- )
- ;
-END C_PROJECTLINE_TRG2
-]]></body>
- </trigger>
- </database>
diff -r 8a29e9d7b467 -r 893fa01f48ba
src-db/database/model/triggers/C_PROJECTLINE_TRG3.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/triggers/C_PROJECTLINE_TRG3.xml Fri Dec 17
09:46:04 2010 +0100
@@ -0,0 +1,100 @@
+<?xml version="1.0"?>
+ <database name="TRIGGER C_PROJECTLINE_TRG3">
+ <trigger name="C_PROJECTLINE_TRG3" table="C_PROJECTLINE" fires="after"
insert="true" update="true" delete="true" foreach="row">
+ <body><![CDATA[
+
+ v_oldLine_PlannedQty NUMBER:=0;
+ v_newLine_PlannedQty NUMBER:=0;
+ v_oldLine_PlannedAmt NUMBER:=0;
+ v_newLine_PlannedAmt NUMBER:=0;
+ v_oldLine_PlannedMarginAmt NUMBER:=0;
+ v_newLine_PlannedMarginAmt NUMBER:=0;
+ v_oldLine_CommittedAmt NUMBER:=0;
+ v_newLine_CommittedAmt NUMBER:=0;
+ v_oldLine_CommittedQty NUMBER:=0;
+ v_newLine_CommittedQty NUMBER:=0;
+ v_oldLine_InvoicedAmt NUMBER:=0;
+ v_newLine_InvoicedAmt NUMBER:=0;
+ v_oldLine_InvoicedQty NUMBER:=0;
+ v_newLine_InvoicedQty NUMBER:=0;
+ v_oldLine_PlannedPOAmt NUMBER:=0;
+ v_newLine_PlannedPOAmt NUMBER:=0;
+
+BEGIN
+
+ IF AD_isTriggerEnabled()='N' THEN RETURN;
+ END IF;
+
+
+ /*************************************************************************
+ * 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.
+ *************************************************************************
+ * $Id: C_ProjectLine_Trg2.sql,v 1.2 2003/05/26 22:31:15 jjanke Exp $
+ ***
+ * Title: Trigger recalculation of all projects
+ * Description:
+ * Where lines were updated in the last minute
+ ************************************************************************/
+
+ IF(UPDATING OR DELETING) THEN
+ v_oldLine_PlannedQty:= COALESCE(:old.PlannedQty,0);
+ v_oldLine_PlannedAmt:=COALESCE(:old.PlannedAmt,0);
+
v_oldLine_PlannedMarginAmt:=COALESCE((COALESCE(:old.PLANNEDPRICE,0)-COALESCE(:old.PLANNEDPOPRICE,0))*100/COALESCE(:old.PLANNEDPRICE,1),0);
+ v_oldLine_CommittedAmt :=COALESCE(:old.CommittedAmt,0);
+ v_oldLine_CommittedQty :=COALESCE(:old.CommittedQty,0);
+ v_oldLine_InvoicedAmt :=COALESCE(:old.InvoicedAmt,0);
+ v_oldLine_InvoicedQty:=COALESCE(:old.InvoicedQty,0);
+ v_oldLine_PlannedPOAmt:=COALESCE(COALESCE(:old.PlannedPrice, 0)
*:old.PlannedQty,0);
+ END IF;
+ IF (INSERTING OR UPDATING) THEN
+ v_newLine_PlannedQty := COALESCE(:new.PlannedQty,0);
+ v_newLine_PlannedAmt:=COALESCE(:new.PlannedAmt,0);
+
v_newLine_PlannedMarginAmt:=COALESCE((COALESCE(:new.PLANNEDPRICE,0)-COALESCE(:new.PLANNEDPOPRICE,0))*100/COALESCE(:new.PLANNEDPRICE,1),0);
+ v_newLine_CommittedAmt :=COALESCE(:new.CommittedAmt,0);
+ v_newLine_CommittedQty :=COALESCE(:new.CommittedQty,0);
+ v_newLine_InvoicedAmt :=COALESCE(:new.InvoicedAmt,0);
+ v_newLine_InvoicedQty:=COALESCE(:new.InvoicedQty,0);
+ v_newLine_PlannedPOAmt:=COALESCE(COALESCE(:new.PlannedPrice, 0)
*:new.PlannedQty,0);
+ UPDATE C_PROJECT SET
+ PlannedQty = PlannedQty - v_oldLine_PlannedQty + v_newLine_PlannedQty,
+ PlannedAmt=PlannedAmt - v_oldLine_PlannedAmt + v_newLine_PlannedAmt,
+ PlannedMarginAmt=PlannedMarginAmt - v_oldLine_PlannedMarginAmt +
v_newLine_PlannedMarginAmt,
+ CommittedAmt=CommittedAmt - v_oldLine_CommittedAmt +
v_newLine_CommittedAmt,
+ CommittedQty=CommittedQty - v_oldLine_CommittedQty +
v_newLine_CommittedQty,
+ InvoicedAmt=InvoicedAmt - v_oldLine_InvoicedAmt + v_newLine_InvoicedAmt,
+ InvoicedQty=InvoicedQty - v_oldLine_InvoicedQty + v_newLine_InvoicedQty,
+ PlannedPOAmt=PlannedPOAmt - v_oldLine_PlannedPOAmt +
v_newLine_PlannedPOAmt
+ WHERE C_PROJECT_ID = :new.C_PROJECT_ID;
+ ELSE
+ UPDATE C_PROJECT SET
+ PlannedQty = PlannedQty - v_oldLine_PlannedQty + v_newLine_PlannedQty,
+ PlannedAmt=PlannedAmt - v_oldLine_PlannedAmt + v_newLine_PlannedAmt,
+ PlannedMarginAmt=PlannedMarginAmt - v_oldLine_PlannedMarginAmt +
v_newLine_PlannedMarginAmt,
+ CommittedAmt=CommittedAmt - v_oldLine_CommittedAmt +
v_newLine_CommittedAmt,
+ CommittedQty=CommittedQty - v_oldLine_CommittedQty +
v_newLine_CommittedQty,
+ InvoicedAmt=InvoicedAmt - v_oldLine_InvoicedAmt + v_newLine_InvoicedAmt,
+ InvoicedQty=InvoicedQty - v_oldLine_InvoicedQty + v_newLine_InvoicedQty,
+ PlannedPOAmt=PlannedPOAmt - v_oldLine_PlannedPOAmt +
v_newLine_PlannedPOAmt
+ WHERE C_PROJECT_ID = :OLD.C_PROJECT_ID;
+ END IF;
+END C_PROJECTLINE_TRG3
+]]></body>
+ </trigger>
+ </database>
diff -r 8a29e9d7b467 -r 893fa01f48ba
src-db/database/model/triggers/C_PROJECT_TRG2.xml
--- a/src-db/database/model/triggers/C_PROJECT_TRG2.xml Thu Dec 16 11:07:42
2010 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-<?xml version="1.0"?>
- <database name="TRIGGER C_PROJECT_TRG2">
- <trigger name="C_PROJECT_TRG2" table="C_PROJECT" fires="before"
insert="false" update="true" 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) 2001-2008 Openbravo, S.L.U.
- *
- * Specifically, this derivative work is based upon the following Compiere
- * file and version.
- *************************************************************************
- * $Id: C_Project_Trg2.sql,v 1.2 2003/05/26 22:31:15 jjanke Exp $
- ***
- * Title: Recalculate Totals
- * Description:
- ************************************************************************/
- v_Count NUMBER;
-
-BEGIN
-
- IF AD_isTriggerEnabled()='N' THEN RETURN;
- END IF;
-
-
- SELECT COUNT(*)
- INTO v_Count
- FROM C_PROJECTLINE
- WHERE C_Project_ID=:NEW.C_Project_ID;
- IF(v_Count > 0) THEN
- -- Update Summary Info
- SELECT SUM(PlannedAmt),
- SUM(PlannedQty),
((SUM(COALESCE(PLANNEDPRICE,0))-SUM(COALESCE(PLANNEDPOPRICE,0)))*100/SUM(COALESCE(PLANNEDPRICE,1))),
SUM(CommittedAmt),
- SUM(CommittedQty), SUM(InvoicedAmt), SUM(InvoicedQty),
- (SUM(COALESCE(PlannedPrice, 0) *PlannedQty))
- INTO :NEW.PlannedAmt,
- :NEW.PlannedQty, :NEW.PlannedMarginAmt, :NEW.CommittedAmt,
- :NEW.CommittedQty, :NEW.InvoicedAmt, :NEW.InvoicedQty,
- :NEW.PlannedPOAmt
- FROM C_PROJECTLINE
- WHERE C_Project_ID=:NEW.C_Project_ID;
- END IF;
- /*
- SELECT MAX(UPDATED)
- INTO :NEW.LASTPLANNEDPROPOSALDATE
- FROM C_PROJECTPROPOSALTASK T
- WHERE EXISTS (SELECT 1 FROM C_PROJECTPROPOSAL P
- WHERE P.C_PROJECTPROPOSAL_ID=T.C_PROJECTPROPOSAL_ID
- AND P.C_PROJECT_ID=:NEW.C_PROJECT_ID);*/
-END C_PROJECT_TRG2
-]]></body>
- </trigger>
- </database>
diff -r 8a29e9d7b467 -r 893fa01f48ba src-db/database/sourcedata/AD_ELEMENT.xml
--- a/src-db/database/sourcedata/AD_ELEMENT.xml Thu Dec 16 11:07:42 2010 +0100
+++ b/src-db/database/sourcedata/AD_ELEMENT.xml Fri Dec 17 09:46:04 2010 +0100
@@ -19022,8 +19022,8 @@
<!--800694--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
<!--800694--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
<!--800694--> <COLUMNNAME><![CDATA[Expreinvoicing]]></COLUMNNAME>
-<!--800694--> <NAME><![CDATA[Reinvoiced Expenses]]></NAME>
-<!--800694--> <PRINTNAME><![CDATA[Reinvoicing]]></PRINTNAME>
+<!--800694--> <NAME><![CDATA[Planned Reinvoiced Expenses]]></NAME>
+<!--800694--> <PRINTNAME><![CDATA[Planned Reinvoiced Expenses]]></PRINTNAME>
<!--800694--> <HELP><![CDATA[Amount of expenses we plan to invoice back to
the client. Real number will originate from sales invoices for this particular
client and project that include products of type "expense" (such as telephone,
electricity, etc)]]></HELP>
<!--800694--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
<!--800694--></AD_ELEMENT>
@@ -19046,8 +19046,8 @@
<!--800696--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
<!--800696--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
<!--800696--> <COLUMNNAME><![CDATA[Expmargin]]></COLUMNNAME>
-<!--800696--> <NAME><![CDATA[Expenses Margin %]]></NAME>
-<!--800696--> <PRINTNAME><![CDATA[Expected Margin %]]></PRINTNAME>
+<!--800696--> <NAME><![CDATA[Planned Expenses Margin %]]></NAME>
+<!--800696--> <PRINTNAME><![CDATA[Planned Expenses Margin %]]></PRINTNAME>
<!--800696--> <HELP><![CDATA[Expected margin for expenses.]]></HELP>
<!--800696--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
<!--800696--></AD_ELEMENT>
@@ -19058,8 +19058,8 @@
<!--800697--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
<!--800697--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
<!--800697--> <COLUMNNAME><![CDATA[Servcost]]></COLUMNNAME>
-<!--800697--> <NAME><![CDATA[Service Cost]]></NAME>
-<!--800697--> <PRINTNAME><![CDATA[Total Service cost]]></PRINTNAME>
+<!--800697--> <NAME><![CDATA[Planned Service Cost]]></NAME>
+<!--800697--> <PRINTNAME><![CDATA[Planned Service cost]]></PRINTNAME>
<!--800697--> <HELP><![CDATA[Expected total cost of services provided. The
real number will originate from all expense sheets (lines marked as Time Sheet)
related to this project.]]></HELP>
<!--800697--> <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
<!--800697--></AD_ELEMENT>
@@ -19082,8 +19082,8 @@
------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits