Author: mbrohl
Date: Wed May 20 20:39:26 2015
New Revision: 1680671
URL:
http://svn.apache.org/r1680671Log:
Manually applied the changes of the patch from jira issue OFBIZ-4480: Need to have an option to pass file name as OrderId for the generated confirmation or invoice PDF.
Thanks Ganesh Bawne for reporting the issue and providing the patch.
Modified:
ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/CompanyHeader.groovy
Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/CompanyHeader.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/CompanyHeader.groovy?rev=1680671&r1=1680670&r2=1680671&view=diff==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/CompanyHeader.groovy (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/CompanyHeader.groovy Wed May 20 20:39:26 2015
@@ -42,6 +42,7 @@ fromPartyId = parameters.fromPartyId;
if (!orderHeader && orderId) {
orderHeader = from("OrderHeader").where("orderId", orderId).queryOne();
+ response.setHeader("Content-Disposition","attachment; filename=\"" + orderId + ".pdf" + "\";");
} else if (shipmentId) {
shipment = from("Shipment").where("shipmentId", shipmentId).queryOne();
orderHeader = shipment.getRelatedOne("PrimaryOrderHeader", false);
@@ -49,6 +50,7 @@ if (!orderHeader && orderId) {
if (!invoice && invoiceId) {
invoice = from("Invoice").where("invoiceId", invoiceId).queryOne();
+ response.setHeader("Content-Disposition","attachment; filename=\"" + invoiceId + ".pdf" + "\";");
}
if (!returnHeader && returnId) {