svn commit: r517398 - in /ofbiz/trunk: applications/product/config/ applications/product/webapp/facility/WEB-INF/ applications/product/webapp/facility/WEB-INF/actions/shipment/ applications/product/webapp/facility/shipment/ applications/product/widget/...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r517398 - in /ofbiz/trunk: applications/product/config/ applications/product/webapp/facility/WEB-INF/ applications/product/webapp/facility/WEB-INF/actions/shipment/ applications/product/webapp/facility/shipment/ applications/product/widget/...

sichen
Author: sichen
Date: Mon Mar 12 14:12:48 2007
New Revision: 517398

URL: http://svn.apache.org/viewvc?view=rev&rev=517398
Log:
OFBIZ-793: Receive inventory verified against purchase order
- Adding a tab in shipment screens to receive purchase order items one unit at a time, while checking quantities against ordered quantity and previously received quantity for the purchase order

Added:
    ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/ReceiveInventoryAgainstPurchaseOrder.bsh   (with props)
    ofbiz/trunk/applications/product/webapp/facility/shipment/ReceiveInventoryAgainstPurchaseOrder.ftl   (with props)
Modified:
    ofbiz/trunk/applications/product/config/ProductUiLabels.properties
    ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml
    ofbiz/trunk/applications/product/webapp/facility/shipment/ShipmentTabBar.ftl
    ofbiz/trunk/applications/product/widget/facility/ShipmentScreens.xml
    ofbiz/trunk/framework/common/config/CommonUiLabels.properties

Modified: ofbiz/trunk/applications/product/config/ProductUiLabels.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/ProductUiLabels.properties?view=diff&rev=517398&r1=517397&r2=517398
==============================================================================
--- ofbiz/trunk/applications/product/config/ProductUiLabels.properties (original)
+++ ofbiz/trunk/applications/product/config/ProductUiLabels.properties Mon Mar 12 14:12:48 2007
@@ -511,7 +511,9 @@
 ProductErrorFacilityIdNotFound=ERROR: Facility with ID [${facilityId}] not found
 ProductErrorNoPackagesFoundForShipment=ERROR: No packages found for this shipment
 ProductErrorOrderIdNotFound=ERROR: Order with ID [${orderId}] not found
+ProductErrorOrderNotPurchaseOrder=Order ${orderId} is not a Purchase Order
 ProductErrorProductNotFound=ERROR: Product not found
+ProductErrorShipmentNotPurchaseShipment=Shipment ${shipmentId} is not a Purchase Shipment
 ProductErrorType=Error: Type
 ProductEstimateId=Estimate ID
 ProductEstimatedArrivalDate=Estimated Arrival Date
@@ -1071,9 +1073,14 @@
 ProductReceiptForReturn=Receipt(s) For Return
 ProductReceiptPurchaseOrder=Receipt(s) For Purchase Order
 ProductReceiveInventory=Receive Inventory
+ProductReceiveInventoryAddProductToReceive=Add Product to Receive
+ProductReceiveInventoryAgainstPO=Receive Against PO
+ProductReceiveInventoryAgainstPurchaseOrder=Receive Inventory Against Purchase Order
 ProductReceiveItem=Receive Item(s)
 ProductReceiveProduct=Receive Product(s)
 ProductReceivePurchaseOrder=Receive Purchase Order
+ProductReceiveInventoryAgainstPurchaseOrderProductNotFound=Product ${productId} not found in order ${orderId}
+ProductReceiveInventoryAgainstPurchaseOrderQuantityExceedsAvailableToReceive=Quantity ${newQuantity} for product ${productId} exceeds quantity available to receive
 ProductReceiveReturn=Receive Return
 ProductReceiveSelectedProduct=Receive Selected Product(s)
 ProductReceiveSelectedShipment=Receive Selected Shipment

