IDEMPIERE-5144 MMatchPO: add validation for currency conversion of invoice price (#1119)

This commit is contained in:
hengsin 2022-01-11 23:24:32 +08:00 committed by GitHub
parent 9fd648b3e8
commit 5843303a4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -32,6 +32,7 @@ import java.util.Properties;
import java.util.logging.Level;
import org.adempiere.base.Core;
import org.adempiere.exceptions.AdempiereException;
import org.adempiere.util.IReservationTracer;
import org.adempiere.util.IReservationTracerFactory;
import org.compiere.acct.Doc;
@ -932,6 +933,10 @@ public class MMatchPO extends X_M_MatchPO
priceActual = MConversionRate.convert(getCtx(), priceActual, invoiceCurrency_ID, orderCurrency_ID,
invoice.getDateInvoiced(), invoice.getC_ConversionType_ID(),
getAD_Client_ID(), getAD_Org_ID());
if (priceActual == null)
throw new AdempiereException(MConversionRateUtil.getErrorMessage(getCtx(), "ErrorConvertingCurrencyToBaseCurrency",
invoiceCurrency_ID, orderCurrency_ID, invoice.getC_ConversionType_ID(), invoice.getDateInvoiced(), get_TrxName()));
}
return priceActual;
}