Tag for Release apache-ofbiz-11.04.05

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/tags/REL-11.04.05@1615062 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java b/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java
index cfe02d4..7fa0247 100644
--- a/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java
+++ b/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java
@@ -512,7 +512,10 @@
             List<GenericValue> acctgTransEntries = invoice.getRelated("AcctgTrans");
             if (UtilValidate.isNotEmpty(acctgTransEntries)) {
                 GenericValue acctgTransEntry = (acctgTransEntries.get(0)).getRelated("AcctgTransEntry").get(0);
-                conversionRate = acctgTransEntry.getBigDecimal("amount").divide(acctgTransEntry.getBigDecimal("origAmount"), new MathContext(100)).setScale(decimals,rounding);
+                BigDecimal origAmount = acctgTransEntry.getBigDecimal("origAmount");
+                if (origAmount.compareTo(ZERO) == 1) {
+                    conversionRate = acctgTransEntry.getBigDecimal("amount").divide(acctgTransEntry.getBigDecimal("origAmount"), new MathContext(100)).setScale(decimals,rounding);
+                }
             }
             // check if a payment is applied and use the currency conversion from there
             if (UtilValidate.isEmpty(conversionRate)) {
diff --git a/applications/content/script/org/ofbiz/content/content/ContentServices.xml b/applications/content/script/org/ofbiz/content/content/ContentServices.xml
index fed946b..f3630e9 100644
--- a/applications/content/script/org/ofbiz/content/content/ContentServices.xml
+++ b/applications/content/script/org/ofbiz/content/content/ContentServices.xml
@@ -800,10 +800,10 @@
             <results-to-map map-name="persistOut"/>
         </call-service>
 
-        <set-service-fields service-name="createCommContentDataResource" mode="OUT" map="persistOut" to-map="filteredPersistOut"/>
-        <iterate-map key="key" value="val" map="filteredPersistOut">
+        <iterate-map key="key" value="val" map="persistOut">
             <field-to-result field="val" result-name="${key}"/>
         </iterate-map>
+
         <set field="mapIn.contentId"  from-field="persistOut.contentId"/>
         <!-- <set field="mapIn.fromDate"  from-field="nowTimestamp"/> -->
         <set field="mapIn.communicationEventId"  from-field="parameters.communicationEventId"/>
diff --git a/applications/content/servicedef/secas.xml b/applications/content/servicedef/secas.xml
index 7a10056..4ef5a26 100644
--- a/applications/content/servicedef/secas.xml
+++ b/applications/content/servicedef/secas.xml
@@ -105,7 +105,7 @@
     </eca>
 
     <!-- electronic text; needs dataResourceId -->
-    <eca service="createElectronicText" event="in-validate">
+    <eca service="createElectronicText" event="invoke">
         <condition field-name="dataResourceId" operator="is-empty"/>
         <set field-name="dataResourceTypeId" value="ELECTRONIC_TEXT"/>
         <action service="createDataResource" mode="sync" result-to-context="true"/>
diff --git a/applications/order/servicedef/secas.xml b/applications/order/servicedef/secas.xml
index 8a9a2db..110671e 100644
--- a/applications/order/servicedef/secas.xml
+++ b/applications/order/servicedef/secas.xml
@@ -87,7 +87,7 @@
         <action service="releaseOrderPayments" mode="sync"/>
         <action service="processRefundReturnForReplacement" mode="sync"/>
     </eca>
-    <eca service="changeOrderStatus" event="global-commit" run-on-error="false">
+    <eca service="changeOrderStatus" event="global-commit-post-run" run-on-error="false">
         <condition field-name="statusId" operator="equals" value="ORDER_COMPLETED"/>
         <condition-field field-name="statusId" operator="not-equals" to-field-name="oldStatusId"/>
         <action service="resetGrandTotal" mode="sync"/>
@@ -223,7 +223,7 @@
         <action service="processCreditReturn" mode="sync"/>
         <action service="processRefundOnlyReturn" mode="sync"/>
     </eca>
-    <eca service="updateReturnStatusFromReceipt" event="global-commit">
+    <eca service="updateReturnStatusFromReceipt" event="global-commit-post-run">
         <condition field-name="returnHeaderStatus" operator="equals" value="RETURN_RECEIVED"/>
         <action service="addProductsBackToCategory" mode="sync"/>
         <action service="processWaitReplacementReturn" mode="sync"/>
diff --git a/applications/party/widget/partymgr/PartyForms.xml b/applications/party/widget/partymgr/PartyForms.xml
index 1d35d8c..f6a7c13 100644
--- a/applications/party/widget/partymgr/PartyForms.xml
+++ b/applications/party/widget/partymgr/PartyForms.xml
@@ -812,8 +812,10 @@
         <field name="partyIdTo" entry-name="parameters.partyId"><display/></field>
         <field name="roleTypeIdTo" title="${uiLabelMap.PartyPartyInTheRoleOf}">
             <drop-down allow-empty="false" no-current-selected-key="_NA_">
-                <entity-options entity-name="RoleType" key-field-name="roleTypeId" description="${description}">
+                <entity-options entity-name="RoleTypeAndParty" key-field-name="roleTypeId" description="${description}">
+                    <entity-constraint name="partyId" value="${partyId}"/>
                     <entity-order-by field-name="description"/>
+                    <entity-order-by field-name="roleTypeId"/>
                 </entity-options>
             </drop-down>
         </field>
diff --git a/applications/product/script/org/ofbiz/product/price/PriceServices.xml b/applications/product/script/org/ofbiz/product/price/PriceServices.xml
index 60210d6..08de83c 100644
--- a/applications/product/script/org/ofbiz/product/price/PriceServices.xml
+++ b/applications/product/script/org/ofbiz/product/price/PriceServices.xml
@@ -21,7 +21,7 @@
 <simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
     <!-- ProductPrice methods -->
-    <simple-method method-name="createProductPrice" short-description="Create an ProductPrice">
+    <simple-method method-name="createProductPrice" short-description="Create a Product Price">
         <set field="callingMethodName" value="createProductPrice"/>
         <set field="checkAction" value="CREATE"/>
         <call-simple-method method-name="checkProductRelatedPermission" xml-resource="component://product/script/org/ofbiz/product/product/ProductServices.xml"/>
diff --git a/applications/product/servicedef/services.xml b/applications/product/servicedef/services.xml
index d58eaea..5b1b78d 100644
--- a/applications/product/servicedef/services.xml
+++ b/applications/product/servicedef/services.xml
@@ -240,12 +240,14 @@
     <service name="createProductPrice" default-entity-name="ProductPrice" engine="simple"
                 location="component://product/script/org/ofbiz/product/price/PriceServices.xml" invoke="createProductPrice" auth="true">
         <description>
-            Create an ProductPrice. 
-            Price is always stored without tax. 
+            Create a Product Price. 
+            
             If taxAuthGeoId and taxAuthPartyId are (or taxAuthCombinedId is) passed in then the price will be considered a price 
             with tax included (the priceWithoutTax, priceWithTax, taxAmount, and taxPercentage fields will also be populated).
-            If the taxInPrice field is 'Y' then the price field will be left with the price included (price will be equal to priceWithTax), 
+            
+            If the taxInPrice field is 'Y' then the price field will be left with the tax included (price will be equal to priceWithTax),            
             otherwise tax will be removed from the passed in price and the price field will be equal to the priceWithoutTax field.
+            
             If taxAuthGeoId or taxAuthPartyId empty, and taxAuthCombinedId is empty, then the taxInPrice field will be ignored.
         </description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
diff --git a/applications/product/widget/catalog/ProductForms.xml b/applications/product/widget/catalog/ProductForms.xml
index 6f786a2..276db8d 100644
--- a/applications/product/widget/catalog/ProductForms.xml
+++ b/applications/product/widget/catalog/ProductForms.xml
@@ -915,17 +915,8 @@
         <field use-when="supplierProduct == null" name="submitButton" title="${uiLabelMap.CommonCreate}"><submit button-type="button"/></field>
         <field use-when="supplierProduct != null" name="submitButton" title="${uiLabelMap.CommonUpdate}"><submit button-type="button"/></field>
     </form>
-    <form name="ListSupplierProducts" type="list" target="updateSupplierProduct" title="" list-name="listIt"
+    <form name="ListSupplierProducts" type="list" target="updateSupplierProduct" title="" list-name="productSuppliers"
         odd-row-style="alternate-row" default-table-style="basic-table">
-        <actions>
-            <service service-name="performFind" result-map="result" result-map-list="listIt">
-                <field-map field-name="inputFields" from-field="requestParameters"/>
-                <field-map field-name="entityName" value="SupplierProduct"/>
-                <field-map field-name="orderBy" from-field="parameters.sortField"/>
-                <field-map field-name="viewIndex" from-field="viewIndex"/>
-                <field-map field-name="viewSize" from-field="viewSize"/>
-            </service>
-        </actions>
         <field name="partyId" title="${uiLabelMap.ProductSupplier}">
             <display-entity entity-name="PartyNameView" also-hidden="true" description="${firstName} ${middleName} ${lastName} ${groupName}">
                 <sub-hyperlink target="/partymgr/control/viewprofile" target-type="inter-app" description="${partyId}" link-style="buttontext">
@@ -935,10 +926,10 @@
         </field>
         <field name="supplierProductId"><display/></field>
         <field name="minimumOrderQuantity" title="${uiLabelMap.ProductMinimumOrderQuantity}" sort-field="true">
-            <display type="date-time"/>
+            <display/>
         </field>
         <field name="orderQtyIncrements" title="${uiLabelMap.ProductOrderQtyIncrements}" sort-field="true">
-            <display type="date-time"/>
+            <display/>
         </field>
         <field name="supplierPrefOrderId">
             <display-entity entity-name="SupplierPrefOrder"/>
diff --git a/applications/product/widget/catalog/ProductScreens.xml b/applications/product/widget/catalog/ProductScreens.xml
index 3cd4c2c..bfc1241 100644
--- a/applications/product/widget/catalog/ProductScreens.xml
+++ b/applications/product/widget/catalog/ProductScreens.xml
@@ -877,7 +877,11 @@
 
                 <!-- default currency in framework/common/config/general.properties -->
                 <property-to-field field="defaultCurrencyUomId" resource="general" property="currency.uom.id.default" default="USD"/>
-
+                <set field="orderBy" from-field="parameters.sortField" default-value="partyId"/>
+                <entity-and entity-name="SupplierProduct" list="productSuppliers">
+                    <field-map field-name="productId" from-field="parameters.productId"/>
+                    <order-by field-name="${orderBy}"/>
+                </entity-and>
                 <entity-one entity-name="SupplierProduct" value-field="supplierProduct" auto-field-map="true"/>
             </actions>
             <widgets>
diff --git a/framework/minilang/src/org/ofbiz/minilang/method/envops/Iterate.java b/framework/minilang/src/org/ofbiz/minilang/method/envops/Iterate.java
index 496565e..ac4f44b0 100644
--- a/framework/minilang/src/org/ofbiz/minilang/method/envops/Iterate.java
+++ b/framework/minilang/src/org/ofbiz/minilang/method/envops/Iterate.java
@@ -137,7 +137,10 @@
                 }
             }
         } else {
-            if (Debug.infoOn()) Debug.logInfo("List not found with name " + listAcsr + ", doing nothing: " + rawString(), module);
+            if (Debug.verboseOn()) {
+                Debug.logVerbose("Cannot iterate over a " + objList == null ? "null object" : objList.getClass().getName()
+                        + ", doing nothing: " + this, module);
+            }
             return true;
         }
         entryAcsr.put(methodContext, oldEntryValue);
diff --git a/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ServiceArtifactInfo.java b/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ServiceArtifactInfo.java
index fb856bd..eb9b576 100644
--- a/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ServiceArtifactInfo.java
+++ b/framework/webtools/src/org/ofbiz/webtools/artifactinfo/ServiceArtifactInfo.java
@@ -123,7 +123,7 @@
     }
     protected void populateEntitiesFromNameSet(Set<String> allEntityNameSet) throws GeneralException {
         for (String entityName: allEntityNameSet) {
-            if (UtilValidate.isEmail(entityName) || entityName.contains("${")) {
+            if (UtilValidate.isEmpty(entityName) || entityName.contains("${")) {
                 continue;
             }
             // attempt to convert relation names to entity names