From 8efef1cb7d7b0fe7365a98715c4da4ed0384cf8c Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 27 May 2014 10:25:58 -0500 Subject: [PATCH 1/4] IDEMPIERE-1967 Bank transfer process should allow for document number to be optional / based on patch from Carlos Augusto Sanchez (caaugustoss) --- .../i2.0/oracle/201405262306_IDEMPIERE-1967.sql | 10 ++++++++++ .../postgresql/201405262306_IDEMPIERE-1967.sql | 7 +++++++ .../src/org/eevolution/process/BankTransfer.java | 14 +++++++++----- 3 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 migration/i2.0/oracle/201405262306_IDEMPIERE-1967.sql create mode 100644 migration/i2.0/postgresql/201405262306_IDEMPIERE-1967.sql diff --git a/migration/i2.0/oracle/201405262306_IDEMPIERE-1967.sql b/migration/i2.0/oracle/201405262306_IDEMPIERE-1967.sql new file mode 100644 index 0000000000..8bc80ae9ab --- /dev/null +++ b/migration/i2.0/oracle/201405262306_IDEMPIERE-1967.sql @@ -0,0 +1,10 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- May 26, 2014 11:06:10 PM COT +-- IDEMPIERE-1967 Bank transfer process should allow for document number to be optional +UPDATE AD_Process_Para SET IsMandatory='N',Updated=TO_DATE('2014-05-26 22:47:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=53251 +; + +SELECT register_migration_script('201405262306_IDEMPIERE-1967.sql') FROM dual +; diff --git a/migration/i2.0/postgresql/201405262306_IDEMPIERE-1967.sql b/migration/i2.0/postgresql/201405262306_IDEMPIERE-1967.sql new file mode 100644 index 0000000000..3029991ac2 --- /dev/null +++ b/migration/i2.0/postgresql/201405262306_IDEMPIERE-1967.sql @@ -0,0 +1,7 @@ +-- May 26, 2014 11:06:10 PM COT +-- IDEMPIERE-1967 Bank transfer process should allow for document number to be optional +UPDATE AD_Process_Para SET IsMandatory='N',Updated=TO_TIMESTAMP('2014-05-26 22:47:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=53251 +; + +SELECT register_migration_script('201405262306_IDEMPIERE-1967.sql') FROM dual +; diff --git a/org.adempiere.base/src/org/eevolution/process/BankTransfer.java b/org.adempiere.base/src/org/eevolution/process/BankTransfer.java index 15a7c416ba..fe3d20a235 100644 --- a/org.adempiere.base/src/org/eevolution/process/BankTransfer.java +++ b/org.adempiere.base/src/org/eevolution/process/BankTransfer.java @@ -26,6 +26,8 @@ import org.compiere.process.ProcessInfoParameter; import org.compiere.process.SvrProcess; import org.compiere.util.AdempiereUserError; import org.compiere.util.Env; +import org.compiere.util.Msg; +import org.compiere.util.Util; /** * Bank Transfer. Generate two Payments entry @@ -98,12 +100,12 @@ public class BankTransfer extends SvrProcess + " - Description="+p_Description+ " - Statement Date="+p_StatementDate+ " - Date Account="+p_DateAcct); + if (Env.getAD_Org_ID(getCtx()) == 0) + throw new AdempiereUserError(Msg.getMsg(getCtx(), "Org0NotAllowed")); + if (p_To_C_BankAccount_ID == 0 || p_From_C_BankAccount_ID == 0) throw new IllegalArgumentException("Banks required"); - if (p_DocumentNo == null || p_DocumentNo.length() == 0) - throw new IllegalArgumentException("Document No required"); - if (p_To_C_BankAccount_ID == p_From_C_BankAccount_ID) throw new AdempiereUserError ("Banks From and To must be different"); @@ -145,7 +147,8 @@ public class BankTransfer extends SvrProcess MPayment paymentBankFrom = new MPayment(getCtx(), 0 , get_TrxName()); paymentBankFrom.setC_BankAccount_ID(mBankFrom.getC_BankAccount_ID()); - paymentBankFrom.setDocumentNo(p_DocumentNo); + if (!Util.isEmpty(p_DocumentNo, true)) + paymentBankFrom.setDocumentNo(p_DocumentNo); paymentBankFrom.setDateAcct(p_DateAcct); paymentBankFrom.setDateTrx(p_StatementDate); paymentBankFrom.setTenderType(MPayment.TENDERTYPE_DirectDeposit); @@ -171,7 +174,8 @@ public class BankTransfer extends SvrProcess MPayment paymentBankTo = new MPayment(getCtx(), 0 , get_TrxName()); paymentBankTo.setC_BankAccount_ID(mBankTo.getC_BankAccount_ID()); - paymentBankTo.setDocumentNo(p_DocumentNo); + if (!Util.isEmpty(p_DocumentNo, true)) + paymentBankTo.setDocumentNo(p_DocumentNo); paymentBankTo.setDateAcct(p_DateAcct); paymentBankTo.setDateTrx(p_StatementDate); paymentBankTo.setTenderType(MPayment.TENDERTYPE_DirectDeposit); From c6b0cd00f9d47ab3b4cbd69cf4789272d145829b Mon Sep 17 00:00:00 2001 From: Carlos Augusto Sanchez Date: Tue, 27 May 2014 17:00:55 -0500 Subject: [PATCH 2/4] IDEMPIERE-1966 Configured sql-order-by statement in product info not taken into account when warehouse is selected --- .../WEB-INF/src/org/adempiere/webui/info/InfoProductWindow.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoProductWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoProductWindow.java index 60306ea4e2..2566d20faf 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoProductWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoProductWindow.java @@ -841,7 +841,7 @@ public class InfoProductWindow extends InfoWindow { @Override protected void prepareTable(ColumnInfo[] layout, String from, String where, String orderBy) { - if (getSelectedWarehouseId() > 0) + if (Util.isEmpty(orderBy) && getSelectedWarehouseId() > 0) { orderBy = "QtyAvailable DESC"; } From bc4866556f4a79af8bbdf4f90baffafa8dbb9ce9 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Thu, 22 May 2014 18:22:53 +0800 Subject: [PATCH 3/4] IDEMPIERE-1052 1003710 Performance issue - Change column reference from table to search as proposed by Low. --- .../oracle/201405221012_Ticket_1003710.sql | 43 +++++++++++++++++++ .../201405221012_Ticket_1003710.sql | 40 +++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 migration/i2.0/oracle/201405221012_Ticket_1003710.sql create mode 100644 migration/i2.0/postgresql/201405221012_Ticket_1003710.sql diff --git a/migration/i2.0/oracle/201405221012_Ticket_1003710.sql b/migration/i2.0/oracle/201405221012_Ticket_1003710.sql new file mode 100644 index 0000000000..920d67735d --- /dev/null +++ b/migration/i2.0/oracle/201405221012_Ticket_1003710.sql @@ -0,0 +1,43 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- May 22, 2014 6:03:29 PM MYT +-- 1003710 Performance issue - Change column reference from table to search +UPDATE AD_Column SET AD_Reference_ID=30,Updated=TO_DATE('2014-05-22 18:03:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=55318 +; + +-- May 22, 2014 6:04:22 PM MYT +UPDATE AD_Column SET AD_Reference_ID=30,Updated=TO_DATE('2014-05-22 18:04:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=201503 +; + +-- May 22, 2014 6:04:56 PM MYT +UPDATE AD_Column SET AD_Reference_ID=30,Updated=TO_DATE('2014-05-22 18:04:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=55303 +; + +-- May 22, 2014 6:06:00 PM MYT +UPDATE AD_Column SET AD_Reference_ID=30,Updated=TO_DATE('2014-05-22 18:06:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=56355 +; + +-- May 22, 2014 6:08:12 PM MYT +UPDATE AD_Column SET AD_Reference_ID=30,Updated=TO_DATE('2014-05-22 18:08:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=55322 +; + +-- May 22, 2014 6:08:58 PM MYT +UPDATE AD_Column SET AD_Reference_ID=30,Updated=TO_DATE('2014-05-22 18:08:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=55323 +; + +-- May 22, 2014 6:09:41 PM MYT +UPDATE AD_Column SET AD_Reference_ID=30,Updated=TO_DATE('2014-05-22 18:09:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=52007 +; + +-- May 22, 2014 6:10:08 PM MYT +UPDATE AD_Column SET AD_Reference_ID=30,Updated=TO_DATE('2014-05-22 18:10:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=55305 +; + +-- May 22, 2014 6:11:15 PM MYT +UPDATE AD_Column SET AD_Reference_ID=30,Updated=TO_DATE('2014-05-22 18:11:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=52008 +; + +SELECT register_migration_script('201405221012_Ticket_1003710.sql') FROM dual +; + diff --git a/migration/i2.0/postgresql/201405221012_Ticket_1003710.sql b/migration/i2.0/postgresql/201405221012_Ticket_1003710.sql new file mode 100644 index 0000000000..9bc3d5671c --- /dev/null +++ b/migration/i2.0/postgresql/201405221012_Ticket_1003710.sql @@ -0,0 +1,40 @@ +-- May 22, 2014 6:03:29 PM MYT +-- 1003710 Performance issue - Change column reference from table to search +UPDATE AD_Column SET AD_Reference_ID=30,Updated=TO_TIMESTAMP('2014-05-22 18:03:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=55318 +; + +-- May 22, 2014 6:04:22 PM MYT +UPDATE AD_Column SET AD_Reference_ID=30,Updated=TO_TIMESTAMP('2014-05-22 18:04:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=201503 +; + +-- May 22, 2014 6:04:56 PM MYT +UPDATE AD_Column SET AD_Reference_ID=30,Updated=TO_TIMESTAMP('2014-05-22 18:04:56','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=55303 +; + +-- May 22, 2014 6:06:00 PM MYT +UPDATE AD_Column SET AD_Reference_ID=30,Updated=TO_TIMESTAMP('2014-05-22 18:06:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=56355 +; + +-- May 22, 2014 6:08:12 PM MYT +UPDATE AD_Column SET AD_Reference_ID=30,Updated=TO_TIMESTAMP('2014-05-22 18:08:12','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=55322 +; + +-- May 22, 2014 6:08:58 PM MYT +UPDATE AD_Column SET AD_Reference_ID=30,Updated=TO_TIMESTAMP('2014-05-22 18:08:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=55323 +; + +-- May 22, 2014 6:09:41 PM MYT +UPDATE AD_Column SET AD_Reference_ID=30,Updated=TO_TIMESTAMP('2014-05-22 18:09:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=52007 +; + +-- May 22, 2014 6:10:08 PM MYT +UPDATE AD_Column SET AD_Reference_ID=30,Updated=TO_TIMESTAMP('2014-05-22 18:10:08','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=55305 +; + +-- May 22, 2014 6:11:15 PM MYT +UPDATE AD_Column SET AD_Reference_ID=30,Updated=TO_TIMESTAMP('2014-05-22 18:11:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=52008 +; + +SELECT register_migration_script('201405221012_Ticket_1003710.sql') FROM dual +; + From c7e4d2cbeb3ce57c2eab829f0c44a445534c076a Mon Sep 17 00:00:00 2001 From: hieplq Date: Mon, 26 May 2014 20:59:00 +0700 Subject: [PATCH 4/4] IDEMPIERE-1419:InfoWindow List column display the value instead of the name --- .../WEB-INF/src/org/adempiere/webui/info/InfoWindow.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java index c07c822ba3..19d1f7c11b 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoWindow.java @@ -272,6 +272,11 @@ public class InfoWindow extends InfoPanel implements ValueChangeListener, EventL { if (infoColumn.getAD_Reference_ID() == DisplayType.List) { + WEditor editor = null; + editor = WebEditorFactory.getEditor(gridFields.get(i), true); + editor.setMandatory(false); + editor.setReadWrite(false); + editorMap.put(infoColumn.getSelectClause(), editor); columnInfo = new ColumnInfo(infoColumn.get_Translation("Name"), infoColumn.getSelectClause(), ValueNamePair.class, (String)null); } else