IDEMPIERE-4808 : Payment Allocation should be IsSOTrx neutral (#703)

* IDEMPIERE-4808 : Payment Allocation should be IsSOTrx neutral

* IDEMPIERE-4808 : forms can use IsSOTrx from AD_Menu

* IDEMPIERE-4808 : add IgnoreIsSOTrxInBPInfo to be used on BPartner InfoWindow

Co-Authored-By: Carlos Ruiz <carg67@gmail.com>

Co-authored-by: Carlos Ruiz <carg67@gmail.com>
This commit is contained in:
Nicolas Micoud 2021-06-04 09:29:37 +02:00 committed by GitHub
parent d9826c775f
commit 98dc9e796c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 172 additions and 8 deletions

View File

@ -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
;

View File

@ -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
;

View File

@ -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();

View File

@ -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;
}
}

View File

@ -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();

View File

@ -45,7 +45,7 @@ public abstract class ADForm extends Window implements EventListener<Event>, 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<Event>, 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<Event>, 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<Event>, 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<Event>, 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<Event>, 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<Event>, 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;
}