You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by le...@apache.org on 2009/10/18 03:42:29 UTC

svn commit: r826334 - in /ofbiz/trunk/applications/product: script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml servicedef/services_shipment.xml

Author: lektran
Date: Sun Oct 18 01:42:29 2009
New Revision: 826334

URL: http://svn.apache.org/viewvc?rev=826334&view=rev
Log:
Don't require unitCost in updateIssuanceShipmentAndPoOnReceiveInventory, because the service is only used by receiveInventoryProduct (as a seca) which doesn't require it
(Found via unit tests)

Modified:
    ofbiz/trunk/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml
    ofbiz/trunk/applications/product/servicedef/services_shipment.xml

Modified: ofbiz/trunk/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml?rev=826334&r1=826333&r2=826334&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml (original)
+++ ofbiz/trunk/applications/product/script/org/ofbiz/shipment/receipt/ShipmentReceiptServices.xml Sun Oct 18 01:42:29 2009
@@ -421,10 +421,18 @@
     <simple-method method-name="updateIssuanceShipmentAndPoOnReceiveInventory" short-description="Update issuance, shipment and order items if quantity received is higher than quantity on purchase order">
         <entity-one value-field="orderItem" entity-name="OrderItem"/>
         <set field="unitCost" from-field="parameters.unitCost" type="BigDecimal"/>
-        <if-compare-field field="unitCost" operator="not-equals" to-field="orderItem.unitPrice">
-            <set field="orderItem.unitPrice" from-field="unitCost"/>
-            <store-value value-field="orderItem"/>
-        </if-compare-field>
+        <if>
+            <condition> <!-- (unitCost != null && unitCost.compareTo(orderItem.get("unitPrice")) != 0) -->
+                <and>
+                    <not><if-empty field="unitCost"/></not>
+                    <if-compare-field field="unitCost" operator="not-equals" to-field="orderItem.unitPrice" type="BigDecimal"/>
+                </and>
+            </condition>
+            <then>
+                <set field="orderItem.unitPrice" from-field="unitCost"/>
+                <store-value value-field="orderItem"/>
+            </then>
+        </if>
         <call-simple-method method-name="getReceivedQuantityForOrderItem"/>
         <if-compare-field field="orderItem.quantity" operator="less" to-field="receivedQuantity" type="BigDecimal">
             <set field="orderItem.quantity" from-field="receivedQuantity"/>

Modified: ofbiz/trunk/applications/product/servicedef/services_shipment.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services_shipment.xml?rev=826334&r1=826333&r2=826334&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/servicedef/services_shipment.xml (original)
+++ ofbiz/trunk/applications/product/servicedef/services_shipment.xml Sun Oct 18 01:42:29 2009
@@ -890,6 +890,6 @@
         <attribute name="quantityAccepted"  type="BigDecimal" mode="IN" optional="false"/>
         <attribute name="shipmentId" type="String" mode="IN" optional="true"/>
         <attribute name="shipmentItemSeqId" type="String" mode="IN" optional="true"/>
-        <attribute name="unitCost" type="String" mode="IN" optional="false"/>
+        <attribute name="unitCost" type="String" mode="IN" optional="true"/>
     </service>
 </services>