From 95bad1508c2d42830f7c1fd287deb57df775cfea Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 16 Jul 2013 09:52:17 -0500 Subject: [PATCH 01/21] IDEMPIERE-1178 2Pack exporting AD_Role_ID=0 as null --- org.adempiere.pipo/src/org/adempiere/pipo2/ReferenceUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/org.adempiere.pipo/src/org/adempiere/pipo2/ReferenceUtils.java b/org.adempiere.pipo/src/org/adempiere/pipo2/ReferenceUtils.java index 47d8633bc4..c437b2520e 100644 --- a/org.adempiere.pipo/src/org/adempiere/pipo2/ReferenceUtils.java +++ b/org.adempiere.pipo/src/org/adempiere/pipo2/ReferenceUtils.java @@ -85,7 +85,8 @@ public class ReferenceUtils { public static String getTableReference(String tableName, String searchColumn, int id, AttributesImpl atts) { String keyColumn = tableName + "_ID"; - if (id > 0 && id <= PackOut.MAX_OFFICIAL_ID) + if ( (id > 0 && id <= PackOut.MAX_OFFICIAL_ID) + || (id == 0 && MTable.isZeroIDTable(tableName))) { //official id atts.addAttribute("", "", "reference", "CDATA", "id"); From c5211d7bf397f323eb06f723568c21853fb6930c Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 16 Jul 2013 10:24:49 -0500 Subject: [PATCH 02/21] IDEMPIERE-1177 Record Info not showing UUID for zero ID records / this was affecting any program trying to read the zero ID records programatically using the ID constructor --- org.adempiere.base/src/org/compiere/model/PO.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/model/PO.java b/org.adempiere.base/src/org/compiere/model/PO.java index 8f89a4aa14..e6ddf2fc8a 100644 --- a/org.adempiere.base/src/org/compiere/model/PO.java +++ b/org.adempiere.base/src/org/compiere/model/PO.java @@ -1276,7 +1276,7 @@ public abstract class PO protected void load (int ID, String trxName) { if (log.isLoggable(Level.FINEST)) log.finest("ID=" + ID); - if (ID > 0) + if (ID > 0 || (ID == 0 && MTable.isZeroIDTable(get_TableName()))) { setKeyInfo(); m_IDs = new Object[] {new Integer(ID)}; From 89ff83536f7f05a8709ceff694cc168414cb41d8 Mon Sep 17 00:00:00 2001 From: Deepak Pansheriya Date: Wed, 17 Jul 2013 14:52:11 +0530 Subject: [PATCH 03/21] IDEMPIERE-460: Fixing regression issue with lookup on web service --- .../adinterface/ModelADServiceImpl.java | 40 ++++++++++++++++--- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/ModelADServiceImpl.java b/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/ModelADServiceImpl.java index 0934fd7e7c..32b11a47eb 100644 --- a/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/ModelADServiceImpl.java +++ b/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/ModelADServiceImpl.java @@ -45,6 +45,7 @@ import javax.xml.ws.WebServiceContext; import org.apache.xmlbeans.StringEnumAbstractBase.Table; import org.compiere.model.Lookup; import org.compiere.model.MColumn; +import org.compiere.model.MLookup; import org.compiere.model.MLookupFactory; import org.compiere.model.MRefTable; import org.compiere.model.MRole; @@ -57,7 +58,9 @@ import org.compiere.model.X_WS_WebServiceFieldInput; import org.compiere.model.X_WS_WebService_Para; import org.compiere.util.CLogger; import org.compiere.util.DB; +import org.compiere.util.DisplayType; import org.compiere.util.Env; +import org.compiere.util.KeyNamePair; import org.compiere.util.Trx; import org.compiere.util.Util; import org.compiere.util.ValueNamePair; @@ -1071,11 +1074,38 @@ public class ModelADServiceImpl extends AbstractService implements ModelADServic "LookupResolutionFailed")); } - String sql = ADLookup.getDirectAccessSQL(lookup, lookupValue.toUpperCase()); - int id = DB.getSQLValue(localTrxName, sql); - if (id > 0) - value = id; - + int AD_Reference_ID = 0; + if(lookup instanceof MLookup){ + AD_Reference_ID = ((MLookup)lookup).getDisplayType(); + } + + if(AD_Reference_ID==DisplayType.List) + { + if (lookup.getSize() == 0) + lookup.refresh(); + Object[] list = lookup.getData(true, true, true, false,false).toArray(); // IDEMPIERE 90 + + for (Object pair : list) { + if (pair instanceof KeyNamePair) { + KeyNamePair p = (KeyNamePair) pair; + if (p.getName().equalsIgnoreCase(lookupValue)) { + value = p.getID(); + break; + } + } else { + ValueNamePair p = (ValueNamePair) pair; + if (p.getName().equalsIgnoreCase(lookupValue)) { + value = p.getValue(); + break; + } + } + } + }else{ + String sql = ADLookup.getDirectAccessSQL(lookup, lookupValue.toUpperCase()); + int id = DB.getSQLValue(localTrxName, sql); + if (id > 0) + value = id; + } if (value == null) { throw new IdempiereServiceFault(" Invalid Lookup value:" + lookupValue, new QName("LookupResolutionFailed")); } From 54862b0d9eeeed052507ded2f41a4d530b07d933 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 17 Jul 2013 08:48:02 -0500 Subject: [PATCH 04/21] IDEMPIERE-460 Add back sample for list lookup --- .../testScripts/GW_Sample_WebServices.zip | Bin 5733 -> 5672 bytes .../idempiere-composite-soapui-project.xml | 3 ++- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/org.idempiere.webservices/testScripts/GW_Sample_WebServices.zip b/org.idempiere.webservices/testScripts/GW_Sample_WebServices.zip index a2c832293b81563d964eeabe04c6ab80be2d7232..691eb49dac0a2b3f4673ca4ab3d2c9089ea6a363 100644 GIT binary patch delta 4643 zcmV+;65Q?OET}9EP)h>@3IG5A005Om@sSNN1C>SbkwG>Cl|}K9dNmQ2Me#y8+hhHa z5dZ*7-2eb4lQ9(^k>3~zR#n!`A#v80){*}jf61XiG@yo|2Z{}LH>&HLI(0JZ($D_( zfA7wYe&^}sPiTyZ2}O<~Po-dHVaL@a6H*ueWaW>7q{`A0NF;v-C~6y!8=Zmg(gEY<{@7>rs`{ ze~#M4^l0`^KKd?AE1&;%F+HnC|I7LE)7O1{HT&nqwBKX#+kd`Gle6c?lk;}*A8*et zayt8;%gZmz#k=F97gJ6%uJZL#dX35edQkRA>#r<*Mf4?NI6nI2eZBWA`xW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zp- zvE#>`I;(LP<{M;+PBZfByQF_$Vk0en&37yg?3Nc z$0w~3fOmkjHleqXJYZ3^fA0>h`r1zoVrAJ{-3s%D;;=nwAD^@o{4UJVqbau;O-k#2z^1&*)9iVe{4jUms^s2vdxm8G7e>G6rMGnSClQy-& zLGLZac5I@*vP(Qe=<<93p;&CgU6N(f+}Xd zFwz0BR!|ceLsfe&fBS)oT_Wu+gl>k(t0?BSqS#z3M?eV?0>)xWtBKQoBd{GJ?O+Sd zwn^F)oy);$@NK?qr@su)2x+}fQHL6xcKb<=J40F}ws{w%w#3$A^Z{zb05&;-9+*KZ zm;x4SD=$X{YqD1FrS{QTD^j})BNa+%n@Ay4A0$T8wm}Xqe?V|v?5<0(t-R%DPukIv zwoC0UWN>q&oRU)_us({^)(U-F8c-IqHa3~2HZ`F<>{W;Q`n!Zt@u5DKfX`2uA~+cTrWJE2!SIElC$ef1VJucG+5Lsm_A1aJvi>Or^I_e ztP<5=CMNVL7`*W<9peY@_Gv_;0nZuarfmlCi=xYl3Z!5aG;$>+AB;D9*<2I6Qn <_0:val>132 + <_0:field column="FreightCostRule" lval="Freight included"/> <_0:field column="FreightAmt"> <_0:val>6 @@ -647,4 +648,4 @@ -]]>Global HTTP Settings \ No newline at end of file +]]>Global HTTP Settings From a8766eb2762c5ca437e4b362603abdf74caf37ae Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 17 Jul 2013 11:19:28 -0500 Subject: [PATCH 05/21] IDEMPIERE-1170 Cannot Drag Tree Item After Insert New Record --- .../src/org/adempiere/webui/adwindow/ADTabpanel.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java index 2436d63623..b4af00a3d2 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/ADTabpanel.java @@ -1216,14 +1216,7 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer }else if(e.isInserting() && gridTab.getRecord_ID() < 0 && gridTab.getTabLevel() > 0 ) { int AD_Tree_ID = Integer.parseInt(gridTab.getParentTab().getValue("AD_Tree_ID").toString()); - MTreeNode root = new MTree (Env.getCtx(), AD_Tree_ID, true, true, null).getRoot(); - SimpleTreeModel treeModel = SimpleTreeModel.createFrom(root); - try { - treePanel.getTree().setItemRenderer(treeModel); - treePanel.getTree().setModel(treeModel); - } catch (Exception treeExc) { - logger.log(Level.SEVERE, "Failed to setup tree"); - } + treePanel.initTree(AD_Tree_ID, windowNo); } } if (listPanel.isVisible()) { From bef6671726c6d66b14d9e6112212b70320f290c6 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 17 Jul 2013 12:26:51 -0500 Subject: [PATCH 06/21] backout 206712e3cad5 / IDEMPIERE-1177 Record Info not showing UUID for zero ID records, messed out creation of users on window, will need to find a better solution for this --- org.adempiere.base/src/org/compiere/model/PO.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/model/PO.java b/org.adempiere.base/src/org/compiere/model/PO.java index e6ddf2fc8a..8f89a4aa14 100644 --- a/org.adempiere.base/src/org/compiere/model/PO.java +++ b/org.adempiere.base/src/org/compiere/model/PO.java @@ -1276,7 +1276,7 @@ public abstract class PO protected void load (int ID, String trxName) { if (log.isLoggable(Level.FINEST)) log.finest("ID=" + ID); - if (ID > 0 || (ID == 0 && MTable.isZeroIDTable(get_TableName()))) + if (ID > 0) { setKeyInfo(); m_IDs = new Object[] {new Integer(ID)}; From 7ee9b8ddc466a391b56f34e275e95b30b45ed1d4 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 17 Jul 2013 12:52:24 -0500 Subject: [PATCH 07/21] IDEMPIERE-1177 Record Info not showing UUID for zero ID records --- .../src/org/compiere/model/GridTable.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/GridTable.java b/org.adempiere.base/src/org/compiere/model/GridTable.java index 79417d23ae..8908165a4d 100644 --- a/org.adempiere.base/src/org/compiere/model/GridTable.java +++ b/org.adempiere.base/src/org/compiere/model/GridTable.java @@ -3822,10 +3822,14 @@ public class GridTable extends AbstractTableModel MTable table = MTable.get (m_ctx, m_AD_Table_ID); PO po = null; int Record_ID = getKeyID(row); - if (Record_ID != -1) - po = table.getPO(Record_ID, m_trxName); - else // Multi - Key - po = table.getPO(getWhereClause(getDataAtRow(row)), m_trxName); + if (Record_ID == 0 && MTable.isZeroIDTable(getTableName())) { + po = new Query(Env.getCtx(), table, getKeyColumnName()+"=0", null).first(); + } else { + if (Record_ID != -1) + po = table.getPO(Record_ID, m_trxName); + else // Multi - Key + po = table.getPO(getWhereClause(getDataAtRow(row)), m_trxName); + } return po; } From be82eec408eca2aca6bef400cefdfa0f3c2ed56e Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 17 Jul 2013 13:15:21 -0500 Subject: [PATCH 08/21] IDEMPIERE-347 Password for user System must be changed via Reset Password window - as a security measure, and also because hashed password corrupt the password if changed from window --- .../i1.0c-release/oracle/201307171313_IDEMPIERE-347.sql | 8 ++++++++ .../postgresql/201307171313_IDEMPIERE-347.sql | 8 ++++++++ 2 files changed, 16 insertions(+) create mode 100644 migration/i1.0c-release/oracle/201307171313_IDEMPIERE-347.sql create mode 100644 migration/i1.0c-release/postgresql/201307171313_IDEMPIERE-347.sql diff --git a/migration/i1.0c-release/oracle/201307171313_IDEMPIERE-347.sql b/migration/i1.0c-release/oracle/201307171313_IDEMPIERE-347.sql new file mode 100644 index 0000000000..d84027ca70 --- /dev/null +++ b/migration/i1.0c-release/oracle/201307171313_IDEMPIERE-347.sql @@ -0,0 +1,8 @@ +-- Jul 17, 2013 1:10:17 PM COT +-- IDEMPIERE-347 passwords hash +UPDATE AD_Column SET ReadOnlyLogic='@AD_User_ID@=0',Updated=TO_DATE('2013-07-17 13:10:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=417 +; + +SELECT register_migration_script('201307171313_IDEMPIERE-347.sql') FROM dual +; + diff --git a/migration/i1.0c-release/postgresql/201307171313_IDEMPIERE-347.sql b/migration/i1.0c-release/postgresql/201307171313_IDEMPIERE-347.sql new file mode 100644 index 0000000000..7943dcb69d --- /dev/null +++ b/migration/i1.0c-release/postgresql/201307171313_IDEMPIERE-347.sql @@ -0,0 +1,8 @@ +-- Jul 17, 2013 1:10:17 PM COT +-- IDEMPIERE-347 passwords hash +UPDATE AD_Column SET ReadOnlyLogic='@AD_User_ID@=0',Updated=TO_TIMESTAMP('2013-07-17 13:10:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=417 +; + +SELECT register_migration_script('201307171313_IDEMPIERE-347.sql') FROM dual +; + From abdf87066945d0c7acb6605642f79d2b77e889b6 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 17 Jul 2013 16:32:20 -0500 Subject: [PATCH 09/21] IDEMPIERE-1185 Cannot Lookup records in Reports --- .../webui/window/ZkReportViewer.java | 52 ++++++++++++------- 1 file changed, 34 insertions(+), 18 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/ZkReportViewer.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/ZkReportViewer.java index 7398361b74..0ecd852f5f 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/ZkReportViewer.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/ZkReportViewer.java @@ -31,6 +31,7 @@ import javax.activation.FileDataSource; import javax.servlet.http.HttpServletRequest; import org.adempiere.exceptions.AdempiereException; +import org.adempiere.exceptions.DBException; import org.adempiere.pdf.Document; import org.adempiere.webui.LayoutUtils; import org.adempiere.webui.apps.AEnv; @@ -125,7 +126,7 @@ public class ZkReportViewer extends Window implements EventListener, ITab /** * */ - private static final long serialVersionUID = 344552813342946104L; + private static final long serialVersionUID = 6208607687967139151L; /** Window No */ private int m_WindowNo = -1; @@ -296,6 +297,9 @@ public class ZkReportViewer extends Window implements EventListener, ITab bFind.setTooltiptext(Util.cleanAmp(Msg.getMsg(Env.getCtx(), "Find"))); toolBar.appendChild(bFind); bFind.addEventListener(Events.ON_CLICK, this); + if (getAD_Tab_ID(m_reportEngine.getPrintFormat().getAD_Table_ID()) <= 0) { + bFind.setVisible(false); // IDEMPIERE-1185 + } toolBar.appendChild(new Separator("vertical")); @@ -421,6 +425,22 @@ public class ZkReportViewer extends Window implements EventListener, ITab init = true; } + /** + * Get the maintenance tab of the table associated to the report engine + * @return AD_Tab_ID or -1 if not found + */ + private int getAD_Tab_ID(int AD_Table_ID) { + // Get Find Tab Info + final String sql = "SELECT t.AD_Tab_ID " + + "FROM AD_Tab t" + + " INNER JOIN AD_Window w ON (t.AD_Window_ID=w.AD_Window_ID)" + + " INNER JOIN AD_Table tt ON (t.AD_Table_ID=tt.AD_Table_ID) " + + "WHERE tt.AD_Table_ID=? " + + "ORDER BY w.IsDefault DESC, t.SeqNo, ABS (tt.AD_Window_ID-t.AD_Window_ID)"; + int AD_Tab_ID = DB.getSQLValueEx(null, sql, AD_Table_ID); + return AD_Tab_ID; + } + private void renderReport() throws Exception { media = null; Listitem selected = previewType.getSelectedItem(); @@ -448,8 +468,10 @@ public class ZkReportViewer extends Window implements EventListener, ITab m_reportEngine.createHTML(file, false, AEnv.getLanguage(Env.getCtx()), new HTMLExtension(Executions.getCurrent().getContextPath(), "rp", this.getUuid())); media = new AMedia(file.getName(), "html", "text/html", file, false); - labelDrill.setVisible(true); - comboDrill.setVisible(true); + if (comboDrill.getItemCount() > 1) { + labelDrill.setVisible(true); + comboDrill.setVisible(true); + } } else if ("XLS".equals(previewType.getSelectedItem().getValue())) { String path = System.getProperty("java.io.tmpdir"); String prefix = makePrefix(m_reportEngine.getName()); @@ -1008,20 +1030,11 @@ public class ZkReportViewer extends Window implements EventListener, ITab */ private void cmd_find() { - int AD_Table_ID = m_reportEngine.getPrintFormat().getAD_Table_ID(); - String title = null; String tableName = null; - // Get Find Tab Info - String sql = "SELECT t.AD_Tab_ID " - // ,w.Name, t.Name, w.IsDefault, t.SeqNo, ABS (tt.AD_Window_ID-t.AD_Window_ID) - + "FROM AD_Tab t" - + " INNER JOIN AD_Window w ON (t.AD_Window_ID=w.AD_Window_ID)" - + " INNER JOIN AD_Table tt ON (t.AD_Table_ID=tt.AD_Table_ID) " - + "WHERE tt.AD_Table_ID=? " - + "ORDER BY w.IsDefault DESC, t.SeqNo, ABS (tt.AD_Window_ID-t.AD_Window_ID)"; - int AD_Tab_ID = DB.getSQLValue(null, sql, AD_Table_ID); + int AD_Table_ID = m_reportEngine.getPrintFormat().getAD_Table_ID(); + int AD_Tab_ID = getAD_Tab_ID(AD_Table_ID); // ASP MClient client = MClient.get(Env.getCtx()); String ASPFilter = ""; @@ -1060,10 +1073,13 @@ public class ZkReportViewer extends Window implements EventListener, ITab + " AND ce.AD_Field_ID IS NULL " + " AND ce.ASP_Status = 'H')"; // Hide // - sql = "SELECT Name, TableName FROM AD_Tab_v WHERE AD_Tab_ID=? " + ASPFilter; - if (!Env.isBaseLanguage(Env.getCtx(), "AD_Tab")) + String sql = null; + if (!Env.isBaseLanguage(Env.getCtx(), "AD_Tab")) { sql = "SELECT Name, TableName FROM AD_Tab_vt WHERE AD_Tab_ID=?" - + " AND AD_Language='" + Env.getAD_Language(Env.getCtx()) + "' " + ASPFilter; + + " AND AD_Language='" + Env.getAD_Language(Env.getCtx()) + "' " + ASPFilter; + } else { + sql = "SELECT Name, TableName FROM AD_Tab_v WHERE AD_Tab_ID=? " + ASPFilter; + } PreparedStatement pstmt = null; ResultSet rs = null; try @@ -1080,7 +1096,7 @@ public class ZkReportViewer extends Window implements EventListener, ITab } catch (SQLException e) { - log.log(Level.SEVERE, sql, e); + throw new DBException(e); } finally { From 180a720f253e313d6d19bdb357e35586e05353ae Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 17 Jul 2013 18:33:58 -0500 Subject: [PATCH 10/21] IDEMPIERE-1174 Found a matchinv created on matchpo was not being posted on immediate accounting --- .../src/org/compiere/model/MInOut.java | 4 ++++ .../src/org/compiere/model/MMatchPO.java | 18 +++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MInOut.java b/org.adempiere.base/src/org/compiere/model/MInOut.java index 2b3b38c527..e9eb47a446 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOut.java +++ b/org.adempiere.base/src/org/compiere/model/MInOut.java @@ -1628,6 +1628,10 @@ public class MInOut extends X_M_InOut implements DocAction } if (!po.isPosted()) addDocsPostProcess(po); + if (po.getMatchInvCreated() != null) { + addDocsPostProcess(po.getMatchInvCreated()); + po.setMatchInvCreated(null); + } } // Update PO with ASI if ( oLine != null && oLine.getM_AttributeSetInstance_ID() == 0 diff --git a/org.adempiere.base/src/org/compiere/model/MMatchPO.java b/org.adempiere.base/src/org/compiere/model/MMatchPO.java index 41904ec972..99bf94df30 100644 --- a/org.adempiere.base/src/org/compiere/model/MMatchPO.java +++ b/org.adempiere.base/src/org/compiere/model/MMatchPO.java @@ -59,8 +59,7 @@ public class MMatchPO extends X_M_MatchPO /** * */ - private static final long serialVersionUID = 7189366329684552916L; - + private static final long serialVersionUID = -3669451656879485463L; /** * Get PO Match with order/invoice @@ -446,6 +445,7 @@ public class MMatchPO extends X_M_MatchPO s_log.fine(msg); continue; } + mpo.setMatchInvCreated(matchInv); if (savepoint != null) { try { @@ -549,7 +549,19 @@ public class MMatchPO extends X_M_MatchPO return retValue; } // create - + + private MMatchInv m_matchInv; + /** + * Register the match inv created for immediate accounting purposes + * @param matchInv + */ + public void setMatchInvCreated(MMatchInv matchInv) { + m_matchInv = matchInv; + } + public MMatchInv getMatchInvCreated() { + return m_matchInv; + } + /** Static Logger */ private static CLogger s_log = CLogger.getCLogger (MMatchPO.class); From 46585842d2b35106e12a676fa79c4f0f397a6e23 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 17 Jul 2013 19:47:09 -0500 Subject: [PATCH 11/21] IDEMPIERE-1174 Found avg po cost detail record was not being created when following flow PO->Inv->Receipt - force the posting of matchpo just when receipt is associated --- .../src/org/compiere/acct/Doc_MatchPO.java | 9 +++++++-- org.adempiere.base/src/org/compiere/model/MInvoice.java | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/acct/Doc_MatchPO.java b/org.adempiere.base/src/org/compiere/acct/Doc_MatchPO.java index daecc82367..f62e68820d 100644 --- a/org.adempiere.base/src/org/compiere/acct/Doc_MatchPO.java +++ b/org.adempiere.base/src/org/compiere/acct/Doc_MatchPO.java @@ -126,14 +126,19 @@ public class Doc_MatchPO extends Doc ArrayList facts = new ArrayList(); // if (getM_Product_ID() == 0 // Nothing to do if no Product - || getQty().signum() == 0 - || m_M_InOutLine_ID == 0) // No posting if not matched to Shipment + || getQty().signum() == 0) { if (log.isLoggable(Level.FINE)) log.fine("No Product/Qty - M_Product_ID=" + getM_Product_ID() + ",Qty=" + getQty()); return facts; } + if (m_M_InOutLine_ID == 0) // No posting if not matched to Shipment + { + p_Error = "No posting if not matched to Shipment"; + return null; + } + // create Fact Header Fact fact = new Fact(this, as, Fact.POST_Actual); setC_Currency_ID(as.getC_Currency_ID()); diff --git a/org.adempiere.base/src/org/compiere/model/MInvoice.java b/org.adempiere.base/src/org/compiere/model/MInvoice.java index 45cff928e0..be7f08cd7a 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoice.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoice.java @@ -1849,7 +1849,7 @@ public class MInvoice extends X_C_Invoice implements DocAction return DocAction.STATUS_Invalid; } matchPO++; - if (!po.isPosted()) + if (!po.isPosted() && po.getM_InOutLine_ID() > 0) // match po don't post if receipt is not assigned, and it doesn't create avg po record addDocsPostProcess(po); } } From 61b9cd95085fbf5792d5afd463cc08388fe7289d Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 17 Jul 2013 22:04:15 -0500 Subject: [PATCH 12/21] IDEMPIERE-1174 Found a matchinv created on matchpo was not being posted on immediate accounting / follow recommendation from Heng Sin about privacy of method --- .../src/org/compiere/model/MInOut.java | 1 - .../src/org/compiere/model/MInOutLine.java | 8 +++- .../src/org/compiere/model/MInvoiceLine.java | 39 +++++++++++++++---- .../src/org/compiere/model/MMatchPO.java | 13 ++++++- 4 files changed, 49 insertions(+), 12 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MInOut.java b/org.adempiere.base/src/org/compiere/model/MInOut.java index e9eb47a446..a2071bcd7a 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOut.java +++ b/org.adempiere.base/src/org/compiere/model/MInOut.java @@ -1630,7 +1630,6 @@ public class MInOut extends X_M_InOut implements DocAction addDocsPostProcess(po); if (po.getMatchInvCreated() != null) { addDocsPostProcess(po.getMatchInvCreated()); - po.setMatchInvCreated(null); } } // Update PO with ASI diff --git a/org.adempiere.base/src/org/compiere/model/MInOutLine.java b/org.adempiere.base/src/org/compiere/model/MInOutLine.java index 2489de1d82..0479bda181 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOutLine.java +++ b/org.adempiere.base/src/org/compiere/model/MInOutLine.java @@ -651,8 +651,12 @@ public class MInOutLine extends X_M_InOutLine MInvoiceLine m_il = MInvoiceLine.getOfInOutLine(this); if (m_il == null) { - log.severe("No Invoice Line for: " + this.toString()); - return Env.ZERO; + m_il = MInvoiceLine.getOfInOutLineFromMatchInv(this); + if (m_il == null) + { + log.severe("No Invoice Line for: " + this.toString()); + return Env.ZERO; + } } return this.getMovementQty().multiply(m_il.getPriceActual()); // Actual delivery } diff --git a/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java b/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java index f55d4f5c05..b087747a1e 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java @@ -52,7 +52,7 @@ public class MInvoiceLine extends X_C_InvoiceLine /** * */ - private static final long serialVersionUID = -5113860437274708398L; + private static final long serialVersionUID = 6157080330492848409L; /** * Get Invoice Line referencing InOut Line @@ -78,6 +78,29 @@ public class MInvoiceLine extends X_C_InvoiceLine return retValue; } // getOfInOutLine + /** + * Get Invoice Line referencing InOut Line - from MatchInv + * @param sLine shipment line + * @return (first) invoice line + */ + public static MInvoiceLine getOfInOutLineFromMatchInv(MInOutLine sLine) { + if (sLine == null) + return null; + final String whereClause = "C_InvoiceLine_ID IN (SELECT C_InvoiceLine_ID FROM M_MatchInv WHERE M_InOutLine_ID=?)"; + List list = new Query(sLine.getCtx(),I_C_InvoiceLine.Table_Name,whereClause,sLine.get_TrxName()) + .setParameters(sLine.getM_InOutLine_ID()) + .list(); + + MInvoiceLine retValue = null; + if (list.size() > 0) { + retValue = list.get(0); + if (list.size() > 1) + s_log.warning("More than one C_InvoiceLine of " + sLine); + } + + return retValue; + } + /** Static Logger */ private static CLogger s_log = CLogger.getCLogger (MInvoiceLine.class); @@ -1053,9 +1076,9 @@ public class MInvoiceLine extends X_C_InvoiceLine // end MZ if (base.signum() != 0) { - double result = getLineNetAmt().multiply(base).doubleValue(); - result /= total.doubleValue(); - lca.setAmt(result, getPrecision()); + BigDecimal result = getLineNetAmt().multiply(base); + result = result.divide(total, BigDecimal.ROUND_HALF_UP); + lca.setAmt(result.doubleValue(), getPrecision()); } if (!lca.save()){ msgreturn = new StringBuilder("Cannot save line Allocation = ").append(lca); @@ -1079,6 +1102,8 @@ public class MInvoiceLine extends X_C_InvoiceLine lca.setM_Product_ID(iol.getM_Product_ID()); lca.setM_AttributeSetInstance_ID(iol.getM_AttributeSetInstance_ID()); BigDecimal base = iol.getBase(lc.getLandedCostDistribution()); + if (base.signum() == 0) + return "Base value is 0 - " + lc.getLandedCostDistribution(); lca.setBase(base); lca.setAmt(getLineNetAmt()); // MZ Goodwill @@ -1174,9 +1199,9 @@ public class MInvoiceLine extends X_C_InvoiceLine // end MZ if (base.signum() != 0) { - double result = getLineNetAmt().multiply(base).doubleValue(); - result /= total.doubleValue(); - lca.setAmt(result, getPrecision()); + BigDecimal result = getLineNetAmt().multiply(base); + result = result.divide(total, BigDecimal.ROUND_HALF_UP); + lca.setAmt(result.doubleValue(), getPrecision()); } if (!lca.save()){ msgreturn = new StringBuilder("Cannot save line Allocation = ").append(lca); diff --git a/org.adempiere.base/src/org/compiere/model/MMatchPO.java b/org.adempiere.base/src/org/compiere/model/MMatchPO.java index 99bf94df30..8bc2e6e388 100644 --- a/org.adempiere.base/src/org/compiere/model/MMatchPO.java +++ b/org.adempiere.base/src/org/compiere/model/MMatchPO.java @@ -551,15 +551,24 @@ public class MMatchPO extends X_M_MatchPO private MMatchInv m_matchInv; + /** * Register the match inv created for immediate accounting purposes * @param matchInv */ - public void setMatchInvCreated(MMatchInv matchInv) { + private void setMatchInvCreated(MMatchInv matchInv) { m_matchInv = matchInv; } + + /** + * Get the match inv created for immediate accounting purposes + * Is cleared after read, so if you read twice second time it returns null + * @param matchInv + */ public MMatchInv getMatchInvCreated() { - return m_matchInv; + MMatchInv tmp = m_matchInv; + m_matchInv = null; + return tmp; } /** Static Logger */ From 8390b8ed1692a82709cf0bbba1342a3b433c2724 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 17 Jul 2013 22:12:21 -0500 Subject: [PATCH 13/21] Backed out changeset 4c2a0e55b08a / wrong commit affecting two tickets and with a bug introduced, will fix in next IDEMPIERE-1174 --- .../src/org/compiere/model/MInOut.java | 1 + .../src/org/compiere/model/MInOutLine.java | 8 +--- .../src/org/compiere/model/MInvoiceLine.java | 39 ++++--------------- .../src/org/compiere/model/MMatchPO.java | 13 +------ 4 files changed, 12 insertions(+), 49 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MInOut.java b/org.adempiere.base/src/org/compiere/model/MInOut.java index a2071bcd7a..e9eb47a446 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOut.java +++ b/org.adempiere.base/src/org/compiere/model/MInOut.java @@ -1630,6 +1630,7 @@ public class MInOut extends X_M_InOut implements DocAction addDocsPostProcess(po); if (po.getMatchInvCreated() != null) { addDocsPostProcess(po.getMatchInvCreated()); + po.setMatchInvCreated(null); } } // Update PO with ASI diff --git a/org.adempiere.base/src/org/compiere/model/MInOutLine.java b/org.adempiere.base/src/org/compiere/model/MInOutLine.java index 0479bda181..2489de1d82 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOutLine.java +++ b/org.adempiere.base/src/org/compiere/model/MInOutLine.java @@ -651,12 +651,8 @@ public class MInOutLine extends X_M_InOutLine MInvoiceLine m_il = MInvoiceLine.getOfInOutLine(this); if (m_il == null) { - m_il = MInvoiceLine.getOfInOutLineFromMatchInv(this); - if (m_il == null) - { - log.severe("No Invoice Line for: " + this.toString()); - return Env.ZERO; - } + log.severe("No Invoice Line for: " + this.toString()); + return Env.ZERO; } return this.getMovementQty().multiply(m_il.getPriceActual()); // Actual delivery } diff --git a/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java b/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java index b087747a1e..f55d4f5c05 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java @@ -52,7 +52,7 @@ public class MInvoiceLine extends X_C_InvoiceLine /** * */ - private static final long serialVersionUID = 6157080330492848409L; + private static final long serialVersionUID = -5113860437274708398L; /** * Get Invoice Line referencing InOut Line @@ -78,29 +78,6 @@ public class MInvoiceLine extends X_C_InvoiceLine return retValue; } // getOfInOutLine - /** - * Get Invoice Line referencing InOut Line - from MatchInv - * @param sLine shipment line - * @return (first) invoice line - */ - public static MInvoiceLine getOfInOutLineFromMatchInv(MInOutLine sLine) { - if (sLine == null) - return null; - final String whereClause = "C_InvoiceLine_ID IN (SELECT C_InvoiceLine_ID FROM M_MatchInv WHERE M_InOutLine_ID=?)"; - List list = new Query(sLine.getCtx(),I_C_InvoiceLine.Table_Name,whereClause,sLine.get_TrxName()) - .setParameters(sLine.getM_InOutLine_ID()) - .list(); - - MInvoiceLine retValue = null; - if (list.size() > 0) { - retValue = list.get(0); - if (list.size() > 1) - s_log.warning("More than one C_InvoiceLine of " + sLine); - } - - return retValue; - } - /** Static Logger */ private static CLogger s_log = CLogger.getCLogger (MInvoiceLine.class); @@ -1076,9 +1053,9 @@ public class MInvoiceLine extends X_C_InvoiceLine // end MZ if (base.signum() != 0) { - BigDecimal result = getLineNetAmt().multiply(base); - result = result.divide(total, BigDecimal.ROUND_HALF_UP); - lca.setAmt(result.doubleValue(), getPrecision()); + double result = getLineNetAmt().multiply(base).doubleValue(); + result /= total.doubleValue(); + lca.setAmt(result, getPrecision()); } if (!lca.save()){ msgreturn = new StringBuilder("Cannot save line Allocation = ").append(lca); @@ -1102,8 +1079,6 @@ public class MInvoiceLine extends X_C_InvoiceLine lca.setM_Product_ID(iol.getM_Product_ID()); lca.setM_AttributeSetInstance_ID(iol.getM_AttributeSetInstance_ID()); BigDecimal base = iol.getBase(lc.getLandedCostDistribution()); - if (base.signum() == 0) - return "Base value is 0 - " + lc.getLandedCostDistribution(); lca.setBase(base); lca.setAmt(getLineNetAmt()); // MZ Goodwill @@ -1199,9 +1174,9 @@ public class MInvoiceLine extends X_C_InvoiceLine // end MZ if (base.signum() != 0) { - BigDecimal result = getLineNetAmt().multiply(base); - result = result.divide(total, BigDecimal.ROUND_HALF_UP); - lca.setAmt(result.doubleValue(), getPrecision()); + double result = getLineNetAmt().multiply(base).doubleValue(); + result /= total.doubleValue(); + lca.setAmt(result, getPrecision()); } if (!lca.save()){ msgreturn = new StringBuilder("Cannot save line Allocation = ").append(lca); diff --git a/org.adempiere.base/src/org/compiere/model/MMatchPO.java b/org.adempiere.base/src/org/compiere/model/MMatchPO.java index 8bc2e6e388..99bf94df30 100644 --- a/org.adempiere.base/src/org/compiere/model/MMatchPO.java +++ b/org.adempiere.base/src/org/compiere/model/MMatchPO.java @@ -551,24 +551,15 @@ public class MMatchPO extends X_M_MatchPO private MMatchInv m_matchInv; - /** * Register the match inv created for immediate accounting purposes * @param matchInv */ - private void setMatchInvCreated(MMatchInv matchInv) { + public void setMatchInvCreated(MMatchInv matchInv) { m_matchInv = matchInv; } - - /** - * Get the match inv created for immediate accounting purposes - * Is cleared after read, so if you read twice second time it returns null - * @param matchInv - */ public MMatchInv getMatchInvCreated() { - MMatchInv tmp = m_matchInv; - m_matchInv = null; - return tmp; + return m_matchInv; } /** Static Logger */ From 0ab9dca20d6c0a4efffb900a9b5cdd076261f743 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 17 Jul 2013 22:27:22 -0500 Subject: [PATCH 14/21] IDEMPIERE-1174 Found a matchinv created on matchpo was not being posted on immediate accounting / follow recommendation from Heng Sin about privacy of method --- .../src/org/compiere/model/MInOut.java | 6 +++--- .../src/org/compiere/model/MMatchPO.java | 13 +++++++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MInOut.java b/org.adempiere.base/src/org/compiere/model/MInOut.java index e9eb47a446..c68d731039 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOut.java +++ b/org.adempiere.base/src/org/compiere/model/MInOut.java @@ -1628,9 +1628,9 @@ public class MInOut extends X_M_InOut implements DocAction } if (!po.isPosted()) addDocsPostProcess(po); - if (po.getMatchInvCreated() != null) { - addDocsPostProcess(po.getMatchInvCreated()); - po.setMatchInvCreated(null); + MMatchInv matchInvCreated = po.getMatchInvCreated(); + if (matchInvCreated != null) { + addDocsPostProcess(matchInvCreated); } } // Update PO with ASI diff --git a/org.adempiere.base/src/org/compiere/model/MMatchPO.java b/org.adempiere.base/src/org/compiere/model/MMatchPO.java index 99bf94df30..8bc2e6e388 100644 --- a/org.adempiere.base/src/org/compiere/model/MMatchPO.java +++ b/org.adempiere.base/src/org/compiere/model/MMatchPO.java @@ -551,15 +551,24 @@ public class MMatchPO extends X_M_MatchPO private MMatchInv m_matchInv; + /** * Register the match inv created for immediate accounting purposes * @param matchInv */ - public void setMatchInvCreated(MMatchInv matchInv) { + private void setMatchInvCreated(MMatchInv matchInv) { m_matchInv = matchInv; } + + /** + * Get the match inv created for immediate accounting purposes + * Is cleared after read, so if you read twice second time it returns null + * @param matchInv + */ public MMatchInv getMatchInvCreated() { - return m_matchInv; + MMatchInv tmp = m_matchInv; + m_matchInv = null; + return tmp; } /** Static Logger */ From 45db44b0240e9236a26e18d7c206319b158e3b9f Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 17 Jul 2013 22:28:31 -0500 Subject: [PATCH 15/21] IDEMPIERE-1173 Fixed landed cost allocation for Average Costing / fix problems with distribution using cost --- .../src/org/compiere/model/MInOutLine.java | 8 +++- .../src/org/compiere/model/MInvoiceLine.java | 39 +++++++++++++++---- 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MInOutLine.java b/org.adempiere.base/src/org/compiere/model/MInOutLine.java index 2489de1d82..0479bda181 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOutLine.java +++ b/org.adempiere.base/src/org/compiere/model/MInOutLine.java @@ -651,8 +651,12 @@ public class MInOutLine extends X_M_InOutLine MInvoiceLine m_il = MInvoiceLine.getOfInOutLine(this); if (m_il == null) { - log.severe("No Invoice Line for: " + this.toString()); - return Env.ZERO; + m_il = MInvoiceLine.getOfInOutLineFromMatchInv(this); + if (m_il == null) + { + log.severe("No Invoice Line for: " + this.toString()); + return Env.ZERO; + } } return this.getMovementQty().multiply(m_il.getPriceActual()); // Actual delivery } diff --git a/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java b/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java index f55d4f5c05..b087747a1e 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java @@ -52,7 +52,7 @@ public class MInvoiceLine extends X_C_InvoiceLine /** * */ - private static final long serialVersionUID = -5113860437274708398L; + private static final long serialVersionUID = 6157080330492848409L; /** * Get Invoice Line referencing InOut Line @@ -78,6 +78,29 @@ public class MInvoiceLine extends X_C_InvoiceLine return retValue; } // getOfInOutLine + /** + * Get Invoice Line referencing InOut Line - from MatchInv + * @param sLine shipment line + * @return (first) invoice line + */ + public static MInvoiceLine getOfInOutLineFromMatchInv(MInOutLine sLine) { + if (sLine == null) + return null; + final String whereClause = "C_InvoiceLine_ID IN (SELECT C_InvoiceLine_ID FROM M_MatchInv WHERE M_InOutLine_ID=?)"; + List list = new Query(sLine.getCtx(),I_C_InvoiceLine.Table_Name,whereClause,sLine.get_TrxName()) + .setParameters(sLine.getM_InOutLine_ID()) + .list(); + + MInvoiceLine retValue = null; + if (list.size() > 0) { + retValue = list.get(0); + if (list.size() > 1) + s_log.warning("More than one C_InvoiceLine of " + sLine); + } + + return retValue; + } + /** Static Logger */ private static CLogger s_log = CLogger.getCLogger (MInvoiceLine.class); @@ -1053,9 +1076,9 @@ public class MInvoiceLine extends X_C_InvoiceLine // end MZ if (base.signum() != 0) { - double result = getLineNetAmt().multiply(base).doubleValue(); - result /= total.doubleValue(); - lca.setAmt(result, getPrecision()); + BigDecimal result = getLineNetAmt().multiply(base); + result = result.divide(total, BigDecimal.ROUND_HALF_UP); + lca.setAmt(result.doubleValue(), getPrecision()); } if (!lca.save()){ msgreturn = new StringBuilder("Cannot save line Allocation = ").append(lca); @@ -1079,6 +1102,8 @@ public class MInvoiceLine extends X_C_InvoiceLine lca.setM_Product_ID(iol.getM_Product_ID()); lca.setM_AttributeSetInstance_ID(iol.getM_AttributeSetInstance_ID()); BigDecimal base = iol.getBase(lc.getLandedCostDistribution()); + if (base.signum() == 0) + return "Base value is 0 - " + lc.getLandedCostDistribution(); lca.setBase(base); lca.setAmt(getLineNetAmt()); // MZ Goodwill @@ -1174,9 +1199,9 @@ public class MInvoiceLine extends X_C_InvoiceLine // end MZ if (base.signum() != 0) { - double result = getLineNetAmt().multiply(base).doubleValue(); - result /= total.doubleValue(); - lca.setAmt(result, getPrecision()); + BigDecimal result = getLineNetAmt().multiply(base); + result = result.divide(total, BigDecimal.ROUND_HALF_UP); + lca.setAmt(result.doubleValue(), getPrecision()); } if (!lca.save()){ msgreturn = new StringBuilder("Cannot save line Allocation = ").append(lca); From 839f02d82347fd4e9d47576eda669b3c5f4f7f79 Mon Sep 17 00:00:00 2001 From: Carlos Augusto Sanchez Date: Thu, 18 Jul 2013 16:20:29 -0500 Subject: [PATCH 16/21] IDEMPIERE-984 Change Role and Logout must check for unsaved records on open windows / use case 1 --- .../oracle/20130717091459_IDEMPIERE-984.sql | 10 ++++ .../20130717091459_IDEMPIERE-984.sql | 11 ++++ .../adwindow/AbstractADWindowContent.java | 5 ++ .../webui/desktop/AbstractDesktop.java | 5 ++ .../webui/desktop/DefaultDesktop.java | 17 ++++++ .../org/adempiere/webui/desktop/IDesktop.java | 2 + .../org/adempiere/webui/panel/UserPanel.java | 52 +++++++++++++++++-- 7 files changed, 98 insertions(+), 4 deletions(-) create mode 100644 migration/i1.0c-release/oracle/20130717091459_IDEMPIERE-984.sql create mode 100644 migration/i1.0c-release/postgresql/20130717091459_IDEMPIERE-984.sql diff --git a/migration/i1.0c-release/oracle/20130717091459_IDEMPIERE-984.sql b/migration/i1.0c-release/oracle/20130717091459_IDEMPIERE-984.sql new file mode 100644 index 0000000000..1c2b601aeb --- /dev/null +++ b/migration/i1.0c-release/oracle/20130717091459_IDEMPIERE-984.sql @@ -0,0 +1,10 @@ +-- Jul 17, 2013 9:14:59 AM COT +-- IDEMPIERE-984 Change Role and Logout must check for unsaved records on open windows +INSERT INTO AD_Message (MsgType,MsgText,MsgTip,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Org_ID,Created,AD_Client_ID) VALUES ('I','There are records that haven''t been saved yet. ','Do you still want to proceed?',200207,'D','78553b48-d536-4366-90ee-7fc69e80f35a','ProceedWithTask?','Y',TO_DATE('2013-07-17 09:14:58','YYYY-MM-DD HH24:MI:SS'),100,100,0,TO_DATE('2013-07-17 09:14:58','YYYY-MM-DD HH24:MI:SS'),0) +; + +-- Jul 17, 2013 9:14:59 AM COT +-- IDEMPIERE-984 Change Role and Logout must check for unsaved records on open windows +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) 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,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200207 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) +; +SELECT register_migration_script('20130717091459_IDEMPIERE-984.sql') FROM dual diff --git a/migration/i1.0c-release/postgresql/20130717091459_IDEMPIERE-984.sql b/migration/i1.0c-release/postgresql/20130717091459_IDEMPIERE-984.sql new file mode 100644 index 0000000000..7c56888df9 --- /dev/null +++ b/migration/i1.0c-release/postgresql/20130717091459_IDEMPIERE-984.sql @@ -0,0 +1,11 @@ +-- Jul 17, 2013 9:14:59 AM COT +-- IDEMPIERE-984 Change Role and Logout must check for unsaved records on open windows +INSERT INTO AD_Message (MsgType,MsgText,MsgTip,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,AD_Org_ID,Created,AD_Client_ID) VALUES ('I','There are records that haven''t been saved yet. ','Do you still want to proceed?',200207,'D','78553b48-d536-4366-90ee-7fc69e80f35a','ProceedWithTask?','Y',TO_TIMESTAMP('2013-07-17 09:14:58','YYYY-MM-DD HH24:MI:SS'),100,100,0,TO_TIMESTAMP('2013-07-17 09:14:58','YYYY-MM-DD HH24:MI:SS'),0) +; + +-- Jul 17, 2013 9:14:59 AM COT +-- IDEMPIERE-984 Change Role and Logout must check for unsaved records on open windows +INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) 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,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200207 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) +; + +SELECT register_migration_script('20130717091459_IDEMPIERE-984.sql') FROM dual diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java index 47e3d91660..e1ec1dcaad 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java @@ -2931,4 +2931,9 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements LayoutUtils.openEmbeddedWindow(getComponent().getParent(), findWindow, "overlap"); } } + + public boolean isPendingChanges() { + return boolChanges; + } + } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/AbstractDesktop.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/AbstractDesktop.java index 54e7e48380..85e656ffef 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/AbstractDesktop.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/AbstractDesktop.java @@ -295,4 +295,9 @@ public abstract class AbstractDesktop extends AbstractUIPart implements IDesktop win.setPage(page); win.doHighlighted(); } + + protected List getWindows(){ + return windows; + } + } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DefaultDesktop.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DefaultDesktop.java index 253624c85f..62b739ee64 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DefaultDesktop.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DefaultDesktop.java @@ -18,6 +18,7 @@ package org.adempiere.webui.desktop; import java.io.Serializable; +import java.util.List; import java.util.Map; import java.util.Properties; @@ -26,6 +27,7 @@ import org.adempiere.base.event.IEventManager; import org.adempiere.base.event.IEventTopics; import org.adempiere.model.MBroadcastMessage; import org.adempiere.util.ServerContext; +import org.adempiere.webui.adwindow.ADWindow; import org.adempiere.webui.apps.AEnv; import org.adempiere.webui.apps.BusyDialog; import org.adempiere.webui.apps.ProcessDialog; @@ -593,4 +595,19 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria super.openTask(taskId); updateHelpContext(X_AD_CtxHelp.CTXTYPE_Task, taskId); } + + public boolean isPendingWindow() { + List windows = getWindows(); + if (windows != null) { + for (int idx = 0; idx < windows.size(); idx++) { + Object ad = windows.get(idx); + if (ad != null && ad instanceof ADWindow) { + if ( ((ADWindow)ad).getADWindowContent().isPendingChanges()) { + return true; + } + } + } + } + return false; + } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/IDesktop.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/IDesktop.java index 7c12de8ca5..4a8b670e75 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/IDesktop.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/IDesktop.java @@ -204,4 +204,6 @@ public interface IDesktop extends UIPart { public void updateHelpContext(String ctxType, int recordId); public void updateHelpTooltip(GridField gridField); + + public boolean isPendingWindow(); } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/UserPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/UserPanel.java index 354ef58b69..d910b0f261 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/UserPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/UserPanel.java @@ -17,13 +17,16 @@ package org.adempiere.webui.panel; + import java.util.Properties; +import org.adempiere.util.Callback; import org.adempiere.webui.component.Label; import org.adempiere.webui.component.Menupopup; import org.adempiere.webui.component.Messagebox; import org.adempiere.webui.session.SessionManager; import org.adempiere.webui.util.FeedbackManager; +import org.adempiere.webui.window.FDialog; import org.adempiere.webui.window.WPreference; import org.compiere.model.MClient; import org.compiere.model.MOrg; @@ -136,14 +139,34 @@ public class UserPanel implements EventListener, Composer return "*"; } } - public void onEvent(Event event) throws Exception { if (event == null) return; if (logout == event.getTarget()) { - SessionManager.logoutSession(); + component.addEventListener("onLogout", new EventListener() { + @Override + public void onEvent(Event event) throws Exception { + SessionManager.logoutSession(); + } + }); + + if (SessionManager.getAppDesktop().isPendingWindow()) { + FDialog.ask(0, component, "ProceedWithTask?", new Callback() { + + @Override + public void onCallback(Boolean result) + { + if (result) + { + Events.echoEvent(new Event("onLogout", component)); + } + } + }); + } else { + SessionManager.logoutSession(); + } } else if (lblUserNameValue == event.getTarget()) { @@ -153,8 +176,29 @@ public class UserPanel implements EventListener, Composer } else if (changeRole == event.getTarget()) { - MUser user = MUser.get(ctx); - SessionManager.changeRole(user); + component.addEventListener("onChangeRole", new EventListener() { + @Override + public void onEvent(Event event) throws Exception { + MUser user = MUser.get(ctx); + SessionManager.changeRole(user); + } + }); + if (SessionManager.getAppDesktop().isPendingWindow()) { + FDialog.ask(0, component, "ProceedWithTask?", new Callback() { + + @Override + public void onCallback(Boolean result) + { + if (result) + { + Events.echoEvent(new Event("onChangeRole", component)); + } + } + }); + } else { + MUser user = MUser.get(ctx); + SessionManager.changeRole(user); + } } else if (preference == event.getTarget()) { From 3e06cf32552cc7367a049b25187f5c49d390da96 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 18 Jul 2013 16:21:18 -0500 Subject: [PATCH 17/21] IDEMPIERE-984 Change Role and Logout must check for unsaved records on open windows / use case 1 / peer review --- .../oracle/20130717091459_IDEMPIERE-984.sql | 2 + .../20130717091459_IDEMPIERE-984.sql | 1 + .../org/adempiere/webui/panel/UserPanel.java | 43 ++++++++++--------- 3 files changed, 25 insertions(+), 21 deletions(-) diff --git a/migration/i1.0c-release/oracle/20130717091459_IDEMPIERE-984.sql b/migration/i1.0c-release/oracle/20130717091459_IDEMPIERE-984.sql index 1c2b601aeb..b0003e00ae 100644 --- a/migration/i1.0c-release/oracle/20130717091459_IDEMPIERE-984.sql +++ b/migration/i1.0c-release/oracle/20130717091459_IDEMPIERE-984.sql @@ -7,4 +7,6 @@ INSERT INTO AD_Message (MsgType,MsgText,MsgTip,AD_Message_ID,EntityType,AD_Messa -- IDEMPIERE-984 Change Role and Logout must check for unsaved records on open windows INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Message_Trl_UU ) 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,Generate_UUID() FROM AD_Language l, AD_Message t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Message_ID=200207 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) ; + SELECT register_migration_script('20130717091459_IDEMPIERE-984.sql') FROM dual +; diff --git a/migration/i1.0c-release/postgresql/20130717091459_IDEMPIERE-984.sql b/migration/i1.0c-release/postgresql/20130717091459_IDEMPIERE-984.sql index 7c56888df9..820178942d 100644 --- a/migration/i1.0c-release/postgresql/20130717091459_IDEMPIERE-984.sql +++ b/migration/i1.0c-release/postgresql/20130717091459_IDEMPIERE-984.sql @@ -9,3 +9,4 @@ INSERT INTO AD_Message_Trl (AD_Language,AD_Message_ID, MsgText,MsgTip, IsTransla ; SELECT register_migration_script('20130717091459_IDEMPIERE-984.sql') FROM dual +; diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/UserPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/UserPanel.java index d910b0f261..ca2265442f 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/UserPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/UserPanel.java @@ -17,7 +17,6 @@ package org.adempiere.webui.panel; - import java.util.Properties; import org.adempiere.util.Callback; @@ -66,7 +65,10 @@ public class UserPanel implements EventListener, Composer protected Component component; - public UserPanel() + private static final String ON_DEFER_CHANGE_ROLE = "onDeferChangeRole"; + private static final String ON_DEFER_LOGOUT = "onDeferLogout"; + + public UserPanel() { super(); this.ctx = Env.getCtx(); @@ -106,6 +108,9 @@ public class UserPanel implements EventListener, Composer SessionManager.getSessionApplication().getKeylistener().addEventListener(Events.ON_CTRL_KEY, this); component.addEventListener("onEmailSupport", this); + + component.addEventListener(ON_DEFER_LOGOUT, this); + component.addEventListener(ON_DEFER_CHANGE_ROLE, this); } private String getUserName() @@ -139,19 +144,13 @@ public class UserPanel implements EventListener, Composer return "*"; } } + public void onEvent(Event event) throws Exception { if (event == null) return; if (logout == event.getTarget()) { - component.addEventListener("onLogout", new EventListener() { - @Override - public void onEvent(Event event) throws Exception { - SessionManager.logoutSession(); - } - }); - if (SessionManager.getAppDesktop().isPendingWindow()) { FDialog.ask(0, component, "ProceedWithTask?", new Callback() { @@ -160,12 +159,12 @@ public class UserPanel implements EventListener, Composer { if (result) { - Events.echoEvent(new Event("onLogout", component)); + Events.echoEvent(ON_DEFER_LOGOUT, component, null); } } }); } else { - SessionManager.logoutSession(); + Events.echoEvent(ON_DEFER_LOGOUT, component, null); } } else if (lblUserNameValue == event.getTarget()) @@ -176,13 +175,6 @@ public class UserPanel implements EventListener, Composer } else if (changeRole == event.getTarget()) { - component.addEventListener("onChangeRole", new EventListener() { - @Override - public void onEvent(Event event) throws Exception { - MUser user = MUser.get(ctx); - SessionManager.changeRole(user); - } - }); if (SessionManager.getAppDesktop().isPendingWindow()) { FDialog.ask(0, component, "ProceedWithTask?", new Callback() { @@ -191,13 +183,12 @@ public class UserPanel implements EventListener, Composer { if (result) { - Events.echoEvent(new Event("onChangeRole", component)); + Events.echoEvent(ON_DEFER_CHANGE_ROLE, component, null); } } }); } else { - MUser user = MUser.get(ctx); - SessionManager.changeRole(user); + Events.echoEvent(ON_DEFER_CHANGE_ROLE, component, null); } } else if (preference == event.getTarget()) @@ -246,6 +237,16 @@ public class UserPanel implements EventListener, Composer } } } + else if (ON_DEFER_LOGOUT.equals(event.getName())) + { + SessionManager.logoutSession(); + } + else if (ON_DEFER_CHANGE_ROLE.equals(event.getName())) + { + MUser user = MUser.get(ctx); + SessionManager.changeRole(user); + } + } @Override From 1319bae51a661f00a9003e864e56d99eac4ab4b3 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 18 Jul 2013 16:43:19 -0500 Subject: [PATCH 18/21] Backout aecb6ca - IDEMPIERE-1177 - backed out as a better solution has been proposed, pending to implement --- .../src/org/compiere/model/GridTable.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/GridTable.java b/org.adempiere.base/src/org/compiere/model/GridTable.java index 8908165a4d..79417d23ae 100644 --- a/org.adempiere.base/src/org/compiere/model/GridTable.java +++ b/org.adempiere.base/src/org/compiere/model/GridTable.java @@ -3822,14 +3822,10 @@ public class GridTable extends AbstractTableModel MTable table = MTable.get (m_ctx, m_AD_Table_ID); PO po = null; int Record_ID = getKeyID(row); - if (Record_ID == 0 && MTable.isZeroIDTable(getTableName())) { - po = new Query(Env.getCtx(), table, getKeyColumnName()+"=0", null).first(); - } else { - if (Record_ID != -1) - po = table.getPO(Record_ID, m_trxName); - else // Multi - Key - po = table.getPO(getWhereClause(getDataAtRow(row)), m_trxName); - } + if (Record_ID != -1) + po = table.getPO(Record_ID, m_trxName); + else // Multi - Key + po = table.getPO(getWhereClause(getDataAtRow(row)), m_trxName); return po; } From 226568658b8aebef49bce235150df788d707dfc1 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 18 Jul 2013 23:35:03 -0500 Subject: [PATCH 19/21] IDEMPIERE-1151 --- .../oracle/201307052208_IDEMPIERE-1151.sql | 339 ++++++++++++++++++ .../201307052208_IDEMPIERE-1151.sql | 339 ++++++++++++++++++ .../src/org/compiere/model/I_AD_Column.java | 13 + .../src/org/compiere/model/MColumn.java | 15 +- .../src/org/compiere/model/X_AD_Column.java | 28 +- .../src/org/compiere/util/Env.java | 12 +- 6 files changed, 741 insertions(+), 5 deletions(-) create mode 100644 migration/i1.0c-release/oracle/201307052208_IDEMPIERE-1151.sql create mode 100644 migration/i1.0c-release/postgresql/201307052208_IDEMPIERE-1151.sql diff --git a/migration/i1.0c-release/oracle/201307052208_IDEMPIERE-1151.sql b/migration/i1.0c-release/oracle/201307052208_IDEMPIERE-1151.sql new file mode 100644 index 0000000000..6e6834f86f --- /dev/null +++ b/migration/i1.0c-release/oracle/201307052208_IDEMPIERE-1151.sql @@ -0,0 +1,339 @@ +-- Jul 5, 2013 9:52:28 PM COT +UPDATE AD_Element SET Help=NULL, Description='Defines whether content must be treated as secure',Updated=TO_DATE('2013-07-05 21:52:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=2991 +; + +-- Jul 5, 2013 9:52:28 PM COT +UPDATE AD_Column SET ColumnName='IsSecure', Name='Secure content', Description='Defines whether content must be treated as secure', Help=NULL WHERE AD_Element_ID=2991 +; + +-- Jul 5, 2013 9:52:28 PM COT +UPDATE AD_Process_Para SET ColumnName='IsSecure', Name='Secure content', Description='Defines whether content must be treated as secure', Help=NULL, AD_Element_ID=2991 WHERE UPPER(ColumnName)='ISSECURE' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL +; + +-- Jul 5, 2013 9:52:28 PM COT +UPDATE AD_Process_Para SET ColumnName='IsSecure', Name='Secure content', Description='Defines whether content must be treated as secure', Help=NULL WHERE AD_Element_ID=2991 AND IsCentrallyMaintained='Y' +; + +-- Jul 5, 2013 9:52:28 PM COT +UPDATE AD_InfoColumn SET ColumnName='IsSecure', Name='Secure content', Description='Defines whether content must be treated as secure', Help=NULL WHERE AD_Element_ID=2991 AND IsCentrallyMaintained='Y' +; + +-- Jul 5, 2013 9:52:28 PM COT +UPDATE AD_Field SET Name='Secure content', Description='Defines whether content must be treated as secure', Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=2991) AND IsCentrallyMaintained='Y' +; + +-- Jul 5, 2013 9:55:26 PM COT +INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,Version,AD_Table_ID,AD_Column_ID,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Description,DefaultValue,Name,IsAllowCopy,Updated,CreatedBy,AD_Org_ID,IsActive,Created,UpdatedBy,IsToolbarButton,IsAlwaysUpdateable,AD_Client_ID,EntityType,IsEncrypted,AD_Element_ID) VALUES (0,'N',0,101,210596,'Y','N','N',0,'N',1,'N',20,'N','N','Y','4390c065-55a1-4f20-b5dd-fbd2b50ee66d','Y','IsSecure','Defines whether content must be treated as secure','N','Secure content','Y',TO_DATE('2013-07-05 21:55:24','YYYY-MM-DD HH24:MI:SS'),100,0,'Y',TO_DATE('2013-07-05 21:55:24','YYYY-MM-DD HH24:MI:SS'),100,'N','N',0,'D','N',2991) +; + +-- Jul 5, 2013 9:55:26 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) 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,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=210596 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) +; + +-- Jul 5, 2013 9:55:33 PM COT +ALTER TABLE AD_Column ADD IsSecure CHAR(1) DEFAULT 'N' CHECK (IsSecure IN ('Y','N')) NOT NULL +; + +-- Jul 5, 2013 9:57:16 PM COT +INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Description,Name,AD_Field_UU,IsDisplayed,IsFieldOnly,UpdatedBy,AD_Org_ID,Created,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,IsQuickEntry,AD_Client_ID,ColumnSpan,NumLines) VALUES (0,'N',101,0,'N','N',210596,420,'Y',202257,'N','D','Defines whether content must be treated as secure','Secure content','16162fa3-3425-4e4b-b1bc-d620bdf72ba4','Y','N',100,0,TO_DATE('2013-07-05 21:57:15','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2013-07-05 21:57:15','YYYY-MM-DD HH24:MI:SS'),'Y','Y',430,1,'N',0,1,1) +; + +-- Jul 5, 2013 9:57:16 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=202257 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) +; + +-- Jul 5, 2013 10:00:19 PM COT +UPDATE AD_Field SET SeqNo=280, IsDisplayed='Y', XPosition=5, ColumnSpan=2,Updated=TO_DATE('2013-07-05 22:00:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202257 +; + +-- Jul 5, 2013 10:00:19 PM COT +UPDATE AD_Field SET SeqNo=290, IsDisplayed='Y', XPosition=2,Updated=TO_DATE('2013-07-05 22:00:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=2370 +; + +-- Jul 5, 2013 10:00:19 PM COT +UPDATE AD_Field SET SeqNo=300,Updated=TO_DATE('2013-07-05 22:00:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10128 +; + +-- Jul 5, 2013 10:00:19 PM COT +UPDATE AD_Field SET SeqNo=310,Updated=TO_DATE('2013-07-05 22:00:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=160 +; + +-- Jul 5, 2013 10:00:19 PM COT +UPDATE AD_Field SET SeqNo=320,Updated=TO_DATE('2013-07-05 22:00:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5122 +; + +-- Jul 5, 2013 10:00:19 PM COT +UPDATE AD_Field SET SeqNo=330,Updated=TO_DATE('2013-07-05 22:00:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4941 +; + +-- Jul 5, 2013 10:00:19 PM COT +UPDATE AD_Field SET SeqNo=340,Updated=TO_DATE('2013-07-05 22:00:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50188 +; + +-- Jul 5, 2013 10:00:19 PM COT +UPDATE AD_Field SET SeqNo=350,Updated=TO_DATE('2013-07-05 22:00:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=168 +; + +-- Jul 5, 2013 10:00:20 PM COT +UPDATE AD_Field SET SeqNo=360,Updated=TO_DATE('2013-07-05 22:00:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=159 +; + +-- Jul 5, 2013 10:00:20 PM COT +UPDATE AD_Field SET SeqNo=370,Updated=TO_DATE('2013-07-05 22:00:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4940 +; + +-- Jul 5, 2013 10:00:20 PM COT +UPDATE AD_Field SET SeqNo=380,Updated=TO_DATE('2013-07-05 22:00:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200288 +; + +-- Jul 5, 2013 10:00:20 PM COT +UPDATE AD_Field SET SeqNo=390,Updated=TO_DATE('2013-07-05 22:00:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56317 +; + +-- Jul 5, 2013 10:00:20 PM COT +UPDATE AD_Field SET SeqNo=400,Updated=TO_DATE('2013-07-05 22:00:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=62467 +; + +-- Jul 5, 2013 10:00:20 PM COT +UPDATE AD_Field SET SeqNo=410,Updated=TO_DATE('2013-07-05 22:00:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=167 +; + +-- Jul 5, 2013 10:00:20 PM COT +UPDATE AD_Field SET SeqNo=420,Updated=TO_DATE('2013-07-05 22:00:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=825 +; + +-- Jul 5, 2013 10:13:17 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:13:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=6560 +; + +-- Jul 5, 2013 10:15:16 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:15:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=6559 +; + +-- Jul 5, 2013 10:15:42 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:15:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=4771 +; + +-- Jul 5, 2013 10:20:07 PM COT +UPDATE R_RequestProcessor SET DateLastRun=TO_DATE('2013-07-05 22:20:07','YYYY-MM-DD HH24:MI:SS'), DateNextRun=TO_DATE('2013-07-05 22:35:07','YYYY-MM-DD HH24:MI:SS'),Updated=TO_DATE('2013-07-05 22:20:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE R_RequestProcessor_ID=1000003 +; + +-- Jul 5, 2013 10:29:14 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:29:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200972 +; + +-- Jul 5, 2013 10:29:21 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:29:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200974 +; + +-- Jul 5, 2013 10:29:27 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:29:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200971 +; + +-- Jul 5, 2013 10:29:32 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:29:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200973 +; + +-- Jul 5, 2013 10:30:23 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:30:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=12943 +; + +-- Jul 5, 2013 10:31:04 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:31:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=9885 +; + +-- Jul 5, 2013 10:31:11 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:31:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=12402 +; + +-- Jul 5, 2013 10:31:14 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:31:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=12409 +; + +-- Jul 5, 2013 10:31:38 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:31:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=7806 +; + +-- Jul 5, 2013 10:31:50 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:31:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=14856 +; + +-- Jul 5, 2013 10:32:00 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:32:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=12944 +; + +-- Jul 5, 2013 10:32:35 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:32:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200458 +; + +-- Jul 5, 2013 10:32:52 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:32:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=7793 +; + +-- Jul 5, 2013 10:32:55 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:32:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=7794 +; + +-- Jul 5, 2013 10:33:28 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:33:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200409 +; + +-- Jul 5, 2013 10:33:35 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:33:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=12401 +; + +-- Jul 5, 2013 10:33:43 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:33:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=417 +; + +-- Jul 5, 2013 10:33:55 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:33:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=61756 +; + +-- Jul 5, 2013 10:33:58 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:33:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200457 +; + +-- Jul 5, 2013 10:34:08 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:34:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=52066 +; + +-- Jul 5, 2013 10:35:02 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:35:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200895 +; + +-- Jul 5, 2013 10:35:15 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:35:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200898 +; + +-- Jul 5, 2013 10:35:26 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:35:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200897 +; + +-- Jul 5, 2013 10:35:30 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:35:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200896 +; + +-- Jul 5, 2013 10:36:19 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:36:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=10365 +; + +-- Jul 5, 2013 10:36:26 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:36:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=10354 +; + +-- Jul 5, 2013 10:36:30 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:36:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=10345 +; + +-- Jul 5, 2013 10:36:37 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:36:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=10350 +; + +-- Jul 5, 2013 10:36:42 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:36:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=10356 +; + +-- Jul 5, 2013 10:36:46 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:36:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=10367 +; + +-- Jul 5, 2013 10:36:56 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:36:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=10360 +; + +-- Jul 5, 2013 10:37:32 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:37:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5060 +; + +-- Jul 5, 2013 10:37:42 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:37:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5062 +; + +-- Jul 5, 2013 10:37:45 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:37:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5064 +; + +-- Jul 5, 2013 10:37:48 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:37:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5065 +; + +-- Jul 5, 2013 10:38:29 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:38:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=54537 +; + +-- Jul 5, 2013 10:38:36 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:38:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=54540 +; + +-- Jul 5, 2013 10:39:10 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:39:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=54587 +; + +-- Jul 5, 2013 10:39:18 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:39:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=54590 +; + +-- Jul 5, 2013 10:39:32 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:39:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=54589 +; + +-- Jul 5, 2013 10:39:43 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:39:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=54539 +; + +-- Jul 5, 2013 10:40:34 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:40:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=13618 +; + +-- Jul 5, 2013 10:41:49 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:41:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200612 +; + +-- Jul 5, 2013 10:43:21 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:43:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=201024 +; + +-- Jul 5, 2013 10:43:24 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:43:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=201025 +; + +-- Jul 5, 2013 10:43:37 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:43:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=201034 +; + +-- Jul 5, 2013 10:43:51 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:43:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=202058 +; + +-- Jul 5, 2013 10:44:00 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:44:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=202064 +; + +-- Jul 5, 2013 10:44:03 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:44:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=202065 +; + +-- Jul 5, 2013 10:44:06 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:44:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=202066 +; + +-- Jul 5, 2013 10:45:06 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:45:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=202216 +; + +-- Jul 5, 2013 10:45:41 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:45:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=201176 +; + +-- Jul 5, 2013 10:45:43 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:45:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=201177 +; + +-- Jul 5, 2013 10:46:00 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_DATE('2013-07-05 22:46:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=201174 +; + +SELECT register_migration_script('201307052208_IDEMPIERE-1151.sql') FROM dual +; + diff --git a/migration/i1.0c-release/postgresql/201307052208_IDEMPIERE-1151.sql b/migration/i1.0c-release/postgresql/201307052208_IDEMPIERE-1151.sql new file mode 100644 index 0000000000..0c95af4b21 --- /dev/null +++ b/migration/i1.0c-release/postgresql/201307052208_IDEMPIERE-1151.sql @@ -0,0 +1,339 @@ +-- Jul 5, 2013 9:52:28 PM COT +UPDATE AD_Element SET Help=NULL, Description='Defines whether content must be treated as secure',Updated=TO_TIMESTAMP('2013-07-05 21:52:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=2991 +; + +-- Jul 5, 2013 9:52:28 PM COT +UPDATE AD_Column SET ColumnName='IsSecure', Name='Secure content', Description='Defines whether content must be treated as secure', Help=NULL WHERE AD_Element_ID=2991 +; + +-- Jul 5, 2013 9:52:28 PM COT +UPDATE AD_Process_Para SET ColumnName='IsSecure', Name='Secure content', Description='Defines whether content must be treated as secure', Help=NULL, AD_Element_ID=2991 WHERE UPPER(ColumnName)='ISSECURE' AND IsCentrallyMaintained='Y' AND AD_Element_ID IS NULL +; + +-- Jul 5, 2013 9:52:28 PM COT +UPDATE AD_Process_Para SET ColumnName='IsSecure', Name='Secure content', Description='Defines whether content must be treated as secure', Help=NULL WHERE AD_Element_ID=2991 AND IsCentrallyMaintained='Y' +; + +-- Jul 5, 2013 9:52:28 PM COT +UPDATE AD_InfoColumn SET ColumnName='IsSecure', Name='Secure content', Description='Defines whether content must be treated as secure', Help=NULL WHERE AD_Element_ID=2991 AND IsCentrallyMaintained='Y' +; + +-- Jul 5, 2013 9:52:28 PM COT +UPDATE AD_Field SET Name='Secure content', Description='Defines whether content must be treated as secure', Help=NULL WHERE AD_Column_ID IN (SELECT AD_Column_ID FROM AD_Column WHERE AD_Element_ID=2991) AND IsCentrallyMaintained='Y' +; + +-- Jul 5, 2013 9:55:26 PM COT +INSERT INTO AD_Column (SeqNoSelection,IsSyncDatabase,Version,AD_Table_ID,AD_Column_ID,IsMandatory,IsTranslated,IsIdentifier,SeqNo,IsParent,FieldLength,IsSelectionColumn,AD_Reference_ID,IsKey,IsAutocomplete,IsAllowLogging,AD_Column_UU,IsUpdateable,ColumnName,Description,DefaultValue,Name,IsAllowCopy,Updated,CreatedBy,AD_Org_ID,IsActive,Created,UpdatedBy,IsToolbarButton,IsAlwaysUpdateable,AD_Client_ID,EntityType,IsEncrypted,AD_Element_ID) VALUES (0,'N',0,101,210596,'Y','N','N',0,'N',1,'N',20,'N','N','Y','4390c065-55a1-4f20-b5dd-fbd2b50ee66d','Y','IsSecure','Defines whether content must be treated as secure','N','Secure content','Y',TO_TIMESTAMP('2013-07-05 21:55:24','YYYY-MM-DD HH24:MI:SS'),100,0,'Y',TO_TIMESTAMP('2013-07-05 21:55:24','YYYY-MM-DD HH24:MI:SS'),100,'N','N',0,'D','N',2991) +; + +-- Jul 5, 2013 9:55:26 PM COT +INSERT INTO AD_Column_Trl (AD_Language,AD_Column_ID, Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Column_Trl_UU ) 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,Generate_UUID() FROM AD_Language l, AD_Column t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Column_ID=210596 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) +; + +-- Jul 5, 2013 9:55:33 PM COT +ALTER TABLE AD_Column ADD COLUMN IsSecure CHAR(1) DEFAULT 'N' CHECK (IsSecure IN ('Y','N')) NOT NULL +; + +-- Jul 5, 2013 9:57:16 PM COT +INSERT INTO AD_Field (SortNo,IsEncrypted,AD_Tab_ID,DisplayLength,IsSameLine,IsHeading,AD_Column_ID,SeqNo,IsCentrallyMaintained,AD_Field_ID,IsReadOnly,EntityType,Description,Name,AD_Field_UU,IsDisplayed,IsFieldOnly,UpdatedBy,AD_Org_ID,Created,CreatedBy,Updated,IsActive,IsDisplayedGrid,SeqNoGrid,XPosition,IsQuickEntry,AD_Client_ID,ColumnSpan,NumLines) VALUES (0,'N',101,0,'N','N',210596,420,'Y',202257,'N','D','Defines whether content must be treated as secure','Secure content','16162fa3-3425-4e4b-b1bc-d620bdf72ba4','Y','N',100,0,TO_TIMESTAMP('2013-07-05 21:57:15','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2013-07-05 21:57:15','YYYY-MM-DD HH24:MI:SS'),'Y','Y',430,1,'N',0,1,1) +; + +-- Jul 5, 2013 9:57:16 PM COT +INSERT INTO AD_Field_Trl (AD_Language,AD_Field_ID, Help,Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy,AD_Field_Trl_UU ) SELECT l.AD_Language,t.AD_Field_ID, t.Help,t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy,Generate_UUID() FROM AD_Language l, AD_Field t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Field_ID=202257 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) +; + +-- Jul 5, 2013 10:00:19 PM COT +UPDATE AD_Field SET SeqNo=280, IsDisplayed='Y', XPosition=5, ColumnSpan=2,Updated=TO_TIMESTAMP('2013-07-05 22:00:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202257 +; + +-- Jul 5, 2013 10:00:19 PM COT +UPDATE AD_Field SET SeqNo=290, IsDisplayed='Y', XPosition=2,Updated=TO_TIMESTAMP('2013-07-05 22:00:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=2370 +; + +-- Jul 5, 2013 10:00:19 PM COT +UPDATE AD_Field SET SeqNo=300,Updated=TO_TIMESTAMP('2013-07-05 22:00:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10128 +; + +-- Jul 5, 2013 10:00:19 PM COT +UPDATE AD_Field SET SeqNo=310,Updated=TO_TIMESTAMP('2013-07-05 22:00:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=160 +; + +-- Jul 5, 2013 10:00:19 PM COT +UPDATE AD_Field SET SeqNo=320,Updated=TO_TIMESTAMP('2013-07-05 22:00:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=5122 +; + +-- Jul 5, 2013 10:00:19 PM COT +UPDATE AD_Field SET SeqNo=330,Updated=TO_TIMESTAMP('2013-07-05 22:00:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4941 +; + +-- Jul 5, 2013 10:00:19 PM COT +UPDATE AD_Field SET SeqNo=340,Updated=TO_TIMESTAMP('2013-07-05 22:00:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=50188 +; + +-- Jul 5, 2013 10:00:19 PM COT +UPDATE AD_Field SET SeqNo=350,Updated=TO_TIMESTAMP('2013-07-05 22:00:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=168 +; + +-- Jul 5, 2013 10:00:20 PM COT +UPDATE AD_Field SET SeqNo=360,Updated=TO_TIMESTAMP('2013-07-05 22:00:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=159 +; + +-- Jul 5, 2013 10:00:20 PM COT +UPDATE AD_Field SET SeqNo=370,Updated=TO_TIMESTAMP('2013-07-05 22:00:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=4940 +; + +-- Jul 5, 2013 10:00:20 PM COT +UPDATE AD_Field SET SeqNo=380,Updated=TO_TIMESTAMP('2013-07-05 22:00:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=200288 +; + +-- Jul 5, 2013 10:00:20 PM COT +UPDATE AD_Field SET SeqNo=390,Updated=TO_TIMESTAMP('2013-07-05 22:00:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=56317 +; + +-- Jul 5, 2013 10:00:20 PM COT +UPDATE AD_Field SET SeqNo=400,Updated=TO_TIMESTAMP('2013-07-05 22:00:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=62467 +; + +-- Jul 5, 2013 10:00:20 PM COT +UPDATE AD_Field SET SeqNo=410,Updated=TO_TIMESTAMP('2013-07-05 22:00:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=167 +; + +-- Jul 5, 2013 10:00:20 PM COT +UPDATE AD_Field SET SeqNo=420,Updated=TO_TIMESTAMP('2013-07-05 22:00:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=825 +; + +-- Jul 5, 2013 10:13:17 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:13:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=6560 +; + +-- Jul 5, 2013 10:15:16 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:15:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=6559 +; + +-- Jul 5, 2013 10:15:42 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:15:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=4771 +; + +-- Jul 5, 2013 10:20:07 PM COT +UPDATE R_RequestProcessor SET DateLastRun=TO_TIMESTAMP('2013-07-05 22:20:07','YYYY-MM-DD HH24:MI:SS'), DateNextRun=TO_TIMESTAMP('2013-07-05 22:35:07','YYYY-MM-DD HH24:MI:SS'),Updated=TO_TIMESTAMP('2013-07-05 22:20:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE R_RequestProcessor_ID=1000003 +; + +-- Jul 5, 2013 10:29:14 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:29:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200972 +; + +-- Jul 5, 2013 10:29:21 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:29:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200974 +; + +-- Jul 5, 2013 10:29:27 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:29:27','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200971 +; + +-- Jul 5, 2013 10:29:32 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:29:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200973 +; + +-- Jul 5, 2013 10:30:23 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:30:23','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=12943 +; + +-- Jul 5, 2013 10:31:04 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:31:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=9885 +; + +-- Jul 5, 2013 10:31:11 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:31:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=12402 +; + +-- Jul 5, 2013 10:31:14 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:31:14','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=12409 +; + +-- Jul 5, 2013 10:31:38 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:31:38','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=7806 +; + +-- Jul 5, 2013 10:31:50 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:31:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=14856 +; + +-- Jul 5, 2013 10:32:00 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:32:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=12944 +; + +-- Jul 5, 2013 10:32:35 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:32:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200458 +; + +-- Jul 5, 2013 10:32:52 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:32:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=7793 +; + +-- Jul 5, 2013 10:32:55 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:32:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=7794 +; + +-- Jul 5, 2013 10:33:28 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:33:28','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200409 +; + +-- Jul 5, 2013 10:33:35 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:33:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=12401 +; + +-- Jul 5, 2013 10:33:43 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:33:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=417 +; + +-- Jul 5, 2013 10:33:55 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:33:55','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=61756 +; + +-- Jul 5, 2013 10:33:58 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:33:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200457 +; + +-- Jul 5, 2013 10:34:08 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:34:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=52066 +; + +-- Jul 5, 2013 10:35:02 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:35:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200895 +; + +-- Jul 5, 2013 10:35:15 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:35:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200898 +; + +-- Jul 5, 2013 10:35:26 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:35:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200897 +; + +-- Jul 5, 2013 10:35:30 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:35:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200896 +; + +-- Jul 5, 2013 10:36:19 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:36:19','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=10365 +; + +-- Jul 5, 2013 10:36:26 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:36:26','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=10354 +; + +-- Jul 5, 2013 10:36:30 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:36:30','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=10345 +; + +-- Jul 5, 2013 10:36:37 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:36:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=10350 +; + +-- Jul 5, 2013 10:36:42 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:36:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=10356 +; + +-- Jul 5, 2013 10:36:46 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:36:46','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=10367 +; + +-- Jul 5, 2013 10:36:56 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:36:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=10360 +; + +-- Jul 5, 2013 10:37:32 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:37:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5060 +; + +-- Jul 5, 2013 10:37:42 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:37:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5062 +; + +-- Jul 5, 2013 10:37:45 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:37:45','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5064 +; + +-- Jul 5, 2013 10:37:48 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:37:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=5065 +; + +-- Jul 5, 2013 10:38:29 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:38:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=54537 +; + +-- Jul 5, 2013 10:38:36 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:38:36','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=54540 +; + +-- Jul 5, 2013 10:39:10 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:39:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=54587 +; + +-- Jul 5, 2013 10:39:18 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:39:18','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=54590 +; + +-- Jul 5, 2013 10:39:32 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:39:32','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=54589 +; + +-- Jul 5, 2013 10:39:43 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:39:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=54539 +; + +-- Jul 5, 2013 10:40:34 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:40:34','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=13618 +; + +-- Jul 5, 2013 10:41:49 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:41:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=200612 +; + +-- Jul 5, 2013 10:43:21 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:43:21','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=201024 +; + +-- Jul 5, 2013 10:43:24 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:43:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=201025 +; + +-- Jul 5, 2013 10:43:37 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:43:37','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=201034 +; + +-- Jul 5, 2013 10:43:51 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:43:51','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=202058 +; + +-- Jul 5, 2013 10:44:00 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:44:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=202064 +; + +-- Jul 5, 2013 10:44:03 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:44:03','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=202065 +; + +-- Jul 5, 2013 10:44:06 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:44:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=202066 +; + +-- Jul 5, 2013 10:45:06 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:45:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=202216 +; + +-- Jul 5, 2013 10:45:41 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:45:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=201176 +; + +-- Jul 5, 2013 10:45:43 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:45:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=201177 +; + +-- Jul 5, 2013 10:46:00 PM COT +UPDATE AD_Column SET IsSecure='Y',Updated=TO_TIMESTAMP('2013-07-05 22:46:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=201174 +; + +SELECT register_migration_script('201307052208_IDEMPIERE-1151.sql') FROM dual +; + diff --git a/org.adempiere.base/src/org/compiere/model/I_AD_Column.java b/org.adempiere.base/src/org/compiere/model/I_AD_Column.java index 022187b7a1..91497d7aa4 100644 --- a/org.adempiere.base/src/org/compiere/model/I_AD_Column.java +++ b/org.adempiere.base/src/org/compiere/model/I_AD_Column.java @@ -441,6 +441,19 @@ public interface I_AD_Column */ public boolean isParent(); + /** Column name IsSecure */ + public static final String COLUMNNAME_IsSecure = "IsSecure"; + + /** Set Secure content. + * Defines whether content must be treated as secure + */ + public void setIsSecure (boolean IsSecure); + + /** Get Secure content. + * Defines whether content must be treated as secure + */ + public boolean isSecure(); + /** Column name IsSelectionColumn */ public static final String COLUMNNAME_IsSelectionColumn = "IsSelectionColumn"; diff --git a/org.adempiere.base/src/org/compiere/model/MColumn.java b/org.adempiere.base/src/org/compiere/model/MColumn.java index 9efc475638..a9cb759b1a 100644 --- a/org.adempiere.base/src/org/compiere/model/MColumn.java +++ b/org.adempiere.base/src/org/compiere/model/MColumn.java @@ -47,7 +47,7 @@ public class MColumn extends X_AD_Column /** * */ - private static final long serialVersionUID = 2344447703630569514L; + private static final long serialVersionUID = 4321132594207949196L; /** * Get MColumn from Cache @@ -67,6 +67,19 @@ public class MColumn extends X_AD_Column return retValue; } // get + /** + * Get MColumn given TableName and ColumnName + * @param ctx context + * @param TableName + * @param ColumnName + * @return MColumn + */ + public static MColumn get (Properties ctx, String tableName, String columnName) + { + MTable table = MTable.get(ctx, tableName); + return table.getColumn(columnName); + } // get + /** * Get Column Name * @param ctx context diff --git a/org.adempiere.base/src/org/compiere/model/X_AD_Column.java b/org.adempiere.base/src/org/compiere/model/X_AD_Column.java index 756a51bbe8..e7513e3d36 100644 --- a/org.adempiere.base/src/org/compiere/model/X_AD_Column.java +++ b/org.adempiere.base/src/org/compiere/model/X_AD_Column.java @@ -32,7 +32,7 @@ public class X_AD_Column extends PO implements I_AD_Column, I_Persistent /** * */ - private static final long serialVersionUID = 20130626L; + private static final long serialVersionUID = 20130705L; /** Standard Constructor */ public X_AD_Column (Properties ctx, int AD_Column_ID, String trxName) @@ -59,6 +59,8 @@ public class X_AD_Column extends PO implements I_AD_Column, I_Persistent setIsKey (false); setIsMandatory (false); setIsParent (false); + setIsSecure (false); +// N setIsSelectionColumn (false); setIsToolbarButton (true); // Y @@ -686,6 +688,30 @@ public class X_AD_Column extends PO implements I_AD_Column, I_Persistent return false; } + /** Set Secure content. + @param IsSecure + Defines whether content must be treated as secure + */ + public void setIsSecure (boolean IsSecure) + { + set_Value (COLUMNNAME_IsSecure, Boolean.valueOf(IsSecure)); + } + + /** Get Secure content. + @return Defines whether content must be treated as secure + */ + public boolean isSecure () + { + Object oo = get_Value(COLUMNNAME_IsSecure); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; + } + /** Set Selection Column. @param IsSelectionColumn Is this column used for finding rows in windows diff --git a/org.adempiere.base/src/org/compiere/util/Env.java b/org.adempiere.base/src/org/compiere/util/Env.java index f241702965..f4a4e26ee4 100644 --- a/org.adempiere.base/src/org/compiere/util/Env.java +++ b/org.adempiere.base/src/org/compiere/util/Env.java @@ -54,6 +54,7 @@ import org.compiere.db.CConnection; import org.compiere.model.GridWindowVO; import org.compiere.model.I_AD_Window; import org.compiere.model.MClient; +import org.compiere.model.MColumn; import org.compiere.model.MLookupCache; import org.compiere.model.MRole; import org.compiere.model.MSession; @@ -1459,9 +1460,9 @@ public final class Env token = token.substring(0, f); } + Properties ctx = po != null ? po.getCtx() : Env.getCtx(); if (token.startsWith("#") || token.startsWith("$")) { //take from context - Properties ctx = po != null ? po.getCtx() : Env.getCtx(); String v = Env.getContext(ctx, token); if (v != null && v.length() > 0) outStr.append(v); @@ -1476,8 +1477,13 @@ public final class Env int tblIndex = format.indexOf("."); String table = tblIndex > 0 ? format.substring(0, tblIndex) : token.substring(0, token.length() - 3); String column = tblIndex > 0 ? format.substring(tblIndex + 1) : format; - outStr.append(DB.getSQLValueString(trxName, - "SELECT " + column + " FROM " + table + " WHERE " + table + "_ID = ?", (Integer)v)); + MColumn col = MColumn.get(ctx, table, column); + if (col != null && col.isSecure()) { + outStr.append("********"); + } else { + outStr.append(DB.getSQLValueString(trxName, + "SELECT " + column + " FROM " + table + " WHERE " + table + "_ID = ?", (Integer)v)); + } } else if (v instanceof Date) { SimpleDateFormat df = new SimpleDateFormat(format); outStr.append(df.format((Date)v)); From 068897e9123206a69a29b2c017e16b40951529eb Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 18 Jul 2013 23:35:17 -0500 Subject: [PATCH 20/21] IDEMPIERE-1162 --- org.adempiere.base/src/org/compiere/model/MMailText.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/org.adempiere.base/src/org/compiere/model/MMailText.java b/org.adempiere.base/src/org/compiere/model/MMailText.java index 394ba91375..8acec867b3 100644 --- a/org.adempiere.base/src/org/compiere/model/MMailText.java +++ b/org.adempiere.base/src/org/compiere/model/MMailText.java @@ -23,6 +23,7 @@ import java.util.logging.Level; import org.compiere.util.CCache; import org.compiere.util.DB; +import org.compiere.util.Env; /** * Request Mail Template Model. @@ -216,7 +217,13 @@ public class MMailText extends X_R_MailText return msgreturn.toString(); // keep for next } // - Object value = po.get_Value(index); + MColumn col = MColumn.get(Env.getCtx(), po.get_TableName(), variable); + Object value = null; + if (col != null && col.isSecure()) { + value = "********"; + } else { + value = po.get_Value(index); + } if (value == null) return ""; return value.toString(); From a33c9c0817a6ec02c3b95c819da53223212422c7 Mon Sep 17 00:00:00 2001 From: Elaine Tan Date: Mon, 22 Jul 2013 18:13:12 +0800 Subject: [PATCH 21/21] IDEMPIERE-860 Review Payment Processors - include credit card validation --- .../org/compiere/model/PaymentProcessor.java | 7 ++-- .../compiere/grid/VPaymentFormCreditCard.java | 2 +- .../apps/form/WPaymentFormCreditCard.java | 8 +++- .../compiere/grid/PaymentFormCreditCard.java | 40 ++++++++++++++++--- 4 files changed, 46 insertions(+), 11 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/PaymentProcessor.java b/org.adempiere.base/src/org/compiere/model/PaymentProcessor.java index dd9886ccd2..7ffdaae862 100644 --- a/org.adempiere.base/src/org/compiere/model/PaymentProcessor.java +++ b/org.adempiere.base/src/org/compiere/model/PaymentProcessor.java @@ -118,8 +118,6 @@ public abstract class PaymentProcessor */ public String validate() throws IllegalArgumentException { String msg = null; - if (p_mp.getC_BP_BankAccount_ID() != 0 || p_mp.getCustomerPaymentProfileID() != null) - return msg; if (MPayment.TENDERTYPE_CreditCard.equals(p_mp.getTenderType())) { msg = validateCreditCard(); } else if (MPayment.TENDERTYPE_Check.equals(p_mp.getTenderType())) { @@ -143,7 +141,10 @@ public abstract class PaymentProcessor } public String validateCreditCard() throws IllegalArgumentException { - String msg = MPaymentValidate.validateCreditCardNumber(p_mp.getCreditCardNumber(), p_mp.getCreditCardType()); + String msg = null; + if (p_mp.getC_BP_BankAccount_ID() != 0 || (p_mp.getCustomerPaymentProfileID() != null && p_mp.getCustomerPaymentProfileID().length() > 0)) + return msg; + msg = MPaymentValidate.validateCreditCardNumber(p_mp.getCreditCardNumber(), p_mp.getCreditCardType()); if (msg != null && msg.length() > 0) throw new IllegalArgumentException(Msg.getMsg(Env.getCtx(), msg)); msg = MPaymentValidate.validateCreditCardExp(p_mp.getCreditCardExpMM(), p_mp.getCreditCardExpYY()); diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormCreditCard.java b/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormCreditCard.java index 312b4e91c8..d48f2d7697 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormCreditCard.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/VPaymentFormCreditCard.java @@ -274,7 +274,7 @@ public class VPaymentFormCreditCard extends PaymentFormCreditCard implements Act ValueNamePair vp = (ValueNamePair)kTypeCombo.getSelectedItem(); String CCType = vp.getValue(); - boolean ok = processOnline(CCType, kNumberField.getText(), kExpField.getText()); + boolean ok = processOnline(CCType, kNumberField.getText(), kApprovalField.getText(), kExpField.getText()); if (!ok) ADialog.error(getWindowNo(), dialog, "PaymentError", processMsg); else diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WPaymentFormCreditCard.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WPaymentFormCreditCard.java index 6c8beb2a72..854a3b3a1a 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WPaymentFormCreditCard.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WPaymentFormCreditCard.java @@ -75,9 +75,13 @@ public class WPaymentFormCreditCard extends PaymentFormCreditCard implements Eve public void init() { Grid kLayout = GridFactory.newGridLayout(); - window.getPanel().appendChild(kLayout); + window.getPanel().appendChild(kLayout); + kNumberField.setMaxlength(16); kNumberField.setCols(16); + + kExpField.setMaxlength(4); kExpField.setCols(4); + kApprovalField.setMaxlength(4); kApprovalField.setCols(4); kApprovalField.setType("password"); kTypeLabel.setText(Msg.translate(Env.getCtx(), "CreditCardType")); @@ -291,7 +295,7 @@ public class WPaymentFormCreditCard extends PaymentFormCreditCard implements Eve ValueNamePair vp = kTypeCombo.getSelectedItem().toValueNamePair(); String CCType = vp.getValue(); - boolean ok = processOnline(CCType, kNumberField.getText(), kExpField.getText()); + boolean ok = processOnline(CCType, kNumberField.getText(), kApprovalField.getText(), kExpField.getText()); if (!ok) FDialog.error(getWindowNo(), window, "PaymentNotProcessed", processMsg); else diff --git a/org.adempiere.ui/src/org/compiere/grid/PaymentFormCreditCard.java b/org.adempiere.ui/src/org/compiere/grid/PaymentFormCreditCard.java index 3be8db4130..d748e8d9df 100644 --- a/org.adempiere.ui/src/org/compiere/grid/PaymentFormCreditCard.java +++ b/org.adempiere.ui/src/org/compiere/grid/PaymentFormCreditCard.java @@ -26,6 +26,7 @@ import org.compiere.model.MOrder; import org.compiere.model.MPayment; import org.compiere.model.MPaymentProcessor; import org.compiere.model.MPaymentTransaction; +import org.compiere.model.MPaymentValidate; import org.compiere.process.DocAction; import org.compiere.util.Env; import org.compiere.util.Msg; @@ -392,16 +393,16 @@ public abstract class PaymentFormCreditCard extends PaymentForm { return true; } - public boolean processOnline(String CCType, String CCNumber, String CCExp) + public boolean processOnline(String CCType, String CCNumber, String CCVV, String CCExp) { - return processOnline(CCType, CCNumber, CCExp, 0); + return processOnline(CCType, CCNumber, CCVV, CCExp, 0); } - public boolean processOnline(String CCType, String CCNumber, String CCExp, int C_PaymentProcessor_ID) + public boolean processOnline(String CCType, String CCNumber, String CCVV, String CCExp, int C_PaymentProcessor_ID) { processMsg = null; boolean error = false; - + int C_Order_ID = Env.getContextAsInt(Env.getCtx(), getWindowNo(), "C_Order_ID"); int C_Invoice_ID = Env.getContextAsInt(Env.getCtx(), getWindowNo(), "C_Invoice_ID"); if (C_Invoice_ID == 0 && m_DocStatus.equals(MInvoice.DOCSTATUS_Completed)) @@ -430,7 +431,7 @@ public abstract class PaymentFormCreditCard extends PaymentForm { MPaymentTransaction mpt = new MPaymentTransaction(Env.getCtx(), 0, null); mpt.setAD_Org_ID(m_AD_Org_ID); - mpt.setCreditCard(MPayment.TRXTYPE_Sales, CCType, CCNumber, "", CCExp); + mpt.setCreditCard(MPayment.TRXTYPE_Sales, CCType, CCNumber, CCVV != null ? CCVV : "", CCExp); mpt.setAmount(m_C_Currency_ID, payAmount); mpt.setC_PaymentProcessor_ID(C_PaymentProcessor_ID); mpt.setPaymentProcessor(); @@ -461,10 +462,20 @@ public abstract class PaymentFormCreditCard extends PaymentForm { mpt.setC_Invoice_ID(C_Invoice_ID); mpt.setDateTrx(m_DateAcct); setCustomizeValues(mpt); + + // validate credit card + String msg = validateCreditCard(CCType, CCNumber, CCVV != null ? CCVV : "", CCExp, mpt.getC_BP_BankAccount_ID(), mpt.getCustomerPaymentProfileID()); + if (msg != null && msg.trim().length() > 0) + { + processMsg = Msg.getMsg(Env.getCtx(), msg); + return false; + } + if (!mpt.save()) { processMsg = Msg.getMsg(Env.getCtx(), "PaymentNotCreated"); return false; } else { + mpt.setCreditCardVV(CCVV != null ? CCVV : ""); approved = mpt.processOnline(); mpt.saveEx(); @@ -507,4 +518,23 @@ public abstract class PaymentFormCreditCard extends PaymentForm { public boolean isApproved() { return m_mPayment.isApproved(); } + + public String validateCreditCard(String CCType, String CCNumber, String CCVV, String CCExp, int C_BP_BankAccount_ID, String CustomerPaymentProfileID) throws IllegalArgumentException { + String msg = null; + if (C_BP_BankAccount_ID != 0 || (CustomerPaymentProfileID != null && CustomerPaymentProfileID.length() > 0)) + return msg; + msg = MPaymentValidate.validateCreditCardNumber(CCNumber, CCType); + if (msg != null && msg.length() > 0) + return Msg.getMsg(Env.getCtx(), msg); + msg = MPaymentValidate.validateCreditCardExp(MPaymentValidate.getCreditCardExpMM(CCExp), MPaymentValidate.getCreditCardExpYY(CCExp)); + if (msg != null && msg.length() > 0) + return Msg.getMsg(Env.getCtx(), msg); + if (CCVV != null && CCVV.length() > 0) + { + msg = MPaymentValidate.validateCreditCardVV(CCVV, CCType); + if (msg != null && msg.length() > 0) + return Msg.getMsg(Env.getCtx(), msg); + } + return msg; + } }