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

Fix NPE when the field is not present in the window
13:56:08.612===========> CalloutPayment.start: start: amounts [147]
java.lang.NullPointerException
        at org.compiere.model.CalloutPayment.amounts(CalloutPayment.java:599)
This commit is contained in:
Carlos Ruiz 2020-11-09 07:16:14 +01:00 committed by GitHub
parent 649312b1d7
commit e105ed3385
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -590,6 +590,8 @@ 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)); 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, "$C_Currency_ID"); int baseCurrencyId = Env.getContextAsInt(ctx, "$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);