Author: jonesde
Date: Tue Jan  5 09:42:33 2010
New Revision: 895963

URL: http://svn.apache.org/viewvc?rev=895963&view=rev
Log:
Small change to allow caller to specify receiveDate instead of assuming now for 
completeInventoryTransfer

Modified:
    ofbiz/trunk/applications/product/servicedef/services_facility.xml
    
ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java

Modified: ofbiz/trunk/applications/product/servicedef/services_facility.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services_facility.xml?rev=895963&r1=895962&r2=895963&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/servicedef/services_facility.xml (original)
+++ ofbiz/trunk/applications/product/servicedef/services_facility.xml Tue Jan  
5 09:42:33 2010
@@ -437,6 +437,7 @@
             location="org.ofbiz.product.inventory.InventoryServices" 
invoke="completeInventoryTransfer">
         <description>Completes the inventory transfer</description>
         <attribute name="inventoryTransferId" type="String" mode="IN" 
optional="false"/>
+        <attribute name="receiveDate" type="Timestamp" mode="IN" 
optional="true"/>
     </service>
     <service name="cancelInventoryTransfer" engine="java"
             location="org.ofbiz.product.inventory.InventoryServices" 
invoke="cancelInventoryTransfer">

Modified: 
ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java?rev=895963&r1=895962&r2=895963&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java
 (original)
+++ 
ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryServices.java
 Tue Jan  5 09:42:33 2010
@@ -192,6 +192,7 @@
     public static Map<String, Object> 
completeInventoryTransfer(DispatchContext dctx, Map<String, ? extends Object> 
context) {
         Delegator delegator = dctx.getDelegator();
         String inventoryTransferId = (String) 
context.get("inventoryTransferId");
+        Timestamp receiveDate = (Timestamp) context.get("receiveDate");
         GenericValue inventoryTransfer = null;
         GenericValue inventoryItem = null;
         GenericValue destinationFacility = null;
@@ -214,7 +215,11 @@
 
         // set the fields on the transfer record
         if (inventoryTransfer.get("receiveDate") == null) {
-            inventoryTransfer.set("receiveDate", UtilDateTime.nowTimestamp());
+            if (receiveDate != null) {
+                inventoryTransfer.set("receiveDate", receiveDate);
+            } else {
+                inventoryTransfer.set("receiveDate", 
UtilDateTime.nowTimestamp());
+            }
         }
 
         if (inventoryType.equals("NON_SERIAL_INV_ITEM")) {


Reply via email to