[OFBiz] SVN: r7892 - in trunk/applications/order/webapp/ordermgr: WEB-INF/actions/order order

jacopo@svn.ofbiz.org jacopo at svn.ofbiz.org
Wed Jun 28 08:09:41 CDT 2006


Author: jacopo
Date: 2006-06-28 08:09:29 -0500 (Wed, 28 Jun 2006)
New Revision: 7892

Modified:
   trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/orderview.bsh
   trunk/applications/order/webapp/ordermgr/order/orderView.fo.ftl
Log:
Added supplier address information to the po PDF report.

Modified: trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/orderview.bsh
===================================================================
--- trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/orderview.bsh	2006-06-28 07:40:57 UTC (rev 7891)
+++ trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/orderview.bsh	2006-06-28 13:09:29 UTC (rev 7892)
@@ -209,6 +209,33 @@
     cmvm = ContactMechWorker.getOrderContactMechValueMaps(delegator, orderId);
     context.put("orderContactMechValueMaps", cmvm);
 
+    if ("PURCHASE_ORDER".equals(orderType)) {
+        // for purchase orders, we need also the supplier's postal address
+        GenericValue supplier = orderReadHelper.getBillFromParty();
+        if (supplier != null) {
+            List supplierContactMechValueMaps = ContactMechWorker.getPartyContactMechValueMaps(delegator, supplier.getString("partyId"), false, "POSTAL_ADDRESS");
+            context.put("supplierContactMechValueMaps", supplierContactMechValueMaps);
+            Iterator supplierContactMechValueMapsIt = supplierContactMechValueMaps.iterator();
+            while (supplierContactMechValueMapsIt.hasNext()) {
+                Map supplierContactMechValueMap = (Map)supplierContactMechValueMapsIt.next();
+                List contactMechPurposes = supplierContactMechValueMap.get("partyContactMechPurposes");
+                Iterator contactMechPurposesIt = contactMechPurposes.iterator();
+                while (contactMechPurposesIt.hasNext()) {
+                    GenericValue contactMechPurpose = (GenericValue)contactMechPurposesIt.next();
+                    if (contactMechPurpose.getString("contactMechPurposeTypeId").equals("GENERAL_LOCATION")) {
+                        context.put("supplierGeneralContactMechValueMap", supplierContactMechValueMap);
+                    } else if (contactMechPurpose.getString("contactMechPurposeTypeId").equals("SHIPPING_LOCATION")) {
+                        context.put("supplierShippingContactMechValueMap", supplierContactMechValueMap);
+                    } else if (contactMechPurpose.getString("contactMechPurposeTypeId").equals("BILLING_LOCATION")) {
+                        context.put("supplierBillingContactMechValueMap", supplierContactMechValueMap);
+                    } else if (contactMechPurpose.getString("contactMechPurposeTypeId").equals("PAYMENT_LOCATION")) {
+                        context.put("supplierPaymentContactMechValueMap", supplierContactMechValueMap);
+                    }
+                }
+            }
+        }
+    }
+
     // see if an approved order with all items completed exists
     context.put("setOrderCompleteOption", false);
     if ("ORDER_APPROVED".equals(orderHeader.getString("statusId"))) {

Modified: trunk/applications/order/webapp/ordermgr/order/orderView.fo.ftl
===================================================================
--- trunk/applications/order/webapp/ordermgr/order/orderView.fo.ftl	2006-06-28 07:40:57 UTC (rev 7891)
+++ trunk/applications/order/webapp/ordermgr/order/orderView.fo.ftl	2006-06-28 13:09:29 UTC (rev 7892)
@@ -104,6 +104,20 @@
                 </fo:table-cell>
                 </#if>
              </#list>
+             <#if orderHeader.getString("orderTypeId") == "PURCHASE_ORDER">
+             <#if supplierGeneralContactMechValueMap?exists>
+               <#assign contactMech = supplierGeneralContactMechValueMap.contactMech>
+               <fo:table-cell>
+                 <fo:block white-space-collapse="false">
+<fo:block font-weight="bold">${uiLabelMap.ProductSupplier}:</fo:block><#assign postalAddress = supplierGeneralContactMechValueMap.postalAddress><#if postalAddress?has_content><#if postalAddress.toName?has_content>${postalAddress.toName}</#if><#if postalAddress.attnName?has_content>
+${postalAddress.attnName}</#if>
+${postalAddress.address1}<#if postalAddress.address2?has_content>
+${postalAddress.address2}</#if>
+${postalAddress.city}<#if postalAddress.stateProvinceGeoId?has_content>, ${postalAddress.stateProvinceGeoId} </#if></#if><#if postalAddress.postalCode?has_content>${postalAddress.postalCode}</#if>
+</fo:block>
+               </fo:table-cell>
+             </#if>
+             </#if>
             </fo:table-row>
          </fo:table-body>
        </fo:table>



More information about the Svn mailing list