Author: sichen
Date: Tue Sep 12 19:02:09 2006
New Revision: 442793

URL: http://svn.apache.org/viewvc?view=rev&rev=442793
Log:
After the order is packed, the list of available invoices will be shown on the 
packing screen, so that the invoices can be printed right there, instead of 
going back to the order again

Modified:
    
incubator/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.bsh
    
incubator/ofbiz/trunk/applications/product/webapp/facility/shipment/PackOrder.ftl
    incubator/ofbiz/trunk/applications/product/widget/facility/CommonScreens.xml

Modified: 
incubator/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.bsh
URL: 
http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.bsh?view=diff&rev=442793&r1=442792&r2=442793
==============================================================================
--- 
incubator/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.bsh
 (original)
+++ 
incubator/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.bsh
 Tue Sep 12 19:02:09 2006
@@ -18,6 +18,7 @@
 import org.ofbiz.entity.*;
 import org.ofbiz.base.util.*;
 import org.ofbiz.order.order.*;
+import org.ofbiz.entity.util.EntityUtil;
 
 facilityId = parameters.get("facilityId");
 if (UtilValidate.isNotEmpty(facilityId)) {
@@ -34,6 +35,19 @@
 }
 context.put("shipmentId", shipmentId);
 
+// If a shipment exists, provide the IDs of any related invoices
+if (UtilValidate.isNotEmpty(shipmentId)) {
+
+    // Get the primaryOrderId from the shipment
+    shipment = delegator.findByPrimaryKey("Shipment", 
UtilMisc.toMap("shipmentId", shipmentId));
+    if (shipment != null && shipment.getString("primaryOrderId") != null) {
+        orderItemBillingList = delegator.findByAnd("OrderItemBilling", 
UtilMisc.toMap("orderId", shipment.getString("primaryOrderId")), 
UtilMisc.toList("invoiceId"));
+        invoiceIds = 
EntityUtil.getFieldListFromEntityList(orderItemBillingList, "invoiceId", true);
+        if (invoiceIds != null) {
+            context.put("invoiceIds", invoiceIds);
+        }
+    }
+}
 if (UtilValidate.isNotEmpty(orderId) && UtilValidate.isEmpty(shipGroupSeqId) 
&& orderId.indexOf("/") > -1) {
     // split the orderID/shipGroupSeqID
     idSplit = orderId.split("\\/");
@@ -85,3 +99,4 @@
         request.setAttribute("errorMessageList", UtilMisc.toList("Order #" + 
orderId + " cannot be found."));
     }
 }
+

Modified: 
incubator/ofbiz/trunk/applications/product/webapp/facility/shipment/PackOrder.ftl
URL: 
http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/product/webapp/facility/shipment/PackOrder.ftl?view=diff&rev=442793&r1=442792&r2=442793
==============================================================================
--- 
incubator/ofbiz/trunk/applications/product/webapp/facility/shipment/PackOrder.ftl
 (original)
+++ 
incubator/ofbiz/trunk/applications/product/webapp/facility/shipment/PackOrder.ftl
 Tue Sep 12 19:02:09 2006
@@ -30,7 +30,20 @@
       <div class="tabletext">
         ${uiLabelMap.CommonView} <a 
href="<@ofbizUrl>/PackingSlip.pdf?shipmentId=${shipmentId}</@ofbizUrl>" 
target="_blank" class="buttontext">${uiLabelMap.ProductPackingSlip}</a> 
${uiLabelMap.CommonOr} 
         ${uiLabelMap.CommonView} <a 
href="<@ofbizUrl>/ShipmentBarCode.pdf?shipmentId=${shipmentId}</@ofbizUrl>" 
target="_blank" class="buttontext">${uiLabelMap.ProductBarcode}</a> 
${uiLabelMap.CommonFor} ${uiLabelMap.ProductShipmentId} <a 
href="<@ofbizUrl>/ViewShipment?shipmentId=${shipmentId}</@ofbizUrl>" 
class="buttontext">${shipmentId}</a>
-      </div>
+       </div>
+       <#if invoiceIds?exists && invoiceIds?has_content>
+         <div class="tabletext">
+           <p>${uiLabelMap.AccountingInvoices}:</p> 
+           <ul>
+             <#list invoiceIds as invoiceId>
+               <li>
+                 #<a 
href="/accounting/control/invoiceOverview?invoiceId=${invoiceId}&externalLoginKey=${externalLoginKey}"
 target="_blank" class="buttontext">${invoiceId}</a>
+                 (<a 
href="/accounting/control/invoice.pdf?invoiceId=${invoiceId}&externalLoginKey=${externalLoginKey}"
 target="_blank" class="buttontext">PDF</a>)
+               </li>
+             </#list>
+           </ul>
+         </div>
+       </#if>
     </#if>
     <div>&nbsp;</div>
 

Modified: 
incubator/ofbiz/trunk/applications/product/widget/facility/CommonScreens.xml
URL: 
http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/product/widget/facility/CommonScreens.xml?view=diff&rev=442793&r1=442792&r2=442793
==============================================================================
--- 
incubator/ofbiz/trunk/applications/product/widget/facility/CommonScreens.xml 
(original)
+++ 
incubator/ofbiz/trunk/applications/product/widget/facility/CommonScreens.xml 
Tue Sep 12 19:02:09 2006
@@ -24,6 +24,7 @@
                 <!-- 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"/>
+                <property-map resource="AccountingUiLabels" 
map-name="uiLabelMap" global="true"/>
 
                 <set field="layoutSettings.companyName" 
from-field="uiLabelMap.FacilityCompanyName" global="true"/>
                 <set field="layoutSettings.companySubtitle" 
from-field="uiLabelMap.FacilityCompanySubtitle" global="true"/>


Reply via email to