IDEMPIERE-2954 Hardcoded messages when an error occurs on converting currencies in invoices

This commit is contained in:
Nicolas Micoud 2016-02-03 19:31:54 +01:00
parent abad3091d0
commit 2a27ac6c9f
1 changed files with 2 additions and 0 deletions

View File

@ -106,6 +106,8 @@ public final class MConversionRateUtil
/** Return the message to show when no exchange rate is found */
public static String getErrorMessage(Properties ctx, String adMessage, int currencyFromID, int currencyToID, int convertionTypeID, Timestamp date, String trxName)
{
if (convertionTypeID == 0)
convertionTypeID = MConversionType.getDefault(Env.getAD_Client_ID(ctx));
String retValue = Msg.getMsg(ctx, adMessage,
new Object[] {MCurrency.get(ctx, currencyFromID).getISO_Code(), MCurrency.get(ctx, currencyToID).getISO_Code(), new MConversionType(ctx, convertionTypeID, trxName).getName(), date});
return retValue;