Added: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/ReceiveInventoryAgainstPurchaseOrder.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/ReceiveInventoryAgainstPurchaseOrder.bsh?view=auto&rev=517398
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/ReceiveInventoryAgainstPurchaseOrder.bsh (added)
+++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/ReceiveInventoryAgainstPurchaseOrder.bsh Mon Mar 12 14:12:48 2007
@@ -0,0 +1,213 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.ofbiz.entity.util.*;
+import org.ofbiz.service.ServiceUtil;
+import org.ofbiz.base.util.*;
+
+delegator = request.getAttribute("delegator");
+
+shipmentId = request.getParameter("shipmentId");
+orderId = request.getParameter("purchaseOrderId");
+shipGroupSeqId = request.getParameter("shipGroupSeqId");
+context.put("shipmentId", shipmentId);
+context.put("orderId", orderId);
+context.put("shipGroupSeqId", shipGroupSeqId);
+
+// Retrieve the map resident in session which stores order item quantities to receive
+itemQuantitiesToReceive = session.getAttribute("purchaseOrderItemQuantitiesToReceive");
+if (! UtilValidate.isEmpty(itemQuantitiesToReceive)) {
+    sessionShipmentId = itemQuantitiesToReceive.get("_shipmentId");
+    sessionOrderId = itemQuantitiesToReceive.get("_orderId");
+    if ( (UtilValidate.isNotEmpty(sessionShipmentId) && ! sessionShipmentId.equals(shipmentId)) ||
+         ((UtilValidate.isNotEmpty(sessionOrderId) && ! sessionOrderId.equals(orderId)))        ||
+         "Y".equals(request.getParameter("clearAll")) ) {
+
+             // Clear the map if the shipmentId or orderId are different than the current ones, or
+             // if the clearAll parameter is present
+             itemQuantitiesToReceive.clear();
+    }
+}
+
+shipment = delegator.findByPrimaryKey("Shipment", UtilMisc.toMap("shipmentId", shipmentId));
+context.put("shipment", shipment);
+if (UtilValidate.isEmpty(shipment)) {
+    return;
+}
+
+isPurchaseShipment = "PURCHASE_SHIPMENT".equals(shipment.getString("shipmentTypeId"));
+context.put("isPurchaseShipment", isPurchaseShipment);
+if (! isPurchaseShipment) {
+    return;
+}
+
+facility = shipment.getRelatedOne("DestinationFacility");
+context.put("facility", facility);
+context.put("facilityId", shipment.get("destinationFacilityId"));
+context.put("now", UtilDateTime.nowTimestamp());
+
+if (UtilValidate.isEmpty(orderId)) {
+    orderId = shipment.get("primaryOrderId");
+}
+if (UtilValidate.isEmpty(shipGroupSeqId)) {
+    shipGroupSeqId = shipment.get("primaryShipGroupSeqId");
+}
+
+if (UtilValidate.isEmpty(orderId)) {
+    return;
+}
+
+orderHeader = delegator.findByPrimaryKey("OrderHeader", UtilMisc.toMap("orderId", orderId));
+context.put("orderHeader", orderHeader);
+if (UtilValidate.isEmpty(orderHeader)) {
+    return;
+}
+
+isPurchaseOrder = "PURCHASE_ORDER".equals(orderHeader.getString("orderTypeId"));
+context.put("isPurchaseOrder", isPurchaseOrder);
+if (! isPurchaseOrder) {
+    return;
+}
+
+// Get the base currency from the facility owner, for currency conversions
+baseCurrencyUomId = null;
+if (! UtilValidate.isEmpty(facility)) {
+    owner = facility.getRelatedOne("OwnerParty");
+    if (! UtilValidate.isEmpty(owner)) {
+        ownerAcctgPref = owner.getRelatedOne("PartyAcctgPreference");
+    }
+    if (! UtilValidate.isEmpty(ownerAcctgPref)) {
+        baseCurrencyUomId = ownerAcctgPref.get("baseCurrencyUomId");
+    }
+}
+
+inventoryItemTypes = delegator.findAll("InventoryItemType");
+context.put("inventoryItemTypes", inventoryItemTypes);
+
+// Populate the tracking map with shipment and order IDs
+if (UtilValidate.isEmpty(itemQuantitiesToReceive)) {
+    itemQuantitiesToReceive = UtilMisc.toMap("_shipmentId", shipmentId, "_orderId", orderId);
+}
+
+oiasgaLimitMap = null;
+if (! UtilValidate.isEmpty(shipGroupSeqId)) {
+    oiasgaLimitMap = UtilMisc.toMap("shipGroupSeqId", shipGroupSeqId);
+}
+
+orderItemDatas = new TreeMap();
+totalAvailableToReceive = 0;
+
+// Populate the order item data for the FTL
+orderItems = orderHeader.getRelated("OrderItemAndShipGroupAssoc", oiasgaLimitMap, UtilMisc.toList("shipGroupSeqId", "orderItemSeqId"));
+orderItemIter = orderItems.iterator();
+while (orderItemIter.hasNext()) {
+    orderItemAndShipGroupAssoc = orderItemIter.next();
+    product = orderItemAndShipGroupAssoc.getRelatedOne("Product");
+    orderItemData = new HashMap();
+
+    // Get the item's ordered quantity
+    totalOrdered = 0;
+    ordered = orderItemAndShipGroupAssoc.getDouble("quantity");
+    if (ordered != null)
+        totalOrdered += ordered.doubleValue();
+
+    // Get the item quantity received from all shipments via the ShipmentReciept entity
+    totalReceived = 0.0;
+    receipts = delegator.findByAnd("ShipmentReceipt", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItemAndShipGroupAssoc.get("orderItemSeqId")));
+    if (receipts != null && receipts.size() > 0) {
+        recIter = receipts.iterator();
+        while (recIter.hasNext()) {
+            rec = recIter.next();
+            accepted = rec.getDouble("quantityAccepted");
+            rejected = rec.getDouble("quantityRejected");
+            if (accepted != null)
+                totalReceived += accepted.doubleValue();
+            if (rejected != null)
+                totalReceived += rejected.doubleValue();                                            
+        }            
+    }
+
+    // Update the unit cost with the converted value, if any
+    if (UtilValidate.isNotEmpty(baseCurrencyUomId)) {
+        if (! UtilValidate.isEmpty(product)) {
+            result = dispatcher.runSync("getProductCost", UtilMisc.toMap("productId", product.get("productId"), "currencyUomId", baseCurrencyUomId, "costComponentTypePrefix", "EST_STD", "userLogin", request.getAttribute("userLogin")));
+            if (!ServiceUtil.isError(result)) {
+                orderItemAndShipGroupAssoc.put("unitPrice", result.get("productCost"));
+            }
+        }
+    }
+
+    // Calculate how many units it should be possible to recieve for this purchase order
+    availableToReceive = totalOrdered - totalReceived;
+    totalAvailableToReceive += availableToReceive;
+    orderItemData.put("availableToReceive", availableToReceive);
+    orderItemData.put("totalQuantityReceived", totalReceived);
+    orderItemData.put("orderItemAndShipGroupAssoc", orderItemAndShipGroupAssoc);
+    orderItemData.put("product", product);
+    orderItemDatas.put(orderItemAndShipGroupAssoc.getString("orderItemSeqId"), orderItemData);
+}
+context.put("orderItemDatas", orderItemDatas.values());
+
+// Handle any item product quantities to receive by adding to the map in session
+productIdToReceive = request.getParameter("productId");
+productQtyToReceive = request.getParameter("quantity");
+if (UtilValidate.isNotEmpty(productIdToReceive)) {
+
+    // Get the first order item with the productId
+    orderItem = EntityUtil.getFirst(EntityUtil.filterByAnd(orderItems, UtilMisc.toMap("productId", productIdToReceive)));
+    if (! UtilValidate.isEmpty(orderItem)) {
+        orderItemSeqId = orderItem.getString("orderItemSeqId");
+        newQuantity = 0;
+        if (! UtilValidate.isEmpty(productQtyToReceive)) {
+            try {
+                quantity = Double.parseDouble(productQtyToReceive);
+            } catch (Exception e) {
+                quantity = 0;
+            }
+            
+            if (itemQuantitiesToReceive.containsKey(orderItemSeqId)) {
+                try {
+                    newQuantity = itemQuantitiesToReceive.get(orderItemSeqId) + quantity;
+                } catch (Exception e) {
+                    // Ignore the quantity update if there's a problem parsing it
+                }
+            } else {
+                newQuantity = quantity;
+            }
+        }
+
+        if (newQuantity <= orderItemDatas.get(orderItemSeqId).get("availableToReceive")) {
+            itemQuantitiesToReceive.put(orderItemSeqId, newQuantity);
+        } else {
+
+            // If the new quantity would be more than the quantity left to receive for this purchase order item, add an error message to the context
+            context.put("newQuantity", newQuantity);
+            context.put("ProductReceiveInventoryAgainstPurchaseOrderQuantityExceedsAvailableToReceive", true);
+        }
+    } else {
+
+        // Add an error message to the context if the productId doesn't exist in this purchase order
+        context.put("ProductReceiveInventoryAgainstPurchaseOrderProductNotFound", true);
+    }
+}
+
+// Put the tracking map back into the session, in case it has been reconstructed
+session.setAttribute("purchaseOrderItemQuantitiesToReceive", itemQuantitiesToReceive);
+context.put("itemQuantitiesToReceive", itemQuantitiesToReceive);
+context.put("totalAvailableToReceive", totalAvailableToReceive);

