FR [2897194] Advanced Zoom and RelationTypes - Thanks to Tobias Schöneberg (tobi42)

Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=2897194
This commit is contained in:
Carlos Ruiz 2010-03-20 12:51:35 +00:00
parent 721654b432
commit 93fbc42293
13 changed files with 2936 additions and 336 deletions

View File

@ -0,0 +1,102 @@
/******************************************************************************
* Product: ADempiere ERP & CRM Smart Business Solution *
* Copyright (C) 2009 www.metas.de *
* 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.adempiere.exceptions;
import org.adempiere.exceptions.AdempiereException;
import org.compiere.model.PO;
import org.compiere.util.CLogger;
import org.compiere.util.Msg;
/**
*
* @author Tobias Schoeneberg, www.metas.de - FR [ 2897194 ] Advanced Zoom and
* RelationTypes
*/
public class PORelationException extends AdempiereException {
private static final CLogger logger = CLogger
.getCLogger(PORelationException.class);
/**
* Message indicates that a po has more or less than one key columns.
* <ul>
* <li>Param 1: the po (toString)</li>
* <li>Param 2: the number of key columns</li>
* </ul>
*/
public static final String MSG_ERR_KEY_COLUMNS_2P = "MRelationType_Err_KeyColumns_2P";
/**
* Message indicates that neither the reference nor the table have an
* AD_Window_ID set.
* <ul>
* <li>Param 1: The AD_Reference's name</li>
* <li>Param 2: The Table name</li>
* <li>Param 3: Whether we are in the ctx of a SO (Y or N)</li>
* </ul>
*/
public static final String MSG_ERR_WINDOW_3P = "MRelationType_Err_Window_3P";
public final String adMsg;
public final Object[] msgParams;
/**
*
*/
private static final long serialVersionUID = -906400765022362887L;
private PORelationException(final String msg, final String adMsg,
final Object... msgParams) {
super(msg);
this.adMsg = adMsg;
this.msgParams = msgParams;
}
public static void throwWrongKeyColumnCount(final PO po) {
logger.fine("Invoked with po " + po);
final Object[] msgParams = new Object[] { po.toString(),
po.get_KeyColumns().length };
final String msg = Msg.getMsg(po.getCtx(), MSG_ERR_KEY_COLUMNS_2P,
msgParams);
final StringBuffer sb = new StringBuffer(msg);
for (final String keyCol : po.get_KeyColumns()) {
sb.append("\n");
sb.append(keyCol);
}
throw new PORelationException(sb.toString(), MSG_ERR_KEY_COLUMNS_2P,
msgParams);
}
public static void throwMissingWindowId(final PO po,
final String referenceName, final String tableName,
final boolean isSOTrx) {
final Object[] msgParams = { referenceName, tableName,
isSOTrx ? "Y" : "N" };
final String msg = Msg
.getMsg(po.getCtx(), MSG_ERR_WINDOW_3P, msgParams);
throw new PORelationException(msg, MSG_ERR_WINDOW_3P, msgParams);
}
}

View File

@ -0,0 +1,152 @@
/******************************************************************************
* Product: ADempiere ERP & CRM Smart Business Solution *
* Copyright (C) 2009 www.metas.de *
* 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.adempiere.model;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import org.adempiere.exceptions.AdempiereException;
import org.compiere.model.MQuery;
import org.compiere.model.MRMA;
import org.compiere.model.PO;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.Env;
/**
* Generic provider of zoom targets. Contains pieces of {@link org.compiere.apps.AZoomAcross}
* methods <code>getZoomTargets</code> and <code>addTarget</code>
*
* @author Tobias Schoeneberg, www.metas.de - FR [ 2897194 ] Advanced Zoom and RelationTypes
*
*/
public class GenericZoomProvider implements IZoomProvider {
private static final CLogger logger = CLogger
.getCLogger(GenericZoomProvider.class);
public List<ZoomInfoFactory.ZoomInfo> retrieveZoomInfos(PO po) {
String sql = "SELECT DISTINCT ws.AD_Window_ID,ws.Name, wp.AD_Window_ID,wp.Name, t.TableName "
+ "FROM AD_Table t ";
boolean baseLanguage = Env.isBaseLanguage(Env.getCtx(), "AD_Window");
if (baseLanguage)
sql += "INNER JOIN AD_Window ws ON (t.AD_Window_ID=ws.AD_Window_ID)"
+ " LEFT OUTER JOIN AD_Window wp ON (t.PO_Window_ID=wp.AD_Window_ID) ";
else
sql += "INNER JOIN AD_Window_Trl ws ON (t.AD_Window_ID=ws.AD_Window_ID AND ws.AD_Language=?)"
+ " LEFT OUTER JOIN AD_Window_Trl wp ON (t.PO_Window_ID=wp.AD_Window_ID AND wp.AD_Language=?) ";
//
sql += "WHERE t.TableName NOT LIKE 'I%'" // No Import
+ " AND EXISTS (SELECT * FROM AD_Tab tt " // First Tab
+ "WHERE (tt.AD_Window_ID=ws.AD_Window_ID OR tt.AD_Window_ID=wp.AD_Window_ID)"
+ " AND tt.AD_Table_ID=t.AD_Table_ID AND tt.SeqNo=10)"
+ " AND t.AD_Table_ID IN "
+ "(SELECT AD_Table_ID FROM AD_Column "
+ "WHERE ColumnName=? AND IsKey='N' AND IsParent='N') " // #x
+ "ORDER BY 2";
final PreparedStatement pstmt = DB.prepareStatement(sql, null);
ResultSet rs = null;
try {
int index = 1;
if (!baseLanguage) {
pstmt.setString(index++, Env.getAD_Language(Env.getCtx()));
pstmt.setString(index++, Env.getAD_Language(Env.getCtx()));
}
pstmt.setString(index++, po.get_TableName() + "_ID");
rs = pstmt.executeQuery();
final List<ZoomInfoFactory.ZoomInfo> result = new ArrayList<ZoomInfoFactory.ZoomInfo>();
while (rs.next()) {
int AD_Window_ID = rs.getInt(1);
String Name = rs.getString(2);
int PO_Window_ID = rs.getInt(3);
String targetTableName = rs.getString(5);
if (PO_Window_ID == 0) {
final MQuery query = evaluateQuery(targetTableName,
AD_Window_ID, Name, null, po);
result.add(new ZoomInfoFactory.ZoomInfo(AD_Window_ID,
query, Name));
} else {
final MQuery query = evaluateQuery(targetTableName,
AD_Window_ID, Name, Boolean.TRUE, po);
result.add(new ZoomInfoFactory.ZoomInfo(AD_Window_ID,
query, Name));
// // PO
}
if (PO_Window_ID != 0) {
Name = rs.getString(4);
final MQuery query = evaluateQuery(targetTableName,
PO_Window_ID, Name, Boolean.FALSE, po);
result.add(new ZoomInfoFactory.ZoomInfo(PO_Window_ID,
query, Name));
}
}
return result;
} catch (SQLException e) {
logger.log(Level.SEVERE, sql, e);
throw new AdempiereException();
} finally {
DB.close(rs, pstmt);
}
}
private static MQuery evaluateQuery(String targetTableName,
int AD_Window_ID, String Name, Boolean isSO, final PO po) {
final MQuery query = new MQuery();
query.addRestriction(po.get_TableName() + "_ID=" + po.get_ID());
query.setZoomTableName(targetTableName);
query.setZoomColumnName(po.get_KeyColumns()[0]);
query.setZoomValue(po.get_ID());
String sql = "SELECT COUNT(*) FROM " + targetTableName + " WHERE "
+ query.getWhereClause(false);
String sqlAdd = "";
if (isSO != null) {
/*
* For RMA, Material Receipt window should be loaded for
* IsSOTrx=true and Shipment for IsSOTrx=false
*/
if (MRMA.Table_Name.equals(po.get_TableName())
&& (AD_Window_ID == 169 || AD_Window_ID == 184)) {
isSO = !isSO;
}
sqlAdd = " AND IsSOTrx=" + (isSO.booleanValue() ? "'Y'" : "'N'");
}
int count = DB.getSQLValue(null, sql + sqlAdd);
if (count < 0 && isSO != null) // error try again w/o SO
count = DB.getSQLValue(null, sql);
query.setRecordCount(count);
return query;
} // checkTarget
}

View File

@ -0,0 +1,36 @@
/******************************************************************************
* Product: ADempiere ERP & CRM Smart Business Solution *
* Copyright (C) 2009 www.metas.de *
* 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.adempiere.model;
import java.util.List;
import org.compiere.model.MQuery;
import org.compiere.model.PO;
/**
*
* @author Tobias Schoeneberg, www.metas.de - FR [ 2897194 ] Advanced Zoom and
* RelationTypes
*/
public interface IZoomProvider {
/**
*
* @param po
* the po we need zoom targets for
* @return a list of zoom targets. The {@link MQuery#getRecordCount()} of
* the ZoomInfo's query member might be zero.
*/
List<ZoomInfoFactory.ZoomInfo> retrieveZoomInfos(PO po);
}

View File

@ -0,0 +1,211 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. *
* 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. *
* For the text or an alternative of this public license, you may reach us *
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
* or via info@compiere.org or http://www.compiere.org/license.html *
*****************************************************************************/
package org.adempiere.model;
import java.math.BigDecimal;
import java.sql.Timestamp;
import org.compiere.model.*;
import org.compiere.util.KeyNamePair;
/** Generated Interface for AD_RelationType
* @author Adempiere (generated)
* @version Release 3.5.4a
*/
public interface I_AD_RelationType
{
/** TableName=AD_RelationType */
public static final String Table_Name = "AD_RelationType";
/** AD_Table_ID=53246 */
public static final int Table_ID = MTable.getTable_ID(Table_Name);
KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);
/** AccessLevel = 7 - System - Client - Org
*/
BigDecimal accessLevel = BigDecimal.valueOf(7);
/** Load Meta Data */
/** Column name AD_Client_ID */
public static final String COLUMNNAME_AD_Client_ID = "AD_Client_ID";
/** Get Client.
* Client/Tenant for this installation.
*/
public int getAD_Client_ID();
/** Column name AD_Org_ID */
public static final String COLUMNNAME_AD_Org_ID = "AD_Org_ID";
/** Set Organization.
* Organizational entity within client
*/
public void setAD_Org_ID (int AD_Org_ID);
/** Get Organization.
* Organizational entity within client
*/
public int getAD_Org_ID();
/** Column name AD_Reference_Source_ID */
public static final String COLUMNNAME_AD_Reference_Source_ID = "AD_Reference_Source_ID";
/** Set Source Reference */
public void setAD_Reference_Source_ID (int AD_Reference_Source_ID);
/** Get Source Reference */
public int getAD_Reference_Source_ID();
public I_AD_Reference getAD_Reference_Source() throws RuntimeException;
/** Column name AD_Reference_Target_ID */
public static final String COLUMNNAME_AD_Reference_Target_ID = "AD_Reference_Target_ID";
/** Set Target Reference */
public void setAD_Reference_Target_ID (int AD_Reference_Target_ID);
/** Get Target Reference */
public int getAD_Reference_Target_ID();
public I_AD_Reference getAD_Reference_Target() throws RuntimeException;
/** Column name AD_RelationType_ID */
public static final String COLUMNNAME_AD_RelationType_ID = "AD_RelationType_ID";
/** Set Relation Type */
public void setAD_RelationType_ID (int AD_RelationType_ID);
/** Get Relation Type */
public int getAD_RelationType_ID();
/** Column name Created */
public static final String COLUMNNAME_Created = "Created";
/** Get Created.
* Date this record was created
*/
public Timestamp getCreated();
/** Column name CreatedBy */
public static final String COLUMNNAME_CreatedBy = "CreatedBy";
/** Get Created By.
* User who created this records
*/
public int getCreatedBy();
/** Column name Description */
public static final String COLUMNNAME_Description = "Description";
/** Set Description.
* Optional short description of the record
*/
public void setDescription (String Description);
/** Get Description.
* Optional short description of the record
*/
public String getDescription();
/** Column name IsActive */
public static final String COLUMNNAME_IsActive = "IsActive";
/** Set Active.
* The record is active in the system
*/
public void setIsActive (boolean IsActive);
/** Get Active.
* The record is active in the system
*/
public boolean isActive();
/** Column name IsDirected */
public static final String COLUMNNAME_IsDirected = "IsDirected";
/** Set Directed.
* Tells whether one "sees" the other end of the relation from each end or just from the source
*/
public void setIsDirected (boolean IsDirected);
/** Get Directed.
* Tells whether one "sees" the other end of the relation from each end or just from the source
*/
public boolean isDirected();
/** Column name Name */
public static final String COLUMNNAME_Name = "Name";
/** Set Name.
* Alphanumeric identifier of the entity
*/
public void setName (String Name);
/** Get Name.
* Alphanumeric identifier of the entity
*/
public String getName();
/** Column name Role_Source */
public static final String COLUMNNAME_Role_Source = "Role_Source";
/** Set Source Role */
public void setRole_Source (String Role_Source);
/** Get Source Role */
public String getRole_Source();
/** Column name Role_Target */
public static final String COLUMNNAME_Role_Target = "Role_Target";
/** Set Target Role */
public void setRole_Target (String Role_Target);
/** Get Target Role */
public String getRole_Target();
/** Column name Type */
public static final String COLUMNNAME_Type = "Type";
/** Set Type.
* Type of Validation (SQL, Java Script, Java Language)
*/
public void setType (String Type);
/** Get Type.
* Type of Validation (SQL, Java Script, Java Language)
*/
public String getType();
/** Column name Updated */
public static final String COLUMNNAME_Updated = "Updated";
/** Get Updated.
* Date this record was updated
*/
public Timestamp getUpdated();
/** Column name UpdatedBy */
public static final String COLUMNNAME_UpdatedBy = "UpdatedBy";
/** Get Updated By.
* User who updated this records
*/
public int getUpdatedBy();
}

View File

