svn commit: r520554 - in /ofbiz/trunk/applications/product: config/ProductUiLabels.properties webapp/facility/WEB-INF/actions/shipment/ReceiveInventoryAgainstPurchaseOrder.bsh webapp/facility/shipment/ReceiveInventoryAgainstPurchaseOrder.ftl

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

svn commit: r520554 - in /ofbiz/trunk/applications/product: config/ProductUiLabels.properties webapp/facility/WEB-INF/actions/shipment/ReceiveInventoryAgainstPurchaseOrder.bsh webapp/facility/shipment/ReceiveInventoryAgainstPurchaseOrder.ftl

sichen
Author: sichen
Date: Tue Mar 20 13:26:14 2007
New Revision: 520554

URL: http://svn.apache.org/viewvc?view=rev&rev=520554
Log:
Receiving inventory against purchase orders:
- Added column for fulfilled back order reservations related to purchase order item
- Fixed currency conversion of purchase order item unit price
- Added missing uiLabel

Modified:
    ofbiz/trunk/applications/product/config/ProductUiLabels.properties
    ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/ReceiveInventoryAgainstPurchaseOrder.bsh
    ofbiz/trunk/applications/product/webapp/facility/shipment/ReceiveInventoryAgainstPurchaseOrder.ftl

Modified: ofbiz/trunk/applications/product/config/ProductUiLabels.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/ProductUiLabels.properties?view=diff&rev=520554&r1=520553&r2=520554
==============================================================================
--- ofbiz/trunk/applications/product/config/ProductUiLabels.properties (original)
+++ ofbiz/trunk/applications/product/config/ProductUiLabels.properties Tue Mar 20 13:26:14 2007
@@ -335,6 +335,7 @@
 ProductAvailablePromiseQuantityHand=Available To Promise / Quantity On Hand
 ProductAvailableThruDate=Available thru date
 ProductAverageCost=Average Cost
+ProductBackOrders=Back Orders
 ProductBackToEditCategory=Back to Edit Category
 ProductBarcode=Barcode
 ProductBase=Base
@@ -1082,6 +1083,7 @@
 ProductReceivePurchaseOrder=Receive Purchase Order
 ProductReceiveInventoryAgainstPurchaseOrderProductNotFound=Product ${productId} not found in order ${orderId}
 ProductReceiveInventoryAgainstPurchaseOrderQuantityExceedsAvailableToReceive=Quantity ${newQuantity} for product ${productId} exceeds quantity available to receive
+ProductReceiveInventoryAgainstPurchaseOrderQuantityGoesToBackOrder=Quantity ${quantityToBackOrder} of ${quantityToReceive} for product ${productId} will go to a back order
 ProductReceiveReturn=Receive Return
 ProductReceiveSelectedProduct=Receive Selected Product(s)
 ProductReceiveSelectedShipment=Receive Selected Shipment

Modified: 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=diff&rev=520554&r1=520553&r2=520554
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/ReceiveInventoryAgainstPurchaseOrder.bsh (original)
+++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/ReceiveInventoryAgainstPurchaseOrder.bsh Tue Mar 20 13:26:14 2007
@@ -137,6 +137,7 @@
     // Get the item quantity received from all shipments via the ShipmentReciept entity
     totalReceived = 0.0;
     receipts = delegator.findByAnd("ShipmentReceipt", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItem.get("orderItemSeqId")));
+    fulfilledReservations = new ArrayList();
     if (receipts != null && receipts.size() > 0) {
         recIter = receipts.iterator();
         while (recIter.hasNext()) {
@@ -147,15 +148,22 @@
                 totalReceived += accepted.doubleValue();
             if (rejected != null)
                 totalReceived += rejected.doubleValue();                                            
+
+            // Get the reservations related to this receipt
+            oisgirs = delegator.findByAnd("OrderItemShipGrpInvRes", UtilMisc.toMap("inventoryItemId", rec.get("inventoryItemId")));
+            if (! UtilValidate.isEmpty(oisgirs)) {
+                fulfilledReservations.addAll(oisgirs);
+            }
         }            
     }
+    orderItemData.put("fulfilledReservations", fulfilledReservations);
 
     // Update the unit cost with the converted value, if any
