From 6da2abfd777b8e2bb431fe507880d432b8e2f0ef Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 16 Feb 2024 12:16:44 +0100 Subject: [PATCH] IDEMPIERE-6042 Improvements to Payment window (#2242) - set IsReceipt field based on DocType - avoid throwing error to the user on callout if the currency rate or converted amt are defined with default null --- .../iD11/oracle/202402131228_IDEMPIERE-6042.sql | 14 ++++++++++++++ .../postgresql/202402131228_IDEMPIERE-6042.sql | 11 +++++++++++ .../src/org/compiere/model/CalloutPayment.java | 9 ++------- 3 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 migration/iD11/oracle/202402131228_IDEMPIERE-6042.sql create mode 100644 migration/iD11/postgresql/202402131228_IDEMPIERE-6042.sql diff --git a/migration/iD11/oracle/202402131228_IDEMPIERE-6042.sql b/migration/iD11/oracle/202402131228_IDEMPIERE-6042.sql new file mode 100644 index 0000000000..d9f864fdaf --- /dev/null +++ b/migration/iD11/oracle/202402131228_IDEMPIERE-6042.sql @@ -0,0 +1,14 @@ +-- IDEMPIERE-6042 Improvements to Payment window +SELECT register_migration_script('202402131228_IDEMPIERE-6042.sql') FROM dual; + +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- Feb 13, 2024, 12:28:11 PM CET +UPDATE AD_Field SET MandatoryLogic='@IsOverrideCurrencyRate@=Y',Updated=TO_TIMESTAMP('2024-02-13 12:28:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205669 +; + +-- Feb 13, 2024, 12:28:15 PM CET +UPDATE AD_Field SET MandatoryLogic='@IsOverrideCurrencyRate@=Y',Updated=TO_TIMESTAMP('2024-02-13 12:28:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205670 +; + diff --git a/migration/iD11/postgresql/202402131228_IDEMPIERE-6042.sql b/migration/iD11/postgresql/202402131228_IDEMPIERE-6042.sql new file mode 100644 index 0000000000..bd29351e25 --- /dev/null +++ b/migration/iD11/postgresql/202402131228_IDEMPIERE-6042.sql @@ -0,0 +1,11 @@ +-- IDEMPIERE-6042 Improvements to Payment window +SELECT register_migration_script('202402131228_IDEMPIERE-6042.sql') FROM dual; + +-- Feb 13, 2024, 12:28:11 PM CET +UPDATE AD_Field SET MandatoryLogic='@IsOverrideCurrencyRate@=Y',Updated=TO_TIMESTAMP('2024-02-13 12:28:11','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205669 +; + +-- Feb 13, 2024, 12:28:15 PM CET +UPDATE AD_Field SET MandatoryLogic='@IsOverrideCurrencyRate@=Y',Updated=TO_TIMESTAMP('2024-02-13 12:28:15','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=205670 +; + diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutPayment.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutPayment.java index d8cb9cac75..e2a9d4baa9 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutPayment.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutPayment.java @@ -248,9 +248,8 @@ public class CalloutPayment extends CalloutEngine if (C_DocType_ID != 0) { dt = MDocType.get (ctx, C_DocType_ID); - Env - .setContext (ctx, WindowNo, "IsSOTrx", dt.isSOTrx () ? "Y" - : "N"); + Env.setContext (ctx, WindowNo, "IsSOTrx", dt.isSOTrx () ? "Y" : "N"); + mTab.setValue(MPayment.COLUMNNAME_IsReceipt, dt.isSOTrx () ? "Y" : "N"); } // Invoice if (C_Invoice_ID != 0) @@ -363,8 +362,6 @@ public class CalloutPayment extends CalloutEngine else { mTab.setValue(colName, oldValue); - if (overrideCR) - mTab.fireDataStatusEEvent("Invalid", Msg.getElement(ctx, colName), true); return ""; } } @@ -390,8 +387,6 @@ public class CalloutPayment extends CalloutEngine else { mTab.setValue(colName, oldValue); - if (overrideCR) - mTab.fireDataStatusEEvent("Invalid", Msg.getElement(ctx, colName), true); return ""; } }