hg merge release-2.0 (merge release2 into development)

This commit is contained in:
Carlos Ruiz 2013-12-11 18:34:56 -05:00
commit 1fd542266e
27 changed files with 33957 additions and 55 deletions

View File

@ -21,7 +21,7 @@ AS
CURSOR CUR_BPLoc IS
SELECT IsRemitTo, C_Location_ID
FROM C_BPartner_Location
WHERE C_BPartner_ID=p_C_BPartner_ID
WHERE C_BPartner_ID=p_C_BPartner_ID AND IsActive='Y'
ORDER BY IsRemitTo DESC;
BEGIN
FOR l IN CUR_BPLoc LOOP
@ -31,4 +31,4 @@ BEGIN
END LOOP;
RETURN v_C_Location_ID;
END bpartnerRemitLocation;
/
/

View File

@ -9,7 +9,7 @@ BEGIN
FOR l IN
SELECT IsRemitTo, C_Location_ID
FROM C_BPartner_Location
WHERE C_BPartner_ID=p_C_BPartner_ID
WHERE C_BPartner_ID=p_C_BPartner_ID AND IsActive='Y'
ORDER BY IsRemitTo DESC
LOOP
IF (v_C_Location_ID IS NULL) THEN

View File

@ -0,0 +1,34 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Nov 27, 2013 4:57:14 PM CET
-- IDEMPIERE-1521
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Element_UU,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,202630,'c7849ef7-da73-46b6-8f8a-448c3ffedccc',0,'DatabaseViewDrop',TO_DATE('2013-11-27 16:57:13','YYYY-MM-DD HH24:MI:SS'),0,'D','Y','Drop view','Drop view',TO_DATE('2013-11-27 16:57:13','YYYY-MM-DD HH24:MI:SS'),0)
;
-- Nov 27, 2013 4:58:14 PM CET
INSERT INTO AD_Process (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Process_UU,AccessLevel,Classname,CopyFromProcess,Created,CreatedBy,EntityType,IsActive,IsBetaFunctionality,IsDirectPrint,IsReport,IsServerProcess,Name,ShowHelp,Statistic_Count,Statistic_Seconds,Updated,UpdatedBy,Value) VALUES (0,0,200066,'8d781c31-93a6-435d-a9c3-eb393d1cf2f3','4','org.compiere.process.DatabaseViewDrop','N',TO_DATE('2013-11-27 16:58:14','YYYY-MM-DD HH24:MI:SS'),0,'D','Y','N','N','N','N','Drop view','Y',0,0,TO_DATE('2013-11-27 16:58:14','YYYY-MM-DD HH24:MI:SS'),0,'AD_ViewComponent Drop')
;
-- Nov 27, 2013 4:58:31 PM CET
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Column_UU,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FKConstraintType,FieldLength,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,210892,'2c8da8e6-1c75-4b7b-8e39-7e28c3399979',202630,0,200066,28,100,'DatabaseViewDrop',TO_DATE('2013-11-27 16:58:30','YYYY-MM-DD HH24:MI:SS'),0,'D','N',1,'Y','Y','Y','N','N','N','N','N','N','N','N','N','N','Y','N','Y','Drop view',0,0,TO_DATE('2013-11-27 16:58:30','YYYY-MM-DD HH24:MI:SS'),0,0)
;
-- Nov 27, 2013 4:58:33 PM CET
ALTER TABLE AD_Table ADD DatabaseViewDrop CHAR(1) DEFAULT NULL
;
-- Nov 27, 2013 4:59:24 PM CET
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Field_UU,AD_Org_ID,AD_Tab_ID,ColumnSpan,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,Updated,UpdatedBy,XPosition) VALUES (0,210892,202541,'e6c3fc02-67cc-4dec-b5c1-c3fe0b7fe717',0,100,2,TO_DATE('2013-11-27 16:59:23','YYYY-MM-DD HH24:MI:SS'),0,1,'D','Y','Y','Y','N','N','N','N','N','Drop view',210,TO_DATE('2013-11-27 16:59:23','YYYY-MM-DD HH24:MI:SS'),0,2)
;
-- Nov 27, 2013 4:59:38 PM CET
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=210, XPosition=5,Updated=TO_DATE('2013-11-27 16:59:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=202541
;
-- Nov 27, 2013 4:59:56 PM CET
UPDATE AD_Field SET DisplayLogic='@IsView@=''Y''',Updated=TO_DATE('2013-11-27 16:59:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=202541
;
SELECT register_migration_script('201311271704_IDEMPIERE-1521.sql') FROM dual
;

View File

@ -0,0 +1,78 @@
SET SQLBLANKLINES ON
SET DEFINE OFF
-- Nov 28, 2013 9:18:15 AM CET
-- IDEMPIERE-1575
UPDATE AD_Column SET FieldLength=255,Updated=TO_DATE('2013-11-28 09:18:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=14862
;
-- Nov 28, 2013 9:18:17 AM CET
ALTER TABLE AD_Issue MODIFY LoggerName NVARCHAR2(255) DEFAULT NULL
;
-- Nov 28, 2013 9:18:33 AM CET
UPDATE AD_Column SET FieldLength=255,Updated=TO_DATE('2013-11-28 09:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=14860
;
-- Nov 28, 2013 9:18:33 AM CET
ALTER TABLE AD_Issue MODIFY SourceClassName NVARCHAR2(255) DEFAULT NULL
;
-- Nov 28, 2013 9:19:32 AM CET
UPDATE AD_Column SET FieldLength=255,Updated=TO_DATE('2013-11-28 09:19:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5664
;
-- Nov 28, 2013 9:19:33 AM CET
ALTER TABLE AD_PInstance_Para MODIFY Info NVARCHAR2(255) DEFAULT NULL
;
-- Nov 28, 2013 9:20:44 AM CET
UPDATE AD_Column SET FieldLength=255,Updated=TO_DATE('2013-11-28 09:20:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=14922
;
-- Nov 28, 2013 9:20:45 AM CET
ALTER TABLE AD_System MODIFY ProfileInfo NVARCHAR2(255) DEFAULT NULL
;
-- Nov 28, 2013 9:21:02 AM CET
UPDATE AD_Column SET FieldLength=120,Updated=TO_DATE('2013-11-28 09:21:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=2902
;
-- Nov 28, 2013 9:21:03 AM CET
ALTER TABLE C_BPartner MODIFY Name NVARCHAR2(120)
;
-- Nov 28, 2013 9:21:17 AM CET
UPDATE AD_Column SET FieldLength=120,Updated=TO_DATE('2013-11-28 09:21:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=1135
;
-- Nov 28, 2013 9:21:18 AM CET
ALTER TABLE C_ElementValue MODIFY Name NVARCHAR2(120)
;
-- Nov 28, 2013 9:21:26 AM CET
UPDATE AD_Column SET FieldLength=120,Updated=TO_DATE('2013-11-28 09:21:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3163
;
-- Nov 28, 2013 9:21:26 AM CET
ALTER TABLE C_ElementValue_Trl MODIFY Name NVARCHAR2(120)
;
-- Nov 28, 2013 9:21:42 AM CET
UPDATE AD_Column SET FieldLength=120,Updated=TO_DATE('2013-11-28 09:21:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5617
;
-- Nov 28, 2013 9:21:43 AM CET
ALTER TABLE C_PaySelection MODIFY Name NVARCHAR2(120)
;
-- Dec 11, 2013 1:49:22 PM CET
UPDATE AD_Column SET FieldLength=255,Updated=TO_DATE('2013-12-11 13:49:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5950
;
-- Dec 11, 2013 1:49:22 PM CET
ALTER TABLE AD_Note MODIFY Reference NVARCHAR2(255) DEFAULT NULL
;
SELECT register_migration_script('201311280926_IDEMPIERE-1575.sql') FROM dual
;

View File

@ -0,0 +1,38 @@
CREATE OR REPLACE FUNCTION bpartnerRemitLocation
(
p_C_BPartner_ID C_BPartner.C_BPartner_ID%TYPE
)
RETURN NUMBER
/*************************************************************************
* The contents of this file are subject to the Compiere License. You may
* obtain a copy of the License at http://www.compiere.org/license.html
* Software is on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
* express or implied. See the License for details. Code: Compiere ERP+CRM
* Copyright (C) 1999-2002 Jorg Janke, ComPiere, Inc. All Rights Reserved.
*************************************************************************
* $Id: C_BPartner_RemitLocation.SQL,v 1.1 2006/04/21 17:51:58 jjanke Exp $
***
* Title: Return the first RemitTo C_Location_ID of a Business Partner
* Description:
*
************************************************************************/
AS
v_C_Location_ID NUMBER := NULL;
CURSOR CUR_BPLoc IS
SELECT IsRemitTo, C_Location_ID
FROM C_BPartner_Location
WHERE C_BPartner_ID=p_C_BPartner_ID AND IsActive='Y'
ORDER BY IsRemitTo DESC;
BEGIN
FOR l IN CUR_BPLoc LOOP
IF (v_C_Location_ID IS NULL) THEN
v_C_Location_ID := l.C_Location_ID;
END IF;
END LOOP;
RETURN v_C_Location_ID;
END bpartnerRemitLocation;
/
SELECT register_migration_script('201312110939_IDEMPIERE-1625.sql') FROM dual
;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,31 @@
-- Nov 27, 2013 4:57:14 PM CET
-- IDEMPIERE-1521
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Element_UU,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,202630,'c7849ef7-da73-46b6-8f8a-448c3ffedccc',0,'DatabaseViewDrop',TO_TIMESTAMP('2013-11-27 16:57:13','YYYY-MM-DD HH24:MI:SS'),0,'D','Y','Drop view','Drop view',TO_TIMESTAMP('2013-11-27 16:57:13','YYYY-MM-DD HH24:MI:SS'),0)
;
-- Nov 27, 2013 4:58:14 PM CET
INSERT INTO AD_Process (AD_Client_ID,AD_Org_ID,AD_Process_ID,AD_Process_UU,AccessLevel,Classname,CopyFromProcess,Created,CreatedBy,EntityType,IsActive,IsBetaFunctionality,IsDirectPrint,IsReport,IsServerProcess,Name,ShowHelp,Statistic_Count,Statistic_Seconds,Updated,UpdatedBy,Value) VALUES (0,0,200066,'8d781c31-93a6-435d-a9c3-eb393d1cf2f3','4','org.compiere.process.DatabaseViewDrop','N',TO_TIMESTAMP('2013-11-27 16:58:14','YYYY-MM-DD HH24:MI:SS'),0,'D','Y','N','N','N','N','Drop view','Y',0,0,TO_TIMESTAMP('2013-11-27 16:58:14','YYYY-MM-DD HH24:MI:SS'),0,'AD_ViewComponent Drop')
;
-- Nov 27, 2013 4:58:31 PM CET
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Column_UU,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FKConstraintType,FieldLength,IsActive,IsAllowCopy,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSecure,IsSelectionColumn,IsSyncDatabase,IsToolbarButton,IsTranslated,IsUpdateable,Name,SeqNo,SeqNoSelection,Updated,UpdatedBy,Version) VALUES (0,210892,'2c8da8e6-1c75-4b7b-8e39-7e28c3399979',202630,0,200066,28,100,'DatabaseViewDrop',TO_TIMESTAMP('2013-11-27 16:58:30','YYYY-MM-DD HH24:MI:SS'),0,'D','N',1,'Y','Y','Y','N','N','N','N','N','N','N','N','N','N','Y','N','Y','Drop view',0,0,TO_TIMESTAMP('2013-11-27 16:58:30','YYYY-MM-DD HH24:MI:SS'),0,0)
;
-- Nov 27, 2013 4:58:33 PM CET
ALTER TABLE AD_Table ADD COLUMN DatabaseViewDrop CHAR(1) DEFAULT NULL
;
-- Nov 27, 2013 4:59:24 PM CET
INSERT INTO AD_Field (AD_Client_ID,AD_Column_ID,AD_Field_ID,AD_Field_UU,AD_Org_ID,AD_Tab_ID,ColumnSpan,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,SeqNo,Updated,UpdatedBy,XPosition) VALUES (0,210892,202541,'e6c3fc02-67cc-4dec-b5c1-c3fe0b7fe717',0,100,2,TO_TIMESTAMP('2013-11-27 16:59:23','YYYY-MM-DD HH24:MI:SS'),0,1,'D','Y','Y','Y','N','N','N','N','N','Drop view',210,TO_TIMESTAMP('2013-11-27 16:59:23','YYYY-MM-DD HH24:MI:SS'),0,2)
;
-- Nov 27, 2013 4:59:38 PM CET
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=210, XPosition=5,Updated=TO_TIMESTAMP('2013-11-27 16:59:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=202541
;
-- Nov 27, 2013 4:59:56 PM CET
UPDATE AD_Field SET DisplayLogic='@IsView@=''Y''',Updated=TO_TIMESTAMP('2013-11-27 16:59:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Field_ID=202541
;
SELECT register_migration_script('201311271704_IDEMPIERE-1521.sql') FROM dual
;

View File

@ -0,0 +1,75 @@
-- Nov 28, 2013 9:18:15 AM CET
-- IDEMPIERE-1575
UPDATE AD_Column SET FieldLength=255,Updated=TO_TIMESTAMP('2013-11-28 09:18:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=14862
;
-- Nov 28, 2013 9:18:17 AM CET
INSERT INTO t_alter_column values('ad_issue','LoggerName','VARCHAR(255)',null,'NULL')
;
-- Nov 28, 2013 9:18:33 AM CET
UPDATE AD_Column SET FieldLength=255,Updated=TO_TIMESTAMP('2013-11-28 09:18:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=14860
;
-- Nov 28, 2013 9:18:33 AM CET
INSERT INTO t_alter_column values('ad_issue','SourceClassName','VARCHAR(255)',null,'NULL')
;
-- Nov 28, 2013 9:19:32 AM CET
UPDATE AD_Column SET FieldLength=255,Updated=TO_TIMESTAMP('2013-11-28 09:19:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5664
;
-- Nov 28, 2013 9:19:33 AM CET
INSERT INTO t_alter_column values('ad_pinstance_para','Info','VARCHAR(255)',null,'NULL')
;
-- Nov 28, 2013 9:20:44 AM CET
UPDATE AD_Column SET FieldLength=255,Updated=TO_TIMESTAMP('2013-11-28 09:20:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=14922
;
-- Nov 28, 2013 9:20:45 AM CET
INSERT INTO t_alter_column values('ad_system','ProfileInfo','VARCHAR(255)',null,'NULL')
;
-- Nov 28, 2013 9:21:02 AM CET
UPDATE AD_Column SET FieldLength=120,Updated=TO_TIMESTAMP('2013-11-28 09:21:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=2902
;
-- Nov 28, 2013 9:21:03 AM CET
INSERT INTO t_alter_column values('c_bpartner','Name','VARCHAR(120)',null,null)
;
-- Nov 28, 2013 9:21:17 AM CET
UPDATE AD_Column SET FieldLength=120,Updated=TO_TIMESTAMP('2013-11-28 09:21:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=1135
;
-- Nov 28, 2013 9:21:18 AM CET
INSERT INTO t_alter_column values('c_elementvalue','Name','VARCHAR(120)',null,null)
;
-- Nov 28, 2013 9:21:26 AM CET
UPDATE AD_Column SET FieldLength=120,Updated=TO_TIMESTAMP('2013-11-28 09:21:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3163
;
-- Nov 28, 2013 9:21:26 AM CET
INSERT INTO t_alter_column values('c_elementvalue_trl','Name','VARCHAR(120)',null,null)
;
-- Nov 28, 2013 9:21:42 AM CET
UPDATE AD_Column SET FieldLength=120,Updated=TO_TIMESTAMP('2013-11-28 09:21:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5617
;
-- Nov 28, 2013 9:21:43 AM CET
INSERT INTO t_alter_column values('c_payselection','Name','VARCHAR(120)',null,null)
;
-- Dec 11, 2013 1:49:22 PM CET
UPDATE AD_Column SET FieldLength=255,Updated=TO_TIMESTAMP('2013-12-11 13:49:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5950
;
-- Dec 11, 2013 1:49:22 PM CET
INSERT INTO t_alter_column values('ad_note','Reference','VARCHAR(255)',null,'NULL')
;
SELECT register_migration_script('201311280926_IDEMPIERE-1575.sql') FROM dual
;

View File

@ -0,0 +1,27 @@
CREATE OR REPLACE FUNCTION bpartnerRemitLocation(p_C_BPartner_ID C_BPartner.C_BPartner_ID%TYPE)
RETURNS numeric AS $body$
DECLARE
v_C_Location_ID NUMERIC := NULL;
l RECORD;
BEGIN
FOR l IN
SELECT IsRemitTo, C_Location_ID
FROM C_BPartner_Location
WHERE C_BPartner_ID=p_C_BPartner_ID AND IsActive='Y'
ORDER BY IsRemitTo DESC
LOOP
IF (v_C_Location_ID IS NULL) THEN
v_C_Location_ID := l.C_Location_ID;
END IF;
END LOOP;
RETURN v_C_Location_ID;
END;
$body$ LANGUAGE plpgsql;
SELECT register_migration_script('201312110939_IDEMPIERE-1625.sql') FROM dual
;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -81,8 +81,9 @@ public class ExpenseTypesFromAccounts extends SvrProcess {
ProcessInfoParameter[] para = getParameter();
for (int i = 0; i < para.length; i++) {
String name = para[i].getParameterName();
if (para[i].getParameter() == null);
else if (name.equals("M_Product_Category_ID")) {
if (para[i].getParameter() == null) {
// nothing
} else if (name.equals("M_Product_Category_ID")) {
m_productCategoryId = para[i].getParameterAsInt();
} else if (name.equals("C_AcctSchema_ID")) {
m_acctSchemaId = para[i].getParameterAsInt();

View File

@ -54,38 +54,54 @@ public class MDashboardContentAccess extends X_PA_DashboardContent_Access {
parameters.add(AD_Client_ID);
StringBuffer sql= new StringBuffer();
// First part : dashboards not configured in access and flagged to be shown in login (this is intended to show new dashboards, otherwise new dashboards won't be shown unless the user go and configure them)
sql.append("SELECT PA_DashboardContent_ID,ColumnNo ")
.append(" FROM PA_DashboardContent ")
.append(" WHERE PA_DashboardContent_ID NOT IN (")
.append(" SELECT PA_DashboardContent_ID ")
.append(" FROM PA_DashboardContent_Access" )
.append(" WHERE IsActive='Y' AND AD_Client_ID IN (0, ?))")
.append(" WHERE AD_Client_ID IN (0, ?))")
.append(" AND IsShowInLogin='Y'")
.append(" AND IsActive='Y' AND AD_Client_ID IN (0, ?)")
.append(" UNION ALL")
// Second part : second part is to process the dashboards configured in content access
.append(" SELECT ct.PA_DashboardContent_ID,ct.ColumnNo")
.append(" FROM PA_DashboardContent ct")
.append(" INNER JOIN PA_DashboardContent_Access cta on (ct.PA_DashboardContent_ID = cta.PA_DashboardContent_ID)")
.append(" WHERE cta.IsActive='Y'")
.append(" AND ct.IsActive='Y'");
if(AD_Role >= 0){
sql.append(" AND coalesce(cta.AD_Role_ID, ?) = ?");
if(AD_Role >= 0) {
sql.append(" AND COALESCE(cta.AD_Role_ID, ?) = ?");
parameters.add(AD_Role);
parameters.add(AD_Role);
}
if (AD_User >= 0){
sql.append(" AND coalesce(cta.AD_User_ID, ?) = ?");
if (AD_User >= 0) {
sql.append(" AND COALESCE(cta.AD_User_ID, ?) = ?");
parameters.add(AD_User);
parameters.add(AD_User);
}
sql.append(" AND cta.AD_Client_ID in (0,?)");
parameters.add(AD_Client_ID);
// New part : remove dashboard if inactive records
sql.append(" AND ct.PA_DashboardContent_ID NOT IN (SELECT PA_DashboardContent_ID FROM PA_DashboardContent_Access WHERE IsActive='N' AND ct.AD_Client_ID in (0,?)");
parameters.add(AD_Client_ID);
if (AD_Role >= 0) {
sql.append(" AND COALESCE(ct.AD_Role_ID, ?) = ?");
parameters.add(AD_Role);
parameters.add(AD_Role);
}
if (AD_User >= 0) {
sql.append(" AND COALESCE(ct.AD_User_ID, ?) = ?");
parameters.add(AD_User);
parameters.add(AD_User);
}
sql.append(")");
sql.append(" ORDER BY ColumnNo");
PreparedStatement pstmt=null;
ResultSet rs = null;

View File

@ -94,6 +94,8 @@ public class MGoal extends X_PA_Goal
DB.close(rs, pstmt);
rs = null; pstmt = null;
}
if (list.size() == 0)
s_log.log (Level.WARNING, Msg.getMsg(ctx, "FindZeroRecords"));
MGoal[] retValue = new MGoal[list.size ()];
list.toArray (retValue);
return retValue;

View File

@ -862,7 +862,7 @@ public class MInvoiceLine extends X_C_InvoiceLine
setPrice();
// IDEMPIERE-1574 Sales Order Line lets Price under the Price Limit when updating
// Check PriceLimit
boolean enforce = m_IsSOTrx && m_parent.getM_PriceList().isEnforcePriceLimit();
boolean enforce = m_IsSOTrx && getParent().getM_PriceList().isEnforcePriceLimit();
if (enforce && MRole.getDefault().isOverwritePriceLimit())
enforce = false;
// Check Price Limit?

View File

@ -109,6 +109,8 @@ public class MMeasure extends X_PA_Measure
String sql = mc.getSqlBarChart(goal.getRestrictions(false),
goal.getMeasureDisplay(), goal.getDateFrom(),
MRole.getDefault()); // logged in role
if (sql.indexOf("@") >= 0)
sql = Env.parseContext(getCtx(), 0, sql, false, false);
PreparedStatement pstmt = null;
ResultSet rs = null;
try

View File

@ -235,6 +235,8 @@ public class MMeasureCalc extends X_PA_MeasureCalc
.append("')=TRUNC(").append(DB.TO_DATE(date)).append(",'").append(trunc).append("')");
}
String finalSQL = addRestrictions(sql.toString(), restrictions, role);
if (finalSQL.indexOf("@") >= 0)
finalSQL = Env.parseContext(getCtx(), 0, finalSQL, false, false);
// Execute
StringBuilder where = new StringBuilder();
PreparedStatement pstmt = null;

View File

@ -872,7 +872,7 @@ public class MOrderLine extends X_C_OrderLine
getProductPricing(m_M_PriceList_ID);
// IDEMPIERE-1574 Sales Order Line lets Price under the Price Limit when updating
// Check PriceLimit
boolean enforce = m_IsSOTrx && m_parent.getM_PriceList().isEnforcePriceLimit();
boolean enforce = m_IsSOTrx && getParent().getM_PriceList().isEnforcePriceLimit();
if (enforce && MRole.getDefault().isOverwritePriceLimit())
enforce = false;
// Check Price Limit?

View File

@ -0,0 +1,43 @@
/******************************************************************************
* Product: iDempiere ERP & CRM Smart Business Solution *
* This program is free software; you can redistribute it and/or modify it *
* under the terms version 2 of the GNU General Public License as published *
* by the Free Software Foundation. This program is distributed in the hope *
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* See the GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License along *
* with this program; if not, write to the Free Software Foundation, Inc., *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
*****************************************************************************/
package org.compiere.process;
import org.adempiere.exceptions.AdempiereException;
import org.compiere.model.MTable;
import org.compiere.util.DB;
import org.compiere.util.Msg;
public class DatabaseViewDrop extends SvrProcess {
private int p_AD_Table_ID = 0;
@Override
protected void prepare()
{
p_AD_Table_ID = getRecord_ID();
}
@Override
protected String doIt() throws Exception
{
MTable table = new MTable(getCtx(), p_AD_Table_ID, get_TrxName());
log.info(table.toString());
if (!table.isView() || !table.isActive())
throw new AdempiereException(Msg.getMsg(getCtx(), "NotActiveDatabaseView"));
String sql = "DROP VIEW " + table.getTableName();
int rvalue = DB.executeUpdateEx(sql, get_TrxName());
return rvalue + " - " + sql;
}
} // DatabaseViewDrop

View File

@ -608,7 +608,7 @@ public final class DisplayType
if (fieldLength == 1)
return "CHAR(" + fieldLength + ")";
else
return "NVARCHAR2(" + fieldLength + ")";
return "VARCHAR2(" + fieldLength + ")";
}
if (displayType == DisplayType.Color) // this condition is never reached - filtered above in isID
{
@ -635,7 +635,7 @@ public final class DisplayType
if (!DisplayType.isText(displayType))
s_log.severe("Unhandled Data Type = " + displayType);
return "NVARCHAR2(" + fieldLength + ")";
return "VARCHAR2(" + fieldLength + ")";
} // getSQLDataType
/**

View File

@ -547,7 +547,7 @@ public final class EMail implements Serializable
try
{
m_from = new InternetAddress (newFrom, true);
if (MSysConfig.getBooleanValue(MSysConfig.MAIL_SEND_BCC_TO_FROM, false, Env.getAD_Client_ID(Env.getCtx())));
if (MSysConfig.getBooleanValue(MSysConfig.MAIL_SEND_BCC_TO_FROM, false, Env.getAD_Client_ID(Env.getCtx())))
addBcc(newFrom);
}
catch (Exception e)

View File

@ -64,6 +64,11 @@ public final class Attachment extends CDialog
*/
private static final long serialVersionUID = 2497487523050526742L;
/**
* Save the last path selected
*/
private static String lastPath = null;
/**
* Constructor.
* loads Attachment, if ID <> 0
@ -424,7 +429,8 @@ public final class Attachment extends CDialog
private void loadFile()
{
log.info("");
JFileChooser chooser = new JFileChooser();
JFileChooser chooser = new JFileChooser(lastPath);
chooser.setDialogType(JFileChooser.OPEN_DIALOG);
chooser.setDialogTitle(Msg.getMsg(Env.getCtx(), "AttachmentNew"));
chooser.setMultiSelectionEnabled(true);
@ -463,6 +469,10 @@ public final class Attachment extends CDialog
}
}
}
// Save path of file
if (files.length>0) {
lastPath = files[0].getParentFile().getAbsolutePath();
}
} // getFileName
/**

View File

@ -282,7 +282,8 @@ public class ProcessParameterPanel extends Panel implements
Row row = new Row();
// The Editor
WEditor editor = WebEditorFactory.getEditor(mField, false);
WEditor editor = WebEditorFactory.getEditor(mField, false);
editor.setProcessParameter(true);
editor.getComponent().addEventListener(Events.ON_FOCUS, this);
editor.getComponent().addEventListener(Events.ON_BLUR, this);
editor.addValueChangeListener(this);
@ -337,6 +338,7 @@ public class ProcessParameterPanel extends Panel implements
m_mFields2.add(mField2);
// The Editor
WEditor editor2 = WebEditorFactory.getEditor(mField2, false);
editor2.setProcessParameter(true);
//override attribute
editor2.getComponent().setWidgetAttribute("columnName", mField2.getColumnName()+"_To");
editor2.getComponent().addEventListener(Events.ON_FOCUS, this);

View File

@ -14,6 +14,7 @@ public class WViewPI extends ADForm {
this.setSclass("window-view-pi");
WPerformanceIndicator.Options options = new WPerformanceIndicator.Options();
WPAPanel paPanel = WPAPanel.get(options);
appendChild(paPanel);
if (paPanel != null)
appendChild(paPanel);
}
}

View File

@ -91,6 +91,8 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
protected WEditorPopupMenu popupMenu;
private boolean tableEditor;
private boolean isProcessParameter;
public WEditor(Component comp, GridField gridField) {
this(comp, gridField, -1);
@ -208,7 +210,8 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
label = new Label("");
label.setValue(strLabel);
label.setTooltiptext(description);
label.setMandatory(mandatory);
this.setMandatory (mandatory);
if (readOnly || !updateable)
@ -546,7 +549,7 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
}
public boolean isMandatoryStyle() {
return mandatory && !readOnly && getGridField().isEditable(true) && isNullOrEmpty();
return mandatory && !readOnly && (isProcessParameter || getGridField().isEditable(true)) && isNullOrEmpty();
}
public boolean isNullOrEmpty() {
@ -632,6 +635,14 @@ public abstract class WEditor implements EventListener<Event>, PropertyChangeLis
}
return false;
}
public boolean isProcessParameter() {
return isProcessParameter;
}
public void setProcessParameter(boolean isProcessParameter) {
this.isProcessParameter = isProcessParameter;
}
private static final String STYLE_ZOOMABLE_LABEL = "cursor: pointer; text-decoration: underline;";
private static final String STYLE_NORMAL_LABEL = "color: #333;";

View File

@ -230,51 +230,57 @@ public class WGadgets extends Window implements EventListener<Event>{
{
Properties ctx = Env.getCtx();
int AD_CLient_ID =Env.getAD_Client_ID(ctx);
int AD_Client_ID =Env.getAD_Client_ID(ctx);
int AD_Role_ID = Env.getAD_Role_ID(ctx);
int AD_User_ID = Env.getAD_User_ID(ctx);
noItems.removeAll(noItems);
yesItems.removeAll(yesItems);
String query = " SELECT ct.PA_DashboardContent_ID, ct.Name "
+" FROM PA_DashboardContent ct"
+" WHERE ct.AD_Client_ID IN (0,?)"
+" AND ct.IsActive='Y'"
+" AND ct.PA_DashboardContent_ID NOT IN ("
+" SELECT pre.PA_DashboardContent_ID"
+" FROM PA_DashboardPreference pre"
+" WHERE pre.AD_Client_ID IN (0,?)"
+" AND pre.AD_Role_ID = ?"
+" AND pre.AD_User_ID = ?"
+" AND pre.AD_Org_ID=0 "
+" AND pre.IsActive='Y') "
+" AND ("
+" ct.PA_DashboardContent_ID NOT IN ( SELECT PA_DashboardContent_ID "
+" FROM PA_DashboardContent_Access"
+" WHERE IsActive='Y' AND AD_Client_ID IN (0, ?))"
+" OR ct.PA_DashboardContent_ID IN ( SELECT cta.PA_DashboardContent_ID "
+" FROM PA_DashboardContent_Access cta "
+" WHERE cta.IsActive='Y'"
+" AND coalesce(cta.AD_Role_ID, ?) = ?"
+" AND coalesce(cta.AD_User_ID, ?) = ?"
+" AND cta.AD_Client_ID in (0,?) ) "
+" )";
String query = ""
+ "SELECT ct.PA_DashboardContent_ID, "
+ " ct.Name "
+ "FROM PA_DashboardContent ct "
+ "WHERE ct.AD_Client_ID IN ( 0, ? ) "
+ " AND ct.IsActive = 'Y' "
+ " AND ct.PA_DashboardContent_ID NOT IN (SELECT pre.PA_DashboardContent_ID "
+ " FROM PA_DashboardPreference pre "
+ " WHERE pre.AD_Client_ID IN ( 0, ? ) "
+ " AND pre.AD_Role_ID = ? "
+ " AND pre.AD_User_ID = ? "
+ " AND pre.AD_Org_ID = 0 "
+ " AND pre.IsActive = 'Y') "
+ " AND ( ct.PA_DashboardContent_ID NOT IN (SELECT cta.PA_DashboardContent_ID "
+ " FROM PA_DashboardContent_Access cta "
+ " WHERE cta.IsActive = 'N' "
+ " AND COALESCE(cta.AD_Role_ID, ?) = ? "
+ " AND COALESCE(cta.AD_User_ID, ?) = ? "
+ " AND cta.AD_Client_ID IN ( 0, ? )) "
+ " OR ct.PA_DashboardContent_ID IN (SELECT cta.PA_DashboardContent_ID "
+ " FROM PA_DashboardContent_Access cta "
+ " WHERE cta.IsActive = 'Y' "
+ " AND COALESCE(cta.AD_Role_ID, ?) = ? "
+ " AND COALESCE(cta.AD_User_ID, ?) = ? "
+ " AND cta.AD_Client_ID IN ( 0, ? )) ) ";
ResultSet rs = null;
PreparedStatement pstmt = null;
try {
pstmt = DB.prepareStatement(query, null);
pstmt.setInt(1, AD_CLient_ID);
pstmt.setInt(2, AD_CLient_ID);
pstmt.setInt(1, AD_Client_ID);
pstmt.setInt(2, AD_Client_ID);
pstmt.setInt(3, AD_Role_ID);
pstmt.setInt(4, AD_User_ID);
pstmt.setInt(5, AD_CLient_ID);
pstmt.setInt(5, AD_Role_ID);
pstmt.setInt(6, AD_Role_ID);
pstmt.setInt(7, AD_Role_ID);
pstmt.setInt(7, AD_User_ID);
pstmt.setInt(8, AD_User_ID);
pstmt.setInt(9, AD_User_ID);
pstmt.setInt(10, AD_CLient_ID);
pstmt.setInt(9, AD_Client_ID);
pstmt.setInt(10, AD_Role_ID);
pstmt.setInt(11, AD_Role_ID);
pstmt.setInt(12, AD_User_ID);
pstmt.setInt(13, AD_User_ID);
pstmt.setInt(14, AD_Client_ID);
rs = pstmt.executeQuery();
while (rs.next()) {
@ -298,7 +304,7 @@ public class WGadgets extends Window implements EventListener<Event>{
+" AND IsActive='Y'";
Query query1 =new Query(ctx,MDashboardPreference.Table_Name, where, null);
query1.setParameters(new Object[]{AD_User_ID,AD_Role_ID ,AD_CLient_ID});
query1.setParameters(new Object[]{AD_User_ID,AD_Role_ID ,AD_Client_ID});
List<MDashboardPreference> preference=query1.list();
if(preference.size() > 0){