IDEMPIERE-5787 Print Dunning Letters doesn't work with multi-language (#1918)

This commit is contained in:
Carlos Ruiz 2023-06-28 17:30:37 +02:00 committed by GitHub
parent 2db4184a5d
commit a0f1793719
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View File

@ -34,6 +34,8 @@ import org.compiere.print.MPrintFormat;
import org.compiere.print.ReportEngine; import org.compiere.print.ReportEngine;
import org.compiere.util.AdempiereUserError; import org.compiere.util.AdempiereUserError;
import org.compiere.util.EMail; import org.compiere.util.EMail;
import org.compiere.util.Language;
import org.compiere.util.Util;
/** /**
* Dunning Letter Print * Dunning Letter Print
@ -171,8 +173,13 @@ public class DunningPrint extends SvrProcess
StringBuilder msginfo = new StringBuilder().append(bp.getName()).append(", Amt=").append(entry.getAmt()); StringBuilder msginfo = new StringBuilder().append(bp.getName()).append(", Amt=").append(entry.getAmt());
info.setDescription(msginfo.toString()); info.setDescription(msginfo.toString());
ReportEngine re = null; ReportEngine re = null;
if (format != null) if (format != null) {
Language lang = client.getLanguage();
if (!Util.isEmpty(bp.getAD_Language()))
lang = Language.getLanguage(bp.getAD_Language());
format.setLanguage(lang);
re = new ReportEngine(getCtx(), format, query, info); re = new ReportEngine(getCtx(), format, query, info);
}
boolean printed = false; boolean printed = false;
if (p_EMailPDF) if (p_EMailPDF)
{ {

View File

@ -38,6 +38,8 @@ import org.compiere.process.ProcessInfoParameter;
import org.compiere.process.SvrProcess; import org.compiere.process.SvrProcess;
import org.compiere.util.AdempiereUserError; import org.compiere.util.AdempiereUserError;
import org.compiere.util.EMail; import org.compiere.util.EMail;
import org.compiere.util.Language;
import org.compiere.util.Util;
/** /**
* Dunning Letter Print * Dunning Letter Print
@ -178,8 +180,13 @@ public class DunningPrint extends SvrProcess
StringBuilder msginfo = new StringBuilder().append(bp.getName()).append(", Amt=").append(entry.getAmt()); StringBuilder msginfo = new StringBuilder().append(bp.getName()).append(", Amt=").append(entry.getAmt());
info.setDescription(msginfo.toString()); info.setDescription(msginfo.toString());
ReportEngine re = null; ReportEngine re = null;
if (format != null) if (format != null) {
Language lang = client.getLanguage();
if (!Util.isEmpty(bp.getAD_Language()))
lang = Language.getLanguage(bp.getAD_Language());
format.setLanguage(lang);
re = new ReportEngine(getCtx(), format, query, info); re = new ReportEngine(getCtx(), format, query, info);
}
boolean printed = false; boolean printed = false;
if (p_EMailPDF) if (p_EMailPDF)
{ {