Skip to content

Commit

Permalink
IDEMPIERE-4808 : Payment Allocation should be IsSOTrx neutral (#703)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
nmicoud and CarlosRuiz-globalqss committed Jun 4, 2021
1 parent d9826c7 commit 98dc9e7
Show file tree
Hide file tree
Showing 6 changed files with 172 additions and 8 deletions.
79 changes: 79 additions & 0 deletions migration/i8.2/oracle/202106031358_IDEMPIERE-4808.sql
Original file line number Diff line number Diff line change
@@ -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
;

76 changes: 76 additions & 0 deletions migration/i8.2/postgresql/202106031358_IDEMPIERE-4808.sql
Original file line number Diff line number Diff line change
@@ -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
;

Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -68,6 +69,7 @@ public void onMenuSelected(int menuId)
try
{
setPredefinedContextVariables(menu.getPredefinedContextVariables());
setMenuIsSOTrx(menu.isSOTrx());

if(menu.getAction().equals(MMenu.ACTION_Window))
{
Expand Down Expand Up @@ -337,4 +339,11 @@ protected String getPredefinedContextVariables() {
return this.predefinedContextVariables;
}

public void setMenuIsSOTrx(boolean isSOTrx) {
this.menuIsSOTrx = isSOTrx;
}

protected boolean isMenuSOTrx() {
return this.menuIsSOTrx;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public ProcessDialog openProcessDialog(int processId, boolean soTrx) {
* @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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -135,7 +135,7 @@ public String getFormName() {
*/
public static ADForm openForm (int adFormID)
{
return openForm(adFormID, null, null, null);
return openForm(adFormID, null, null, null, false);
}

/**
Expand All @@ -146,7 +146,7 @@ public static ADForm openForm (int adFormID)
* @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);
}

/**
Expand All @@ -158,7 +158,7 @@ public static ADForm openForm(int formId, String predefinedContextVariables) {
*/
public static ADForm openForm (int adFormID, GridTab gridTab)
{
return openForm(adFormID, gridTab, null, null);
return openForm(adFormID, gridTab, null, null, false);
}

/**
Expand All @@ -171,7 +171,7 @@ public static ADForm openForm (int adFormID, GridTab gridTab)
*/
public static ADForm openForm (int adFormID, GridTab gridTab, ProcessInfo pi)
{
return openForm(adFormID, gridTab, pi, null);
return openForm(adFormID, gridTab, pi, null, false);
}

/**
Expand All @@ -183,7 +183,7 @@ public static ADForm openForm (int adFormID, GridTab gridTab, ProcessInfo pi)
* @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);
Expand All @@ -204,6 +204,7 @@ public static ADForm openForm (int adFormID, GridTab gridTab, ProcessInfo pi, St
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;
}
Expand Down

0 comments on commit 98dc9e7

Please sign in to comment.