Propchange: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/ReceiveInventoryAgainstPurchaseOrder.bsh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/ReceiveInventoryAgainstPurchaseOrder.bsh
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/ReceiveInventoryAgainstPurchaseOrder.bsh
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml?view=diff&rev=517398&r1=517397&r2=517398
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml Mon Mar 12 14:12:48 2007
@@ -1003,6 +1003,10 @@
         <response name="success" type="view" value="AddItemsFromOrder"/>
         <response name="error" type="view" value="AddItemsFromOrder"/>
     </request-map>
+    <request-map uri="ReceiveInventoryAgainstPurchaseOrder">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="ReceiveInventoryAgainstPurchaseOrder"/>
+    </request-map>
     <!-- ================ Shipment Items From Order Requests ================= -->
     <request-map uri="EditShipmentPlan">
         <security https="true" auth="true"/>
@@ -1101,6 +1105,7 @@
     <view-map name="EditShipmentPackages" type="screen" page="component://product/widget/facility/ShipmentScreens.xml#EditShipmentPackages"/>
     <view-map name="EditShipmentRouteSegments" type="screen" page="component://product/widget/facility/ShipmentScreens.xml#EditShipmentRouteSegments"/>
     <view-map name="AddItemsFromOrder" type="screen" page="component://product/widget/facility/ShipmentScreens.xml#AddItemsFromOrder"/>
