diff --git a/org.adempiere.base/src/org/compiere/model/MInOut.java b/org.adempiere.base/src/org/compiere/model/MInOut.java index ee2282bced..b2a6f65556 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOut.java +++ b/org.adempiere.base/src/org/compiere/model/MInOut.java @@ -26,9 +26,12 @@ import java.util.Properties; import java.util.logging.Level; import org.adempiere.exceptions.AdempiereException; +import org.compiere.print.MPrintFormat; import org.compiere.print.ReportEngine; import org.compiere.process.DocAction; import org.compiere.process.DocumentEngine; +import org.compiere.process.ProcessInfo; +import org.compiere.process.ServerProcessCtl; import org.compiere.util.CLogger; import org.compiere.util.DB; import org.compiere.util.Env; @@ -616,6 +619,21 @@ public class MInOut extends X_M_InOut implements DocAction ReportEngine re = ReportEngine.get (getCtx(), ReportEngine.SHIPMENT, getM_InOut_ID(), get_TrxName()); if (re == null) return null; + MPrintFormat format = re.getPrintFormat(); + // We have a Jasper Print Format + // ============================== + if(format.getJasperProcess_ID() > 0) + { + ProcessInfo pi = new ProcessInfo ("", format.getJasperProcess_ID()); + pi.setRecord_ID ( getC_Order_ID() ); + pi.setIsBatch(true); + + ServerProcessCtl.process(null, pi, null); + + return pi.getPDFReport(); + } + // Standard Print Format (Non-Jasper) + // ================================== return re.getPDF(file); } // createPDF diff --git a/org.adempiere.base/src/org/compiere/model/MInvoice.java b/org.adempiere.base/src/org/compiere/model/MInvoice.java index 93aef95cfb..5356bb14da 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoice.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoice.java @@ -30,9 +30,12 @@ import java.util.logging.Level; import org.adempiere.exceptions.AdempiereException; import org.adempiere.exceptions.BPartnerNoAddressException; import org.adempiere.exceptions.DBException; +import org.compiere.print.MPrintFormat; import org.compiere.print.ReportEngine; import org.compiere.process.DocAction; import org.compiere.process.DocumentEngine; +import org.compiere.process.ProcessInfo; +import org.compiere.process.ServerProcessCtl; import org.compiere.util.CCache; import org.compiere.util.CLogger; import org.compiere.util.DB; @@ -1272,6 +1275,21 @@ public class MInvoice extends X_C_Invoice implements DocAction ReportEngine re = ReportEngine.get (getCtx(), ReportEngine.INVOICE, getC_Invoice_ID(), get_TrxName()); if (re == null) return null; + MPrintFormat format = re.getPrintFormat(); + // We have a Jasper Print Format + // ============================== + if(format.getJasperProcess_ID() > 0) + { + ProcessInfo pi = new ProcessInfo ("", format.getJasperProcess_ID()); + pi.setRecord_ID ( getC_Order_ID() ); + pi.setIsBatch(true); + + ServerProcessCtl.process(null, pi, null); + + return pi.getPDFReport(); + } + // Standard Print Format (Non-Jasper) + // ================================== return re.getPDF(file); } // createPDF diff --git a/org.adempiere.base/src/org/compiere/model/MOrder.java b/org.adempiere.base/src/org/compiere/model/MOrder.java index bac0dab99e..4e6f71c603 100644 --- a/org.adempiere.base/src/org/compiere/model/MOrder.java +++ b/org.adempiere.base/src/org/compiere/model/MOrder.java @@ -30,15 +30,16 @@ import java.util.Vector; import java.util.logging.Level; import java.util.regex.Pattern; -import javax.mail.internet.AddressException; - import org.adempiere.exceptions.AdempiereException; import org.adempiere.exceptions.BPartnerNoBillToAddressException; import org.adempiere.exceptions.BPartnerNoShipToAddressException; import org.adempiere.exceptions.FillMandatoryException; +import org.compiere.print.MPrintFormat; import org.compiere.print.ReportEngine; import org.compiere.process.DocAction; import org.compiere.process.DocumentEngine; +import org.compiere.process.ProcessInfo; +import org.compiere.process.ServerProcessCtl; import org.compiere.util.DB; import org.compiere.util.Env; import org.compiere.util.Msg; @@ -618,6 +619,21 @@ public class MOrder extends X_C_Order implements DocAction ReportEngine re = ReportEngine.get (getCtx(), ReportEngine.ORDER, getC_Order_ID(), get_TrxName()); if (re == null) return null; + MPrintFormat format = re.getPrintFormat(); + // We have a Jasper Print Format + // ============================== + if(format.getJasperProcess_ID() > 0) + { + ProcessInfo pi = new ProcessInfo ("", format.getJasperProcess_ID()); + pi.setRecord_ID ( getC_Order_ID() ); + pi.setIsBatch(true); + + ServerProcessCtl.process(null, pi, null); + + return pi.getPDFReport(); + } + // Standard Print Format (Non-Jasper) + // ================================== return re.getPDF(file); } // createPDF diff --git a/org.adempiere.base/src/org/compiere/model/MRfQResponse.java b/org.adempiere.base/src/org/compiere/model/MRfQResponse.java index fb3da3156a..2368dba740 100644 --- a/org.adempiere.base/src/org/compiere/model/MRfQResponse.java +++ b/org.adempiere.base/src/org/compiere/model/MRfQResponse.java @@ -25,7 +25,10 @@ import java.util.ArrayList; import java.util.Properties; import java.util.logging.Level; +import org.compiere.print.MPrintFormat; import org.compiere.print.ReportEngine; +import org.compiere.process.ProcessInfo; +import org.compiere.process.ServerProcessCtl; import org.compiere.util.DB; import org.compiere.util.EMail; import org.compiere.util.Env; @@ -286,6 +289,21 @@ public class MRfQResponse extends X_C_RfQResponse ReportEngine re = ReportEngine.get (getCtx(), ReportEngine.RFQ, getC_RfQResponse_ID()); if (re == null) return null; + MPrintFormat format = re.getPrintFormat(); + // We have a Jasper Print Format + // ============================== + if(format.getJasperProcess_ID() > 0) + { + ProcessInfo pi = new ProcessInfo ("", format.getJasperProcess_ID()); + pi.setRecord_ID ( getC_Order_ID() ); + pi.setIsBatch(true); + + ServerProcessCtl.process(null, pi, null); + + return pi.getPDFReport(); + } + // Standard Print Format (Non-Jasper) + // ================================== return re.getPDF(file); } // getPDF