diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/InvoicePrint.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/InvoicePrint.java index a56e43f0cd..90089e6dcb 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/InvoicePrint.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/process/InvoicePrint.java @@ -229,7 +229,7 @@ public class InvoicePrint extends SvrProcess PreparedStatement pstmt = null; ResultSet rs = null; - List pdfList = new ArrayList(); + final List pdfList = new ArrayList(); try { pstmt = DB.prepareStatement(sql.toString(), get_TrxName()); @@ -368,6 +368,20 @@ public class InvoicePrint extends SvrProcess DB.close(rs, pstmt); } + AEnv.executeAsyncDesktopTask(new Runnable() { + @Override + public void run() { + showReports(pdfList); + } + }); + + // + if (p_EMailPDF) + return "@Sent@=" + count + " - @Errors@=" + errors; + return "@Printed@=" + count; + } // doIt + + private void showReports(List pdfList) { if (pdfList.size() > 1) { try { File outFile = File.createTempFile("InvoicePrint", ".pdf"); @@ -390,10 +404,6 @@ public class InvoicePrint extends SvrProcess } } - // - if (p_EMailPDF) - return "@Sent@=" + count + " - @Errors@=" + errors; - return "@Printed@=" + count; - } // doIt + } } // InvoicePrint