IDEMPIERE-4083 currency rate by document or by transaction (#589)

Fix problem with callout message
This commit is contained in:
Carlos Ruiz 2021-02-16 13:39:19 +01:00 committed by GitHub
parent 5e60c443d2
commit 2c899d3b49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 6 deletions

View File

@ -333,6 +333,10 @@ public class CalloutPayment extends CalloutEngine
int AD_Client_ID = Env.getContextAsInt (ctx, WindowNo, "AD_Client_ID"); int AD_Client_ID = Env.getContextAsInt (ctx, WindowNo, "AD_Client_ID");
int AD_Org_ID = Env.getContextAsInt (ctx, WindowNo, "AD_Org_ID"); int AD_Org_ID = Env.getContextAsInt (ctx, WindowNo, "AD_Org_ID");
Boolean overrideCR = (Boolean)(colName.equals(I_C_Payment.COLUMNNAME_IsOverrideCurrencyRate) ? value : mTab.getValue(I_C_Payment.COLUMNNAME_IsOverrideCurrencyRate));
if (overrideCR == null)
overrideCR = Boolean.FALSE;
if (colName.equals(I_C_Payment.COLUMNNAME_CurrencyRate)) if (colName.equals(I_C_Payment.COLUMNNAME_CurrencyRate))
{ {
if (value != null) if (value != null)
@ -364,6 +368,7 @@ public class CalloutPayment extends CalloutEngine
else else
{ {
mTab.setValue(colName, oldValue); mTab.setValue(colName, oldValue);
if (overrideCR)
mTab.fireDataStatusEEvent("Invalid", Msg.getElement(ctx, colName), true); mTab.fireDataStatusEEvent("Invalid", Msg.getElement(ctx, colName), true);
return ""; return "";
} }
@ -390,6 +395,7 @@ public class CalloutPayment extends CalloutEngine
else else
{ {
mTab.setValue(colName, oldValue); mTab.setValue(colName, oldValue);
if (overrideCR)
mTab.fireDataStatusEEvent("Invalid", Msg.getElement(ctx, colName), true); mTab.fireDataStatusEEvent("Invalid", Msg.getElement(ctx, colName), true);
return ""; return "";
} }
@ -589,16 +595,13 @@ public class CalloutPayment extends CalloutEngine
if (colName.equals(I_C_Payment.COLUMNNAME_C_Currency_ID) || colName.equals(I_C_Payment.COLUMNNAME_PayAmt) if (colName.equals(I_C_Payment.COLUMNNAME_C_Currency_ID) || colName.equals(I_C_Payment.COLUMNNAME_PayAmt)
|| colName.equals(I_C_Payment.COLUMNNAME_IsOverrideCurrencyRate) ) { || colName.equals(I_C_Payment.COLUMNNAME_IsOverrideCurrencyRate) ) {
Boolean override = (Boolean)(colName.equals(I_C_Payment.COLUMNNAME_IsOverrideCurrencyRate) ? value : mTab.getValue(I_C_Payment.COLUMNNAME_IsOverrideCurrencyRate));
if (override == null)
override = Boolean.FALSE;
int baseCurrencyId = Env.getContextAsInt(ctx, Env.C_CURRENCY_ID); int baseCurrencyId = Env.getContextAsInt(ctx, Env.C_CURRENCY_ID);
if (baseCurrencyId == C_Currency_ID) { if (baseCurrencyId == C_Currency_ID) {
mTab.setValue(I_C_Payment.COLUMNNAME_IsOverrideCurrencyRate, false); mTab.setValue(I_C_Payment.COLUMNNAME_IsOverrideCurrencyRate, false);
mTab.setValue(I_C_Payment.COLUMNNAME_CurrencyRate, null); mTab.setValue(I_C_Payment.COLUMNNAME_CurrencyRate, null);
mTab.setValue(I_C_Payment.COLUMNNAME_ConvertedAmt, null); mTab.setValue(I_C_Payment.COLUMNNAME_ConvertedAmt, null);
} }
else if (!override) { else if (!overrideCR) {
mTab.setValue(I_C_Payment.COLUMNNAME_CurrencyRate, null); mTab.setValue(I_C_Payment.COLUMNNAME_CurrencyRate, null);
mTab.setValue(I_C_Payment.COLUMNNAME_ConvertedAmt, null); mTab.setValue(I_C_Payment.COLUMNNAME_ConvertedAmt, null);
} else { } else {