-    if (UtilValidate.isNotEmpty(baseCurrencyUomId)) {
+    if (UtilValidate.isNotEmpty(baseCurrencyUomId) && UtilValidate.isNotEmpty(orderHeader.getString("currencyUom"))) {
         if (! UtilValidate.isEmpty(product)) {
-            result = dispatcher.runSync("getProductCost", UtilMisc.toMap("productId", product.get("productId"), "currencyUomId", baseCurrencyUomId, "costComponentTypePrefix", "EST_STD", "userLogin", request.getAttribute("userLogin")));
+            result = dispatcher.runSync("convertUom", UtilMisc.toMap("uomId", orderHeader.getString("currencyUom"), "uomIdTo", baseCurrencyUomId, "originalValue", orderItem.get("unitPrice")));
             if (!ServiceUtil.isError(result)) {
-                orderItem.put("unitPrice", result.get("productCost"));
+                orderItem.put("unitPrice", result.get("convertedValue"));
             }
         }
     }

Modified: 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=diff&rev=520554&r1=520553&r2=520554
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/shipment/ReceiveInventoryAgainstPurchaseOrder.ftl (original)
+++ ofbiz/trunk/applications/product/webapp/facility/shipment/ReceiveInventoryAgainstPurchaseOrder.ftl Tue Mar 20 13:26:14 2007
@@ -93,6 +93,7 @@
                         <td><div class="tableheadtext">${uiLabelMap.OrderBackOrdered}</div></td>
                         <td><div class="tableheadtext">${uiLabelMap.CommonReceived}</div></td>
                         <td><div class="tableheadtext">${uiLabelMap.ProductOpenQuantity}</div></td>
+                        <td><div class="tableheadtext">${uiLabelMap.ProductBackOrders}</div></td>
                         <#if itemsAvailableToReceive>
                             <td><div class="tableheadtext">${uiLabelMap.CommonReceive}</div></td>
                             <td><div class="tableheadtext">${uiLabelMap.ProductInventoryItemType}</div></td>
@@ -108,6 +109,7 @@
                         <#assign totalQuantityReceived = orderItemData.totalQuantityReceived?default(0)>
                         <#assign availableToReceive = orderItemData.availableToReceive?default(0)>
                         <#assign backOrderedQuantity = orderItemData.backOrderedQuantity?default(0)>
+                        <#assign fulfilledReservations = orderItemData.fulfilledReservations>
                         
                         <tr>
                             <td><div class="tabletext">${(product.internalName)?if_exists} [${orderItem.productId?default("N/A")}]</div></td>
@@ -143,6 +145,15 @@
                                     ${orderItem.quantity - orderItem.cancelQuantity?default(0) - totalQuantityReceived}
                                 </div>
                             </td>
+                            <td>
+                                <div class="tabletext">
+                                    <#if fulfilledReservations?has_content>
+                                        <#list fulfilledReservations?sort_by("orderId") as fulfilledReservation>
+                                            ${fulfilledReservation.orderId}<br/>
+                                        </#list>
+                                    </#if>
+                                </div>
+                            </td>
                             <#if availableToReceive &gt; 0 >
                                 <td>
                                     <input type="hidden" name="productId_o_${rowCount}" value="${(product.productId)?if_exists}"/>
@@ -189,7 +200,7 @@
                     </#list>
                     <#if itemsAvailableToReceive>
                         <tr>
-                            <td colspan="10" align="right">
+                            <td colspan="11" align="right">
                                 <a href="<@ofbizUrl>ReceiveInventoryAgainstPurchaseOrder?shipmentId=${shipmentId}&purchaseOrderId=${orderId}&clearAll=Y</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonClearAll}</a>
                             </td>
                             <td align="right">
@@ -197,7 +208,7 @@
                             </td>
                         </tr>
                         <tr>
-                            <td colspan="11" align="right">
+                            <td colspan="12" align="right">
                                 <a class="smallSubmit" href="<@ofbizUrl>completePurchaseOrder?orderId=${orderId}&facilityId=${facilityId}&shipmentId=${shipmentId}</@ofbizUrl>">${uiLabelMap.OrderForceCompletePurchaseOrder}</a>
                             </td>
                         </tr>