From 2bca265f59de872051c6725becb9a430855c6fc9 Mon Sep 17 00:00:00 2001 From: eugenh Date: Thu, 26 Feb 2015 09:51:50 -0500 Subject: [PATCH 1/5] hotfix/BF3564464 Import File Loader discards input records , https://sourceforge.net/tracker/?func=detail&aid=3564464&group_id=176962&atid=879332 IDEMPIERE-431 --- .../src/org/compiere/impexp/ImpFormat.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/impexp/ImpFormat.java b/org.adempiere.base/src/org/compiere/impexp/ImpFormat.java index 68a22ab1f7..d7d5745dcb 100644 --- a/org.adempiere.base/src/org/compiere/impexp/ImpFormat.java +++ b/org.adempiere.base/src/org/compiere/impexp/ImpFormat.java @@ -37,8 +37,10 @@ import org.compiere.util.Env; * @author Jorg Janke * @author Trifon Trifonov, Catura AG (www.catura.de) *
  • FR [ 3010957 ] Custom Separator Character, http://sourceforge.net/tracker/?func=detail&aid=3010957&group_id=176962&atid=879335
  • - - * @version $Id: ImpFormat.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $ + * @author eugen.hanussek@klst.com + *
  • BF [ 3564464 ] Import File Loader discards input records , https://sourceforge.net/tracker/?func=detail&aid=3564464&group_id=176962&atid=879332
  • + * + * @version $Id$ */ public final class ImpFormat { @@ -617,8 +619,10 @@ public final class ImpFormat } if (log.isLoggable(Level.FINER)) log.finer("New ID=" + ID + " " + find); } - else - if (log.isLoggable(Level.FINER)) log.finer("Old ID=" + ID + " " + find); + else { + log.warning("Not Inserted, Old ID=" + ID + " " + find); + return false; + } // Update Info ------------------------------------------------------- sql = new StringBuilder ("UPDATE ") From 26b664e0d76cb2104a4cafeb4ffc69c1c89b1cfc Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 26 Feb 2015 14:04:54 -0500 Subject: [PATCH 2/5] IDEMPIERE-1771 Sysconfig Invoice_ReverseUseNewNumber does not work when doc_type has "Overwrite Sequence on Complete" --- org.adempiere.base/src/org/compiere/model/MInvoice.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/org.adempiere.base/src/org/compiere/model/MInvoice.java b/org.adempiere.base/src/org/compiere/model/MInvoice.java index d2f051fe66..e309535460 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoice.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoice.java @@ -2115,6 +2115,8 @@ public class MInvoice extends X_C_Invoice implements DocAction * Set the definite document number after completed */ private void setDefiniteDocumentNo() { + if (isReversal() && ! MSysConfig.getBooleanValue(MSysConfig.Invoice_ReverseUseNewNumber, true, getAD_Client_ID())) // IDEMPIERE-1771 + return; MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); if (dt.isOverwriteDateOnComplete()) { setDateInvoiced(new Timestamp (System.currentTimeMillis())); From 8e03122c9ea045106736883047a8fa28aafa906f Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 26 Feb 2015 19:28:28 -0500 Subject: [PATCH 3/5] IDEMPIERE-1733 Cannot change Currency To in window Currency Rate --- org.adempiere.base/src/org/compiere/model/GridTable.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/GridTable.java b/org.adempiere.base/src/org/compiere/model/GridTable.java index e9062f7813..42f079c5a5 100644 --- a/org.adempiere.base/src/org/compiere/model/GridTable.java +++ b/org.adempiere.base/src/org/compiere/model/GridTable.java @@ -3207,12 +3207,8 @@ public class GridTable extends AbstractTableModel GridField field = (GridField)m_fields.get(j); columnName = field.getColumnName(); displayType = field.getDisplayType(); - // Integer, ID, Lookup (UpdatedBy is a numeric column) - if (displayType == DisplayType.Integer - || (DisplayType.isID(displayType) - && (columnName.endsWith("_ID") || columnName.endsWith("_Acct") - || columnName.equals("AD_Key") || columnName.equals("AD_Display"))) - || columnName.endsWith("atedBy")) + // Integer, ID, Lookup + if (displayType == DisplayType.Integer || DisplayType.isID(displayType)) { rowData[j] = new Integer(rs.getInt(j+1)); // Integer if (rs.wasNull()) From e2016a6b77bffb933301a046e57aaadc8b3e284c Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 26 Feb 2015 19:52:15 -0500 Subject: [PATCH 4/5] IDEMPIERE-1733 Cannot change Currency To in window Currency Rate / two special cases of foreign keys as String --- .../src/org/adempiere/process/ResetLockedAccount.java | 2 +- org.adempiere.base/src/org/compiere/model/GridTable.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/org.adempiere.base/src/org/adempiere/process/ResetLockedAccount.java b/org.adempiere.base/src/org/adempiere/process/ResetLockedAccount.java index 3aeb8e7e3d..fae4fd5313 100644 --- a/org.adempiere.base/src/org/adempiere/process/ResetLockedAccount.java +++ b/org.adempiere.base/src/org/adempiere/process/ResetLockedAccount.java @@ -52,7 +52,7 @@ public class ResetLockedAccount extends SvrProcess { .append(" AND DateAccountLocked IS NOT NULL ") .append(" AND AD_User_ID = " + user.getAD_User_ID()); int no = DB.executeUpdate(sql.toString(), new Object[] { p_AD_Client_ID }, false, get_TrxName()); - if (no < 0) + if (no <= 0) throw new AdempiereException("Could not unlock user account" + user.toString()); StringBuilder msgreturn = new StringBuilder("@OK@ - The user '").append(user.getName()).append("' has been unlocked"); diff --git a/org.adempiere.base/src/org/compiere/model/GridTable.java b/org.adempiere.base/src/org/compiere/model/GridTable.java index 42f079c5a5..a78f1256ee 100644 --- a/org.adempiere.base/src/org/compiere/model/GridTable.java +++ b/org.adempiere.base/src/org/compiere/model/GridTable.java @@ -3208,7 +3208,7 @@ public class GridTable extends AbstractTableModel columnName = field.getColumnName(); displayType = field.getDisplayType(); // Integer, ID, Lookup - if (displayType == DisplayType.Integer || DisplayType.isID(displayType)) + if (displayType == DisplayType.Integer || (DisplayType.isID(displayType) && !(columnName.equals("EntityType") || columnName.equals("AD_Language")))) { rowData[j] = new Integer(rs.getInt(j+1)); // Integer if (rs.wasNull()) From 138daff406401ffe878563b7a9757e0d2d39cc38 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 26 Feb 2015 20:24:51 -0500 Subject: [PATCH 5/5] IDEMPIERE-1800 Reset Locked Account shows all clients / IDEMPIERE-373 --- .../oracle/201502261959_IDEMPIERE-1800.sql | 27 +++++++++++++++++++ .../201502261959_IDEMPIERE-1800.sql | 24 +++++++++++++++++ .../adempiere/process/ResetLockedAccount.java | 6 ++--- 3 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 migration/i2.1/oracle/201502261959_IDEMPIERE-1800.sql create mode 100644 migration/i2.1/postgresql/201502261959_IDEMPIERE-1800.sql diff --git a/migration/i2.1/oracle/201502261959_IDEMPIERE-1800.sql b/migration/i2.1/oracle/201502261959_IDEMPIERE-1800.sql new file mode 100644 index 0000000000..ca3db98708 --- /dev/null +++ b/migration/i2.1/oracle/201502261959_IDEMPIERE-1800.sql @@ -0,0 +1,27 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-1800 Reset Locked Account shows all clients +-- Feb 26, 2015 7:56:16 PM COT +UPDATE AD_Process_Para SET AD_Val_Rule_ID=116, DefaultValue='@#AD_Client_ID@',Updated=TO_DATE('2015-02-26 19:56:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=200029 +; + +-- Feb 26, 2015 7:58:22 PM COT +INSERT INTO AD_Val_Rule (AD_Val_Rule_ID,Name,Type,Code,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Val_Rule_UU) VALUES (200067,'AD_User Locked of Client','S','AD_User.AD_Client_ID=@#AD_Client_ID@ AND IsLocked=''Y''',0,0,'Y',TO_DATE('2015-02-26 19:58:20','YYYY-MM-DD HH24:MI:SS'),100,TO_DATE('2015-02-26 19:58:20','YYYY-MM-DD HH24:MI:SS'),100,'D','13699034-b9eb-493f-9156-2d6864f366d1') +; + +-- Feb 26, 2015 7:58:33 PM COT +UPDATE AD_Process_Para SET AD_Val_Rule_ID=200067,Updated=TO_DATE('2015-02-26 19:58:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=200030 +; + +-- Feb 26, 2015 7:58:42 PM COT +UPDATE AD_Process_Para SET IsActive='N',Updated=TO_DATE('2015-02-26 19:58:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=200029 +; + +-- Feb 26, 2015 8:21:57 PM COT +UPDATE AD_Process SET Help='Select a locked user from the list to unlock it. Alternatively you can run the process without selecting any user, in this case the process will unlock all locked users from the client applying accordingly the policies configured for "max account lock" and "max inactive period".',Updated=TO_DATE('2015-02-26 20:21:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=200008 +; + +SELECT register_migration_script('201502261959_IDEMPIERE-1800.sql') FROM dual +; + diff --git a/migration/i2.1/postgresql/201502261959_IDEMPIERE-1800.sql b/migration/i2.1/postgresql/201502261959_IDEMPIERE-1800.sql new file mode 100644 index 0000000000..fa4e7dffd6 --- /dev/null +++ b/migration/i2.1/postgresql/201502261959_IDEMPIERE-1800.sql @@ -0,0 +1,24 @@ +-- IDEMPIERE-1800 Reset Locked Account shows all clients +-- Feb 26, 2015 7:56:16 PM COT +UPDATE AD_Process_Para SET AD_Val_Rule_ID=116, DefaultValue='@#AD_Client_ID@',Updated=TO_TIMESTAMP('2015-02-26 19:56:16','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=200029 +; + +-- Feb 26, 2015 7:58:22 PM COT +INSERT INTO AD_Val_Rule (AD_Val_Rule_ID,Name,Type,Code,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,AD_Val_Rule_UU) VALUES (200067,'AD_User Locked of Client','S','AD_User.AD_Client_ID=@#AD_Client_ID@ AND IsLocked=''Y''',0,0,'Y',TO_TIMESTAMP('2015-02-26 19:58:20','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2015-02-26 19:58:20','YYYY-MM-DD HH24:MI:SS'),100,'D','13699034-b9eb-493f-9156-2d6864f366d1') +; + +-- Feb 26, 2015 7:58:33 PM COT +UPDATE AD_Process_Para SET AD_Val_Rule_ID=200067,Updated=TO_TIMESTAMP('2015-02-26 19:58:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=200030 +; + +-- Feb 26, 2015 7:58:42 PM COT +UPDATE AD_Process_Para SET IsActive='N',Updated=TO_TIMESTAMP('2015-02-26 19:58:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=200029 +; + +-- Feb 26, 2015 8:21:57 PM COT +UPDATE AD_Process SET Help='Select a locked user from the list to unlock it. Alternatively you can run the process without selecting any user, in this case the process will unlock all locked users from the client applying accordingly the policies configured for "max account lock" and "max inactive period".',Updated=TO_TIMESTAMP('2015-02-26 20:21:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_ID=200008 +; + +SELECT register_migration_script('201502261959_IDEMPIERE-1800.sql') FROM dual +; + diff --git a/org.adempiere.base/src/org/adempiere/process/ResetLockedAccount.java b/org.adempiere.base/src/org/adempiere/process/ResetLockedAccount.java index fae4fd5313..3564e27ab6 100644 --- a/org.adempiere.base/src/org/adempiere/process/ResetLockedAccount.java +++ b/org.adempiere.base/src/org/adempiere/process/ResetLockedAccount.java @@ -47,7 +47,7 @@ public class ResetLockedAccount extends SvrProcess { if (!user.isLocked()) throw new AdempiereException("User " + user.getName() + " is not locked"); - StringBuilder sql = new StringBuilder ("UPDATE AD_User SET IsLocked = 'N', DateAccountLocked=NULL, FailedLoginCount=0, DateLastLogin=NULL, Updated=SysDate ") + StringBuilder sql = new StringBuilder ("UPDATE AD_User SET IsLocked = 'N', DateAccountLocked=NULL, FailedLoginCount=0, Updated=SysDate ") .append(" WHERE IsLocked='Y' AND AD_Client_ID = ? ") .append(" AND DateAccountLocked IS NOT NULL ") .append(" AND AD_User_ID = " + user.getAD_User_ID()); @@ -63,8 +63,8 @@ public class ResetLockedAccount extends SvrProcess { int MAX_ACCOUNT_LOCK_MINUTES = MSysConfig.getIntValue(MSysConfig.USER_LOCKING_MAX_ACCOUNT_LOCK_MINUTES, 0); int MAX_INACTIVE_PERIOD = MSysConfig.getIntValue(MSysConfig.USER_LOCKING_MAX_INACTIVE_PERIOD_DAY, 0); - StringBuilder sql = new StringBuilder("UPDATE AD_User SET IsLocked = 'N', DateAccountLocked=NULL, FailedLoginCount=0, DateLastLogin=NULL, Updated=SysDate ") - .append(" WHERE IsLocked='Y' AND AD_Client_ID IN (0, ?) ") + StringBuilder sql = new StringBuilder("UPDATE AD_User SET IsLocked = 'N', DateAccountLocked=NULL, FailedLoginCount=0, Updated=SysDate ") + .append(" WHERE IsLocked='Y' AND AD_Client_ID = ? ") .append(" AND DateAccountLocked IS NOT NULL"); if (DB.isPostgreSQL())