Author: sichen
Date: Wed Mar 14 15:02:11 2007 New Revision: 518349 URL: http://svn.apache.org/viewvc?view=rev&rev=518349 Log: When receiving inventory against a PO, issue order item quantity and receive the same inventory quantity in sequence via a service group, to eliminate redundant steps Modified: ofbiz/trunk/applications/product/servicedef/services_shipment.xml ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml ofbiz/trunk/applications/product/webapp/facility/shipment/ReceiveInventoryAgainstPurchaseOrder.ftl Modified: ofbiz/trunk/applications/product/servicedef/services_shipment.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services_shipment.xml?view=diff&rev=518349&r1=518348&r2=518349 ============================================================================== --- ofbiz/trunk/applications/product/servicedef/services_shipment.xml (original) +++ ofbiz/trunk/applications/product/servicedef/services_shipment.xml Wed Mar 14 15:02:11 2007 @@ -523,6 +523,14 @@ <override name="facilityId" optional="false"/> </service> + <service name="issueOrderItemToShipmentAndReceiveAgainstPO" engine="group" auth="true"> + <description>Issues order item quantity specified to the shipment, then receives inventory for that item and quantity</description> + <group> + <invoke name="issueOrderItemToShipment" result-to-context="true"/> + <invoke name="receiveInventoryProduct" result-to-context="true"/> + </group> + </service> + <service name="quickReceiveReturn" engine="simple" location="org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml" invoke="quickReceiveReturn" auth="true"> <attribute name="returnId" type="String" mode="IN" optional="false"/> 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=518349&r1=518348&r2=518349 ============================================================================== --- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml (original) +++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml Wed Mar 14 15:02:11 2007 @@ -1007,6 +1007,12 @@ <security https="true" auth="true"/> <response name="success" type="view" value="ReceiveInventoryAgainstPurchaseOrder"/> </request-map> + <request-map uri="issueOrderItemToShipmentAndReceiveAgainstPO"> + <security https="true" auth="true"/> + <event type="service-multi" path="" invoke="issueOrderItemToShipmentAndReceiveAgainstPO"/> + <response name="success" type="view" value="ReceiveInventoryAgainstPurchaseOrder"/> + <response name="error" type="view" value="ReceiveInventoryAgainstPurchaseOrder"/> + </request-map> <!-- ================ Shipment Items From Order Requests ================= --> <request-map uri="EditShipmentPlan"> <security https="true" auth="true"/> 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=518349&r1=518348&r2=518349 ============================================================================== --- ofbiz/trunk/applications/product/webapp/facility/shipment/ReceiveInventoryAgainstPurchaseOrder.ftl (original) +++ ofbiz/trunk/applications/product/webapp/facility/shipment/ReceiveInventoryAgainstPurchaseOrder.ftl Wed Mar 14 15:02:11 2007 @@ -18,6 +18,19 @@ --> <#if shipment?exists> + <#-- JS to populate the quantity_o_# field required by the chained issueOrderItemToShipment service --> + <script type="text/javascript"> + function populateQuantities(rowCount) { + for (var x = 0; x <= rowCount; x++) { + var quantityAcceptedInput = document.getElementById('quantityAccepted_o_' + x); + var quantityInput = document.getElementById('quantity_o_' + x); + if (quantityAcceptedInput != null && quantityInput != null) { + quantityInput.value = quantityAcceptedInput.value; + } + } + } + </script> + <#assign productId = parameters.productId?if_exists/> <div class="head3">${uiLabelMap.ProductReceiveInventoryAgainstPurchaseOrder}</div> @@ -64,7 +77,7 @@ <#if orderItemDatas?exists> <#assign rowCount = 0> <#assign totalReadyToReceive = 0/> - <form action="<@ofbizUrl>receiveInventoryProduct/ReceiveInventoryAgainstPurchaseOrder?clearAll=Y</@ofbizUrl>" method="post" name="selectAllForm"> + <form action="<@ofbizUrl>issueOrderItemToShipmentAndReceiveAgainstPO?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}"> @@ -124,13 +137,15 @@ <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"/> + <#-- quantity field required by the chained issueOrderItemToShipment service --> + <input type="hidden" name="quantity_o_${rowCount}" id="quantity_o_${rowCount}" value=""/> <#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}"/> + <input type="text" class='inputBox' size="5" name="quantityAccepted_o_${rowCount}" id="quantityAccepted_o_${rowCount}" value="${quantityToReceive}"/> </td> <td> <select name="inventoryItemTypeId_o_${rowCount}" class="selectBox"> @@ -159,7 +174,7 @@ <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}"/> + <a class="smallSubmit" href="javascript:populateQuantities(${rowCount - 1});document.selectAllForm.submit();">${uiLabelMap.ProductReceiveItem}</a> </td> </tr> </#if> |
Free forum by Nabble | Edit this page |