Fix them all in 1 shoot : +1
Jacques
From: "Adrian Crum" <[email protected]>
I'd rather get the UEL code to work with the existing syntax. If everyone could
be patient, I should have this fixed soon.
-Adrian
Jacques Le Roux wrote:
Thanks David,
I remember you already wrote that. Last time I searched I did not find the right
syntax (because of the " I guess)
Jacques
From: "David E Jones" <[email protected]>
The safest syntax to use (but a bit cumbersome) is:
field="totalsMap["receipt.orderItemSeqId"]"
If it works without the " then all the better though!
-David
On Apr 20, 2009, at 8:52 AM, Adrian Crum wrote:
Jacopo,
totalsMap.${receipt.orderItemSeqId}
should work on revision 764992 or later. If not, try
totalsMap[receipt.orderItemSeqId]
A good explanation can be found in section 1.5 and 1.6 of the UEL syntax
documentation.
-Adrian
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"/>