Author: jacopoc
Date: Thu Aug 17 10:53:05 2006
New Revision: 432306
URL:
http://svn.apache.org/viewvc?rev=432306&view=revLog:
Applied patch from Christian Geisert (OFBIZ-162) to add a "fromPartyId" parameter to companyHeader.bsh (and fall back to "Company" if this parameter isn't specified).
This parameter is also set in QuoteReport.fo.ftl.
I'm not sure I like the idea of having the "Company" party hardcoded here, but for now I think it is an acceptable solution.
Modified:
incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/companyHeader.bsh
incubator/ofbiz/trunk/applications/order/webapp/ordermgr/quote/QuoteReport.fo.ftl
Modified: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/companyHeader.bsh
URL:
http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/companyHeader.bsh?rev=432306&r1=432305&r2=432306&view=diff==============================================================================
--- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/companyHeader.bsh (original)
+++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/companyHeader.bsh Thu Aug 17 10:53:05 2006
@@ -17,7 +17,8 @@
// this script is used to get the company's logo header information for orders, invoices, and returns. It can either take order, invoice, returnHeader from
// parameters or use orderId, invoiceId, or returnId to look them up.
-
+ // if none of these parameters are available then fromPartyId is used or "Company" as fallback
+
import org.ofbiz.base.util.*;
import org.ofbiz.entity.*;
import org.ofbiz.entity.util.*;
@@ -32,6 +33,7 @@
returnHeader = (GenericValue) parameters.get("returnHeader");
returnId = parameters.get("returnId");
nowTimestamp = UtilDateTime.nowTimestamp();
+fromPartyId = parameters.get("fromPartyId");
if (orderHeader == null && orderId != null) {
orderHeader = (GenericValue) delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", orderId));
@@ -77,6 +79,15 @@
} else if (returnHeader != null) {
if (returnHeader.getString("returnHeaderTypeId").equals("CUSTOMER_RETURN") && returnHeader.get("toPartyId") != null) {
partyId = returnHeader.getString("toPartyId");
+ }
+}
+
+// if partyId wasn't found use fromPartyId-parameter
+if (partyId == null) {
+ if (fromPartyId != null) {
+ partyId = fromPartyId;
+ } else {
+ partyId = "Company";
}
}
Modified: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/quote/QuoteReport.fo.ftl
URL:
http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/quote/QuoteReport.fo.ftl?rev=432306&r1=432305&r2=432306&view=diff==============================================================================
--- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/quote/QuoteReport.fo.ftl (original)
+++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/quote/QuoteReport.fo.ftl Thu Aug 17 10:53:05 2006
@@ -38,6 +38,7 @@
<fo:table-row>
<#-- Top Left cell -->
<fo:table-cell>
+ <#assign fromPartyId = quote.partyId?if_exists/>
${screens.render("component://order/widget/ordermgr/OrderPrintForms.xml#CompanyLogo")}
</fo:table-cell>
<#-- Top Right cell -->