+    <view-map name="ReceiveInventoryAgainstPurchaseOrder" type="screen" page="component://product/widget/facility/ShipmentScreens.xml#ReceiveInventoryAgainstPurchaseOrder"/>
     <view-map name="QuickShipOrder" type="screen" page="component://product/widget/facility/ShipmentScreens.xml#QuickShipOrder"/>
     
     <view-map name="InventoryReports" type="screen" page="component://product/widget/facility/ReportScreens.xml#InventoryReports"/>

Added: ofbiz/trunk/applications/product/webapp/facility/shipment/ReceiveInventoryAgainstPurchaseOrder.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/shipment/ReceiveInventoryAgainstPurchaseOrder.ftl?view=auto&rev=517398
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/shipment/ReceiveInventoryAgainstPurchaseOrder.ftl (added)
+++ ofbiz/trunk/applications/product/webapp/facility/shipment/ReceiveInventoryAgainstPurchaseOrder.ftl Mon Mar 12 14:12:48 2007
@@ -0,0 +1,177 @@
+<#--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<#if shipment?exists>
+
+    <#assign productId = parameters.productId?if_exists/>
+    <div class="head3">${uiLabelMap.ProductReceiveInventoryAgainstPurchaseOrder}</div>
+
+    <div class="errorMessage">
+        <#if ! isPurchaseShipment>
+            <#assign uiLabelWithVar=uiLabelMap.ProductErrorShipmentNotPurchaseShipment?interpret><@uiLabelWithVar/>
+        <#elseif orderId?has_content && !orderHeader?exists>
+            <#assign uiLabelWithVar=uiLabelMap.ProductErrorOrderIdNotFound?interpret><@uiLabelWithVar/>
+        <#elseif orderHeader?exists && orderHeader.orderTypeId != "PURCHASE_ORDER">
+            <#assign uiLabelWithVar=uiLabelMap.ProductErrorOrderNotPurchaseOrder?interpret><@uiLabelWithVar/>
+        <#elseif ProductReceiveInventoryAgainstPurchaseOrderProductNotFound?exists>
+            <#assign uiLabelWithVar=uiLabelMap.ProductReceiveInventoryAgainstPurchaseOrderProductNotFound?interpret><@uiLabelWithVar/>
+        <#elseif ProductReceiveInventoryAgainstPurchaseOrderQuantityExceedsAvailableToReceive?exists>
+            <#assign uiLabelWithVar=uiLabelMap.ProductReceiveInventoryAgainstPurchaseOrderQuantityExceedsAvailableToReceive?interpret><@uiLabelWithVar/>
+        </#if>
+    </div>
+
+    <form name="ReceiveInventoryAgainstPurchaseOrder" action="<@ofbizUrl>ReceiveInventoryAgainstPurchaseOrder</@ofbizUrl>">
+        <input type="hidden" name="clearAll" value="Y"/>
+        <div class="tabletext">
+            ${uiLabelMap.ProductShipmentId} : <input type="text" class='inputBox' size="20" name="shipmentId" value="${shipmentId?if_exists}"/>
+            ${uiLabelMap.ProductOrderId} : <input type="text" class='inputBox' size="20" name="purchaseOrderId" value="${orderId?if_exists}"/>
+            <span class='tabletext'>
+                <a href="javascript:call_fieldlookup2(document.additemsfromorder.orderId,'LookupOrderHeaderAndShipInfo');">
+                    <img src='/images/fieldlookup.gif' width='15' height='14' border='0' alt='Click here For Field Lookup'>
+                </a>
+            </span>
+            ${uiLabelMap.ProductOrderShipGroupId} : <input type="text" class='inputBox' size="20" name="shipGroupSeqId" value="${shipGroupSeqId?if_exists}"/>
+            <input type="submit" value="${uiLabelMap.CommonSelect}" class="smallSubmit"/>
+        </div>
+    </form>
+    
+    <#if isPurchaseShipment>
+    
+        <#assign itemsAvailableToReceive = totalAvailableToReceive?default(0) &gt; 0/>
+        <#if orderItemDatas?exists>
+            <#assign rowCount = 0>
+            <#assign totalReadyToReceive = 0/>
+            <form action="<@ofbizUrl>receiveInventoryProduct/ReceiveInventoryAgainstPurchaseOrder?clearAll=Y</@ofbizUrl>" method="post" name="selectAllForm">
+                <input type="hidden" name="facilityId" value="${facilityId}"/>
+                <input type="hidden" name="purchaseOrderId" value="${orderId}"/>
+                <input type="hidden" name="shipmentId" value="${shipmentId}">
+                <input type="hidden" name="_useRowSubmit" value="Y"/>
+                <table width="100%" cellpadding="2" cellspacing="0" border="1">
+                    <tr>
+                        <td><div class="tableheadtext">${uiLabelMap.ProductProduct}</div></td>
+                        <td><div class="tableheadtext">${uiLabelMap.OrderOrder}</div></td>
+                        <td><div class="tableheadtext">${uiLabelMap.CommonReceived}</div></td>
+                        <td><div class="tableheadtext">${uiLabelMap.ProductOpenQuantity}</div></td>
+                        <td><div class="tableheadtext">${uiLabelMap.CommonReceive}</div></td>
+                        <td><div class="tableheadtext">${uiLabelMap.ProductInventoryItemType}</div></td>
+                        <#if itemsAvailableToReceive>
+                            <td colspan="2" align="right">
+                                <div class="tableheadtext">${uiLabelMap.CommonAll}<input type="checkbox" name="selectAll" value="${uiLabelMap.CommonY}" onclick="javascript:toggleAll(this, 'selectAllForm');"></div>
+                            </td>
+                        </#if>
+                    </tr>
+                    <#list orderItemDatas?if_exists as orderItemData>
+                        <#assign orderItemAndShipGroupAssoc = orderItemData.orderItemAndShipGroupAssoc>
+                        <#assign product = orderItemData.product?if_exists>
+                        <#assign totalQuantityReceived = orderItemData.totalQuantityReceived?default(0)>
+                        <#assign availableToReceive = orderItemData.availableToReceive?default(0)>
+                        
+                        <tr>
+                            <td><div class="tabletext">${(product.internalName)?if_exists} [${orderItemAndShipGroupAssoc.productId?default("N/A")}]</div></td>
+                            <td>
+                                <div class="tabletext">
+                                    ${orderItemAndShipGroupAssoc.quantity}
+                                </div>
+                            </td>
+                            <td>
+                                <div class="tabletext">${totalQuantityReceived}</div>
+                            </td>
+                            <td>
+                                <div class="tabletext">
+                                    ${orderItemAndShipGroupAssoc.quantity - totalQuantityReceived}
+                                </div>
+                            </td>
+                            <#if availableToReceive &gt; 0 >
+                                <td>
+                                    <input type="hidden" name="productId_o_${rowCount}" value="${(product.productId)?if_exists}"/>
+                                    <input type="hidden" name="facilityId_o_${rowCount}" value="${facilityId}"/>
+                                    <input type="hidden" name="shipmentId_o_${rowCount}" value="${shipmentId}"/>
+                                    <input type="hidden" name="orderId_o_${rowCount}" value="${orderItemAndShipGroupAssoc.orderId}"/>
+                                    <input type="hidden" name="shipGroupSeqId_o_${rowCount}" value="${orderItemAndShipGroupAssoc.shipGroupSeqId}"/>
+                                    <input type="hidden" name="orderItemSeqId_o_${rowCount}" value="${orderItemAndShipGroupAssoc.orderItemSeqId}"/>
+                                    <input type="hidden" name="unitCost_o_${rowCount}" value="${orderItemAndShipGroupAssoc.unitPrice?default(0)}"/>
+                                    <input type="hidden" name="currencyUomId_o_${rowCount}" value="${currencyUomId?default("")}"/>
+                                    <input type="hidden" name="ownerPartyId_o_${rowCount}" value="${(facility.ownerPartyId)?if_exists}"/>
+                                    <input type="hidden" name="datetimeReceived_o_${rowCount}" value="${now}"/>
+                                    <input type="hidden" name="quantityRejected_o_${rowCount}" value="0"/>
+                                    <#if itemQuantitiesToReceive?exists && itemQuantitiesToReceive.get(orderItemAndShipGroupAssoc.orderItemSeqId)?exists>
+                                        <#assign quantityToReceive = itemQuantitiesToReceive.get(orderItemAndShipGroupAssoc.orderItemSeqId)>
+                                    <#else>
+                                        <#assign quantityToReceive = 0>
+                                    </#if>
+                                    <#assign totalReadyToReceive = totalReadyToReceive + quantityToReceive/>
+                                    <input type="text" class='inputBox' size="5" name="quantityAccepted_o_${rowCount}" value="${quantityToReceive}"/>
+                                </td>
+                                <td>              
+                                    <select name="inventoryItemTypeId_o_${rowCount}" class="selectBox">
+                                      <#list inventoryItemTypes as inventoryItemType>
+                                      <option value="${inventoryItemType.inventoryItemTypeId}"
+                                          <#if (facility.defaultInventoryItemTypeId?has_content) && (inventoryItemType.inventoryItemTypeId == facility.defaultInventoryItemTypeId)>
+                                              selected="selected"
+                                          </#if>    
+                                      >${inventoryItemType.get("description",locale)?default(inventoryItemType.inventoryItemTypeId)}</option>
+                                      </#list>
+                                    </select>
+                                </td>
+                                <td align="right">              
+                                    <a href="<@ofbizUrl>ReceiveInventoryAgainstPurchaseOrder?shipmentId=${shipmentId}&purchaseOrderId=${orderId}&productId=${product.productId}</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonClear}</a>
+                                </td>
+                                <td align="right">              
+                                  <input type="checkbox" name="_rowSubmit_o_${rowCount}" value="Y" onclick="javascript:checkToggle(this, 'selectAllForm');">
+                                </td>
+                                <#assign rowCount = rowCount + 1>  
+                            </#if>
+                        </tr>
+                    </#list>
+                    <#if itemsAvailableToReceive>
+                        <tr>
+                            <td colspan="7" align="right">
+                                <a href="<@ofbizUrl>ReceiveInventoryAgainstPurchaseOrder?shipmentId=${shipmentId}&purchaseOrderId=${orderId}&clearAll=Y</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonClearAll}</a>
+                            </td>
+                            <td align="right">
+                                <input type="submit" class="smallSubmit" value="${uiLabelMap.ProductReceiveItem}"/>
+                            </td>
+                        </tr>
+                    </#if>
+                </table>
+                <input type="hidden" name="_rowCount" value="${rowCount}">
+            </form>
+            <script language="JavaScript" type="text/javascript">selectAll('selectAllForm');</script>
+        </#if>
+        <#if itemsAvailableToReceive && totalReadyToReceive < totalAvailableToReceive>
+            <div class="head3">${uiLabelMap.ProductReceiveInventoryAddProductToReceive}</div>
+            <form name="addProductToReceive" method="post" action="<@ofbizUrl>ReceiveInventoryAgainstPurchaseOrder</@ofbizUrl>">
+                <input type="hidden" name="shipmentId" value="${shipmentId}"/>
+                <input type="hidden" name="purchaseOrderId" value="${orderId}"/>
+                <div class="tabletext">
+                    <span class="tabletext">
+                        ${uiLabelMap.ProductProductId} <input type="text" class="inputBox" size="20" id="productId" name="productId" value=""/>
+                        @
+                        <input type="text" class="inputBox" name="quantity" size="6" maxlength="6" value="1" tabindex="0"/>
+                        <input type="submit" value="${uiLabelMap.CommonAdd}" class="smallSubmit"/>
+                    </span>
+                </div>
+            </form>
+            <script language="javascript">
+                document.getElementById('productId').focus();
+            </script>
+        </#if>
+    </#if>
+<#else>
+  <h3>${uiLabelMap.ProductShipmentNotFoundId}: [${shipmentId?if_exists}]</h3>
+</#if>

