From c218175559186ecc0767583e88b464d359d3bab6 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Fri, 20 Dec 2013 17:08:19 +0800 Subject: [PATCH] 1003646 Print Dunning Letter - Null Pointer Exception. --- .../adempiere/webui/process/DunningPrint.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) 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 27a8080009..df2cc725a2 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 @@ -123,7 +123,7 @@ public class DunningPrint extends SvrProcess int count = 0; int errors = 0; MDunningRunEntry[] entries = run.getEntries(false); - List pdfList = new ArrayList(); + final List pdfList = new ArrayList(); for (int i = 0; i < entries.length; i++) { MDunningRunEntry entry = entries[i]; @@ -258,6 +258,18 @@ public class DunningPrint extends SvrProcess return msgreturn.toString(); } + AEnv.executeAsyncDesktopTask(new Runnable() { + @Override + public void run() { + showReports(pdfList); + } + }); + + StringBuilder msgreturn = new StringBuilder("@Printed@=").append(count); + return msgreturn.toString(); + } // doIt + + private void showReports(List pdfList) { if (pdfList.size() > 1) { try { File outFile = File.createTempFile("DunningPrint", ".pdf"); @@ -278,8 +290,6 @@ public class DunningPrint extends SvrProcess log.log(Level.SEVERE, e.getLocalizedMessage(), e); } } - StringBuilder msgreturn = new StringBuilder("@Printed@=").append(count); - return msgreturn.toString(); - } // doIt + } } // DunningPrint