@ -0,0 +1,480 @@
/******************************************************************************
* Product: ADempiere ERP & CRM Smart Business Solution *
* Copyright (C) 2009 www.metas.de *
* 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.adempiere.model;
import static org.compiere.model.I_AD_Ref_Table.COLUMNNAME_AD_Reference_ID;
import static org.compiere.model.I_AD_Ref_Table.COLUMNNAME_OrderByClause;
import static org.compiere.model.I_AD_Ref_Table.COLUMNNAME_WhereClause;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Properties;
import java.util.Set;
import org.adempiere.exceptions.AdempiereException;
import org.adempiere.exceptions.PORelationException;
import org.adempiere.model.ZoomInfoFactory.ZoomInfo;
import org.compiere.model.I_AD_Ref_Table;
import org.compiere.model.Lookup;
import org.compiere.model.MColumn;
import org.compiere.model.MQuery;
import org.compiere.model.MRefTable;
import org.compiere.model.MTable;
import org.compiere.model.PO;
import org.compiere.model.Query;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.Util;
/**
* Formal definition for a set of data record pairs
*
* @author Tobias Schoeneberg, www.metas.de - FR [ 2897194 ] Advanced Zoom and
* RelationTypes
*/
public class MRelationType extends X_AD_RelationType implements IZoomProvider {
private static final CLogger logger = CLogger
.getCLogger(MRelationType.class);
/**
* Selection for those relation types whose AD_Reference(s) might match a
* given PO. Only evaluates the table and key column of the reference's
* AD_Ref_Table entries.
* <p>
* <b>Warning:</b> Doesn't support POs with more or less than one key
* column.
*/
final static String SQL = //
" SELECT " //
+ " rt.AD_RelationType_ID AS " + COLUMNNAME_AD_RelationType_ID //
+ ", rt.Name AS " + COLUMNNAME_Name //
+ ", rt.IsDirected AS " + COLUMNNAME_IsDirected //
+ ", ref.AD_Reference_ID AS " + COLUMNNAME_AD_Reference_ID //
+ ", tab.WhereClause AS " + COLUMNNAME_WhereClause //
+ ", tab.OrderByClause AS " + COLUMNNAME_OrderByClause //
+ " FROM" //
+ " AD_RelationType rt, AD_Reference ref, AD_Ref_Table tab" //
+ " WHERE " //
+ " rt.IsActive='Y'" //
+ " AND ref.IsActive='Y'" //
+ " AND ref.ValidationType='T'" // must have table validation
+ " AND (" // join the source AD_Reference
+ " rt.AD_Reference_Source_ID=ref.AD_Reference_ID" //
+ " OR (" // not directed? -> also join the target AD_Reference
+ " rt.IsDirected='N' " //
+ " AND rt.AD_Reference_Target_ID=ref.AD_Reference_ID" //
+ " )" //
+ " )" //
+ " AND tab.IsActive='Y'" // Join the AD_Reference's AD_Ref_Table
+ " AND tab.AD_Reference_ID=ref.AD_Reference_ID" //
+ " AND tab.AD_Table_ID=?" //
+ " AND tab.AD_Key=?" //
+ " ORDER BY rt.Name";
final static String SQL_WINDOW_NAME = "SELECT Name FROM AD_Window WHERE AD_WINDOW_ID=?";
final static String SQL_WINDOW_NAME_TRL = "SELECT Name FROM AD_Window_Trl WHERE AD_WINDOW_ID=?";
/**
*
*/
private static final long serialVersionUID = 5486148151201672913L;
public int destinationRefId;
public MRelationType(Properties ctx, int AD_RelationType_ID, String trxName) {
super(ctx, AD_RelationType_ID, trxName);
}
public MRelationType(Properties ctx, ResultSet rs, String trxName) {
super(ctx, rs, trxName);
}
/**
* Returns the types that define a relation which contains the given PO.
* Explicit types are returned even if they don't actually contain the given
* PO.
*
* @param po
* @return
*/
public static List<MRelationType> retrieveTypes(final PO po,
final int windowId) {
if (po.get_KeyColumns().length != 1) {
logger.severe(po + " has " + po.get_KeyColumns().length
+ " key column(s). Should have one.");
PORelationException.throwWrongKeyColumnCount(po);
}
final String keyColumn = po.get_KeyColumns()[0];
final int colId = MColumn.getColumn_ID(po.get_TableName(), keyColumn);
final PreparedStatement pstmt = DB.prepareStatement(SQL, po
.get_TrxName());
ResultSet rs = null;
try {
pstmt.setInt(1, po.get_Table_ID());
pstmt.setInt(2, colId);
rs = pstmt.executeQuery();
final List<MRelationType> result = evalResultSet(po, windowId, rs);
logger.info("There are " + result.size() + " matching types for "
+ po);
return result;
} catch (SQLException e) {
logger.severe(e.getMessage());
throw new AdempiereException(e);
} finally {
DB.close(rs, pstmt);
}
}
public static List<ZoomInfo> retrieveZoomInfos(final PO po,
final int windowID) {
final List<MRelationType> matchingTypes = MRelationType.retrieveTypes(
po, windowID);
final List<ZoomInfo> result = new ArrayList<ZoomInfo>();
for (final MRelationType currentType : matchingTypes) {
result.addAll(currentType.retrieveZoomInfos(po));
}
return result;
}
private String getDestinationRoleDisplay() {
checkDestinationRefId();
final Integer colIdx;
final String keyValue;
if (destinationRefId == getAD_Reference_Source_ID()) {
colIdx = this.get_ColumnIndex(COLUMNNAME_Role_Source);
keyValue = getRole_Source();
} else {
colIdx = this.get_ColumnIndex(COLUMNNAME_Role_Target);
keyValue = getRole_Target();
}
if (Util.isEmpty(keyValue)) {
return "";
}
final Lookup lookup = this.p_info.getColumnLookup(colIdx);
return lookup.getDisplay(keyValue);
}
private String retrieveWindowName(final int windowId) {
final boolean baseLanguage = Env.isBaseLanguage(Env.getCtx(),
"AD_Window");
final String sql = baseLanguage ? SQL_WINDOW_NAME : SQL_WINDOW_NAME_TRL;
final PreparedStatement pstmt = DB.prepareStatement(sql, null);
ResultSet rs = null;
try {
pstmt.setInt(1, windowId);
rs = pstmt.executeQuery();
if (rs.next()) {
return rs.getString(1);
}
return null;
} catch (SQLException e) {
throw new AdempiereException(e);
} finally {
DB.close(rs, pstmt);
}
}
private static List<MRelationType> evalResultSet(final PO po,
final int windowId, final ResultSet rs) throws SQLException {
final List<MRelationType> result = new ArrayList<MRelationType>();
final Set<Integer> alreadySeen = new HashSet<Integer>();
while (rs.next()) {
final int relTypeId = rs.getInt(COLUMNNAME_AD_RelationType_ID);
if (!alreadySeen.add(relTypeId)) {
continue;
}
final MRelationType newType = new MRelationType(po.getCtx(),
relTypeId, po.get_TrxName());
// figure out which AD_reference is the destination relative to the
// given po and windowID
if (newType.isDirected()) {
// the type is directed, so the target reference is always the
// destination.
newType.destinationRefId = newType.getAD_Reference_Target_ID();
}
else if (newType.retrieveSourceTableName().equals(
newType.retrieveTargetTableName())) {
final MRefTable sourceRefTable = retrieveRefTable(po.getCtx(),
newType.getAD_Reference_Source_ID(), po.get_TrxName());
if (windowId == newType.retrieveWindowID(po, sourceRefTable)) {
newType.destinationRefId = newType
.getAD_Reference_Target_ID();
} else {
newType.destinationRefId = newType
.getAD_Reference_Source_ID();
}
} else {
if (po.get_TableName()
.equals(newType.retrieveSourceTableName())) {
newType.destinationRefId = newType
.getAD_Reference_Target_ID();
} else {
newType.destinationRefId = newType
.getAD_Reference_Source_ID();
}
}
result.add(newType);
}
return result;
}
static boolean whereClauseMatches(PO po, String where) {
if (Util.isEmpty(where, true)) {
logger.fine("whereClause is empty. Returning true");
return true;
}
final String parsedWhere = parseWhereClause(po, where);
if (Util.isEmpty(parsedWhere)) {
return false;
}
final PO result = new Query(po.getCtx(), po.get_TableName(),
parsedWhere, po.get_TrxName()).first();
final boolean match = result != null;
logger.fine("whereClause='" + parsedWhere + "' matches po='" + po
+ "':" + match);
return match;
}
public static String parseWhereClause(final PO po, final String where) {
logger
.fine("building private ctx instance containing the PO's String and int values");
final Properties privateCtx = new Properties();
privateCtx.putAll(po.getCtx());
for (int i = 0; i < po.get_ColumnCount(); i++) {
final Object val = po.get_Value(i);
if (val == null) {
continue;
}
if (val instanceof Integer) {
Env.setContext(privateCtx, "#" + po.get_ColumnName(i),
(Integer) val);
} else if (val instanceof String) {
Env.setContext(privateCtx, "#" + po.get_ColumnName(i),
(String) val);
}
}
final String parsedWhere = Env.parseContext(privateCtx, -1, where,
false);
logger.fine("whereClause='" + where + "'; parsedWhere='" + parsedWhere
+ "'");
return parsedWhere;
}
public void checkDestinationRefId() {
if (destinationRefId == 0) {
throw new IllegalStateException(
"Can't create a destination query when I don't know which one of the two AD_Reference_ID is the destination.");
}
}
/**
*
* @param po
* @return
*/
public List<ZoomInfoFactory.ZoomInfo> retrieveZoomInfos(final PO po) {
checkDestinationRefId();
final MRefTable refTable = retrieveRefTable(getCtx(), destinationRefId,
get_TrxName());
final MQuery query = new MQuery();
query.addRestriction(parseWhereClause(po, refTable.getWhereClause()));
query.setZoomTableName(retrieveDestinationTableName());
query.setZoomColumnName(retrieveDestinationKeyColName());
evaluateQuery(query);
final int windowId = retrieveWindowID(po, refTable);
String display = getDestinationRoleDisplay();
if (Util.isEmpty(display)) {
display = retrieveWindowName(windowId);
}
assert !Util.isEmpty(display);
return Collections.singletonList(new ZoomInfoFactory.ZoomInfo(windowId,
query, display));
}
public int retrieveWindowID(final PO po, final MRefTable refTable) {
MTable table = null;
int windowId = refTable.getAD_Window_ID();
if (windowId == 0) {
final int tableId = refTable.getAD_Table_ID();
table = MTable.get(po.getCtx(), tableId);
if (Env.isSOTrx(po.getCtx())) {
windowId = table.getAD_Window_ID();
} else {
windowId = table.getPO_Window_ID();
}
}
if (windowId == 0) {
PORelationException.throwMissingWindowId(po,
getAD_Reference_Target().getName(), table.getName(), Env
.isSOTrx(po.getCtx()));
}
return windowId;
}
public static MRefTable retrieveRefTable(final Properties ctx,
final int referenceId, final String trxName) {
final Object[] params = { referenceId };
final MRefTable refTable = new Query(ctx, I_AD_Ref_Table.Table_Name,
COLUMNNAME_AD_Reference_ID + "=?", trxName).setParameters(
params).firstOnly();
return refTable;
}
private static void evaluateQuery(final MQuery query) {
final String sqlCommon = " FROM " + query.getZoomTableName()
+ " WHERE " + query.getWhereClause(false);
final String sqlCount = "SELECT COUNT(*) " + sqlCommon;
final int count = DB.getSQLValueEx(null, sqlCount);
query.setRecordCount(count);
if (count > 0) {
final String sqlFirstKey = "SELECT " + query.getZoomColumnName()
+ sqlCommon;
final int firstKey = DB.getSQLValueEx(null, sqlFirstKey);
query.setZoomValue(firstKey);
}
}
private String retrieveSourceTableName() {
return retrieveTableName(getAD_Reference_Source_ID());
}
private String retrieveTargetTableName() {
return retrieveTableName(getAD_Reference_Target_ID());
}
public String retrieveDestinationTableName() {
return retrieveTableName(destinationRefId);
}
private String retrieveTableName(final int refId) {
return retrieveRefTable(getCtx(), refId, get_TrxName()).getAD_Table()
.getTableName();
}
public String retrieveDestinationKeyColName() {
final int keyColumnId = retrieveRefTable(getCtx(), destinationRefId,
get_TrxName()).getAD_Key();
return MColumn.getColumnName(getCtx(), keyColumnId);
}
@Override
public String toString() {
final StringBuffer sb = new StringBuffer("MRelationType[");
//
sb.append(get_ID());
sb.append(", Name=").append(getName());
sb.append(", Type=").append(getType());
sb.append(", AD_Reference_Destination_RefId=").append(destinationRefId);
sb.append(", AD_Reference_Source_ID=").append(
getAD_Reference_Source_ID());
sb.append(", Role_Source=").append(getRole_Source());
sb.append(", AD_Reference_Target_ID=").append(
getAD_Reference_Target_ID());
sb.append(", Role_Target=").append(getRole_Target()); //
sb.append("]");
return sb.toString();
}
}

View File

@ -0,0 +1,282 @@
/******************************************************************************
* Product: Adempiere ERP & CRM Smart Business Solution *
* Copyright (C) 1999-2007 ComPiere, Inc. All Rights Reserved. *
* 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. *
* For the text or an alternative of this public license, you may reach us *
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
* or via info@compiere.org or http://www.compiere.org/license.html *
*****************************************************************************/
/** Generated Model - DO NOT CHANGE */
package org.adempiere.model;
import java.sql.ResultSet;
import java.util.Properties;
import org.compiere.model.*;
import org.compiere.util.KeyNamePair;
/** Generated Model for AD_RelationType
* @author Adempiere (generated)
* @version Release 3.5.4a - $Id$ */
public class X_AD_RelationType extends PO implements I_AD_RelationType, I_Persistent
{
/**
*
*/
private static final long serialVersionUID = 20091113L;
/** Standard Constructor */
public X_AD_RelationType (Properties ctx, int AD_RelationType_ID, String trxName)
{
super (ctx, AD_RelationType_ID, trxName);
/** if (AD_RelationType_ID == 0)
{
setAD_RelationType_ID (0);
setIsDirected (false);
// N
setName (null);
setRole_Source (null);
setRole_Target (null);
setType (null);
// I
} */
}
/** Load Constructor */
public X_AD_RelationType (Properties ctx, ResultSet rs, String trxName)
{
super (ctx, rs, trxName);
}
/** AccessLevel
* @return 7 - System - Client - Org
*/
protected int get_AccessLevel()
{
return accessLevel.intValue();
}
/** Load Meta Data */
protected POInfo initPO (Properties ctx)
{
POInfo poi = POInfo.getPOInfo (ctx, Table_ID, get_TrxName());
return poi;
}
public String toString()
{
StringBuffer sb = new StringBuffer ("X_AD_RelationType[")
.append(get_ID()).append("]");
return sb.toString();
}
public I_AD_Reference getAD_Reference_Source() throws RuntimeException
{
return (I_AD_Reference)MTable.get(getCtx(), I_AD_Reference.Table_Name)
.getPO(getAD_Reference_Source_ID(), get_TrxName()); }
/** Set Source Reference.
@param AD_Reference_Source_ID Source Reference */
public void setAD_Reference_Source_ID (int AD_Reference_Source_ID)
{
if (AD_Reference_Source_ID < 1)
set_Value (COLUMNNAME_AD_Reference_Source_ID, null);
else
set_Value (COLUMNNAME_AD_Reference_Source_ID, Integer.valueOf(AD_Reference_Source_ID));
}
/** Get Source Reference.
@return Source Reference */
public int getAD_Reference_Source_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_Reference_Source_ID);
if (ii == null)
return 0;
return ii.intValue();
}
public I_AD_Reference getAD_Reference_Target() throws RuntimeException
{
return (I_AD_Reference)MTable.get(getCtx(), I_AD_Reference.Table_Name)
.getPO(getAD_Reference_Target_ID(), get_TrxName()); }
/** Set Target Reference.
@param AD_Reference_Target_ID Target Reference */
public void setAD_Reference_Target_ID (int AD_Reference_Target_ID)
{
if (AD_Reference_Target_ID < 1)
set_Value (COLUMNNAME_AD_Reference_Target_ID, null);
else
set_Value (COLUMNNAME_AD_Reference_Target_ID, Integer.valueOf(AD_Reference_Target_ID));
}
/** Get Target Reference.
@return Target Reference */
public int getAD_Reference_Target_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_Reference_Target_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Relation Type.
@param AD_RelationType_ID Relation Type */
public void setAD_RelationType_ID (int AD_RelationType_ID)
{
if (AD_RelationType_ID < 1)
set_ValueNoCheck (COLUMNNAME_AD_RelationType_ID, null);
else
set_ValueNoCheck (COLUMNNAME_AD_RelationType_ID, Integer.valueOf(AD_RelationType_ID));
}
/** Get Relation Type.
@return Relation Type */
public int getAD_RelationType_ID ()
{
Integer ii = (Integer)get_Value(COLUMNNAME_AD_RelationType_ID);
if (ii == null)
return 0;
return ii.intValue();
}
/** Set Description.
@param Description
Optional short description of the record
*/
public void setDescription (String Description)
{
set_Value (COLUMNNAME_Description, Description);
}
/** Get Description.
@return Optional short description of the record
*/
public String getDescription ()
{
return (String)get_Value(COLUMNNAME_Description);
}
/** Set Directed.
@param IsDirected
Tells whether one "sees" the other end of the relation from each end or just from the source
*/
public void setIsDirected (boolean IsDirected)
{
set_Value (COLUMNNAME_IsDirected, Boolean.valueOf(IsDirected));
}
/** Get Directed.
@return Tells whether one "sees" the other end of the relation from each end or just from the source
*/
public boolean isDirected ()
{
Object oo = get_Value(COLUMNNAME_IsDirected);
if (oo != null)
{
if (oo instanceof Boolean)
return ((Boolean)oo).booleanValue();
return "Y".equals(oo);
}
return false;
}
/** Set Name.
@param Name
Alphanumeric identifier of the entity
*/
public void setName (String Name)
{
set_Value (COLUMNNAME_Name, Name);
}
/** Get Name.
@return Alphanumeric identifier of the entity
*/
public String getName ()
{
return (String)get_Value(COLUMNNAME_Name);
}
/** Get Record ID/ColumnName
@return ID/ColumnName pair
*/
public KeyNamePair getKeyNamePair()
{
return new KeyNamePair(get_ID(), getName());
}
/** Role_Source AD_Reference_ID=53331 */
public static final int ROLE_SOURCE_AD_Reference_ID=53331;
/** Order = Order */
public static final String ROLE_SOURCE_Order = "Order";
/** Invoice = Invoice */
public static final String ROLE_SOURCE_Invoice = "Invoice";
/** Set Source Role.
@param Role_Source Source Role */
public void setRole_Source (String Role_Source)
{
set_Value (COLUMNNAME_Role_Source, Role_Source);
}
/** Get Source Role.
@return Source Role */
public String getRole_Source ()
{
return (String)get_Value(COLUMNNAME_Role_Source);
}
/** Role_Target AD_Reference_ID=53331 */
public static final int ROLE_TARGET_AD_Reference_ID=53331;
/** Order = Order */
public static final String ROLE_TARGET_Order = "Order";
/** Invoice = Invoice */
public static final String ROLE_TARGET_Invoice = "Invoice";
/** Set Target Role.
@param Role_Target Target Role */
public void setRole_Target (String Role_Target)
{
set_Value (COLUMNNAME_Role_Target, Role_Target);
}
/** Get Target Role.
@return Target Role */
public String getRole_Target ()
{
return (String)get_Value(COLUMNNAME_Role_Target);
}
/** Type AD_Reference_ID=53332 */
public static final int TYPE_AD_Reference_ID=53332;
/** Implicit = I */
public static final String TYPE_Implicit = "I";
/** Explicit = E */
public static final String TYPE_Explicit = "E";
/** Set Type.
@param Type
Type of Validation (SQL, Java Script, Java Language)
*/
public void setType (String Type)
{
set_Value (COLUMNNAME_Type, Type);
}
/** Get Type.
@return Type of Validation (SQL, Java Script, Java Language)
*/
public String getType ()
{
return (String)get_Value(COLUMNNAME_Type);
}
}

View File

@ -0,0 +1,123 @@
/******************************************************************************
* Product: ADempiere ERP & CRM Smart Business Solution *
* Copyright (C) 2009 www.metas.de *
* 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.adempiere.model;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.compiere.model.MQuery;
import org.compiere.model.PO;
import org.compiere.util.CLogger;
/**
*
* @author Tobias Schoeneberg, www.metas.de - FR [ 2897194 ] Advanced Zoom and
* RelationTypes
*/
public class ZoomInfoFactory {
/**
* Simple class that contains zoom information. Currently used by
* {@link org.compiere.apps.AZoomAcross}.
*
* @author ts
*
*/
public static final class ZoomInfo {
public final String destinationDisplay;
public final MQuery query;
public final int windowId;
public ZoomInfo(int windowId, MQuery query, String destinationDisplay) {
this.windowId = windowId;
this.query = query;
this.destinationDisplay = destinationDisplay;
}
@Override
public String toString() {
final StringBuffer sb = new StringBuffer();
sb.append("ZoomInfo[");
sb.append("Display=");
sb.append(destinationDisplay);
sb.append(", AD_Window_ID=").append(windowId);
sb.append(", RecordCount=").append(
query == null ? "<no query>" : query.getRecordCount());
sb.append("]");
return sb.toString();
}
}
private static final CLogger logger = CLogger
.getCLogger(ZoomInfoFactory.class);
/**
* Adds {@link ZoomInfo} instances from {@link MRelationType}s and
* {@link GenericZoomProvider}.
*
* First it looks for matching {@link MRelationType} instances and adds
* their {@link MRelationType#retrieveZoomInfos(PO)} results. Then it adds
* the {@link GenericZoomProvider}'s results unless there is already one
* from a MRelationType that has an quals
* {@link ZoomInfo#destinationDisplay} value.
*
* @param po
* @param windowID
* @return
*/
public static List<ZoomInfoFactory.ZoomInfo> retrieveZoomInfos(final PO po,
final int windowID) {
logger.config("PO=" + po + " - AD_Window_ID=" + windowID);
final List<ZoomInfoFactory.ZoomInfo> result = new ArrayList<ZoomInfoFactory.ZoomInfo>();
final Set<String> alreadySeen = new HashSet<String>();
for (final ZoomInfo zoomInfo : MRelationType.retrieveZoomInfos(po,
windowID)) {
logger.fine("Adding zoomInfo " + zoomInfo);
alreadySeen.add(zoomInfo.destinationDisplay);
result.add(zoomInfo);
}
final GenericZoomProvider genericZoomProvider = new GenericZoomProvider();
for (final ZoomInfo zoomInfo : genericZoomProvider
.retrieveZoomInfos(po)) {
if (alreadySeen.add(zoomInfo.destinationDisplay)) {
logger.fine("Adding zoomInfo " + zoomInfo + " from "
+ GenericZoomProvider.class.getSimpleName());
result.add(zoomInfo);
} else {
logger.fine("Skipping zoomInfo " + zoomInfo + " from "
+ GenericZoomProvider.class.getSimpleName()
+ " because there is already one for destination '"
+ zoomInfo.destinationDisplay + "'");
}
}
return result;
}
}

View File