Propchange: ofbiz/trunk/applications/product/webapp/facility/shipment/ReceiveInventoryAgainstPurchaseOrder.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/product/webapp/facility/shipment/ReceiveInventoryAgainstPurchaseOrder.ftl
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/applications/product/webapp/facility/shipment/ReceiveInventoryAgainstPurchaseOrder.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/applications/product/webapp/facility/shipment/ShipmentTabBar.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/shipment/ShipmentTabBar.ftl?view=diff&rev=517398&r1=517397&r2=517398
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/shipment/ShipmentTabBar.ftl (original)
+++ ofbiz/trunk/applications/product/webapp/facility/shipment/ShipmentTabBar.ftl Mon Mar 12 14:12:48 2007
@@ -33,6 +33,9 @@
     <#if shipment.shipmentTypeId?exists && shipment.shipmentTypeId='PURCHASE_SHIPMENT' && shipment.destinationFacilityId?exists>
       <a href="<@ofbizUrl>ReceiveInventory?shipmentId=${shipmentId}&facilityId=${shipment.destinationFacilityId?if_exists}<#if shipment.primaryOrderId?exists>&purchaseOrderId=${shipment.primaryOrderId}</#if></@ofbizUrl>" class="${selectedClassMap.ReceiveInventory?default(unselectedClassName)}">${uiLabelMap.ProductReceiveInventory}</a>
     </#if>
