[OFBiz] SVN: r5919 - in trunk/applications/product: webapp/facility/WEB-INF webapp/facility/WEB-INF/actions/shipment webapp/facility/shipment widget/facility

jaz at svn.ofbiz.org jaz at svn.ofbiz.org
Thu Oct 6 00:49:08 EDT 2005


Author: jaz
Date: 2005-10-05 23:49:01 -0500 (Wed, 05 Oct 2005)
New Revision: 5919

Added:
   trunk/applications/product/webapp/facility/shipment/PackingSlip.fo.ftl
Modified:
   trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.bsh
   trunk/applications/product/webapp/facility/WEB-INF/controller.xml
   trunk/applications/product/webapp/facility/shipment/PackOrder.ftl
   trunk/applications/product/widget/facility/FacilityScreens.xml
   trunk/applications/product/widget/facility/ShipmentScreens.xml
Log:
implemented packing slip


Modified: trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.bsh
===================================================================
--- trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.bsh	2005-10-05 05:34:43 UTC (rev 5918)
+++ trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.bsh	2005-10-06 04:49:01 UTC (rev 5919)
@@ -37,6 +37,11 @@
 
 orderId = parameters.get("orderId");
 shipGroupSeqId = parameters.get("shipGroupSeqId");
+shipmentId = parameters.get("shipmentId");
+if (shipmentId == null) {
+    shipmentId = request.getAttribute("shipmentId");
+}
+context.put("shipmentId", shipmentId);
 
 if (UtilValidate.isNotEmpty(orderId) && UtilValidate.isEmpty(shipGroupSeqId) && orderId.indexOf("/") > -1) {
     // split the orderID/shipGroupSeqID

Modified: trunk/applications/product/webapp/facility/WEB-INF/controller.xml
===================================================================
--- trunk/applications/product/webapp/facility/WEB-INF/controller.xml	2005-10-05 05:34:43 UTC (rev 5918)
+++ trunk/applications/product/webapp/facility/WEB-INF/controller.xml	2005-10-06 04:49:01 UTC (rev 5919)
@@ -589,6 +589,10 @@
         <response name="success" type="view" value="PackOrder"/>
         <response name="error" type="view" value="PackOrder"/>
     </request-map>
+    <request-map uri="PackingSlip.pdf">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="PackingSlip.pdf"/>
+    </request-map>    
 
     <!-- ================ Shipment Requests ================= -->
     <request-map uri="FindShipment">
@@ -926,6 +930,7 @@
     <view-map name="EditFacilityGroupRoles" type="screen" page="component://product/widget/facility/FacilityGroupScreens.xml#EditFacilityGroupRoles"/>
 
     <view-map name="PackOrder" type="screen" page="component://product/widget/facility/ShipmentScreens.xml#PackOrder"/>
+    <view-map name="PackingSlip.pdf" type="screenfop" page="component://product/widget/facility/ShipmentScreens.xml#PackingSlip.fo"/>
 
     <view-map name="FindShipment" type="screen" page="component://product/widget/facility/ShipmentScreens.xml#FindShipment"/>
     <view-map name="ViewShipment" type="screen" page="component://product/widget/facility/ShipmentScreens.xml#ViewShipment"/>

Modified: trunk/applications/product/webapp/facility/shipment/PackOrder.ftl
===================================================================
--- trunk/applications/product/webapp/facility/shipment/PackOrder.ftl	2005-10-05 05:34:43 UTC (rev 5918)
+++ trunk/applications/product/webapp/facility/shipment/PackOrder.ftl	2005-10-06 04:49:01 UTC (rev 5919)
@@ -20,15 +20,17 @@
  *  THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  *
  *@author     Andy Zeneski (jaz at ofbiz.org)
- *@author     Catherine.Heintz at nereide.biz (migration to UiLabel)
  *@version    $Rev$
- *@since      3.0
+ *@since      3.5
 -->
 
 <#if security.hasEntityPermission("FACILITY", "_VIEW", session)>
     <#assign showInput = requestParameters.showInput?default("Y")>
     <#assign hideGrid = requestParameters.hideGrid?default("N")>
     <div class="head1">Pack Order<span class='head2'>&nbsp;in&nbsp;${facility.facilityName?if_exists} [${uiLabelMap.CommonId}:${facilityId?if_exists}]</span></div>
+    <#if shipmentId?has_content>
+      <div class="tabletext">View <a href="<@ofbizUrl>/PackingSlip.pdf?shipmentId=${shipmentId}</@ofbizUrl>" target="_blank" class="buttontext">Packing Slip</a> For Shipment #${shipmentId}</div>
+    </#if>
     <div>&nbsp;</div>
 
     <!-- select order form -->
@@ -67,7 +69,7 @@
       <input type="hidden" name="facilityId" value="${facilityId?if_exists}"/>
     </form>
 
-    <#if orderHeader?exists && orderHeader?has_content>
+    <#if showInput != "N" && orderHeader?exists && orderHeader?has_content>
       <hr class="sepbar"/>
       <div class='head2'>Order #${orderId} / ShipGroup #${shipGroupSeqId}</div>
       <div class="tableheadtext">${packingSession.getPrimaryOrderId()?default("N/A")} / ${packingSession.getPrimaryShipGroupSeqId()?default("N/A")}</div>
@@ -254,7 +256,7 @@
           <div>&nbsp;</div>
         </form>
       </#if>
-        
+
       <!-- packed items display -->
       <#assign packedLines = packingSession.getLines()?if_exists>
       <#if packedLines?has_content>

Added: trunk/applications/product/webapp/facility/shipment/PackingSlip.fo.ftl
===================================================================
--- trunk/applications/product/webapp/facility/shipment/PackingSlip.fo.ftl	2005-10-05 05:34:43 UTC (rev 5918)
+++ trunk/applications/product/webapp/facility/shipment/PackingSlip.fo.ftl	2005-10-06 04:49:01 UTC (rev 5919)
@@ -0,0 +1,167 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+
+<#--
+ *  Copyright (c) 2003-2005 The Open For Business Project - www.ofbiz.org
+ *
+ *  Permission is hereby granted, free of charge, to any person obtaining a
+ *  copy of this software and associated documentation files (the "Software"),
+ *  to deal in the Software without restriction, including without limitation
+ *  the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ *  and/or sell copies of the Software, and to permit persons to whom the
+ *  Software is furnished to do so, subject to the following conditions:
+ *
+ *  The above copyright notice and this permission notice shall be included
+ *  in all copies or substantial portions of the Software.
+ *
+ *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ *  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ *  CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
+ *  OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+ *  THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *@author     Andy Zeneski (jaz at ofbiz.org)
+ *@version    $Rev$
+ *@since      3.5
+-->
+
+<fo:layout-master-set>
+    <fo:simple-page-master master-name="main" page-height="11in" page-width="8.5in"
+            margin-top="0.5in" margin-bottom="1in" margin-left="1in" margin-right="1in">
+        <fo:region-body margin-top="1in"/>
+        <fo:region-before extent="1in"/>
+        <fo:region-after extent="1in"/>
+    </fo:simple-page-master>
+</fo:layout-master-set>
+
+    <#if hasPermission>
+        <#assign rowColor = "white">
+        <#assign shipGroup = shipment.getRelatedOne("PrimaryOrderItemShipGroup")?if_exists>
+        <#assign carrier = (shipGroup.carrierPartyId)?default("N/A")>
+        <fo:page-sequence master-reference="main">
+        <fo:flow flow-name="xsl-region-body" font-family="Helvetica">
+            <fo:block text-align="right">
+                <fo:instream-foreign-object>
+                    <barcode:barcode xmlns:barcode="http://barcode4j.krysalis.org/ns"
+                            message="${shipment.shipmentId}">
+                        <barcode:code39>
+                            <barcode:height>8mm</barcode:height>
+                        </barcode:code39>
+                    </barcode:barcode>
+                </fo:instream-foreign-object>
+            </fo:block>
+            <fo:block><fo:leader/></fo:block>
+
+            <fo:block font-size="14pt">Shipment #${shipmentId}</fo:block>
+            <fo:block font-size="12pt">Order #${shipment.primaryOrderId?default("N/A")} / ${shipment.primaryShipGroupSeqId?default("N/A")}</fo:block>
+            <fo:block><fo:leader/></fo:block>
+
+            <fo:block space-after.optimum="10pt" font-size="10pt">
+            <fo:table>
+                <fo:table-column column-width="150pt"/>
+                <fo:table-column column-width="150pt"/>
+                <fo:table-column column-width="150pt"/>
+                <fo:table-header>
+                    <fo:table-row font-weight="bold">
+                        <fo:table-cell padding="2pt" background-color="#D4D0C8">
+                            <fo:block>Shipping Address</fo:block>
+                        </fo:table-cell>
+                        <fo:table-cell padding="2pt" background-color="#D4D0C8">
+                            <fo:block text-align="center">Shipping Method</fo:block>
+                        </fo:table-cell>
+                        <fo:table-cell padding="2pt" background-color="#D4D0C8">
+                            <fo:block text-align="right">Handling Instructions</fo:block>
+                        </fo:table-cell>
+                    </fo:table-row>
+                </fo:table-header>
+                <fo:table-body>
+                    <fo:table-row>
+                        <fo:table-cell padding="2pt">
+                            <fo:block>
+                                <#if destinationPostalAddress?has_content>
+                                  <fo:block>To: ${destinationPostalAddress.toName?if_exists}</fo:block>
+                                  <#if destinationPostalAddress.attnName?has_content>
+                                    <fo:block>Attn: ${destinationPostalAddress.attnName?if_exists}</fo:block>
+                                  </#if>
+                                  <fo:block>${destinationPostalAddress.address1?if_exists}</fo:block>
+                                  <fo:block>${destinationPostalAddress.address2?if_exists}</fo:block>
+                                  <fo:block>
+                                    ${destinationPostalAddress.city?if_exists}<#if destinationPostalAddress.stateProvinceGeoId?has_content>, ${destinationPostalAddress.stateProvinceGeoId}</#if>
+                                    ${destinationPostalAddress.postalCode?if_exists} ${destinationPostalAddress.countryGeoId?if_exists}
+                                  </fo:block>
+                                </#if>
+                            </fo:block>
+                        </fo:table-cell>
+                        <fo:table-cell padding="2pt">
+                            <fo:block text-align="center">
+                                <#if carrier != "_NA_">
+                                   ${carrier}
+                                </#if>
+                                ${shipGroup.shipmentMethodTypeId?default("??")}
+                            </fo:block>
+                        </fo:table-cell>
+                        <fo:table-cell padding="2pt">
+                            <fo:block text-align="right">${shipment.handlingInstructions?if_exists}</fo:block>
+                        </fo:table-cell>
+                    </fo:table-row>
+                </fo:table-body>
+            </fo:table>
+            </fo:block>
+
+            <fo:block space-after.optimum="10pt" font-size="10pt">
+            <fo:table>
+                <fo:table-column column-width="250pt"/>
+                <fo:table-column column-width="100pt"/>
+                <fo:table-column column-width="100pt"/>
+                <fo:table-header>
+                    <fo:table-row font-weight="bold">
+                        <fo:table-cell padding="2pt" background-color="#D4D0C8"><fo:block>Product</fo:block></fo:table-cell>
+                        <fo:table-cell padding="2pt" background-color="#D4D0C8"><fo:block>Quantity Requested</fo:block></fo:table-cell>
+                        <fo:table-cell padding="2pt" background-color="#D4D0C8"><fo:block>Quantity Shipped</fo:block></fo:table-cell>
+                    </fo:table-row>
+                </fo:table-header>
+                <fo:table-body>
+                    <#list shipmentItemDatas as shipmentItem>
+                        <#assign itemIssuances = shipmentItem.itemIssuances>
+                        <#list itemIssuances as issue>
+                            <#assign orderItem = issue.getRelatedOne("OrderItem")>
+                            <#assign product = shipmentItem.product>
+                            <fo:table-row>
+                                <fo:table-cell padding="2pt" background-color="${rowColor}">
+                                    <#if product?has_content>
+                                        <fo:block>${product.internalName?default("Internal Name Not Set!")} [${product.productId}]</fo:block>
+                                    <#else/>
+                                        <fo:block>&nbsp;</fo:block>
+                                    </#if>
+                                </fo:table-cell>
+                                <fo:table-cell padding="2pt" background-color="${rowColor}">
+                                    <fo:block>${orderItem.quantity}</fo:block>
+                                </fo:table-cell>
+                                <fo:table-cell padding="2pt" background-color="${rowColor}">
+                                    <fo:block>${issue.quantity}</fo:block>
+                                </fo:table-cell>
+                            </fo:table-row>
+                            <#-- toggle the row color -->
+                            <#if rowColor == "white">
+                                <#assign rowColor = "#CCCCCC">
+                            <#else>
+                                <#assign rowColor = "white">
+                            </#if>
+                        </#list>
+                    </#list>
+                </fo:table-body>
+            </fo:table>
+            </fo:block>
+        </fo:flow>
+        </fo:page-sequence>
+
+    <#else>
+        <fo:block font-size="14pt">
+            ${uiLabelMap.ProductFacilityViewPermissionError}
+        </fo:block>
+    </#if>
+
+</fo:root>
+


Property changes on: trunk/applications/product/webapp/facility/shipment/PackingSlip.fo.ftl
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + "Id Rev Author"
Name: svn:eol-style
   + native

Modified: trunk/applications/product/widget/facility/FacilityScreens.xml
===================================================================
--- trunk/applications/product/widget/facility/FacilityScreens.xml	2005-10-05 05:34:43 UTC (rev 5918)
+++ trunk/applications/product/widget/facility/FacilityScreens.xml	2005-10-06 04:49:01 UTC (rev 5919)
@@ -485,5 +485,5 @@
                 </platform-specific>
             </widgets>
         </section>
-    </screen>
+    </screen>    
 </screens>

Modified: trunk/applications/product/widget/facility/ShipmentScreens.xml
===================================================================
--- trunk/applications/product/widget/facility/ShipmentScreens.xml	2005-10-05 05:34:43 UTC (rev 5918)
+++ trunk/applications/product/widget/facility/ShipmentScreens.xml	2005-10-06 04:49:01 UTC (rev 5919)
@@ -269,4 +269,23 @@
             </widgets>
         </section>
     </screen>
+
+    <screen name="PackingSlip.fo">
+        <section>
+            <actions>
+                <!-- base/top/specific map first, then more common map added for shared labels -->
+                <property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/>
+                <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
+
+                <set field="shipmentId" from-field="parameters.shipmentId"/>
+                <script location="component://product/webapp/facility/WEB-INF/actions/shipment/ViewShipment.bsh"/>
+                <script location="component://product/webapp/facility/WEB-INF/actions/shipment/EditShipmentItems.bsh"/>
+            </actions>
+            <widgets>
+                <platform-specific>
+                    <html><html-template location="component://product/webapp/facility/shipment/PackingSlip.fo.ftl"/></html>
+                </platform-specific>
+            </widgets>
+        </section>
+    </screen>
 </screens>



More information about the Svn mailing list