Just a quick note on syntax: there is a difference between these two.
The first one "totalsMap.${receipt.orderItemSeqId}" is saying find an
entry in the totalsMap Map with the key consisting of the value of the
receipt.orderItemSeqId field.
The second one "totalsMap.receipt.orderItemSeqId" is saying find an
entry in the totalsMap Map with the key consisting of the value
"receipt", and then results of that should be a Map and find an entry
in that "totalsMap.receipt" Map that has a key of "orderItemSeqId".
-David
On Apr 20, 2009, at 8:22 AM, Jacopo Cappellato wrote:
Hi Adrian,
could you please review the following change I did? Is it the
correct way to fix this issue? Do you think we should search for
similar patterns in the system and fix them?
Thanks,
Jacopo
Begin forwarded message:
From: [email protected]
Date: April 20, 2009 4:19:28 PM GMT+02:00
To: [email protected]
Subject: svn commit: r766704 - /ofbiz/trunk/applications/order/
script/org/ofbiz/order/order/OrderSimpleMethods.xml
Reply-To: [email protected]
Author: jacopoc
Date: Mon Apr 20 14:19:28 2009
New Revision: 766704
URL: http://svn.apache.org/viewvc?rev=766704&view=rev
Log:
Fixed code that was not working (I think) after recent
implementation of UEL.
Modified:
ofbiz/trunk/applications/order/script/org/ofbiz/order/order/
OrderSimpleMethods.xml
Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/
order/OrderSimpleMethods.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderSimpleMethods.xml?rev=766704&r1=766703&r2=766704&view=diff
=
=
=
=
=
=
=
=
=
=====================================================================
--- ofbiz/trunk/applications/order/script/org/ofbiz/order/order/
OrderSimpleMethods.xml (original)
+++ ofbiz/trunk/applications/order/script/org/ofbiz/order/order/
OrderSimpleMethods.xml Mon Apr 20 14:19:28 2009
@@ -85,11 +85,11 @@
<field-map field-name="orderId" from-
field="parameters.orderId"/>
</entity-and>
<iterate list="shipmentReceipts" entry="receipt">
- <if-empty field="totalsMap.${receipt.orderItemSeqId}">
- <set field="totalsMap.${receipt.orderItemSeqId}"
value="0" type="BigDecimal"/>
+ <if-empty field="totalsMap.receipt.orderItemSeqId">
+ <set field="totalsMap.receipt.orderItemSeqId"
value="0" type="BigDecimal"/>
</if-empty>
- <calculate field="totalsMap.${receipt.orderItemSeqId}">
- <calcop field="totalsMap.$
{receipt.orderItemSeqId}" operator="add">
+ <calculate field="totalsMap.receipt.orderItemSeqId">
+ <calcop field="totalsMap.receipt.orderItemSeqId"
operator="add">
<calcop field="receipt.quantityAccepted"
operator="get"/>
<calcop field="receipt.quantityRejected"
operator="get"/>
</calcop>
@@ -98,7 +98,7 @@
<set from-field="receipt.orderItemSeqId"
field="newLookupMap.orderItemSeqId"/>
<find-by-primary-key entity-name="OrderItem"
map="newLookupMap" value-field="orderItem"/>
<if-compare field="orderItem.statusId" operator="not-
equals" value="ITEM_COMPLETED">
- <if-compare-field field="orderItem.quantity" to-
field="totalsMap.${receipt.orderItemSeqId}" operator="less-equals"
type="BigDecimal">
+ <if-compare-field field="orderItem.quantity" to-
field="totalsMap.receipt.orderItemSeqId" operator="less-equals"
type="BigDecimal">
<!-- update the status for the item -->
<set field="orderItem.statusId"
value="ITEM_COMPLETED"/>
<store-value value-field="orderItem"/>