From a0f179371985427b66ceddf93935f5ba37a50f6a Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 28 Jun 2023 17:30:37 +0200 Subject: [PATCH] IDEMPIERE-5787 Print Dunning Letters doesn't work with multi-language (#1918) --- .../src/org/compiere/process/DunningPrint.java | 9 ++++++++- .../src/org/adempiere/webui/process/DunningPrint.java | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/org.adempiere.base.process/src/org/compiere/process/DunningPrint.java b/org.adempiere.base.process/src/org/compiere/process/DunningPrint.java index b7e3fd8063..c1004f1739 100644 --- a/org.adempiere.base.process/src/org/compiere/process/DunningPrint.java +++ b/org.adempiere.base.process/src/org/compiere/process/DunningPrint.java @@ -34,6 +34,8 @@ import org.compiere.print.MPrintFormat; import org.compiere.print.ReportEngine; import org.compiere.util.AdempiereUserError; import org.compiere.util.EMail; +import org.compiere.util.Language; +import org.compiere.util.Util; /** * Dunning Letter Print @@ -171,8 +173,13 @@ public class DunningPrint extends SvrProcess StringBuilder msginfo = new StringBuilder().append(bp.getName()).append(", Amt=").append(entry.getAmt()); info.setDescription(msginfo.toString()); 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); + } boolean printed = false; if (p_EMailPDF) { diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/DunningPrint.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/DunningPrint.java index a8f49fca06..e0560a20e0 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/DunningPrint.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/DunningPrint.java @@ -38,6 +38,8 @@ import org.compiere.process.ProcessInfoParameter; import org.compiere.process.SvrProcess; import org.compiere.util.AdempiereUserError; import org.compiere.util.EMail; +import org.compiere.util.Language; +import org.compiere.util.Util; /** * Dunning Letter Print @@ -178,8 +180,13 @@ public class DunningPrint extends SvrProcess StringBuilder msginfo = new StringBuilder().append(bp.getName()).append(", Amt=").append(entry.getAmt()); info.setDescription(msginfo.toString()); 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); + } boolean printed = false; if (p_EMailPDF) {