+    <#if shipment.shipmentTypeId?exists && shipment.shipmentTypeId='PURCHASE_SHIPMENT' && shipment.destinationFacilityId?exists && shipment.primaryOrderId?exists>
+      <a href="<@ofbizUrl>ReceiveInventoryAgainstPurchaseOrder?shipmentId=${shipmentId?if_exists}&purchaseOrderId=${shipment.primaryOrderId?if_exists}</@ofbizUrl>" class="${selectedClassMap.ProductReceiveInventoryAgainstPurchaseOrder?default(unselectedClassName)}">${uiLabelMap.ProductReceiveInventoryAgainstPO}</a>
+    </#if>
     <#if shipment.shipmentTypeId?exists && shipment.shipmentTypeId='SALES_SHIPMENT'>
       <a href="<@ofbizUrl>EditShipmentItems?shipmentId=${shipmentId}</@ofbizUrl>" class="${selectedClassMap.EditShipmentItems?default(unselectedClassName)}">${uiLabelMap.ProductItems}</a>
       <a href="<@ofbizUrl>EditShipmentPackages?shipmentId=${shipmentId}</@ofbizUrl>" class="${selectedClassMap.EditShipmentPackages?default(unselectedClassName)}">${uiLabelMap.ProductPackages}</a>

Modified: ofbiz/trunk/applications/product/widget/facility/ShipmentScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/facility/ShipmentScreens.xml?view=diff&rev=517398&r1=517397&r2=517398
==============================================================================
--- ofbiz/trunk/applications/product/widget/facility/ShipmentScreens.xml (original)
+++ ofbiz/trunk/applications/product/widget/facility/ShipmentScreens.xml Mon Mar 12 14:12:48 2007
@@ -319,4 +319,26 @@
             </widgets>
         </section>
     </screen>
