diff --git a/migration/i8.2/oracle/202106031358_IDEMPIERE-4808.sql b/migration/i8.2/oracle/202106031358_IDEMPIERE-4808.sql new file mode 100644 index 0000000000..0fbae8ed41 --- /dev/null +++ b/migration/i8.2/oracle/202106031358_IDEMPIERE-4808.sql @@ -0,0 +1,79 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-4808 Payment Allocation should be IsSOTrx neutral +-- Jun 3, 2021, 1:38:39 PM CEST +UPDATE AD_InfoColumn SET DisplayLogic='@IsSOTrx:Y@=Y | @+IgnoreIsSOTrxInBPInfo:N@=Y', SeqNoSelection=10, DefaultValue='@SQL=SELECT CASE WHEN ''@IsSOTrx:X@''=''X'' OR ''@+IgnoreIsSOTrxInBPInfo:N@''=''Y'' THEN '''' ELSE ''@IsSOTrx@'' END AS DefaultValue FROM DUAL',Updated=TO_DATE('2021-06-03 13:38:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200036 +; + +-- Jun 3, 2021, 1:38:52 PM CEST +UPDATE AD_InfoColumn SET DisplayLogic='@IsSOTrx:N@=N | @+IgnoreIsSOTrxInBPInfo:N@=Y', SeqNoSelection=20, DefaultValue='@SQL=SELECT CASE WHEN ''@IsSOTrx:X@''=''X'' OR ''@+IgnoreIsSOTrxInBPInfo:N@''=''Y'' THEN '''' WHEN ''@IsSOTrx:X@''=''N'' THEN ''Y'' ELSE ''N'' END AS DefaultValue FROM DUAL',Updated=TO_DATE('2021-06-03 13:38:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200037 +; + +-- Jun 3, 2021, 1:31:20 PM CEST +UPDATE AD_Menu SET PredefinedContextVariables='IgnoreIsSOTrxInBPInfo=Y',Updated=TO_DATE('2021-06-03 13:31:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID IN ( +53289, /* Form - Accounting Fact Reconcilation (manual) */ +245, /* Form - Payment Allocation */ +434, /* Report - Accounting Fact Daily*/ +433, /* Report - Accounting Fact Details*/ +435, /* Report - Accounting Fact Period*/ +246, /* Report - Allocation*/ +400, /* Report - Asset Delivery Details*/ +474, /* Report - Asset Delivery Month*/ +200043, /* Report - Bank Register Report*/ +512, /* Report - Business Partner Open*/ +399, /* Report - Customer Assets*/ +53185, /* Report - Distribution Order Detail*/ +481, /* Report - Open Confirmation Details*/ +482, /* Report - Open Confirmations*/ +543, /* Report - Order Detail*/ +511, /* Report - Payment Details*/ +256, /* Report - Product Transaction Value*/ +260, /* Report - Project Status Summary*/ +231, /* Report - Quarterly Invoice Customer by Vendor*/ +196, /* Report - Replenish Report*/ +53354, /* Report - Replenish Report incl. Production*/ +350, /* Report - Statement of Accounts*/ +502, /* Report - Trial Balance*/ +509, /* Report - UnAllocated Invoices*/ +510, /* Report - UnAllocated Payments*/ +497, /* Process - Auto Allocation*/ +53190, /* Process - Bank/Cash Transfer*/ +420, /* Process - Business Partner Organization*/ +348, /* Process - Deliver Assets*/ +535, /* Process - Invoice Requests*/ +507, /* Process - Order Batch Process*/ +304, /* Process - Receivables Write-Off*/ +50009, /* Process - Request EMail Processor*/ +496, /* Process - Reset Allocation*/ +473, /* Process - UnLink Business Partner Org*/ +506 /* Process - Validate Business Partner*/ +) +; + +-- Jun 3, 2021, 1:42:58 PM CEST +UPDATE AD_Window SET PredefinedContextVariables='IgnoreIsSOTrxInBPInfo=Y',Updated=TO_DATE('2021-06-03 13:42:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Window_ID IN ( +200005, /* GL Journal*/ +132, /* GL Journal Batch*/ +277, /* Import Bank Statement*/ +278, /* Import GL Journal*/ +53121, /* Import Inventory Move*/ +280, /* Import Payment*/ +53071, /* Import Price List*/ +170, /* Inventory Move*/ +146, /* Price List*/ +337, /* Price List Schema*/ +130, /* Project*/ +108, /* User*/ +/* Buttons running processes with BP parameter in these windows: */ +53134, /* Cash Plan*/ +321, /* Dunning Run*/ +216, /* Financial Report*/ +200013, /* GL Journal Generator*/ +206 /* Payment Selection*/ +) +; + +SELECT register_migration_script('202106031358_IDEMPIERE-4808.sql') FROM dual +; + diff --git a/migration/i8.2/postgresql/202106031358_IDEMPIERE-4808.sql b/migration/i8.2/postgresql/202106031358_IDEMPIERE-4808.sql new file mode 100644 index 0000000000..4e41d77d86 --- /dev/null +++ b/migration/i8.2/postgresql/202106031358_IDEMPIERE-4808.sql @@ -0,0 +1,76 @@ +-- IDEMPIERE-4808 Payment Allocation should be IsSOTrx neutral +-- Jun 3, 2021, 1:38:39 PM CEST +UPDATE AD_InfoColumn SET DisplayLogic='@IsSOTrx:Y@=Y | @+IgnoreIsSOTrxInBPInfo:N@=Y', SeqNoSelection=10, DefaultValue='@SQL=SELECT CASE WHEN ''@IsSOTrx:X@''=''X'' OR ''@+IgnoreIsSOTrxInBPInfo:N@''=''Y'' THEN '''' ELSE ''@IsSOTrx@'' END AS DefaultValue FROM DUAL',Updated=TO_TIMESTAMP('2021-06-03 13:38:39','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200036 +; + +-- Jun 3, 2021, 1:38:52 PM CEST +UPDATE AD_InfoColumn SET DisplayLogic='@IsSOTrx:N@=N | @+IgnoreIsSOTrxInBPInfo:N@=Y', SeqNoSelection=20, DefaultValue='@SQL=SELECT CASE WHEN ''@IsSOTrx:X@''=''X'' OR ''@+IgnoreIsSOTrxInBPInfo:N@''=''Y'' THEN '''' WHEN ''@IsSOTrx:X@''=''N'' THEN ''Y'' ELSE ''N'' END AS DefaultValue FROM DUAL',Updated=TO_TIMESTAMP('2021-06-03 13:38:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_InfoColumn_ID=200037 +; + +-- Jun 3, 2021, 1:31:20 PM CEST +UPDATE AD_Menu SET PredefinedContextVariables='IgnoreIsSOTrxInBPInfo=Y',Updated=TO_TIMESTAMP('2021-06-03 13:31:20','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Menu_ID IN ( +53289, /* Form - Accounting Fact Reconcilation (manual) */ +245, /* Form - Payment Allocation */ +434, /* Report - Accounting Fact Daily*/ +433, /* Report - Accounting Fact Details*/ +435, /* Report - Accounting Fact Period*/ +246, /* Report - Allocation*/ +400, /* Report - Asset Delivery Details*/ +474, /* Report - Asset Delivery Month*/ +200043, /* Report - Bank Register Report*/ +512, /* Report - Business Partner Open*/ +399, /* Report - Customer Assets*/ +53185, /* Report - Distribution Order Detail*/ +481, /* Report - Open Confirmation Details*/ +482, /* Report - Open Confirmations*/ +543, /* Report - Order Detail*/ +511, /* Report - Payment Details*/ +256, /* Report - Product Transaction Value*/ +260, /* Report - Project Status Summary*/ +231, /* Report - Quarterly Invoice Customer by Vendor*/ +196, /* Report - Replenish Report*/ +53354, /* Report - Replenish Report incl. Production*/ +350, /* Report - Statement of Accounts*/ +502, /* Report - Trial Balance*/ +509, /* Report - UnAllocated Invoices*/ +510, /* Report - UnAllocated Payments*/ +497, /* Process - Auto Allocation*/ +53190, /* Process - Bank/Cash Transfer*/ +420, /* Process - Business Partner Organization*/ +348, /* Process - Deliver Assets*/ +535, /* Process - Invoice Requests*/ +507, /* Process - Order Batch Process*/ +304, /* Process - Receivables Write-Off*/ +50009, /* Process - Request EMail Processor*/ +496, /* Process - Reset Allocation*/ +473, /* Process - UnLink Business Partner Org*/ +506 /* Process - Validate Business Partner*/ +) +; + +-- Jun 3, 2021, 1:42:58 PM CEST +UPDATE AD_Window SET PredefinedContextVariables='IgnoreIsSOTrxInBPInfo=Y',Updated=TO_TIMESTAMP('2021-06-03 13:42:58','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Window_ID IN ( +200005, /* GL Journal*/ +132, /* GL Journal Batch*/ +277, /* Import Bank Statement*/ +278, /* Import GL Journal*/ +53121, /* Import Inventory Move*/ +280, /* Import Payment*/ +53071, /* Import Price List*/ +170, /* Inventory Move*/ +146, /* Price List*/ +337, /* Price List Schema*/ +130, /* Project*/ +108, /* User*/ +/* Buttons running processes with BP parameter in these windows: */ +53134, /* Cash Plan*/ +321, /* Dunning Run*/ +216, /* Financial Report*/ +200013, /* GL Journal Generator*/ +206 /* Payment Selection*/ +) +; + +SELECT register_migration_script('202106031358_IDEMPIERE-4808.sql') FROM dual +; + diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WAllocation.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WAllocation.java index 9aa46117ab..5180776b4e 100755 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WAllocation.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WAllocation.java @@ -98,7 +98,6 @@ public class WAllocation extends Allocation */ public WAllocation() { - Env.setContext(Env.getCtx(), form.getWindowNo(), "IsSOTrx", "Y"); // defaults to no try { super.dynInit(); 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 d74063dd07..e804aaa322 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 @@ -44,6 +44,7 @@ public abstract class AbstractDesktop extends AbstractUIPart implements IDesktop private transient ClientInfo clientInfo; private String predefinedContextVariables; + private boolean menuIsSOTrx; @SuppressWarnings("unused") private static final CLogger logger = CLogger.getCLogger(AbstractDesktop.class); @@ -68,6 +69,7 @@ public abstract class AbstractDesktop extends AbstractUIPart implements IDesktop try { setPredefinedContextVariables(menu.getPredefinedContextVariables()); + setMenuIsSOTrx(menu.isSOTrx()); if(menu.getAction().equals(MMenu.ACTION_Window)) { @@ -337,4 +339,11 @@ public abstract class AbstractDesktop extends AbstractUIPart implements IDesktop return this.predefinedContextVariables; } + public void setMenuIsSOTrx(boolean isSOTrx) { + this.menuIsSOTrx = isSOTrx; + } + + protected boolean isMenuSOTrx() { + return this.menuIsSOTrx; + } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/TabbedDesktop.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/TabbedDesktop.java index 0e0b46ec33..4d2ee881b8 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/TabbedDesktop.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/TabbedDesktop.java @@ -87,7 +87,7 @@ public abstract class TabbedDesktop extends AbstractDesktop { * @return ADWindow */ public ADForm openForm(int formId) { - ADForm form = ADForm.openForm(formId, getPredefinedContextVariables()); + ADForm form = ADForm.openForm(formId, null, null, getPredefinedContextVariables(), isMenuSOTrx()); if (Window.Mode.EMBEDDED == form.getWindowMode()) { DesktopTabpanel tabPanel = new DesktopTabpanel(); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADForm.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADForm.java index b44334d306..109c79bcfb 100755 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADForm.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/ADForm.java @@ -45,7 +45,7 @@ public abstract class ADForm extends Window implements EventListener, IHe /** * */ - private static final long serialVersionUID = 1621402409447265196L; + private static final long serialVersionUID = -2238655179806815227L; /** The class' logging enabler */ protected static final CLogger logger; @@ -135,7 +135,7 @@ public abstract class ADForm extends Window implements EventListener, IHe */ public static ADForm openForm (int adFormID) { - return openForm(adFormID, null, null, null); + return openForm(adFormID, null, null, null, false); } /** @@ -146,7 +146,7 @@ public abstract class ADForm extends Window implements EventListener, IHe * @return The created form */ public static ADForm openForm(int formId, String predefinedContextVariables) { - return openForm(formId, null, null, predefinedContextVariables); + return openForm(formId, null, null, predefinedContextVariables, false); } /** @@ -158,7 +158,7 @@ public abstract class ADForm extends Window implements EventListener, IHe */ public static ADForm openForm (int adFormID, GridTab gridTab) { - return openForm(adFormID, gridTab, null, null); + return openForm(adFormID, gridTab, null, null, false); } /** @@ -171,7 +171,7 @@ public abstract class ADForm extends Window implements EventListener, IHe */ public static ADForm openForm (int adFormID, GridTab gridTab, ProcessInfo pi) { - return openForm(adFormID, gridTab, pi, null); + return openForm(adFormID, gridTab, pi, null, false); } /** @@ -183,7 +183,7 @@ public abstract class ADForm extends Window implements EventListener, IHe * @param predefinedContextVariables * @return The created form */ - public static ADForm openForm (int adFormID, GridTab gridTab, ProcessInfo pi, String predefinedContextVariables) + public static ADForm openForm (int adFormID, GridTab gridTab, ProcessInfo pi, String predefinedContextVariables, boolean isSOTrx) { ADForm form; MForm mform = new MForm(Env.getCtx(), adFormID, null); @@ -204,6 +204,7 @@ public abstract class ADForm extends Window implements EventListener, IHe form.gridTab = gridTab; form.setProcessInfo(pi); Env.setPredefinedVariables(Env.getCtx(), form.getWindowNo(), predefinedContextVariables); + Env.setContext(Env.getCtx(), form.getWindowNo(), "IsSOTrx", isSOTrx); form.init(adFormID, name); return form; }