@ -2155,8 +2155,8 @@ public final class APanel extends CPanel
query.addRestriction(link, MQuery.EQUAL,
Env.getContext(m_ctx, m_curWindowNo, link));
}
new AZoomAcross (aZoomAcross.getButton(),
m_curTab.getTableName(), query);
new AZoomAcross(aZoomAcross.getButton(), m_curTab.getTableName(),
m_curTab.getAD_Window_ID(), query);
} // cmd_zoom
/**

View File

@ -16,25 +16,21 @@
*****************************************************************************/
package org.compiere.apps;
import java.awt.Cursor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.List;
import javax.swing.JComponent;
import javax.swing.JPopupMenu;
import org.adempiere.model.ZoomInfoFactory;
import org.compiere.model.MQuery;
import org.compiere.model.MRMA;
import org.compiere.model.PO;
import org.compiere.model.Query;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.Env;
import org.compiere.util.Ini;
import org.compiere.util.KeyNamePair;
import org.compiere.util.Msg;
/**
@ -45,194 +41,85 @@ import org.compiere.util.Msg;
* @version $Id: AZoomAcross.java,v 1.2 2006/07/30 00:51:27 jjanke Exp $
*
* @author Teo Sarca, SC ARHIPAC SERVICE SRL - FR [ 1762465 ]
* @author afalcone - Bug Fix [ 1659420 ] Usability: zoom across
* @author Tobias Schoeneberg, www.metas.de - FR [ 2897194 ] Advanced Zoom and RelationTypes
*/
public class AZoomAcross implements ActionListener
public class AZoomAcross
{
/**
* Constructor
* @param invoker component to display popup (optional)
* @param tableName table name
* @param query query
* @param tableName zoom source table (i.e. the table we start from)
* @param query query that specifies the zoom source PO (i.e. the PO we start from)
*/
public AZoomAcross (JComponent invoker, String tableName, MQuery query)
public AZoomAcross (JComponent invoker, String tableName, final int windowID, MQuery query)
{
log.config("TableName=" + tableName + " - " + query);
m_tableName = tableName;
m_query = query;
this(invoker, new Query(Env.getCtx(), tableName,
query.getWhereClause(), null).first(), windowID);
}
// See What is there
getZoomTargets (invoker, tableName);
} // AReport
public AZoomAcross(JComponent invoker, PO po, final int windowID) {
/** The Query */
private MQuery m_query;
/** The Popup */
private JPopupMenu m_popup = new JPopupMenu("ZoomMenu");
/** The Option List */
private ArrayList<KeyNamePair> m_list = new ArrayList<KeyNamePair>();
/** Logger */
private static CLogger log = CLogger.getCLogger(AZoomAcross.class);
/** Table Name */
private String m_tableName;
logger.config("PO=" + po+", WindowID="+windowID);
/**
* Get the Zomm Targets for the table.
* Fill the list and the popup menu
* @param invoker component to display popup (optional)
* @param tableName table
*/
private void getZoomTargets (JComponent invoker, String tableName)
{
String sql = "SELECT DISTINCT ws.AD_Window_ID,ws.Name, wp.AD_Window_ID,wp.Name, t.TableName "
+ "FROM AD_Table t ";
boolean baseLanguage = Env.isBaseLanguage(Env.getCtx(), "AD_Window");
if (baseLanguage)
sql += "INNER JOIN AD_Window ws ON (t.AD_Window_ID=ws.AD_Window_ID)"
+ " LEFT OUTER JOIN AD_Window wp ON (t.PO_Window_ID=wp.AD_Window_ID) ";
else
sql += "INNER JOIN AD_Window_Trl ws ON (t.AD_Window_ID=ws.AD_Window_ID AND ws.AD_Language=?)"
+ " LEFT OUTER JOIN AD_Window_Trl wp ON (t.PO_Window_ID=wp.AD_Window_ID AND wp.AD_Language=?) ";
//
sql += "WHERE t.TableName NOT LIKE 'I%'" // No Import
+ " AND EXISTS (SELECT * FROM AD_Tab tt " // First Tab
+ "WHERE (tt.AD_Window_ID=ws.AD_Window_ID OR tt.AD_Window_ID=wp.AD_Window_ID)"
+ " AND tt.AD_Table_ID=t.AD_Table_ID AND tt.SeqNo=10)"
+ " AND t.AD_Table_ID IN "
+ "(SELECT AD_Table_ID FROM AD_Column "
+ "WHERE ColumnName=? AND IsKey='N' AND IsParent='N') " // #x
+ "ORDER BY 2";
try
{
PreparedStatement pstmt = DB.prepareStatement(sql, null);
int index = 1;
if (!baseLanguage)
{
pstmt.setString (index++, Env.getAD_Language(Env.getCtx()));
pstmt.setString (index++, Env.getAD_Language(Env.getCtx()));
}
pstmt.setString (index++, tableName + "_ID");
ResultSet rs = pstmt.executeQuery();
while (rs.next())
{
int AD_Window_ID = rs.getInt(1);
String Name = rs.getString(2);
int PO_Window_ID = rs.getInt(3);
String targetTableName = rs.getString(5);
if (PO_Window_ID == 0)
addTarget(targetTableName, AD_Window_ID, Name, null);
else
addTarget(targetTableName, AD_Window_ID, Name, Boolean.TRUE);
// PO
if (PO_Window_ID != 0)
{
Name = rs.getString(4);
addTarget(targetTableName, PO_Window_ID, Name, Boolean.FALSE);
mkZoomTargets(po, windowID);
for (final ZoomInfoFactory.ZoomInfo zoomInfo : zoomInfos) {
final String label = zoomInfo.destinationDisplay + " (#"
+ zoomInfo.query.getRecordCount() + ")";
m_popup.add(label).addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
launchZoom(zoomInfo);
}
}
rs.close();
pstmt.close();
}
catch (SQLException e)
{
log.log(Level.SEVERE, sql, e);
});
}
// Begin - afalcone - Bug Fix [ 1659420 ] Usability: zoom across
/*
// No Zoom
if (m_list.size() == 0)
{
ADialog.info(0, invoker, "NoZoomTarget");
log.info("BaseLanguage=" + baseLanguage);
if (zoomInfos.isEmpty()) {
m_popup.add(Msg.getMsg(Env.getCtx(), "NoZoomTarget")); // Added
}
else if (invoker.isShowing())
m_popup.show(invoker, 0, invoker.getHeight()); // below button
*/
// No Zoom
if (m_list.size() == 0)
{
m_popup.add(Msg.getMsg(Env.getCtx(), "NoZoomTarget")); // Added
log.info("BaseLanguage=" + baseLanguage);
}
if (invoker.isShowing())
if (invoker.isShowing()) {
m_popup.show(invoker, 0, invoker.getHeight());
//End - afalcone - Bug Fix [ 1659420 ] Usability: zoom across
} // getZoomTargets
/**
* Check Target and Add to popup
* @param targetTableName table name
* @param AD_Window_ID window
* @param Name name
* @param isSO has po/so Window
* @return true if there is a record
*/
private boolean addTarget (String targetTableName,
int AD_Window_ID, String Name, Boolean isSO)
{
String sql = "SELECT COUNT(*) FROM " + targetTableName
+ " WHERE " + m_query.getWhereClause(false);
String sqlAdd = "";
if (isSO != null)
{
/*
For RMA, Material Receipt window should be loaded for IsSOTrx=true
and Shipment for IsSOTrx=false
*/
if (MRMA.Table_Name.equals(m_tableName) && (AD_Window_ID == 169
|| AD_Window_ID == 184))
{
isSO = !isSO;
}
sqlAdd = " AND IsSOTrx=" + (isSO.booleanValue() ? "'Y'" : "'N'");
}
int count = DB.getSQLValue(null, sql+sqlAdd);
if (count < 0 && isSO != null) // error try again w/o SO
count = DB.getSQLValue(null, sql);
if (count <= 0)
return false;
//
KeyNamePair pp = new KeyNamePair (AD_Window_ID, Name + " (#"+count+")");
m_list.add(pp);
m_popup.add(pp.toString()).addActionListener(this);
m_query.setRecordCount(count);
return true;
} // checkTarget
}
/**
* Action Listener
* @param e event
*/
public void actionPerformed(ActionEvent e)
{
m_popup.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
String cmd = e.getActionCommand();
for (int i = 0; i < m_list.size(); i++)
{
KeyNamePair pp = (KeyNamePair)m_list.get(i);
if (cmd.equals(pp.getName()))
{
launchZoom (pp);
return;
private final JPopupMenu m_popup = new JPopupMenu("ZoomMenu");
private static final CLogger logger = CLogger.getCLogger(AZoomAcross.class);
private final List<ZoomInfoFactory.ZoomInfo> zoomInfos = new ArrayList<ZoomInfoFactory.ZoomInfo>();
private void mkZoomTargets(final PO po, final int windowID) {
for (final ZoomInfoFactory.ZoomInfo zoomInfo : ZoomInfoFactory.retrieveZoomInfos(po,
windowID)) {
if (zoomInfo.query.getRecordCount() == 0) {
logger.fine("No target records for destination "
+ zoomInfo.destinationDisplay);
continue;
}
zoomInfos.add(zoomInfo);
}
} // actionPerformed
}
/**
* Launch Zoom
* @param pp KeyPair
*/
private void launchZoom (KeyNamePair pp)
private void launchZoom (final ZoomInfoFactory.ZoomInfo zoomInfo)
{
int AD_Window_ID = pp.getKey();
log.info("AD_Window_ID=" + AD_Window_ID
+ " - " + m_query);
final int AD_Window_ID = zoomInfo.windowId;
final MQuery query = zoomInfo.query;
logger.info("AD_Window_ID=" + AD_Window_ID
+ " - " + query);
AWindow frame = new AWindow();
if (!frame.initWindow(AD_Window_ID, m_query))
if (!frame.initWindow(AD_Window_ID, query))
return;
AEnv.addToWindowManager(frame);
if (Ini.isPropertyBool(Ini.P_OPEN_WINDOW_MAXIMIZED) )

View File

@ -0,0 +1,719 @@
-- 13.11.2009 14:59:58 MEZ
-- FR 2897194 Advanced Zoom and RelationTypes
INSERT INTO AD_Table (AD_Org_ID,AD_Client_ID,AD_Table_ID,CopyColumnsFromTable,Created,CreatedBy,Description,EntityType,ImportTable,IsActive,IsChangeLog,IsDeleteable,IsHighVolume,IsSecurityEnabled,IsView,LoadSeq,Name,ReplicationType,TableName,Updated,AccessLevel,UpdatedBy) VALUES (0,0,53246,'N',TO_DATE('2009-11-13 14:59:55','YYYY-MM-DD HH24:MI:SS'),100,'Defines the sets of record pairs (and the conditions a given pair must fulfill to be part of one)','D','N','Y','N','Y','N','N','N',0,'Relation Type','L','AD_RelationType',TO_DATE('2009-11-13 14:59:55','YYYY-MM-DD HH24:MI:SS'),'7',100)
;
-- 13.11.2009 14:59:58 MEZ
INSERT INTO AD_Table_Trl (AD_Language,AD_Table_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Table_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Table t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Table_ID=53246 AND NOT EXISTS (SELECT * FROM AD_Table_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Table_ID=t.AD_Table_ID)
;
-- 13.11.2009 14:59:58 MEZ
INSERT INTO AD_Sequence (AD_Org_ID,AD_Sequence_ID,Created,CreatedBy,CurrentNext,CurrentNextSys,Description,IncrementNo,IsActive,IsAudited,IsAutoSequence,IsTableID,Name,StartNewYear,StartNo,Updated,UpdatedBy,AD_Client_ID) VALUES (0,53355,TO_DATE('2009-11-13 14:59:58','YYYY-MM-DD HH24:MI:SS'),100,1000000,50000,'Table AD_RelationType',1,'Y','N','Y','Y','AD_RelationType','N',1000000,TO_DATE('2009-11-13 14:59:58','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 13.11.2009 15:00:17 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,102,19,53246,129,'AD_Client_ID',TO_DATE('2009-11-13 15:00:16','YYYY-MM-DD HH24:MI:SS'),100,'@#AD_Client_ID@','Client/Tenant for this installation.','D',22,'A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.','Y','N','N','N','N','Y','N','N','N','N','N','Client',0,TO_DATE('2009-11-13 15:00:16','YYYY-MM-DD HH24:MI:SS'),100,1,0,58571)
;
-- 13.11.2009 15:00:17 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58571 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:00:18 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,113,19,53246,104,'AD_Org_ID',TO_DATE('2009-11-13 15:00:17','YYYY-MM-DD HH24:MI:SS'),100,'@#AD_Org_ID@','Organizational entity within client','D',22,'An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','Y','N','N','N','N','Y','N','N','N','N','N','Organization',0,TO_DATE('2009-11-13 15:00:17','YYYY-MM-DD HH24:MI:SS'),100,1,0,58572)
;
-- 13.11.2009 15:00:18 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58572 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:00:19 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,193,19,53246,'C_Currency_ID',TO_DATE('2009-11-13 15:00:18','YYYY-MM-DD HH24:MI:SS'),100,'The Currency for this record','D',22,'Indicates the Currency to be used when processing or reporting on this record','Y','N','N','N','N','Y','N','N','N','N','Y','Currency',0,TO_DATE('2009-11-13 15:00:18','YYYY-MM-DD HH24:MI:SS'),100,1,0,58573)
;
-- 13.11.2009 15:00:19 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58573 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:00:20 MEZ
INSERT INTO AD_Element (AD_Org_ID,AD_Element_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,AD_Client_ID,UpdatedBy) VALUES (0,54070,'AD_RelationType_ID',TO_DATE('2009-11-13 15:00:19','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Relation Type','Relation Type',TO_DATE('2009-11-13 15:00:19','YYYY-MM-DD HH24:MI:SS'),0,100)
;
-- 13.11.2009 15:00:20 MEZ
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=54070 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 13.11.2009 15:00:22 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,54070,13,53246,'AD_RelationType_ID',TO_DATE('2009-11-13 15:00:19','YYYY-MM-DD HH24:MI:SS'),100,'D',22,'Y','N','N','N','Y','Y','N','N','N','N','N','Relation Type',0,TO_DATE('2009-11-13 15:00:19','YYYY-MM-DD HH24:MI:SS'),100,1,0,58574)
;
-- 13.11.2009 15:00:22 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58574 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:00:23 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,245,16,53246,'Created',TO_DATE('2009-11-13 15:00:22','YYYY-MM-DD HH24:MI:SS'),100,'Date this record was created','D',7,'The Created field indicates the date that this record was created.','Y','N','N','N','N','Y','N','N','N','N','N','Created',0,TO_DATE('2009-11-13 15:00:22','YYYY-MM-DD HH24:MI:SS'),100,1,0,58575)
;
-- 13.11.2009 15:00:23 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58575 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:00:24 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Reference_Value_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,110,246,18,53246,'CreatedBy',TO_DATE('2009-11-13 15:00:23','YYYY-MM-DD HH24:MI:SS'),100,'User who created this records','D',22,'The Created By field indicates the user who created this record.','Y','N','N','N','N','Y','N','N','N','N','N','Created By',0,TO_DATE('2009-11-13 15:00:23','YYYY-MM-DD HH24:MI:SS'),100,1,0,58576)
;
-- 13.11.2009 15:00:24 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58576 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:00:25 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,275,10,53246,'Description',TO_DATE('2009-11-13 15:00:24','YYYY-MM-DD HH24:MI:SS'),100,'Optional short description of the record','D',255,'A description is limited to 255 characters.','Y','N','N','N','N','N','N','N','N','N','Y','Description',0,TO_DATE('2009-11-13 15:00:24','YYYY-MM-DD HH24:MI:SS'),100,1,0,58577)
;
-- 13.11.2009 15:00:25 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58577 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:00:26 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,348,20,53246,'IsActive',TO_DATE('2009-11-13 15:00:25','YYYY-MM-DD HH24:MI:SS'),100,'Y','The record is active in the system','D',1,'There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports.
There are two reasons for de-activating and not deleting records:
(1) The system requires the record for audit purposes.
(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.','Y','N','N','N','N','Y','N','N','N','N','Y','Active',0,TO_DATE('2009-11-13 15:00:25','YYYY-MM-DD HH24:MI:SS'),100,1,0,58578)
;
-- 13.11.2009 15:00:26 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58578 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:00:27 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,469,10,53246,'Name',TO_DATE('2009-11-13 15:00:26','YYYY-MM-DD HH24:MI:SS'),100,'Alphanumeric identifier of the entity','D',60,'The name of an entity (record) is used as an default search option in addition to the search key. The name is up to 60 characters in length.','Y','N','N','Y','N','Y','N','N','N','N','Y','Name',1,TO_DATE('2009-11-13 15:00:26','YYYY-MM-DD HH24:MI:SS'),100,1,0,58579)
;
-- 13.11.2009 15:00:27 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58579 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:00:28 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,607,16,53246,'Updated',TO_DATE('2009-11-13 15:00:27','YYYY-MM-DD HH24:MI:SS'),100,'Date this record was updated','D',7,'The Updated field indicates the date that this record was updated.','Y','N','N','N','N','Y','N','N','N','N','N','Updated',0,TO_DATE('2009-11-13 15:00:27','YYYY-MM-DD HH24:MI:SS'),100,1,0,58580)
;
-- 13.11.2009 15:00:28 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58580 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:00:29 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Reference_Value_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,110,608,18,53246,'UpdatedBy',TO_DATE('2009-11-13 15:00:28','YYYY-MM-DD HH24:MI:SS'),100,'User who updated this records','D',22,'The Updated By field indicates the user who updated this record.','Y','N','N','N','N','Y','N','N','N','N','N','Updated By',0,TO_DATE('2009-11-13 15:00:28','YYYY-MM-DD HH24:MI:SS'),100,1,0,58581)
;
-- 13.11.2009 15:00:29 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58581 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:00:57 MEZ
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=58573
;
-- 13.11.2009 15:00:57 MEZ
DELETE FROM AD_Column WHERE AD_Column_ID=58573
;
-- 13.11.2009 15:02:11 MEZ
INSERT INTO AD_Element (AD_Org_ID,AD_Element_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,AD_Client_ID,UpdatedBy) VALUES (0,54071,'AD_Reference_Source_ID',TO_DATE('2009-11-13 15:02:08','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Source Reference','Source Reference',TO_DATE('2009-11-13 15:02:08','YYYY-MM-DD HH24:MI:SS'),0,100)
;
-- 13.11.2009 15:02:11 MEZ
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=54071 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 13.11.2009 15:02:32 MEZ
INSERT INTO AD_Element (AD_Org_ID,AD_Element_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,AD_Client_ID,UpdatedBy) VALUES (0,54072,'AD_Reference_Target_ID',TO_DATE('2009-11-13 15:02:30','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Target Reference','Target Reference',TO_DATE('2009-11-13 15:02:30','YYYY-MM-DD HH24:MI:SS'),0,100)
;
-- 13.11.2009 15:02:32 MEZ
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=54072 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 13.11.2009 15:03:03 MEZ
INSERT INTO AD_Element (AD_Org_ID,AD_Element_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,AD_Client_ID,UpdatedBy) VALUES (0,54073,'Role_Source',TO_DATE('2009-11-13 15:02:58','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Source Role','Source Role',TO_DATE('2009-11-13 15:02:58','YYYY-MM-DD HH24:MI:SS'),0,100)
;
-- 13.11.2009 15:03:03 MEZ
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=54073 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 13.11.2009 15:04:41 MEZ
INSERT INTO AD_Element (AD_Org_ID,AD_Element_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,AD_Client_ID,UpdatedBy) VALUES (0,54074,'IsDirected',TO_DATE('2009-11-13 15:04:41','YYYY-MM-DD HH24:MI:SS'),100,'Tells whether one "sees" the other end of the relation from each end or just from the source','D','Y','Directed','Directed',TO_DATE('2009-11-13 15:04:41','YYYY-MM-DD HH24:MI:SS'),0,100)
;
-- 13.11.2009 15:04:41 MEZ
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=54074 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 13.11.2009 15:05:49 MEZ
INSERT INTO AD_Reference (AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType,AD_Client_ID) VALUES (0,53330,TO_DATE('2009-11-13 15:05:49','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N','AD_Reference Table',TO_DATE('2009-11-13 15:05:49','YYYY-MM-DD HH24:MI:SS'),100,'T',0)
;
-- 13.11.2009 15:05:49 MEZ
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=53330 AND NOT EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 13.11.2009 15:06:48 MEZ
INSERT INTO AD_Ref_Table (AD_Display,AD_Key,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,Updated,UpdatedBy,AD_Client_ID,WhereClause,AD_Reference_ID,AD_Table_ID) VALUES (130,129,0,TO_DATE('2009-11-13 15:06:48','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N',TO_DATE('2009-11-13 15:06:48','YYYY-MM-DD HH24:MI:SS'),100,0,'AD_Reference.ValidationType=''T''
AND exists ( /* reference must have an active AD_Ref_Table entry */
select * from AD_Ref_Table t
where t.AD_Reference_ID=AD_Reference.AD_Reference_ID
and t.IsActive=''Y''
)',53330,102)
;
-- 13.11.2009 15:07:12 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Reference_Value_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,53330,54071,18,53246,'AD_Reference_Source_ID',TO_DATE('2009-11-13 15:07:12','YYYY-MM-DD HH24:MI:SS'),100,'U',10,'Y','Y','N','N','N','N','N','N','N','N','N','N','Y','Source Reference',0,TO_DATE('2009-11-13 15:07:12','YYYY-MM-DD HH24:MI:SS'),100,0,0,58582)
;
-- 13.11.2009 15:07:12 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58582 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:07:34 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Reference_Value_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,53330,54072,18,53246,'AD_Reference_Target_ID',TO_DATE('2009-11-13 15:07:33','YYYY-MM-DD HH24:MI:SS'),100,'U',10,'Y','Y','N','N','N','N','N','N','N','N','N','N','Y','Target Reference',0,TO_DATE('2009-11-13 15:07:33','YYYY-MM-DD HH24:MI:SS'),100,0,0,58583)
;
-- 13.11.2009 15:07:34 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58583 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:08:12 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,54074,20,53246,'IsDirected',TO_DATE('2009-11-13 15:08:11','YYYY-MM-DD HH24:MI:SS'),100,'N','Tells whether one "sees" the other end of the relation from each end or just from the source','U',1,'Y','Y','N','N','N','N','N','Y','N','N','N','N','Y','Directed',0,TO_DATE('2009-11-13 15:08:11','YYYY-MM-DD HH24:MI:SS'),100,0,0,58584)
;
-- 13.11.2009 15:08:12 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58584 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:09:50 MEZ
INSERT INTO AD_Reference (AD_Org_ID,AD_Reference_ID,Created,CreatedBy,Description,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType,AD_Client_ID) VALUES (0,53331,TO_DATE('2009-11-13 15:09:50','YYYY-MM-DD HH24:MI:SS'),100,'Defines the possible "roles" a the records of a relation can have','D','Y','N','AD_RelationType Role',TO_DATE('2009-11-13 15:09:50','YYYY-MM-DD HH24:MI:SS'),100,'L',0)
;
-- 13.11.2009 15:09:50 MEZ
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=53331 AND NOT EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 13.11.2009 15:10:12 MEZ
INSERT INTO AD_Ref_List (AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,AD_Client_ID,Value) VALUES (0,53331,53552,TO_DATE('2009-11-13 15:10:11','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Order',TO_DATE('2009-11-13 15:10:11','YYYY-MM-DD HH24:MI:SS'),100,0,'Order')
;
-- 13.11.2009 15:10:12 MEZ
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=53552 AND NOT EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 13.11.2009 15:10:21 MEZ
INSERT INTO AD_Ref_List (AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,AD_Client_ID,Value) VALUES (0,53331,53553,TO_DATE('2009-11-13 15:10:21','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Invoice',TO_DATE('2009-11-13 15:10:21','YYYY-MM-DD HH24:MI:SS'),100,0,'Invoice')
;
-- 13.11.2009 15:10:21 MEZ
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=53553 AND NOT EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 13.11.2009 15:10:58 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Reference_Value_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,53331,54073,17,53246,'Role_Source',TO_DATE('2009-11-13 15:10:57','YYYY-MM-DD HH24:MI:SS'),100,'U',50,'Y','Y','N','N','N','N','N','Y','N','N','N','N','Y','Source Role',0,TO_DATE('2009-11-13 15:10:57','YYYY-MM-DD HH24:MI:SS'),100,0,0,58585)
;
-- 13.11.2009 15:10:58 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58585 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:12:02 MEZ
INSERT INTO AD_Element (AD_Org_ID,AD_Element_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,AD_Client_ID,UpdatedBy) VALUES (0,54075,'Role_Target',TO_DATE('2009-11-13 15:12:01','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Target Role','Target Role',TO_DATE('2009-11-13 15:12:01','YYYY-MM-DD HH24:MI:SS'),0,100)
;
-- 13.11.2009 15:12:02 MEZ
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=54075 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 13.11.2009 15:12:35 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Reference_Value_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,53331,54075,17,53246,'Role_Target',TO_DATE('2009-11-13 15:12:35','YYYY-MM-DD HH24:MI:SS'),100,'U',50,'Y','Y','N','N','N','N','N','N','N','N','N','N','Y','Target Role',0,TO_DATE('2009-11-13 15:12:35','YYYY-MM-DD HH24:MI:SS'),100,0,0,58586)
;
-- 13.11.2009 15:12:35 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58586 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:12:38 MEZ
UPDATE AD_Column SET IsMandatory='Y',Updated=TO_DATE('2009-11-13 15:12:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=58586
;
-- 13.11.2009 15:15:10 MEZ
INSERT INTO AD_Reference (AD_Org_ID,AD_Reference_ID,Created,CreatedBy,Description,EntityType,Help,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType,AD_Client_ID) VALUES (0,53332,TO_DATE('2009-11-13 15:15:09','YYYY-MM-DD HH24:MI:SS'),100,'"Type" of a relation type','D','For now we only have implicit realtion types, i.e. the record pairs are defined by the rule itself. In future we would like to have explicit type also. An explizit type just defines a template, the actual pairs can be added by a user or by the system itself.','Y','N','AD_RelationType Type',TO_DATE('2009-11-13 15:15:09','YYYY-MM-DD HH24:MI:SS'),100,'L',0)
;
-- 13.11.2009 15:15:10 MEZ
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=53332 AND NOT EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 13.11.2009 15:15:32 MEZ
INSERT INTO AD_Ref_List (AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,Description,EntityType,IsActive,Name,Updated,UpdatedBy,AD_Client_ID,Value) VALUES (0,53332,53554,TO_DATE('2009-11-13 15:15:31','YYYY-MM-DD HH24:MI:SS'),100,NULL,'D','Y','Implicit',TO_DATE('2009-11-13 15:15:31','YYYY-MM-DD HH24:MI:SS'),100,0,'I')
;
-- 13.11.2009 15:15:32 MEZ
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=53554 AND NOT EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 13.11.2009 15:16:19 MEZ
INSERT INTO AD_Ref_List (AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,AD_Client_ID,Value) VALUES (0,53332,53555,TO_DATE('2009-11-13 15:16:19','YYYY-MM-DD HH24:MI:SS'),100,'D','N','Explicit',TO_DATE('2009-11-13 15:16:19','YYYY-MM-DD HH24:MI:SS'),100,0,'E')
;
-- 13.11.2009 15:16:19 MEZ
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=53555 AND NOT EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 13.11.2009 15:16:40 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Reference_Value_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,53332,600,17,53246,'Type',TO_DATE('2009-11-13 15:16:39','YYYY-MM-DD HH24:MI:SS'),100,'Type of Validation (SQL, Java Script, Java Language)','U',1,'The Type indicates the type of validation that will occur. This can be SQL, Java Script or Java Language.','Y','Y','N','N','N','N','N','Y','N','N','N','N','Y','Type',0,TO_DATE('2009-11-13 15:16:39','YYYY-MM-DD HH24:MI:SS'),100,0,0,58587)
;
-- 13.11.2009 15:16:40 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58587 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:16:56 MEZ
UPDATE AD_Column SET EntityType='D',Updated=TO_DATE('2009-11-13 15:16:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=58587
;
-- 13.11.2009 15:16:59 MEZ
UPDATE AD_Column SET EntityType='D',Updated=TO_DATE('2009-11-13 15:16:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=58586
;
-- 13.11.2009 15:17:02 MEZ
UPDATE AD_Column SET EntityType='D',Updated=TO_DATE('2009-11-13 15:17:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=58585
;
-- 13.11.2009 15:17:05 MEZ
UPDATE AD_Column SET EntityType='D',Updated=TO_DATE('2009-11-13 15:17:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=58584
;
-- 13.11.2009 15:17:11 MEZ
UPDATE AD_Column SET EntityType='D',Updated=TO_DATE('2009-11-13 15:17:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=58583
;
-- 13.11.2009 15:17:33 MEZ
UPDATE AD_Column SET EntityType='D',Updated=TO_DATE('2009-11-13 15:17:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=58582
;
-- 13.11.2009 15:18:44 MEZ
INSERT INTO AD_Window (AD_Org_ID,AD_Window_ID,Created,CreatedBy,EntityType,IsActive,IsBetaFunctionality,IsDefault,IsSOTrx,Name,Processing,Updated,UpdatedBy,WindowType,WinHeight,AD_Client_ID,WinWidth) VALUES (0,53102,TO_DATE('2009-11-13 15:18:43','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N','N','Y','Relation Type','N',TO_DATE('2009-11-13 15:18:43','YYYY-MM-DD HH24:MI:SS'),100,'M',0,0,0)
;
-- 13.11.2009 15:18:44 MEZ
INSERT INTO AD_Window_Trl (AD_Language,AD_Window_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Window_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Window t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Window_ID=53102 AND NOT EXISTS (SELECT * FROM AD_Window_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Window_ID=t.AD_Window_ID)
;
-- 13.11.2009 15:19:04 MEZ
UPDATE AD_Table SET AD_Window_ID=53102,Updated=TO_DATE('2009-11-13 15:19:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=53246
;
-- 13.11.2009 15:19:44 MEZ
INSERT INTO AD_Tab (AD_Org_ID,CreatedBy,EntityType,HasTree,ImportFields,IsActive,IsAdvancedTab,IsInfoTab,IsInsertRecord,IsReadOnly,IsSingleRow,IsSortTab,IsTranslationTab,Name,Processing,SeqNo,TabLevel,Updated,UpdatedBy,AD_Client_ID,AD_Tab_ID,AD_Table_ID,AD_Window_ID,Created) VALUES (0,100,'D','N','N','Y','N','N','Y','N','N','N','N','Relation Type','N',10,0,TO_DATE('2009-11-13 15:19:43','YYYY-MM-DD HH24:MI:SS'),100,0,53285,53246,53102,TO_DATE('2009-11-13 15:19:43','YYYY-MM-DD HH24:MI:SS'))
;
-- 13.11.2009 15:19:44 MEZ
INSERT INTO AD_Tab_Trl (AD_Language,AD_Tab_ID, Description,Help,Name,CommitWarning, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Tab_ID, t.Description,t.Help,t.Name,t.CommitWarning, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Tab t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Tab_ID=53285 AND NOT EXISTS (SELECT * FROM AD_Tab_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Tab_ID=t.AD_Tab_ID)
;
-- 13.11.2009 15:20:14 MEZ
INSERT INTO AD_Field (AD_Column_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,AD_Client_ID,UpdatedBy,AD_Field_ID) VALUES (58578,0,53285,TO_DATE('2009-11-13 15:20:13','YYYY-MM-DD HH24:MI:SS'),100,'The record is active in the system',1,'D','There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports.
There are two reasons for de-activating and not deleting records:
(1) The system requires the record for audit purposes.
(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.','Y','Y','Y','N','N','N','N','N','Active',TO_DATE('2009-11-13 15:20:13','YYYY-MM-DD HH24:MI:SS'),0,100,58064)
;
-- 13.11.2009 15:20:14 MEZ
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=58064 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 13.11.2009 15:20:15 MEZ
INSERT INTO AD_Field (AD_Column_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,AD_Client_ID,UpdatedBy,AD_Field_ID) VALUES (58571,0,53285,TO_DATE('2009-11-13 15:20:14','YYYY-MM-DD HH24:MI:SS'),100,'Client/Tenant for this installation.',22,'D','A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.','Y','Y','Y','N','N','N','N','N','Client',TO_DATE('2009-11-13 15:20:14','YYYY-MM-DD HH24:MI:SS'),0,100,58065)
;
-- 13.11.2009 15:20:15 MEZ
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=58065 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 13.11.2009 15:20:15 MEZ
INSERT INTO AD_Field (AD_Column_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,AD_Client_ID,UpdatedBy,AD_Field_ID) VALUES (58577,0,53285,TO_DATE('2009-11-13 15:20:15','YYYY-MM-DD HH24:MI:SS'),100,'Optional short description of the record',255,'D','A description is limited to 255 characters.','Y','Y','Y','N','N','N','N','N','Description',TO_DATE('2009-11-13 15:20:15','YYYY-MM-DD HH24:MI:SS'),0,100,58066)
;
-- 13.11.2009 15:20:15 MEZ
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=58066 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 13.11.2009 15:20:16 MEZ
INSERT INTO AD_Field (AD_Column_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,AD_Client_ID,UpdatedBy,AD_Field_ID) VALUES (58584,0,53285,TO_DATE('2009-11-13 15:20:15','YYYY-MM-DD HH24:MI:SS'),100,'Tells whether one "sees" the other end of the relation from each end or just from the source',1,'D','Y','Y','Y','N','N','N','N','N','Directed',TO_DATE('2009-11-13 15:20:15','YYYY-MM-DD HH24:MI:SS'),0,100,58067)
;
-- 13.11.2009 15:20:16 MEZ
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=58067 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 13.11.2009 15:20:16 MEZ
INSERT INTO AD_Field (AD_Column_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,AD_Client_ID,UpdatedBy,AD_Field_ID) VALUES (58579,0,53285,TO_DATE('2009-11-13 15:20:16','YYYY-MM-DD HH24:MI:SS'),100,'Alphanumeric identifier of the entity',60,'D','The name of an entity (record) is used as an default search option in addition to the search key. The name is up to 60 characters in length.','Y','Y','Y','N','N','N','N','N','Name',TO_DATE('2009-11-13 15:20:16','YYYY-MM-DD HH24:MI:SS'),0,100,58068)
;
-- 13.11.2009 15:20:16 MEZ
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=58068 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 13.11.2009 15:20:17 MEZ
INSERT INTO AD_Field (AD_Column_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,AD_Client_ID,UpdatedBy,AD_Field_ID) VALUES (58572,0,53285,TO_DATE('2009-11-13 15:20:16','YYYY-MM-DD HH24:MI:SS'),100,'Organizational entity within client',22,'D','An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','Y','Y','Y','N','N','N','N','N','Organization',TO_DATE('2009-11-13 15:20:16','YYYY-MM-DD HH24:MI:SS'),0,100,58069)
;
-- 13.11.2009 15:20:17 MEZ
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=58069 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 13.11.2009 15:20:17 MEZ
INSERT INTO AD_Field (AD_Column_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,AD_Client_ID,UpdatedBy,AD_Field_ID) VALUES (58574,0,53285,TO_DATE('2009-11-13 15:20:17','YYYY-MM-DD HH24:MI:SS'),100,22,'D','Y','Y','N','N','N','N','N','N','Relation Type',TO_DATE('2009-11-13 15:20:17','YYYY-MM-DD HH24:MI:SS'),0,100,58070)
;
-- 13.11.2009 15:20:17 MEZ
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=58070 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 13.11.2009 15:20:18 MEZ
INSERT INTO AD_Field (AD_Column_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,AD_Client_ID,UpdatedBy,AD_Field_ID) VALUES (58582,0,53285,TO_DATE('2009-11-13 15:20:17','YYYY-MM-DD HH24:MI:SS'),100,10,'D','Y','Y','Y','N','N','N','N','N','Source Reference',TO_DATE('2009-11-13 15:20:17','YYYY-MM-DD HH24:MI:SS'),0,100,58071)
;
-- 13.11.2009 15:20:18 MEZ
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=58071 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 13.11.2009 15:20:19 MEZ
INSERT INTO AD_Field (AD_Column_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,AD_Client_ID,UpdatedBy,AD_Field_ID) VALUES (58585,0,53285,TO_DATE('2009-11-13 15:20:18','YYYY-MM-DD HH24:MI:SS'),100,50,'D','Y','Y','Y','N','N','N','N','N','Source Role',TO_DATE('2009-11-13 15:20:18','YYYY-MM-DD HH24:MI:SS'),0,100,58072)
;
-- 13.11.2009 15:20:19 MEZ
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=58072 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 13.11.2009 15:20:19 MEZ
INSERT INTO AD_Field (AD_Column_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,AD_Client_ID,UpdatedBy,AD_Field_ID) VALUES (58583,0,53285,TO_DATE('2009-11-13 15:20:19','YYYY-MM-DD HH24:MI:SS'),100,10,'D','Y','Y','Y','N','N','N','N','N','Target Reference',TO_DATE('2009-11-13 15:20:19','YYYY-MM-DD HH24:MI:SS'),0,100,58073)
;
-- 13.11.2009 15:20:19 MEZ
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=58073 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 13.11.2009 15:20:20 MEZ
INSERT INTO AD_Field (AD_Column_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,AD_Client_ID,UpdatedBy,AD_Field_ID) VALUES (58586,0,53285,TO_DATE('2009-11-13 15:20:19','YYYY-MM-DD HH24:MI:SS'),100,50,'D','Y','Y','Y','N','N','N','N','N','Target Role',TO_DATE('2009-11-13 15:20:19','YYYY-MM-DD HH24:MI:SS'),0,100,58074)
;
-- 13.11.2009 15:20:20 MEZ
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=58074 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 13.11.2009 15:20:20 MEZ
INSERT INTO AD_Field (AD_Column_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,AD_Client_ID,UpdatedBy,AD_Field_ID) VALUES (58587,0,53285,TO_DATE('2009-11-13 15:20:20','YYYY-MM-DD HH24:MI:SS'),100,'Type of Validation (SQL, Java Script, Java Language)',1,'D','The Type indicates the type of validation that will occur. This can be SQL, Java Script or Java Language.','Y','Y','Y','N','N','N','N','N','Type',TO_DATE('2009-11-13 15:20:20','YYYY-MM-DD HH24:MI:SS'),0,100,58075)
;
-- 13.11.2009 15:20:20 MEZ
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=58075 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 13.11.2009 15:21:25 MEZ
UPDATE AD_Field SET SeqNo=10,IsDisplayed='Y' WHERE AD_Field_ID=58065
;
-- 13.11.2009 15:21:25 MEZ
UPDATE AD_Field SET SeqNo=20,IsDisplayed='Y' WHERE AD_Field_ID=58069
;
-- 13.11.2009 15:21:25 MEZ
UPDATE AD_Field SET SeqNo=30,IsDisplayed='Y' WHERE AD_Field_ID=58068
;
-- 13.11.2009 15:21:25 MEZ
UPDATE AD_Field SET SeqNo=40,IsDisplayed='Y' WHERE AD_Field_ID=58064
;
-- 13.11.2009 15:21:25 MEZ
UPDATE AD_Field SET SeqNo=50,IsDisplayed='Y' WHERE AD_Field_ID=58066
;
-- 13.11.2009 15:21:25 MEZ
UPDATE AD_Field SET SeqNo=60,IsDisplayed='Y' WHERE AD_Field_ID=58067
;
-- 13.11.2009 15:21:25 MEZ
UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=58075
;
-- 13.11.2009 15:21:25 MEZ
UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=58071
;
-- 13.11.2009 15:21:25 MEZ
UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=58072
;
-- 13.11.2009 15:21:25 MEZ
UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=58073
;
-- 13.11.2009 15:21:25 MEZ
UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=58074
;
-- 13.11.2009 15:21:38 MEZ
UPDATE AD_Field SET IsSameLine='Y',Updated=TO_DATE('2009-11-13 15:21:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58064
;
-- 13.11.2009 15:21:52 MEZ
UPDATE AD_Field SET IsSameLine='Y',Updated=TO_DATE('2009-11-13 15:21:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58072
;
-- 13.11.2009 15:21:57 MEZ
UPDATE AD_Field SET IsSameLine='Y',Updated=TO_DATE('2009-11-13 15:21:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58074
;
-- 13.11.2009 15:22:03 MEZ
UPDATE AD_Field SET IsSameLine='Y',Updated=TO_DATE('2009-11-13 15:22:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58075
;
-- 13.11.2009 15:22:46 MEZ
INSERT INTO AD_Menu (AD_Org_ID,AD_Client_ID,AD_Menu_ID,AD_Window_ID,Created,CreatedBy,EntityType,IsActive,IsReadOnly,IsSOTrx,IsSummary,Name,Updated,Action,UpdatedBy) VALUES (0,0,53251,53102,TO_DATE('2009-11-13 15:22:45','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N','N','N','Relation Type',TO_DATE('2009-11-13 15:22:45','YYYY-MM-DD HH24:MI:SS'),'W',100)
;
-- 13.11.2009 15:22:46 MEZ
INSERT INTO AD_Menu_Trl (AD_Language,AD_Menu_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Menu_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Menu t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Menu_ID=53251 AND NOT EXISTS (SELECT * FROM AD_Menu_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Menu_ID=t.AD_Menu_ID)
;
-- 13.11.2009 15:22:46 MEZ
INSERT INTO AD_TreeNodeMM (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo) SELECT t.AD_Client_ID, 0, 'Y', SysDate, 100, SysDate, 100,t.AD_Tree_ID, 53251, 0, 999 FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.TreeType='MM' AND NOT EXISTS (SELECT * FROM AD_TreeNodeMM e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=53251)
;
-- 13.11.2009 15:22:54 MEZ
UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=0, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53251
;
-- 13.11.2009 15:22:54 MEZ
UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=1, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=155
;
-- 13.11.2009 15:22:54 MEZ
UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=2, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=156
;
-- 13.11.2009 15:22:54 MEZ
UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=3, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=175
;
-- 13.11.2009 15:22:54 MEZ
UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=4, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=157
;
-- 13.11.2009 15:22:54 MEZ
UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=5, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=552
;
-- 13.11.2009 15:22:59 MEZ
UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=0, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53251
;
-- 13.11.2009 15:22:59 MEZ
UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=1, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=155
;
-- 13.11.2009 15:22:59 MEZ
UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=2, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=156
;
-- 13.11.2009 15:22:59 MEZ
UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=3, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=175
;
-- 13.11.2009 15:22:59 MEZ
UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=4, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=157
;
-- 13.11.2009 15:22:59 MEZ
UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=5, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=53251
;
-- 13.11.2009 15:22:59 MEZ
UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=6, Updated=SysDate WHERE AD_Tree_ID=10 AND Node_ID=552
;
-- 13.11.2009 15:25:11 MEZ
UPDATE AD_Column SET DefaultValue='I',Updated=TO_DATE('2009-11-13 15:25:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=58587
;
-- 13.11.2009 15:26:25 MEZ
INSERT INTO AD_Reference (AD_Org_ID,AD_Reference_ID,Created,CreatedBy,Description,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType,AD_Client_ID) VALUES (0,53333,TO_DATE('2009-11-13 15:26:25','YYYY-MM-DD HH24:MI:SS'),100,'Finds C_OrderIDs for a given C_Invoice_ID','D','Y','N','RelType C_Invoice_ID->C_Order',TO_DATE('2009-11-13 15:26:25','YYYY-MM-DD HH24:MI:SS'),100,'T',0)
;
-- 13.11.2009 15:26:25 MEZ
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=53333 AND NOT EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 13.11.2009 15:27:09 MEZ
INSERT INTO AD_Ref_Table (AD_Display,AD_Key,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,OrderByClause,Updated,UpdatedBy,AD_Client_ID,WhereClause,AD_Reference_ID,AD_Table_ID) VALUES (2169,2161,0,TO_DATE('2009-11-13 15:27:09','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N','DocumentNo',TO_DATE('2009-11-13 15:27:09','YYYY-MM-DD HH24:MI:SS'),100,0,'C_Order_ID IN (
select o.c_order_id from c_order o
left join c_orderline ol on o.c_order_id = ol.c_order_id
left join c_invoiceline il on ol.c_orderline_id = il.c_orderline_id
where il.C_Invoice_ID=@C_Invoice_ID@
)',53333,259)
;
-- 13.11.2009 15:27:40 MEZ
INSERT INTO AD_Reference (AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType,AD_Client_ID) VALUES (0,53334,TO_DATE('2009-11-13 15:27:40','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N','RelType C_Order_ID->C_Invoice',TO_DATE('2009-11-13 15:27:40','YYYY-MM-DD HH24:MI:SS'),100,'T',0)
;
-- 13.11.2009 15:27:40 MEZ
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=53334 AND NOT EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 13.11.2009 15:28:08 MEZ
UPDATE AD_Reference SET Description='Finds C_Invoice_IDs for a given C_C_Order_ID',Updated=TO_DATE('2009-11-13 15:28:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=53334
;
-- 13.11.2009 15:28:08 MEZ
UPDATE AD_Reference_Trl SET IsTranslated='N' WHERE AD_Reference_ID=53334
;
-- 13.11.2009 15:28:14 MEZ
UPDATE AD_Reference SET Description='Finds C_Order_IDs for a given C_Invoice_ID',Updated=TO_DATE('2009-11-13 15:28:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=53333
;
-- 13.11.2009 15:28:14 MEZ
UPDATE AD_Reference_Trl SET IsTranslated='N' WHERE AD_Reference_ID=53333
;
-- 13.11.2009 15:29:23 MEZ
INSERT INTO AD_Ref_Table (AD_Display,AD_Key,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,OrderByClause,Updated,UpdatedBy,AD_Client_ID,WhereClause,AD_Reference_ID,AD_Table_ID) VALUES (3492,3484,0,TO_DATE('2009-11-13 15:29:23','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N','DocumentNo',TO_DATE('2009-11-13 15:29:23','YYYY-MM-DD HH24:MI:SS'),100,0,'C_Invoice_ID IN (
select i.C_Invoice_ID from C_Invoice i
left join C_InvoiceLine il on il.C_Invoice_ID = i.C_Invoice_ID
left join C_OrderLine ol on ol.C_OrderLine_ID = il.C_OrderLine_ID
where ol.C_Order_ID=@C_Order_ID@
)',53334,318)
;
-- 13.11.2009 15:30:58 MEZ
CREATE TABLE AD_RelationType (AD_Client_ID NUMBER(10) NOT NULL, AD_Org_ID NUMBER(10) NOT NULL, AD_Reference_Source_ID NUMBER(10) DEFAULT NULL , AD_Reference_Target_ID NUMBER(10) DEFAULT NULL , AD_RelationType_ID NUMBER(10) NOT NULL, Created DATE NOT NULL, CreatedBy NUMBER(10) NOT NULL, Description NVARCHAR2(255) DEFAULT NULL , IsActive CHAR(1) DEFAULT 'Y' CHECK (IsActive IN ('Y','N')) NOT NULL, IsDirected CHAR(1) DEFAULT 'N' CHECK (IsDirected IN ('Y','N')) NOT NULL, Name NVARCHAR2(60) NOT NULL, Role_Source NVARCHAR2(50) NOT NULL, Role_Target NVARCHAR2(50) NOT NULL, Type CHAR(1) DEFAULT 'I' NOT NULL, Updated DATE NOT NULL, UpdatedBy NUMBER(10) NOT NULL, CONSTRAINT AD_RelationType_Key PRIMARY KEY (AD_RelationType_ID))
;
-- 13.11.2009 15:49:25 MEZ
INSERT INTO AD_Message (AD_Org_ID,AD_Message_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,AD_Client_ID,Value) VALUES (0,53088,TO_DATE('2009-11-13 15:49:24','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','PO {0} has {1} key columns. Needs to have exactly one.','E',TO_DATE('2009-11-13 15:49:24','YYYY-MM-DD HH24:MI:SS'),100,0,'MRelationType_Err_KeyColumns_2P')
;
-- 13.11.2009 15:49:25 MEZ
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=53088 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
;
-- 13.11.2009 15:51:17 MEZ
INSERT INTO AD_Message (AD_Org_ID,AD_Message_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,AD_Client_ID,Value) VALUES (0,53089,TO_DATE('2009-11-13 15:51:16','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Neither reference {0} nor table {1} have an AD_Window_ID. IsSOTrx: {2}','E',TO_DATE('2009-11-13 15:51:16','YYYY-MM-DD HH24:MI:SS'),100,0,'MRelationType_Err_Window_3P')
;
-- 13.11.2009 15:51:17 MEZ
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=53089 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
;
-- 16.11.2009 17:42:58 MEZ
UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2009-11-16 17:42:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=58585
;
-- 16.11.2009 17:43:02 MEZ
ALTER TABLE AD_RelationType MODIFY Role_Source NVARCHAR2(50) DEFAULT NULL
;
-- 16.11.2009 17:43:02 MEZ
ALTER TABLE AD_RelationType MODIFY Role_Source NULL
;
-- 16.11.2009 17:43:17 MEZ
UPDATE AD_Column SET IsMandatory='N',Updated=TO_DATE('2009-11-16 17:43:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=58586
;
-- 16.11.2009 17:43:18 MEZ
ALTER TABLE AD_RelationType MODIFY Role_Target NVARCHAR2(50) DEFAULT NULL
;
-- 16.11.2009 17:43:18 MEZ
ALTER TABLE AD_RelationType MODIFY Role_Target NULL
;
-- 16.11.2009 17:45:03 MEZ
UPDATE AD_Element SET Description='If set, this role will be used as label for the zoom target instead of the zoom target''s window name',Updated=TO_DATE('2009-11-16 17:45:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=54075
;
-- 16.11.2009 17:45:03 MEZ
UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=54075
;
-- 16.11.2009 17:45:03 MEZ
UPDATE AD_Column SET ColumnName='Role_Target', Name='Target Role', Description='If set, this role will be used as label for the zoom target instead of the zoom target''s window name', Help=NULL WHERE AD_Element_ID=54075
;
-- 16.11.2009 17:45:03 MEZ
UPDATE AD_Process_Para SET ColumnName='Role_Target', Name='Target Role', Description='If set, this role will be used as label for the zoom target instead of the zoom target''s window name', Help=NULL, AD_Element_ID=54075 WHERE UPPER(ColumnName)='ROLE_TARGET' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 16.11.2009 17:45:03 MEZ
UPDATE AD_Process_Para SET ColumnName='Role_Target', Name='Target Role', Description='If set, this role will be used as label for the zoom target instead of the zoom target''s window name', Help=NULL WHERE AD_Element_ID=54075 AND IsCentrallyMaintained='Y'
;
-- 16.11.2009 17:45:03 MEZ
UPDATE AD_Field SET Name='Target Role', Description='If set, this role will be used as label for the zoom target instead of the zoom target''s window name', Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=54075) AND IsCentrallyMaintained='Y'
;
-- 16.11.2009 17:45:25 MEZ
UPDATE AD_Element SET Description='If set, this role will be used as label for the zoom destination instead of the destinations''s window name',Updated=TO_DATE('2009-11-16 17:45:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=54075
;
-- 16.11.2009 17:45:25 MEZ
UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=54075
;
-- 16.11.2009 17:45:25 MEZ
UPDATE AD_Column SET ColumnName='Role_Target', Name='Target Role', Description='If set, this role will be used as label for the zoom destination instead of the destinations''s window name', Help=NULL WHERE AD_Element_ID=54075
;
-- 16.11.2009 17:45:25 MEZ
UPDATE AD_Process_Para SET ColumnName='Role_Target', Name='Target Role', Description='If set, this role will be used as label for the zoom destination instead of the destinations''s window name', Help=NULL, AD_Element_ID=54075 WHERE UPPER(ColumnName)='ROLE_TARGET' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 16.11.2009 17:45:25 MEZ
UPDATE AD_Process_Para SET ColumnName='Role_Target', Name='Target Role', Description='If set, this role will be used as label for the zoom destination instead of the destinations''s window name', Help=NULL WHERE AD_Element_ID=54075 AND IsCentrallyMaintained='Y'
;
-- 16.11.2009 17:45:25 MEZ
UPDATE AD_Field SET Name='Target Role', Description='If set, this role will be used as label for the zoom destination instead of the destinations''s window name', Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=54075) AND IsCentrallyMaintained='Y'
;
-- 16.11.2009 17:45:40 MEZ
UPDATE AD_Element SET Description='If set, this role will be used as label for the zoom destination instead of the destinations''s window name',Updated=TO_DATE('2009-11-16 17:45:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=54073
;
-- 16.11.2009 17:45:40 MEZ
UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=54073
;
-- 16.11.2009 17:45:40 MEZ
UPDATE AD_Column SET ColumnName='Role_Source', Name='Source Role', Description='If set, this role will be used as label for the zoom destination instead of the destinations''s window name', Help=NULL WHERE AD_Element_ID=54073
;
-- 16.11.2009 17:45:40 MEZ
UPDATE AD_Process_Para SET ColumnName='Role_Source', Name='Source Role', Description='If set, this role will be used as label for the zoom destination instead of the destinations''s window name', Help=NULL, AD_Element_ID=54073 WHERE UPPER(ColumnName)='ROLE_SOURCE' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 16.11.2009 17:45:40 MEZ
UPDATE AD_Process_Para SET ColumnName='Role_Source', Name='Source Role', Description='If set, this role will be used as label for the zoom destination instead of the destinations''s window name', Help=NULL WHERE AD_Element_ID=54073 AND IsCentrallyMaintained='Y'
;
-- 16.11.2009 17:45:40 MEZ
UPDATE AD_Field SET Name='Source Role', Description='If set, this role will be used as label for the zoom destination instead of the destinations''s window name', Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=54073) AND IsCentrallyMaintained='Y'
;
-- 13.11.2009 15:31:34 MEZ
INSERT INTO AD_RelationType (AD_Org_ID,AD_Client_ID,AD_Reference_Target_ID,AD_RelationType_ID,Created,CreatedBy,IsActive,IsDirected,Name,Role_Source,Role_Target,Type,Updated,UpdatedBy,AD_Reference_Source_ID) VALUES (0,0,53334,50001,TO_DATE('2009-11-13 15:31:33','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Order<->Invoice',NULL,NULL,'I',TO_DATE('2009-11-13 15:31:33','YYYY-MM-DD HH24:MI:SS'),100,53333)
;

View File

@ -0,0 +1,718 @@
-- 13.11.2009 14:59:58 MEZ
-- FR 2897194 Advanced Zoom and RelationTypes
INSERT INTO AD_Table (AD_Org_ID,AD_Client_ID,AD_Table_ID,CopyColumnsFromTable,Created,CreatedBy,Description,EntityType,ImportTable,IsActive,IsChangeLog,IsDeleteable,IsHighVolume,IsSecurityEnabled,IsView,LoadSeq,Name,ReplicationType,TableName,Updated,AccessLevel,UpdatedBy) VALUES (0,0,53246,'N',TO_TIMESTAMP('2009-11-13 14:59:55','YYYY-MM-DD HH24:MI:SS'),100,'Defines the sets of record pairs (and the conditions a given pair must fulfill to be part of one)','D','N','Y','N','Y','N','N','N',0,'Relation Type','L','AD_RelationType',TO_TIMESTAMP('2009-11-13 14:59:55','YYYY-MM-DD HH24:MI:SS'),'7',100)
;
-- 13.11.2009 14:59:58 MEZ
INSERT INTO AD_Table_Trl (AD_Language,AD_Table_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Table_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Table t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Table_ID=53246 AND NOT EXISTS (SELECT * FROM AD_Table_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Table_ID=t.AD_Table_ID)
;
-- 13.11.2009 14:59:58 MEZ
INSERT INTO AD_Sequence (AD_Org_ID,AD_Sequence_ID,Created,CreatedBy,CurrentNext,CurrentNextSys,Description,IncrementNo,IsActive,IsAudited,IsAutoSequence,IsTableID,Name,StartNewYear,StartNo,Updated,UpdatedBy,AD_Client_ID) VALUES (0,53355,TO_TIMESTAMP('2009-11-13 14:59:58','YYYY-MM-DD HH24:MI:SS'),100,1000000,50000,'Table AD_RelationType',1,'Y','N','Y','Y','AD_RelationType','N',1000000,TO_TIMESTAMP('2009-11-13 14:59:58','YYYY-MM-DD HH24:MI:SS'),100,0)
;
-- 13.11.2009 15:00:17 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,102,19,53246,129,'AD_Client_ID',TO_TIMESTAMP('2009-11-13 15:00:16','YYYY-MM-DD HH24:MI:SS'),100,'@#AD_Client_ID@','Client/Tenant for this installation.','D',22,'A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.','Y','N','N','N','N','Y','N','N','N','N','N','Client',0,TO_TIMESTAMP('2009-11-13 15:00:16','YYYY-MM-DD HH24:MI:SS'),100,1,0,58571)
;
-- 13.11.2009 15:00:17 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58571 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:00:18 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,AD_Val_Rule_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,113,19,53246,104,'AD_Org_ID',TO_TIMESTAMP('2009-11-13 15:00:17','YYYY-MM-DD HH24:MI:SS'),100,'@#AD_Org_ID@','Organizational entity within client','D',22,'An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','Y','N','N','N','N','Y','N','N','N','N','N','Organization',0,TO_TIMESTAMP('2009-11-13 15:00:17','YYYY-MM-DD HH24:MI:SS'),100,1,0,58572)
;
-- 13.11.2009 15:00:18 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58572 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:00:19 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,193,19,53246,'C_Currency_ID',TO_TIMESTAMP('2009-11-13 15:00:18','YYYY-MM-DD HH24:MI:SS'),100,'The Currency for this record','D',22,'Indicates the Currency to be used when processing or reporting on this record','Y','N','N','N','N','Y','N','N','N','N','Y','Currency',0,TO_TIMESTAMP('2009-11-13 15:00:18','YYYY-MM-DD HH24:MI:SS'),100,1,0,58573)
;
-- 13.11.2009 15:00:19 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58573 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:00:20 MEZ
INSERT INTO AD_Element (AD_Org_ID,AD_Element_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,AD_Client_ID,UpdatedBy) VALUES (0,54070,'AD_RelationType_ID',TO_TIMESTAMP('2009-11-13 15:00:19','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Relation Type','Relation Type',TO_TIMESTAMP('2009-11-13 15:00:19','YYYY-MM-DD HH24:MI:SS'),0,100)
;
-- 13.11.2009 15:00:20 MEZ
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=54070 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 13.11.2009 15:00:22 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,54070,13,53246,'AD_RelationType_ID',TO_TIMESTAMP('2009-11-13 15:00:19','YYYY-MM-DD HH24:MI:SS'),100,'D',22,'Y','N','N','N','Y','Y','N','N','N','N','N','Relation Type',0,TO_TIMESTAMP('2009-11-13 15:00:19','YYYY-MM-DD HH24:MI:SS'),100,1,0,58574)
;
-- 13.11.2009 15:00:22 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58574 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:00:23 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,245,16,53246,'Created',TO_TIMESTAMP('2009-11-13 15:00:22','YYYY-MM-DD HH24:MI:SS'),100,'Date this record was created','D',7,'The Created field indicates the date that this record was created.','Y','N','N','N','N','Y','N','N','N','N','N','Created',0,TO_TIMESTAMP('2009-11-13 15:00:22','YYYY-MM-DD HH24:MI:SS'),100,1,0,58575)
;
-- 13.11.2009 15:00:23 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58575 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:00:24 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Reference_Value_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,110,246,18,53246,'CreatedBy',TO_TIMESTAMP('2009-11-13 15:00:23','YYYY-MM-DD HH24:MI:SS'),100,'User who created this records','D',22,'The Created By field indicates the user who created this record.','Y','N','N','N','N','Y','N','N','N','N','N','Created By',0,TO_TIMESTAMP('2009-11-13 15:00:23','YYYY-MM-DD HH24:MI:SS'),100,1,0,58576)
;
-- 13.11.2009 15:00:24 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58576 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:00:25 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,275,10,53246,'Description',TO_TIMESTAMP('2009-11-13 15:00:24','YYYY-MM-DD HH24:MI:SS'),100,'Optional short description of the record','D',255,'A description is limited to 255 characters.','Y','N','N','N','N','N','N','N','N','N','Y','Description',0,TO_TIMESTAMP('2009-11-13 15:00:24','YYYY-MM-DD HH24:MI:SS'),100,1,0,58577)
;
-- 13.11.2009 15:00:25 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58577 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:00:26 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,348,20,53246,'IsActive',TO_TIMESTAMP('2009-11-13 15:00:25','YYYY-MM-DD HH24:MI:SS'),100,'Y','The record is active in the system','D',1,'There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports.
There are two reasons for de-activating and not deleting records:
(1) The system requires the record for audit purposes.
(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.','Y','N','N','N','N','Y','N','N','N','N','Y','Active',0,TO_TIMESTAMP('2009-11-13 15:00:25','YYYY-MM-DD HH24:MI:SS'),100,1,0,58578)
;
-- 13.11.2009 15:00:26 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58578 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:00:27 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,469,10,53246,'Name',TO_TIMESTAMP('2009-11-13 15:00:26','YYYY-MM-DD HH24:MI:SS'),100,'Alphanumeric identifier of the entity','D',60,'The name of an entity (record) is used as an default search option in addition to the search key. The name is up to 60 characters in length.','Y','N','N','Y','N','Y','N','N','N','N','Y','Name',1,TO_TIMESTAMP('2009-11-13 15:00:26','YYYY-MM-DD HH24:MI:SS'),100,1,0,58579)
;
-- 13.11.2009 15:00:27 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58579 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:00:28 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,607,16,53246,'Updated',TO_TIMESTAMP('2009-11-13 15:00:27','YYYY-MM-DD HH24:MI:SS'),100,'Date this record was updated','D',7,'The Updated field indicates the date that this record was updated.','Y','N','N','N','N','Y','N','N','N','N','N','Updated',0,TO_TIMESTAMP('2009-11-13 15:00:27','YYYY-MM-DD HH24:MI:SS'),100,1,0,58580)
;
-- 13.11.2009 15:00:28 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58580 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:00:29 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Reference_Value_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAlwaysUpdateable,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,110,608,18,53246,'UpdatedBy',TO_TIMESTAMP('2009-11-13 15:00:28','YYYY-MM-DD HH24:MI:SS'),100,'User who updated this records','D',22,'The Updated By field indicates the user who updated this record.','Y','N','N','N','N','Y','N','N','N','N','N','Updated By',0,TO_TIMESTAMP('2009-11-13 15:00:28','YYYY-MM-DD HH24:MI:SS'),100,1,0,58581)
;
-- 13.11.2009 15:00:29 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58581 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:00:57 MEZ
DELETE FROM AD_Column_Trl WHERE AD_Column_ID=58573
;
-- 13.11.2009 15:00:57 MEZ
DELETE FROM AD_Column WHERE AD_Column_ID=58573
;
-- 13.11.2009 15:02:11 MEZ
INSERT INTO AD_Element (AD_Org_ID,AD_Element_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,AD_Client_ID,UpdatedBy) VALUES (0,54071,'AD_Reference_Source_ID',TO_TIMESTAMP('2009-11-13 15:02:08','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Source Reference','Source Reference',TO_TIMESTAMP('2009-11-13 15:02:08','YYYY-MM-DD HH24:MI:SS'),0,100)
;
-- 13.11.2009 15:02:11 MEZ
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=54071 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 13.11.2009 15:02:32 MEZ
INSERT INTO AD_Element (AD_Org_ID,AD_Element_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,AD_Client_ID,UpdatedBy) VALUES (0,54072,'AD_Reference_Target_ID',TO_TIMESTAMP('2009-11-13 15:02:30','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Target Reference','Target Reference',TO_TIMESTAMP('2009-11-13 15:02:30','YYYY-MM-DD HH24:MI:SS'),0,100)
;
-- 13.11.2009 15:02:32 MEZ
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=54072 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 13.11.2009 15:03:03 MEZ
INSERT INTO AD_Element (AD_Org_ID,AD_Element_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,AD_Client_ID,UpdatedBy) VALUES (0,54073,'Role_Source',TO_TIMESTAMP('2009-11-13 15:02:58','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Source Role','Source Role',TO_TIMESTAMP('2009-11-13 15:02:58','YYYY-MM-DD HH24:MI:SS'),0,100)
;
-- 13.11.2009 15:03:03 MEZ
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=54073 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 13.11.2009 15:04:41 MEZ
INSERT INTO AD_Element (AD_Org_ID,AD_Element_ID,ColumnName,Created,CreatedBy,Description,EntityType,IsActive,Name,PrintName,Updated,AD_Client_ID,UpdatedBy) VALUES (0,54074,'IsDirected',TO_TIMESTAMP('2009-11-13 15:04:41','YYYY-MM-DD HH24:MI:SS'),100,'Tells whether one "sees" the other end of the relation from each end or just from the source','D','Y','Directed','Directed',TO_TIMESTAMP('2009-11-13 15:04:41','YYYY-MM-DD HH24:MI:SS'),0,100)
;
-- 13.11.2009 15:04:41 MEZ
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=54074 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 13.11.2009 15:05:49 MEZ
INSERT INTO AD_Reference (AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType,AD_Client_ID) VALUES (0,53330,TO_TIMESTAMP('2009-11-13 15:05:49','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N','AD_Reference Table',TO_TIMESTAMP('2009-11-13 15:05:49','YYYY-MM-DD HH24:MI:SS'),100,'T',0)
;
-- 13.11.2009 15:05:49 MEZ
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=53330 AND NOT EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 13.11.2009 15:06:48 MEZ
INSERT INTO AD_Ref_Table (AD_Display,AD_Key,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,Updated,UpdatedBy,AD_Client_ID,WhereClause,AD_Reference_ID,AD_Table_ID) VALUES (130,129,0,TO_TIMESTAMP('2009-11-13 15:06:48','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N',TO_TIMESTAMP('2009-11-13 15:06:48','YYYY-MM-DD HH24:MI:SS'),100,0,'AD_Reference.ValidationType=''T''
AND exists ( /* reference must have an active AD_Ref_Table entry */
select * from AD_Ref_Table t
where t.AD_Reference_ID=AD_Reference.AD_Reference_ID
and t.IsActive=''Y''
)',53330,102)
;
-- 13.11.2009 15:07:12 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Reference_Value_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,53330,54071,18,53246,'AD_Reference_Source_ID',TO_TIMESTAMP('2009-11-13 15:07:12','YYYY-MM-DD HH24:MI:SS'),100,'U',10,'Y','Y','N','N','N','N','N','N','N','N','N','N','Y','Source Reference',0,TO_TIMESTAMP('2009-11-13 15:07:12','YYYY-MM-DD HH24:MI:SS'),100,0,0,58582)
;
-- 13.11.2009 15:07:12 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58582 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:07:34 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Reference_Value_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,53330,54072,18,53246,'AD_Reference_Target_ID',TO_TIMESTAMP('2009-11-13 15:07:33','YYYY-MM-DD HH24:MI:SS'),100,'U',10,'Y','Y','N','N','N','N','N','N','N','N','N','N','Y','Target Reference',0,TO_TIMESTAMP('2009-11-13 15:07:33','YYYY-MM-DD HH24:MI:SS'),100,0,0,58583)
;
-- 13.11.2009 15:07:34 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58583 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:08:12 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,DefaultValue,Description,EntityType,FieldLength,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,54074,20,53246,'IsDirected',TO_TIMESTAMP('2009-11-13 15:08:11','YYYY-MM-DD HH24:MI:SS'),100,'N','Tells whether one "sees" the other end of the relation from each end or just from the source','U',1,'Y','Y','N','N','N','N','N','Y','N','N','N','N','Y','Directed',0,TO_TIMESTAMP('2009-11-13 15:08:11','YYYY-MM-DD HH24:MI:SS'),100,0,0,58584)
;
-- 13.11.2009 15:08:12 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58584 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:09:50 MEZ
INSERT INTO AD_Reference (AD_Org_ID,AD_Reference_ID,Created,CreatedBy,Description,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType,AD_Client_ID) VALUES (0,53331,TO_TIMESTAMP('2009-11-13 15:09:50','YYYY-MM-DD HH24:MI:SS'),100,'Defines the possible "roles" a the records of a relation can have','D','Y','N','AD_RelationType Role',TO_TIMESTAMP('2009-11-13 15:09:50','YYYY-MM-DD HH24:MI:SS'),100,'L',0)
;
-- 13.11.2009 15:09:50 MEZ
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=53331 AND NOT EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 13.11.2009 15:10:12 MEZ
INSERT INTO AD_Ref_List (AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,AD_Client_ID,Value) VALUES (0,53331,53552,TO_TIMESTAMP('2009-11-13 15:10:11','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Order',TO_TIMESTAMP('2009-11-13 15:10:11','YYYY-MM-DD HH24:MI:SS'),100,0,'Order')
;
-- 13.11.2009 15:10:12 MEZ
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=53552 AND NOT EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 13.11.2009 15:10:21 MEZ
INSERT INTO AD_Ref_List (AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,AD_Client_ID,Value) VALUES (0,53331,53553,TO_TIMESTAMP('2009-11-13 15:10:21','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Invoice',TO_TIMESTAMP('2009-11-13 15:10:21','YYYY-MM-DD HH24:MI:SS'),100,0,'Invoice')
;
-- 13.11.2009 15:10:21 MEZ
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=53553 AND NOT EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 13.11.2009 15:10:58 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Reference_Value_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,53331,54073,17,53246,'Role_Source',TO_TIMESTAMP('2009-11-13 15:10:57','YYYY-MM-DD HH24:MI:SS'),100,'U',50,'Y','Y','N','N','N','N','N','Y','N','N','N','N','Y','Source Role',0,TO_TIMESTAMP('2009-11-13 15:10:57','YYYY-MM-DD HH24:MI:SS'),100,0,0,58585)
;
-- 13.11.2009 15:10:58 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58585 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:12:02 MEZ
INSERT INTO AD_Element (AD_Org_ID,AD_Element_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,AD_Client_ID,UpdatedBy) VALUES (0,54075,'Role_Target',TO_TIMESTAMP('2009-11-13 15:12:01','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Target Role','Target Role',TO_TIMESTAMP('2009-11-13 15:12:01','YYYY-MM-DD HH24:MI:SS'),0,100)
;
-- 13.11.2009 15:12:02 MEZ
INSERT INTO AD_Element_Trl (AD_Language,AD_Element_ID, Description,Help,Name,PO_Description,PO_Help,PO_Name,PO_PrintName,PrintName, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Element_ID, t.Description,t.Help,t.Name,t.PO_Description,t.PO_Help,t.PO_Name,t.PO_PrintName,t.PrintName, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Element t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Element_ID=54075 AND NOT EXISTS (SELECT * FROM AD_Element_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Element_ID=t.AD_Element_ID)
;
-- 13.11.2009 15:12:35 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Reference_Value_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,53331,54075,17,53246,'Role_Target',TO_TIMESTAMP('2009-11-13 15:12:35','YYYY-MM-DD HH24:MI:SS'),100,'U',50,'Y','Y','N','N','N','N','N','N','N','N','N','N','Y','Target Role',0,TO_TIMESTAMP('2009-11-13 15:12:35','YYYY-MM-DD HH24:MI:SS'),100,0,0,58586)
;
-- 13.11.2009 15:12:35 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58586 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:12:38 MEZ
UPDATE AD_Column SET IsMandatory='Y',Updated=TO_TIMESTAMP('2009-11-13 15:12:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=58586
;
-- 13.11.2009 15:15:10 MEZ
INSERT INTO AD_Reference (AD_Org_ID,AD_Reference_ID,Created,CreatedBy,Description,EntityType,Help,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType,AD_Client_ID) VALUES (0,53332,TO_TIMESTAMP('2009-11-13 15:15:09','YYYY-MM-DD HH24:MI:SS'),100,'"Type" of a relation type','D','For now we only have implicit realtion types, i.e. the record pairs are defined by the rule itself. In future we would like to have explicit type also. An explizit type just defines a template, the actual pairs can be added by a user or by the system itself.','Y','N','AD_RelationType Type',TO_TIMESTAMP('2009-11-13 15:15:09','YYYY-MM-DD HH24:MI:SS'),100,'L',0)
;
-- 13.11.2009 15:15:10 MEZ
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=53332 AND NOT EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 13.11.2009 15:15:32 MEZ
INSERT INTO AD_Ref_List (AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,Description,EntityType,IsActive,Name,Updated,UpdatedBy,AD_Client_ID,Value) VALUES (0,53332,53554,TO_TIMESTAMP('2009-11-13 15:15:31','YYYY-MM-DD HH24:MI:SS'),100,NULL,'D','Y','Implicit',TO_TIMESTAMP('2009-11-13 15:15:31','YYYY-MM-DD HH24:MI:SS'),100,0,'I')
;
-- 13.11.2009 15:15:32 MEZ
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=53554 AND NOT EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 13.11.2009 15:16:19 MEZ
INSERT INTO AD_Ref_List (AD_Org_ID,AD_Reference_ID,AD_Ref_List_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,AD_Client_ID,Value) VALUES (0,53332,53555,TO_TIMESTAMP('2009-11-13 15:16:19','YYYY-MM-DD HH24:MI:SS'),100,'D','N','Explicit',TO_TIMESTAMP('2009-11-13 15:16:19','YYYY-MM-DD HH24:MI:SS'),100,0,'E')
;
-- 13.11.2009 15:16:19 MEZ
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=53555 AND NOT EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
-- 13.11.2009 15:16:40 MEZ
INSERT INTO AD_Column (AD_Org_ID,AD_Reference_Value_ID,AD_Element_ID,AD_Reference_ID,AD_Table_ID,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAllowLogging,IsAlwaysUpdateable,IsAutocomplete,IsEncrypted,IsIdentifier,IsKey,IsMandatory,IsParent,IsSelectionColumn,IsSyncDatabase,IsTranslated,IsUpdateable,Name,SeqNo,Updated,UpdatedBy,Version,AD_Client_ID,AD_Column_ID) VALUES (0,53332,600,17,53246,'Type',TO_TIMESTAMP('2009-11-13 15:16:39','YYYY-MM-DD HH24:MI:SS'),100,'Type of Validation (SQL, Java Script, Java Language)','U',1,'The Type indicates the type of validation that will occur. This can be SQL, Java Script or Java Language.','Y','Y','N','N','N','N','N','Y','N','N','N','N','Y','Type',0,TO_TIMESTAMP('2009-11-13 15:16:39','YYYY-MM-DD HH24:MI:SS'),100,0,0,58587)
;
-- 13.11.2009 15:16:40 MEZ
INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Column_ID, t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=58587 AND NOT EXISTS (SELECT * FROM AD_Column_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Column_ID=t.AD_Column_ID)
;
-- 13.11.2009 15:16:56 MEZ
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2009-11-13 15:16:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=58587
;
-- 13.11.2009 15:16:59 MEZ
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2009-11-13 15:16:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=58586
;
-- 13.11.2009 15:17:02 MEZ
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2009-11-13 15:17:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=58585
;
-- 13.11.2009 15:17:05 MEZ
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2009-11-13 15:17:05','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=58584
;
-- 13.11.2009 15:17:11 MEZ
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2009-11-13 15:17:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=58583
;
-- 13.11.2009 15:17:33 MEZ
UPDATE AD_Column SET EntityType='D',Updated=TO_TIMESTAMP('2009-11-13 15:17:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=58582
;
-- 13.11.2009 15:18:44 MEZ
INSERT INTO AD_Window (AD_Org_ID,AD_Window_ID,Created,CreatedBy,EntityType,IsActive,IsBetaFunctionality,IsDefault,IsSOTrx,Name,Processing,Updated,UpdatedBy,WindowType,WinHeight,AD_Client_ID,WinWidth) VALUES (0,53102,TO_TIMESTAMP('2009-11-13 15:18:43','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N','N','Y','Relation Type','N',TO_TIMESTAMP('2009-11-13 15:18:43','YYYY-MM-DD HH24:MI:SS'),100,'M',0,0,0)
;
-- 13.11.2009 15:18:44 MEZ
INSERT INTO AD_Window_Trl (AD_Language,AD_Window_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Window_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Window t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Window_ID=53102 AND NOT EXISTS (SELECT * FROM AD_Window_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Window_ID=t.AD_Window_ID)
;
-- 13.11.2009 15:19:04 MEZ
UPDATE AD_Table SET AD_Window_ID=53102,Updated=TO_TIMESTAMP('2009-11-13 15:19:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=53246
;
-- 13.11.2009 15:19:44 MEZ
INSERT INTO AD_Tab (AD_Org_ID,CreatedBy,EntityType,HasTree,ImportFields,IsActive,IsAdvancedTab,IsInfoTab,IsInsertRecord,IsReadOnly,IsSingleRow,IsSortTab,IsTranslationTab,Name,Processing,SeqNo,TabLevel,Updated,UpdatedBy,AD_Client_ID,AD_Tab_ID,AD_Table_ID,AD_Window_ID,Created) VALUES (0,100,'D','N','N','Y','N','N','Y','N','N','N','N','Relation Type','N',10,0,TO_TIMESTAMP('2009-11-13 15:19:43','YYYY-MM-DD HH24:MI:SS'),100,0,53285,53246,53102,TO_TIMESTAMP('2009-11-13 15:19:43','YYYY-MM-DD HH24:MI:SS'))
;
-- 13.11.2009 15:19:44 MEZ
INSERT INTO AD_Tab_Trl (AD_Language,AD_Tab_ID, Description,Help,Name,CommitWarning, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Tab_ID, t.Description,t.Help,t.Name,t.CommitWarning, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Tab t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Tab_ID=53285 AND NOT EXISTS (SELECT * FROM AD_Tab_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Tab_ID=t.AD_Tab_ID)
;
-- 13.11.2009 15:20:14 MEZ
INSERT INTO AD_Field (AD_Column_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,AD_Client_ID,UpdatedBy,AD_Field_ID) VALUES (58578,0,53285,TO_TIMESTAMP('2009-11-13 15:20:13','YYYY-MM-DD HH24:MI:SS'),100,'The record is active in the system',1,'D','There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reports.
There are two reasons for de-activating and not deleting records:
(1) The system requires the record for audit purposes.
(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are invoices for this partner record existing. You de-activate the Business Partner and prevent that this record is used for future entries.','Y','Y','Y','N','N','N','N','N','Active',TO_TIMESTAMP('2009-11-13 15:20:13','YYYY-MM-DD HH24:MI:SS'),0,100,58064)
;
-- 13.11.2009 15:20:14 MEZ
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=58064 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 13.11.2009 15:20:15 MEZ
INSERT INTO AD_Field (AD_Column_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,AD_Client_ID,UpdatedBy,AD_Field_ID) VALUES (58571,0,53285,TO_TIMESTAMP('2009-11-13 15:20:14','YYYY-MM-DD HH24:MI:SS'),100,'Client/Tenant for this installation.',22,'D','A Client is a company or a legal entity. You cannot share data between Clients. Tenant is a synonym for Client.','Y','Y','Y','N','N','N','N','N','Client',TO_TIMESTAMP('2009-11-13 15:20:14','YYYY-MM-DD HH24:MI:SS'),0,100,58065)
;
-- 13.11.2009 15:20:15 MEZ
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=58065 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 13.11.2009 15:20:15 MEZ
INSERT INTO AD_Field (AD_Column_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,AD_Client_ID,UpdatedBy,AD_Field_ID) VALUES (58577,0,53285,TO_TIMESTAMP('2009-11-13 15:20:15','YYYY-MM-DD HH24:MI:SS'),100,'Optional short description of the record',255,'D','A description is limited to 255 characters.','Y','Y','Y','N','N','N','N','N','Description',TO_TIMESTAMP('2009-11-13 15:20:15','YYYY-MM-DD HH24:MI:SS'),0,100,58066)
;
-- 13.11.2009 15:20:15 MEZ
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=58066 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 13.11.2009 15:20:16 MEZ
INSERT INTO AD_Field (AD_Column_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,AD_Client_ID,UpdatedBy,AD_Field_ID) VALUES (58584,0,53285,TO_TIMESTAMP('2009-11-13 15:20:15','YYYY-MM-DD HH24:MI:SS'),100,'Tells whether one "sees" the other end of the relation from each end or just from the source',1,'D','Y','Y','Y','N','N','N','N','N','Directed',TO_TIMESTAMP('2009-11-13 15:20:15','YYYY-MM-DD HH24:MI:SS'),0,100,58067)
;
-- 13.11.2009 15:20:16 MEZ
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=58067 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 13.11.2009 15:20:16 MEZ
INSERT INTO AD_Field (AD_Column_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,AD_Client_ID,UpdatedBy,AD_Field_ID) VALUES (58579,0,53285,TO_TIMESTAMP('2009-11-13 15:20:16','YYYY-MM-DD HH24:MI:SS'),100,'Alphanumeric identifier of the entity',60,'D','The name of an entity (record) is used as an default search option in addition to the search key. The name is up to 60 characters in length.','Y','Y','Y','N','N','N','N','N','Name',TO_TIMESTAMP('2009-11-13 15:20:16','YYYY-MM-DD HH24:MI:SS'),0,100,58068)
;
-- 13.11.2009 15:20:16 MEZ
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=58068 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 13.11.2009 15:20:17 MEZ
INSERT INTO AD_Field (AD_Column_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,AD_Client_ID,UpdatedBy,AD_Field_ID) VALUES (58572,0,53285,TO_TIMESTAMP('2009-11-13 15:20:16','YYYY-MM-DD HH24:MI:SS'),100,'Organizational entity within client',22,'D','An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.','Y','Y','Y','N','N','N','N','N','Organization',TO_TIMESTAMP('2009-11-13 15:20:16','YYYY-MM-DD HH24:MI:SS'),0,100,58069)
;
-- 13.11.2009 15:20:17 MEZ
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=58069 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 13.11.2009 15:20:17 MEZ
INSERT INTO AD_Field (AD_Column_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,AD_Client_ID,UpdatedBy,AD_Field_ID) VALUES (58574,0,53285,TO_TIMESTAMP('2009-11-13 15:20:17','YYYY-MM-DD HH24:MI:SS'),100,22,'D','Y','Y','N','N','N','N','N','N','Relation Type',TO_TIMESTAMP('2009-11-13 15:20:17','YYYY-MM-DD HH24:MI:SS'),0,100,58070)
;
-- 13.11.2009 15:20:17 MEZ
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=58070 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 13.11.2009 15:20:18 MEZ
INSERT INTO AD_Field (AD_Column_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,AD_Client_ID,UpdatedBy,AD_Field_ID) VALUES (58582,0,53285,TO_TIMESTAMP('2009-11-13 15:20:17','YYYY-MM-DD HH24:MI:SS'),100,10,'D','Y','Y','Y','N','N','N','N','N','Source Reference',TO_TIMESTAMP('2009-11-13 15:20:17','YYYY-MM-DD HH24:MI:SS'),0,100,58071)
;
-- 13.11.2009 15:20:18 MEZ
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=58071 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 13.11.2009 15:20:19 MEZ
INSERT INTO AD_Field (AD_Column_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,AD_Client_ID,UpdatedBy,AD_Field_ID) VALUES (58585,0,53285,TO_TIMESTAMP('2009-11-13 15:20:18','YYYY-MM-DD HH24:MI:SS'),100,50,'D','Y','Y','Y','N','N','N','N','N','Source Role',TO_TIMESTAMP('2009-11-13 15:20:18','YYYY-MM-DD HH24:MI:SS'),0,100,58072)
;
-- 13.11.2009 15:20:19 MEZ
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=58072 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 13.11.2009 15:20:19 MEZ
INSERT INTO AD_Field (AD_Column_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,AD_Client_ID,UpdatedBy,AD_Field_ID) VALUES (58583,0,53285,TO_TIMESTAMP('2009-11-13 15:20:19','YYYY-MM-DD HH24:MI:SS'),100,10,'D','Y','Y','Y','N','N','N','N','N','Target Reference',TO_TIMESTAMP('2009-11-13 15:20:19','YYYY-MM-DD HH24:MI:SS'),0,100,58073)
;
-- 13.11.2009 15:20:19 MEZ
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=58073 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 13.11.2009 15:20:20 MEZ
INSERT INTO AD_Field (AD_Column_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,DisplayLength,EntityType,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,AD_Client_ID,UpdatedBy,AD_Field_ID) VALUES (58586,0,53285,TO_TIMESTAMP('2009-11-13 15:20:19','YYYY-MM-DD HH24:MI:SS'),100,50,'D','Y','Y','Y','N','N','N','N','N','Target Role',TO_TIMESTAMP('2009-11-13 15:20:19','YYYY-MM-DD HH24:MI:SS'),0,100,58074)
;
-- 13.11.2009 15:20:20 MEZ
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=58074 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 13.11.2009 15:20:20 MEZ
INSERT INTO AD_Field (AD_Column_ID,AD_Org_ID,AD_Tab_ID,Created,CreatedBy,Description,DisplayLength,EntityType,Help,IsActive,IsCentrallyMaintained,IsDisplayed,IsEncrypted,IsFieldOnly,IsHeading,IsReadOnly,IsSameLine,Name,Updated,AD_Client_ID,UpdatedBy,AD_Field_ID) VALUES (58587,0,53285,TO_TIMESTAMP('2009-11-13 15:20:20','YYYY-MM-DD HH24:MI:SS'),100,'Type of Validation (SQL, Java Script, Java Language)',1,'D','The Type indicates the type of validation that will occur. This can be SQL, Java Script or Java Language.','Y','Y','Y','N','N','N','N','N','Type',TO_TIMESTAMP('2009-11-13 15:20:20','YYYY-MM-DD HH24:MI:SS'),0,100,58075)
;
-- 13.11.2009 15:20:20 MEZ
INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Field_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=58075 AND NOT EXISTS (SELECT * FROM AD_Field_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Field_ID=t.AD_Field_ID)
;
-- 13.11.2009 15:21:25 MEZ
UPDATE AD_Field SET SeqNo=10,IsDisplayed='Y' WHERE AD_Field_ID=58065
;
-- 13.11.2009 15:21:25 MEZ
UPDATE AD_Field SET SeqNo=20,IsDisplayed='Y' WHERE AD_Field_ID=58069
;
-- 13.11.2009 15:21:25 MEZ
UPDATE AD_Field SET SeqNo=30,IsDisplayed='Y' WHERE AD_Field_ID=58068
;
-- 13.11.2009 15:21:25 MEZ
UPDATE AD_Field SET SeqNo=40,IsDisplayed='Y' WHERE AD_Field_ID=58064
;
-- 13.11.2009 15:21:25 MEZ
UPDATE AD_Field SET SeqNo=50,IsDisplayed='Y' WHERE AD_Field_ID=58066
;
-- 13.11.2009 15:21:25 MEZ
UPDATE AD_Field SET SeqNo=60,IsDisplayed='Y' WHERE AD_Field_ID=58067
;
-- 13.11.2009 15:21:25 MEZ
UPDATE AD_Field SET SeqNo=70,IsDisplayed='Y' WHERE AD_Field_ID=58075
;
-- 13.11.2009 15:21:25 MEZ
UPDATE AD_Field SET SeqNo=80,IsDisplayed='Y' WHERE AD_Field_ID=58071
;
-- 13.11.2009 15:21:25 MEZ
UPDATE AD_Field SET SeqNo=90,IsDisplayed='Y' WHERE AD_Field_ID=58072
;
-- 13.11.2009 15:21:25 MEZ
UPDATE AD_Field SET SeqNo=100,IsDisplayed='Y' WHERE AD_Field_ID=58073
;
-- 13.11.2009 15:21:25 MEZ
UPDATE AD_Field SET SeqNo=110,IsDisplayed='Y' WHERE AD_Field_ID=58074
;
-- 13.11.2009 15:21:38 MEZ
UPDATE AD_Field SET IsSameLine='Y',Updated=TO_TIMESTAMP('2009-11-13 15:21:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58064
;
-- 13.11.2009 15:21:52 MEZ
UPDATE AD_Field SET IsSameLine='Y',Updated=TO_TIMESTAMP('2009-11-13 15:21:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58072
;
-- 13.11.2009 15:21:57 MEZ
UPDATE AD_Field SET IsSameLine='Y',Updated=TO_TIMESTAMP('2009-11-13 15:21:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58074
;
-- 13.11.2009 15:22:03 MEZ
UPDATE AD_Field SET IsSameLine='Y',Updated=TO_TIMESTAMP('2009-11-13 15:22:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=58075
;
-- 13.11.2009 15:22:46 MEZ
INSERT INTO AD_Menu (AD_Org_ID,AD_Client_ID,AD_Menu_ID,AD_Window_ID,Created,CreatedBy,EntityType,IsActive,IsReadOnly,IsSOTrx,IsSummary,Name,Updated,Action,UpdatedBy) VALUES (0,0,53251,53102,TO_TIMESTAMP('2009-11-13 15:22:45','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N','N','N','Relation Type',TO_TIMESTAMP('2009-11-13 15:22:45','YYYY-MM-DD HH24:MI:SS'),'W',100)
;
-- 13.11.2009 15:22:46 MEZ
INSERT INTO AD_Menu_Trl (AD_Language,AD_Menu_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Menu_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Menu t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Menu_ID=53251 AND NOT EXISTS (SELECT * FROM AD_Menu_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Menu_ID=t.AD_Menu_ID)
;
-- 13.11.2009 15:22:46 MEZ
INSERT INTO AD_TreeNodeMM (AD_Client_ID,AD_Org_ID, IsActive,Created,CreatedBy,Updated,UpdatedBy, AD_Tree_ID, Node_ID, Parent_ID, SeqNo) SELECT t.AD_Client_ID, 0, 'Y', CURRENT_TIMESTAMP, 100, CURRENT_TIMESTAMP, 100,t.AD_Tree_ID, 53251, 0, 999 FROM AD_Tree t WHERE t.AD_Client_ID=0 AND t.IsActive='Y' AND t.IsAllNodes='Y' AND t.TreeType='MM' AND NOT EXISTS (SELECT * FROM AD_TreeNodeMM e WHERE e.AD_Tree_ID=t.AD_Tree_ID AND Node_ID=53251)
;
-- 13.11.2009 15:22:54 MEZ
UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=0, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53251
;
-- 13.11.2009 15:22:54 MEZ
UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=1, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=155
;
-- 13.11.2009 15:22:54 MEZ
UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=2, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=156
;
-- 13.11.2009 15:22:54 MEZ
UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=3, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=175
;
-- 13.11.2009 15:22:54 MEZ
UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=4, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=157
;
-- 13.11.2009 15:22:54 MEZ
UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=5, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=552
;
-- 13.11.2009 15:22:59 MEZ
UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=0, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53251
;
-- 13.11.2009 15:22:59 MEZ
UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=1, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=155
;
-- 13.11.2009 15:22:59 MEZ
UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=2, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=156
;
-- 13.11.2009 15:22:59 MEZ
UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=3, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=175
;
-- 13.11.2009 15:22:59 MEZ
UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=4, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=157
;
-- 13.11.2009 15:22:59 MEZ
UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=5, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=53251
;
-- 13.11.2009 15:22:59 MEZ
UPDATE AD_TreeNodeMM SET Parent_ID=218, SeqNo=6, Updated=CURRENT_TIMESTAMP WHERE AD_Tree_ID=10 AND Node_ID=552
;
-- 13.11.2009 15:25:11 MEZ
UPDATE AD_Column SET DefaultValue='I',Updated=TO_TIMESTAMP('2009-11-13 15:25:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=58587
;
-- 13.11.2009 15:26:25 MEZ
INSERT INTO AD_Reference (AD_Org_ID,AD_Reference_ID,Created,CreatedBy,Description,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType,AD_Client_ID) VALUES (0,53333,TO_TIMESTAMP('2009-11-13 15:26:25','YYYY-MM-DD HH24:MI:SS'),100,'Finds C_OrderIDs for a given C_Invoice_ID','D','Y','N','RelType C_Invoice_ID->C_Order',TO_TIMESTAMP('2009-11-13 15:26:25','YYYY-MM-DD HH24:MI:SS'),100,'T',0)
;
-- 13.11.2009 15:26:25 MEZ
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=53333 AND NOT EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 13.11.2009 15:27:09 MEZ
INSERT INTO AD_Ref_Table (AD_Display,AD_Key,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,OrderByClause,Updated,UpdatedBy,AD_Client_ID,WhereClause,AD_Reference_ID,AD_Table_ID) VALUES (2169,2161,0,TO_TIMESTAMP('2009-11-13 15:27:09','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N','DocumentNo',TO_TIMESTAMP('2009-11-13 15:27:09','YYYY-MM-DD HH24:MI:SS'),100,0,'C_Order_ID IN (
select o.c_order_id from c_order o
left join c_orderline ol on o.c_order_id = ol.c_order_id
left join c_invoiceline il on ol.c_orderline_id = il.c_orderline_id
where il.C_Invoice_ID=@C_Invoice_ID@
)',53333,259)
;
-- 13.11.2009 15:27:40 MEZ
INSERT INTO AD_Reference (AD_Org_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,IsOrderByValue,Name,Updated,UpdatedBy,ValidationType,AD_Client_ID) VALUES (0,53334,TO_TIMESTAMP('2009-11-13 15:27:40','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N','RelType C_Order_ID->C_Invoice',TO_TIMESTAMP('2009-11-13 15:27:40','YYYY-MM-DD HH24:MI:SS'),100,'T',0)
;
-- 13.11.2009 15:27:40 MEZ
INSERT INTO AD_Reference_Trl (AD_Language,AD_Reference_ID, Description,Help,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Reference_ID, t.Description,t.Help,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Reference t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Reference_ID=53334 AND NOT EXISTS (SELECT * FROM AD_Reference_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Reference_ID=t.AD_Reference_ID)
;
-- 13.11.2009 15:28:08 MEZ
UPDATE AD_Reference SET Description='Finds C_Invoice_IDs for a given C_C_Order_ID',Updated=TO_TIMESTAMP('2009-11-13 15:28:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=53334
;
-- 13.11.2009 15:28:08 MEZ
UPDATE AD_Reference_Trl SET IsTranslated='N' WHERE AD_Reference_ID=53334
;
-- 13.11.2009 15:28:14 MEZ
UPDATE AD_Reference SET Description='Finds C_Order_IDs for a given C_Invoice_ID',Updated=TO_TIMESTAMP('2009-11-13 15:28:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Reference_ID=53333
;
-- 13.11.2009 15:28:14 MEZ
UPDATE AD_Reference_Trl SET IsTranslated='N' WHERE AD_Reference_ID=53333
;
-- 13.11.2009 15:29:23 MEZ
INSERT INTO AD_Ref_Table (AD_Display,AD_Key,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,IsValueDisplayed,OrderByClause,Updated,UpdatedBy,AD_Client_ID,WhereClause,AD_Reference_ID,AD_Table_ID) VALUES (3492,3484,0,TO_TIMESTAMP('2009-11-13 15:29:23','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','N','DocumentNo',TO_TIMESTAMP('2009-11-13 15:29:23','YYYY-MM-DD HH24:MI:SS'),100,0,'C_Invoice_ID IN (
select i.C_Invoice_ID from C_Invoice i
left join C_InvoiceLine il on il.C_Invoice_ID = i.C_Invoice_ID
left join C_OrderLine ol on ol.C_OrderLine_ID = il.C_OrderLine_ID
where ol.C_Order_ID=@C_Order_ID@
)',53334,318)
;
-- 13.11.2009 15:30:58 MEZ
CREATE TABLE AD_RelationType (AD_Client_ID NUMERIC(10) NOT NULL, AD_Org_ID NUMERIC(10) NOT NULL, AD_Reference_Source_ID NUMERIC(10) DEFAULT NULL , AD_Reference_Target_ID NUMERIC(10) DEFAULT NULL , AD_RelationType_ID NUMERIC(10) NOT NULL, Created TIMESTAMP NOT NULL, CreatedBy NUMERIC(10) NOT NULL, Description VARCHAR(255) DEFAULT NULL , IsActive CHAR(1) DEFAULT 'Y' CHECK (IsActive IN ('Y','N')) NOT NULL, IsDirected CHAR(1) DEFAULT 'N' CHECK (IsDirected IN ('Y','N')) NOT NULL, Name VARCHAR(60) NOT NULL, Role_Source VARCHAR(50) NOT NULL, Role_Target VARCHAR(50) NOT NULL, Type CHAR(1) DEFAULT 'I' NOT NULL, Updated TIMESTAMP NOT NULL, UpdatedBy NUMERIC(10) NOT NULL, CONSTRAINT AD_RelationType_Key PRIMARY KEY (AD_RelationType_ID))
;
-- 13.11.2009 15:49:25 MEZ
INSERT INTO AD_Message (AD_Org_ID,AD_Message_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,AD_Client_ID,Value) VALUES (0,53088,TO_TIMESTAMP('2009-11-13 15:49:24','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','PO {0} has {1} key columns. Needs to have exactly one.','E',TO_TIMESTAMP('2009-11-13 15:49:24','YYYY-MM-DD HH24:MI:SS'),100,0,'MRelationType_Err_KeyColumns_2P')
;
-- 13.11.2009 15:49:25 MEZ
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=53088 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
;
-- 13.11.2009 15:51:17 MEZ
INSERT INTO AD_Message (AD_Org_ID,AD_Message_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,AD_Client_ID,Value) VALUES (0,53089,TO_TIMESTAMP('2009-11-13 15:51:16','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','Neither reference {0} nor table {1} have an AD_Window_ID. IsSOTrx: {2}','E',TO_TIMESTAMP('2009-11-13 15:51:16','YYYY-MM-DD HH24:MI:SS'),100,0,'MRelationType_Err_Window_3P')
;
-- 13.11.2009 15:51:17 MEZ
INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Message_ID, t.MsgText,t.MsgTip, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=53089 AND NOT EXISTS (SELECT * FROM AD_Message_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Message_ID=t.AD_Message_ID)
;
-- 16.11.2009 17:42:58 MEZ
UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2009-11-16 17:42:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=58585
;
-- 16.11.2009 17:43:02 MEZ
INSERT INTO t_alter_column values('ad_relationtype','Role_Source','VARCHAR(50)',null,'NULL')
;
-- 16.11.2009 17:43:02 MEZ
INSERT INTO t_alter_column values('ad_relationtype','Role_Source',null,'NULL',null)
;
-- 16.11.2009 17:43:17 MEZ
UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2009-11-16 17:43:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=58586
;
-- 16.11.2009 17:43:18 MEZ
INSERT INTO t_alter_column values('ad_relationtype','Role_Target','VARCHAR(50)',null,'NULL')
;
-- 16.11.2009 17:43:18 MEZ
INSERT INTO t_alter_column values('ad_relationtype','Role_Target',null,'NULL',null)
;
-- 16.11.2009 17:45:03 MEZ
UPDATE AD_Element SET Description='If set, this role will be used as label for the zoom target instead of the zoom target''s window name',Updated=TO_TIMESTAMP('2009-11-16 17:45:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=54075
;
-- 16.11.2009 17:45:03 MEZ
UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=54075
;
-- 16.11.2009 17:45:03 MEZ
UPDATE AD_Column SET ColumnName='Role_Target', Name='Target Role', Description='If set, this role will be used as label for the zoom target instead of the zoom target''s window name', Help=NULL WHERE AD_Element_ID=54075
;
-- 16.11.2009 17:45:03 MEZ
UPDATE AD_Process_Para SET ColumnName='Role_Target', Name='Target Role', Description='If set, this role will be used as label for the zoom target instead of the zoom target''s window name', Help=NULL, AD_Element_ID=54075 WHERE UPPER(ColumnName)='ROLE_TARGET' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 16.11.2009 17:45:03 MEZ
UPDATE AD_Process_Para SET ColumnName='Role_Target', Name='Target Role', Description='If set, this role will be used as label for the zoom target instead of the zoom target''s window name', Help=NULL WHERE AD_Element_ID=54075 AND IsCentrallyMaintained='Y'
;
-- 16.11.2009 17:45:03 MEZ
UPDATE AD_Field SET Name='Target Role', Description='If set, this role will be used as label for the zoom target instead of the zoom target''s window name', Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=54075) AND IsCentrallyMaintained='Y'
;
-- 16.11.2009 17:45:25 MEZ
UPDATE AD_Element SET Description='If set, this role will be used as label for the zoom destination instead of the destinations''s window name',Updated=TO_TIMESTAMP('2009-11-16 17:45:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=54075
;
-- 16.11.2009 17:45:25 MEZ
UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=54075
;
-- 16.11.2009 17:45:25 MEZ
UPDATE AD_Column SET ColumnName='Role_Target', Name='Target Role', Description='If set, this role will be used as label for the zoom destination instead of the destinations''s window name', Help=NULL WHERE AD_Element_ID=54075
;
-- 16.11.2009 17:45:25 MEZ
UPDATE AD_Process_Para SET ColumnName='Role_Target', Name='Target Role', Description='If set, this role will be used as label for the zoom destination instead of the destinations''s window name', Help=NULL, AD_Element_ID=54075 WHERE UPPER(ColumnName)='ROLE_TARGET' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 16.11.2009 17:45:25 MEZ
UPDATE AD_Process_Para SET ColumnName='Role_Target', Name='Target Role', Description='If set, this role will be used as label for the zoom destination instead of the destinations''s window name', Help=NULL WHERE AD_Element_ID=54075 AND IsCentrallyMaintained='Y'
;
-- 16.11.2009 17:45:25 MEZ
UPDATE AD_Field SET Name='Target Role', Description='If set, this role will be used as label for the zoom destination instead of the destinations''s window name', Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=54075) AND IsCentrallyMaintained='Y'
;
-- 16.11.2009 17:45:40 MEZ
UPDATE AD_Element SET Description='If set, this role will be used as label for the zoom destination instead of the destinations''s window name',Updated=TO_TIMESTAMP('2009-11-16 17:45:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=54073
;
-- 16.11.2009 17:45:40 MEZ
UPDATE AD_Element_Trl SET IsTranslated='N' WHERE AD_Element_ID=54073
;
-- 16.11.2009 17:45:40 MEZ
UPDATE AD_Column SET ColumnName='Role_Source', Name='Source Role', Description='If set, this role will be used as label for the zoom destination instead of the destinations''s window name', Help=NULL WHERE AD_Element_ID=54073
;
-- 16.11.2009 17:45:40 MEZ
UPDATE AD_Process_Para SET ColumnName='Role_Source', Name='Source Role', Description='If set, this role will be used as label for the zoom destination instead of the destinations''s window name', Help=NULL, AD_Element_ID=54073 WHERE UPPER(ColumnName)='ROLE_SOURCE' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL
;
-- 16.11.2009 17:45:40 MEZ
UPDATE AD_Process_Para SET ColumnName='Role_Source', Name='Source Role', Description='If set, this role will be used as label for the zoom destination instead of the destinations''s window name', Help=NULL WHERE AD_Element_ID=54073 AND IsCentrallyMaintained='Y'
;
-- 16.11.2009 17:45:40 MEZ
UPDATE AD_Field SET Name='Source Role', Description='If set, this role will be used as label for the zoom destination instead of the destinations''s window name', Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=54073) AND IsCentrallyMaintained='Y'
;
-- 13.11.2009 15:31:34 MEZ
INSERT INTO AD_RelationType (AD_Org_ID,AD_Client_ID,AD_Reference_Target_ID,AD_RelationType_ID,Created,CreatedBy,IsActive,IsDirected,Name,Role_Source,Role_Target,Type,Updated,UpdatedBy,AD_Reference_Source_ID) VALUES (0,0,53334,50001,TO_TIMESTAMP('2009-11-13 15:31:33','YYYY-MM-DD HH24:MI:SS'),100,'Y','N','Order<->Invoice',NULL,NULL,'I',TO_TIMESTAMP('2009-11-13 15:31:33','YYYY-MM-DD HH24:MI:SS'),100,53333)
;

View File

@ -20,6 +20,7 @@ import java.sql.*;
import java.util.*;
import java.util.logging.*;
import org.adempiere.model.ZoomInfoFactory;
import org.adempiere.webui.apps.AEnv;
import org.compiere.model.*;
import org.compiere.util.*;
@ -41,197 +42,85 @@ import org.zkoss.zul.Menupopup;
*
* ZK Port
* @author Low Heng Sin
* @author Tobias Schoeneberg, www.metas.de - FR [ 2897194 ] Advanced Zoom and RelationTypes
*/
public class WZoomAcross implements EventListener
public class WZoomAcross
{
/**
* Constructor
* @param invoker component to display popup (optional)
* @param tableName table name
* @param query query
* @param tableName zoom source table (i.e. the table we start from)
* @param query query that specifies the zoom source PO (i.e. the PO we start from)
*/
public WZoomAcross (Component invoker, String tableName, MQuery query)
public WZoomAcross (Component invoker, String tableName, final int windowID, MQuery query)
{
log.config("TableName=" + tableName + " - " + query);
m_tableName = tableName;
m_query = query;
this(invoker, new Query(Env.getCtx(), tableName,
query.getWhereClause(), null).first(), windowID);
// See What is there
getZoomTargets (invoker, tableName);
} // AReport
}
/** The Query */
private MQuery m_query;
/** The Popup */
private Menupopup m_popup = new Menupopup(); //"ZoomMenu"
/** The Option List */
private ArrayList<KeyNamePair> m_list = new ArrayList<KeyNamePair>();
/** Logger */
private static CLogger log = CLogger.getCLogger(WZoomAcross.class);
/** Table Name */
private String m_tableName;
private ArrayList<String> m_targets = new ArrayList<String>();
public WZoomAcross(Component invoker, PO po, final int windowID) {
/**
* Get the Zomm Targets for the table.
* Fill the list and the popup menu
* @param invoker component to display popup (optional)
* @param tableName table
*/
private void getZoomTargets (Component invoker, String tableName)
{
String sql = "SELECT DISTINCT ws.AD_Window_ID,ws.Name, wp.AD_Window_ID,wp.Name, t.TableName "
+ "FROM AD_Table t ";
boolean baseLanguage = Env.isBaseLanguage(Env.getCtx(), "AD_Window");
if (baseLanguage)
sql += "INNER JOIN AD_Window ws ON (t.AD_Window_ID=ws.AD_Window_ID)"
+ " LEFT OUTER JOIN AD_Window wp ON (t.PO_Window_ID=wp.AD_Window_ID) ";
else
sql += "INNER JOIN AD_Window_Trl ws ON (t.AD_Window_ID=ws.AD_Window_ID AND ws.AD_Language=?)"
+ " LEFT OUTER JOIN AD_Window_Trl wp ON (t.PO_Window_ID=wp.AD_Window_ID AND wp.AD_Language=?) ";
//
sql += "WHERE t.TableName NOT LIKE 'I%'" // No Import
+ " AND EXISTS (SELECT * FROM AD_Tab tt " // First Tab
+ "WHERE (tt.AD_Window_ID=ws.AD_Window_ID OR tt.AD_Window_ID=wp.AD_Window_ID)"
+ " AND tt.AD_Table_ID=t.AD_Table_ID AND tt.SeqNo=10)"
+ " AND t.AD_Table_ID IN "
+ "(SELECT AD_Table_ID FROM AD_Column "
+ "WHERE ColumnName=? AND IsKey='N' AND IsParent='N') " // #x
+ "ORDER BY 2";
try
{
PreparedStatement pstmt = DB.prepareStatement(sql, null);
int index = 1;
if (!baseLanguage)
{
pstmt.setString (index++, Env.getAD_Language(Env.getCtx()));
pstmt.setString (index++, Env.getAD_Language(Env.getCtx()));
}
pstmt.setString (index++, tableName + "_ID");
ResultSet rs = pstmt.executeQuery();
while (rs.next())
{
int AD_Window_ID = rs.getInt(1);
String Name = rs.getString(2);
int PO_Window_ID = rs.getInt(3);
String targetTableName = rs.getString(5);
if (PO_Window_ID == 0)
addTarget(targetTableName, AD_Window_ID, Name, null);
else
addTarget(targetTableName, AD_Window_ID, Name, Boolean.TRUE);
// PO
if (PO_Window_ID != 0)
{
Name = rs.getString(4);
addTarget(targetTableName, PO_Window_ID, Name, Boolean.FALSE);
log.config("PO=" + po+", WindowID="+windowID);
mkZoomTargets(po, windowID);
for (final ZoomInfoFactory.ZoomInfo zoomInfo : zoomInfos) {
final String label = zoomInfo.destinationDisplay + " (#"
+ zoomInfo.query.getRecordCount() + ")";
final Menuitem menuItem = new Menuitem(label);
menuItem.addEventListener(Events.ON_CLICK, new EventListener() {
@Override
public void onEvent(Event event) throws Exception {
launchZoom(zoomInfo);
}
}
rs.close();
pstmt.close();
}
catch (SQLException e)
{
log.log(Level.SEVERE, sql, e);
});
m_popup.appendChild(menuItem);
}
// Begin - afalcone - Bug Fix [ 1659420 ] Usability: zoom across
/*
// No Zoom
if (m_list.size() == 0)
{
ADialog.info(0, invoker, "NoZoomTarget");
log.info("BaseLanguage=" + baseLanguage);
}
else if (invoker.isShowing())
m_popup.show(invoker, 0, invoker.getHeight()); // below button
*/
// No Zoom
if (m_list.size() == 0)
{
Menuitem menuItem = new Menuitem(Msg.getMsg(Env.getCtx(), "NoZoomTarget"));
if (zoomInfos.isEmpty()) {
final Menuitem menuItem = new Menuitem(Msg.getMsg(Env.getCtx(), "NoZoomTarget"));
m_popup.appendChild(menuItem); // Added
log.info("BaseLanguage=" + baseLanguage);
}
m_popup.setPage(invoker.getPage());
m_popup.open(invoker);
}
//End - afalcone - Bug Fix [ 1659420 ] Usability: zoom across
private Menupopup m_popup = new Menupopup(); //"ZoomMenu"
} // getZoomTargets
private static final CLogger log = CLogger.getCLogger(WZoomAcross.class);
/**
* Check Target and Add to popup
* @param targetTableName table name
* @param AD_Window_ID window
* @param Name name
* @param isSO has po/so Window
* @return true if there is a record
*/
private boolean addTarget (String targetTableName,
int AD_Window_ID, String Name, Boolean isSO)
{
String key = targetTableName + AD_Window_ID + Name + isSO;
if (m_targets.contains(key))
return false;
else
m_targets.add(key);
private final List<ZoomInfoFactory.ZoomInfo> zoomInfos = new ArrayList<ZoomInfoFactory.ZoomInfo>();
String sql = "SELECT COUNT(*) FROM " + targetTableName
+ " WHERE " + m_query.getWhereClause(false);
String sqlAdd = "";
if (isSO != null)
{
/*
For RMA, Material Receipt window should be loaded for IsSOTrx=true
and Shipment for IsSOTrx=false
*/
private void mkZoomTargets(final PO po, final int windowID) {
if (MRMA.Table_Name.equals(m_tableName) && (AD_Window_ID == 169
|| AD_Window_ID == 184))
{
isSO = !isSO;
for (final ZoomInfoFactory.ZoomInfo zoomInfo : ZoomInfoFactory.retrieveZoomInfos(po,
windowID)) {
if (zoomInfo.query.getRecordCount() == 0) {
log.fine("No target records for destination "
+ zoomInfo.destinationDisplay);
continue;
}
sqlAdd = " AND IsSOTrx=" + (isSO.booleanValue() ? "'Y'" : "'N'");
zoomInfos.add(zoomInfo);
}
int count = DB.getSQLValue(null, sql+sqlAdd);
if (count < 0 && isSO != null) // error try again w/o SO
count = DB.getSQLValue(null, sql);
if (count <= 0)
return false;
//
KeyNamePair pp = new KeyNamePair (AD_Window_ID, Name + " (#"+count+")");
m_list.add(pp);
Menuitem menuItem = new Menuitem(pp.toString());
menuItem.addEventListener(Events.ON_CLICK, this);
m_popup.appendChild(menuItem);
m_query.setRecordCount(count);
return true;
} // checkTarget
}
/**
* Launch Zoom
* @param pp KeyPair
*/
private void launchZoom (KeyNamePair pp)
private void launchZoom (final ZoomInfoFactory.ZoomInfo zoomInfo)
{
int AD_Window_ID = pp.getKey();
AEnv.zoom(AD_Window_ID, m_query);
final int AD_Window_ID = zoomInfo.windowId;
final MQuery query = zoomInfo.query;
log.info("AD_Window_ID=" + AD_Window_ID
+ " - " + query);
AEnv.zoom(AD_Window_ID, query);
} // launchZoom
public void onEvent(Event e) throws Exception {
if (e.getTarget() instanceof Menuitem) {
String cmd = ((Menuitem)e.getTarget()).getLabel();
for (int i = 0; i < m_list.size(); i++)
{
KeyNamePair pp = (KeyNamePair)m_list.get(i);
if (cmd.equals(pp.getName()))
{
launchZoom (pp);
return;
}
}
}
}
} // AZoom

View File

@ -1732,7 +1732,8 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
query.addRestriction(link, MQuery.EQUAL,
Env.getContext(ctx, curWindowNo, link));
}
new WZoomAcross (toolbar.getEvent().getTarget(), curTab.getTableName(), query);
new WZoomAcross(toolbar.getEvent().getTarget(), curTab
.getTableName(), curTab.getAD_Window_ID(), query);
}
}