Author: ashish
Date: Wed Nov 3 10:24:32 2010
New Revision: 1030390
URL:
http://svn.apache.org/viewvc?rev=1030390&view=revLog:
Bug fix.
Applied the patch from jira issue - OFBIZ-4007 - On Order pdf(s), Website URL is not showing according to the purpose type (PRIMARY_WEB_URL).
-- Website URL on order pdf is not showing according to purpose (PRIMARY_WEB_URL)
-- Website URL is showing directly first record of PartyContactMech. When we don't have primary record then it should come first record of PartyContactMech entity.
Thanks Amit for the contribution.
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=1030390&r1=1030389&r2=1030390&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 Nov 3 10:24:32 2010
@@ -185,6 +185,11 @@ if (selEmails) {
}
// website
+websiteUrls = EntityUtil.filterByDate(delegator.findByAnd("PartyContactMechPurpose", [partyId : partyId, contactMechPurposeTypeId : "PRIMARY_WEB_URL"]));
+if (websiteUrls) {
+ websiteUrl = EntityUtil.getFirst(websiteUrls);
+ context.website = delegator.findOne("ContactMech", [contactMechId : websiteUrl.contactMechId], false);
+} else { //get web address from party contact mech
contacts = delegator.findByAnd("PartyContactMech", [partyId : partyId]);
selContacts = EntityUtil.filterByDate(contacts, nowTimestamp, "fromDate", "thruDate", true);
if (selContacts) {
@@ -197,6 +202,7 @@ if (selContacts) {
}
}
}
+}
//Bank account
paymentMethods = delegator.findByAnd("PaymentMethod", [partyId : partyId, paymentMethodTypeId : "EFT_ACCOUNT"]);