From 695008744908b3a23521d9c12f4089573dc1e71d Mon Sep 17 00:00:00 2001 From: Nicolas Micoud Date: Wed, 8 Nov 2017 10:58:09 +0100 Subject: [PATCH] IDEMPIERE-3532 Remove hardcoded values for InfoInvoiceWindow (BPartnerID / IsSOTrx) and InfoPaymentWindow (IsSOTrx) --- .../oracle/201710271720_IDEMPIERE-3532.sql | 18 ++++++++++ .../201710271720_IDEMPIERE-3532.sql | 16 +++++++++ .../webui/info/InfoInvoiceWindow.java | 35 +------------------ .../webui/info/InfoPaymentWindow.java | 25 +------------ 4 files changed, 36 insertions(+), 58 deletions(-) create mode 100644 migration/i5.1/oracle/201710271720_IDEMPIERE-3532.sql create mode 100644 migration/i5.1/postgresql/201710271720_IDEMPIERE-3532.sql diff --git a/migration/i5.1/oracle/201710271720_IDEMPIERE-3532.sql b/migration/i5.1/oracle/201710271720_IDEMPIERE-3532.sql new file mode 100644 index 0000000000..5cf4720808 --- /dev/null +++ b/migration/i5.1/oracle/201710271720_IDEMPIERE-3532.sql @@ -0,0 +1,18 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-3532 - Remove hardcoded values for InfoInvoiceWindow (BPartnerID / IsSOTrx) and InfoPaymentWindow (IsSOTrx) +-- Oct 27, 2017 5:16:11 PM CEST +UPDATE AD_InfoColumn SET DefaultValue='@C_BPartner_ID@',Updated=TO_DATE('2017-10-27 17:16:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_InfoColumn_ID=200052 +; + +-- Oct 27, 2017 5:16:25 PM CEST +UPDATE AD_InfoColumn SET DefaultValue='@SQL=SELECT ''@IsSOTrx:Y@'' AS DefaultValue FROM DUAL',Updated=TO_DATE('2017-10-27 17:16:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_InfoColumn_ID=200066 +; + +-- Oct 27, 2017 5:17:29 PM CEST +UPDATE AD_InfoColumn SET DefaultValue='@SQL=SELECT ''@IsSOTrx:Y@'' AS DefaultValue FROM DUAL',Updated=TO_DATE('2017-10-27 17:17:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_InfoColumn_ID=200085 +; + +SELECT register_migration_script('201705041136_IDEMPIERE-3338.sql') FROM dual +; diff --git a/migration/i5.1/postgresql/201710271720_IDEMPIERE-3532.sql b/migration/i5.1/postgresql/201710271720_IDEMPIERE-3532.sql new file mode 100644 index 0000000000..1fabb5fd26 --- /dev/null +++ b/migration/i5.1/postgresql/201710271720_IDEMPIERE-3532.sql @@ -0,0 +1,16 @@ +-- IDEMPIERE-3532 - Remove hardcoded values for InfoInvoiceWindow (BPartnerID / IsSOTrx) and InfoPaymentWindow (IsSOTrx) +-- Oct 27, 2017 5:16:12 PM CEST +UPDATE AD_InfoColumn SET DefaultValue='@C_BPartner_ID@',Updated=TO_TIMESTAMP('2017-10-27 17:16:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_InfoColumn_ID=200052 +; + +-- Oct 27, 2017 5:16:25 PM CEST +UPDATE AD_InfoColumn SET DefaultValue='@SQL=SELECT ''@IsSOTrx:Y@'' AS DefaultValue FROM DUAL',Updated=TO_TIMESTAMP('2017-10-27 17:16:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_InfoColumn_ID=200066 +; + +-- Oct 27, 2017 5:17:29 PM CEST +UPDATE AD_InfoColumn SET DefaultValue='@SQL=SELECT ''@IsSOTrx:Y@'' AS DefaultValue FROM DUAL',Updated=TO_TIMESTAMP('2017-10-27 17:17:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_InfoColumn_ID=200085 +; + + +SELECT register_migration_script('201705041136_IDEMPIERE-3338.sql') FROM dual +; diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoInvoiceWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoInvoiceWindow.java index bc79bb8e0e..f8d617c07a 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoInvoiceWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoInvoiceWindow.java @@ -3,9 +3,7 @@ */ package org.adempiere.webui.info; -import org.adempiere.webui.editor.WEditor; import org.compiere.util.Env; -import org.compiere.util.Util; /** * @author hengsin @@ -15,7 +13,7 @@ public class InfoInvoiceWindow extends InfoWindow { /** * */ - private static final long serialVersionUID = -3169476148884310274L; + private static final long serialVersionUID = -5175983673145977830L; /** * @param WindowNo @@ -49,37 +47,6 @@ public class InfoInvoiceWindow extends InfoWindow { super(WindowNo, tableName, keyColumn, queryValue, multipleSelection, whereClause, AD_InfoWindow_ID, lookup); } - - /** - * {@inheritDoc} - */ - @Override - protected void initParameters() { - String isSOTrx = Env.getContext(Env.getCtx(), p_WindowNo, "IsSOTrx"); - if (!isLookup() && Util.isEmpty(isSOTrx)) { - isSOTrx = "Y"; - } - - //Set Defaults - String bp = Env.getContext(Env.getCtx(), p_WindowNo, "C_BPartner_ID"); - if (!Util.isEmpty(bp)) { - for (WEditor editor : editors) { - if (editor.getGridField() != null && editor.getGridField().getColumnName().equals("C_BPartner_ID")) { - editor.setValue(new Integer(bp)); - break; - } - } - } - - if (!Util.isEmpty(isSOTrx)) { - for (WEditor editor : editors) { - if (editor.getGridField() != null && editor.getGridField().getColumnName().equals("IsSOTrx")) { - editor.setValue(isSOTrx); - break; - } - } - } - } @Override protected void saveSelectionDetail() { diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoPaymentWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoPaymentWindow.java index c26a791e67..61dc6c30cd 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoPaymentWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/info/InfoPaymentWindow.java @@ -3,10 +3,6 @@ */ package org.adempiere.webui.info; -import org.adempiere.webui.editor.WEditor; -import org.compiere.util.Env; -import org.compiere.util.Util; - /** * @author hengsin * @@ -15,7 +11,7 @@ public class InfoPaymentWindow extends InfoWindow { /** * */ - private static final long serialVersionUID = -3556977962189259779L; + private static final long serialVersionUID = 1322780214387328688L; /** * @param WindowNo @@ -50,23 +46,4 @@ public class InfoPaymentWindow extends InfoWindow { whereClause, AD_InfoWindow_ID, lookup); } - /** - * {@inheritDoc} - */ - @Override - protected void initParameters() { - String isSOTrx = Env.getContext(Env.getCtx(), p_WindowNo, "IsSOTrx"); - if (!isLookup() && Util.isEmpty(isSOTrx)) { - isSOTrx = "Y"; - } - - if (!Util.isEmpty(isSOTrx)) { - for (WEditor editor : editors) { - if (editor.getGridField() != null && editor.getGridField().getColumnName().equals("IsReceipt")) { - editor.setValue(isSOTrx); - break; - } - } - } - } }