+
+    <screen name="ReceiveInventoryAgainstPurchaseOrder">
+        <section>
+            <actions>
+                <set field="titleProperty" value="ProductReceiveInventoryAgainstPurchaseOrder"/>
+                <set field="headerItem" value="shipment"/>
+                <set field="tabButtonItem" value="ProductReceiveInventoryAgainstPO"/>
+                <property-map resource="OrderUiLabels" map-name="uiLabelMap" global="true"/>
+                <script location="component://product/webapp/facility/WEB-INF/actions/shipment/ReceiveInventoryAgainstPurchaseOrder.bsh"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonShipmentDecorator">
+                    <decorator-section name="body">
+                        <platform-specific>
+                            <html><html-template location="component://product/webapp/facility/shipment/ReceiveInventoryAgainstPurchaseOrder.ftl"/></html>
+                        </platform-specific>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+
 </screens>

Modified: ofbiz/trunk/framework/common/config/CommonUiLabels.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/config/CommonUiLabels.properties?view=diff&rev=517398&r1=517397&r2=517398
==============================================================================
--- ofbiz/trunk/framework/common/config/CommonUiLabels.properties (original)
+++ ofbiz/trunk/framework/common/config/CommonUiLabels.properties Mon Mar 12 14:12:48 2007
@@ -81,6 +81,7 @@
 CommonChooseLanguage=Choose Language
 CommonCity=City
 CommonClear=Clear
+CommonClearAll=Clear All
 CommonClickHere=Click Here
 CommonClose=Close
 CommonCloseTab=-