You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by sa...@apache.org on 2011/09/20 19:46:24 UTC

svn commit: r1173274 [4/13] - in /ofbiz/branches/jackrabbit20100709: ./ applications/accounting/config/ applications/accounting/entitydef/ applications/accounting/script/org/ofbiz/accounting/invoice/ applications/accounting/script/org/ofbiz/accounting/...

Modified: ofbiz/branches/jackrabbit20100709/applications/marketing/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/marketing/servicedef/services.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/marketing/servicedef/services.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/marketing/servicedef/services.xml Tue Sep 20 17:46:13 2011
@@ -263,6 +263,22 @@ under the License.
         <attribute name="statusId" type="String" mode="IN"/>        
     </service> 
     
+    <!-- WebSiteContactList services -->
+    <service name="createWebSiteContactList" engine="simple" default-entity-name="WebSiteContactList" 
+        location="component://marketing/script/org/ofbiz/marketing/contact/ContactListServices.xml" invoke="createWebSiteContactList">
+        <auto-attributes mode="IN" include="pk" optional="false"/>
+        <auto-attributes mode="IN" include="nonpk" optional="true"/>
+    </service>
+    <service name="updateWebSiteContactList" engine="simple" default-entity-name="WebSiteContactList" 
+        location="component://marketing/script/org/ofbiz/marketing/contact/ContactListServices.xml" invoke="updateWebSiteContactList">
+        <auto-attributes mode="IN" include="pk" optional="false"/>
+        <auto-attributes mode="IN" include="nonpk" optional="true"/>
+    </service>
+    <service name="deleteWebSiteContactList" engine="simple" default-entity-name="WebSiteContactList" 
+        location="component://marketing/script/org/ofbiz/marketing/contact/ContactListServices.xml" invoke="deleteWebSiteContactList">
+        <auto-attributes mode="IN" include="pk" optional="false"/>
+    </service>
+    
     <!-- TrackingCode Services -->
     <service name="createTrackingCode" default-entity-name="TrackingCode" engine="simple"
             location="component://marketing/script/org/ofbiz/marketing/tracking/TrackingCodeServices.xml" invoke="createTrackingCode" auth="true">
@@ -303,100 +319,86 @@ under the License.
     </service>
 
     <!-- SegmentGroup Services -->
-    <service name="createSegmentGroup" default-entity-name="SegmentGroup" engine="simple"
-            location="component://marketing/script/org/ofbiz/marketing/segment/SegmentServices.xml" invoke="createSegmentGroup" auth="true">
-        <description>Create a SegmentGroup record</description>
+    <service name="createSegmentGroup" default-entity-name="SegmentGroup" engine="entity-auto" invoke="create" auth="true">
+        <description>Create a SegmentGroup</description>
+        <permission-service service-name="marketingPermissionService" main-action="CREATE"/>
         <auto-attributes include="pk" mode="OUT" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
-    <service name="updateSegmentGroup" default-entity-name="SegmentGroup" engine="simple"
-            location="component://marketing/script/org/ofbiz/marketing/segment/SegmentServices.xml" invoke="updateSegmentGroup" auth="true">
-        <description>Update a SegmentGroup record</description>
+    <service name="updateSegmentGroup" default-entity-name="SegmentGroup" engine="entity-auto" invoke="update" auth="true">
+        <description>Update a SegmentGroup</description>
+        <permission-service service-name="marketingPermissionService" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
-    <service name="deleteSegmentGroup" default-entity-name="SegmentGroup" engine="simple"
-            location="component://marketing/script/org/ofbiz/marketing/segment/SegmentServices.xml" invoke="deleteSegmentGroup" auth="true">
-        <description>Update a SegmentGroup record</description>
+    <service name="deleteSegmentGroup" default-entity-name="SegmentGroup" engine="entity-auto" invoke="delete" auth="true">
+        <description>Delete a SegmentGroup</description>
+        <permission-service service-name="marketingPermissionService" main-action="DELETE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
     </service>
 
     <!-- SegmentGroupClassification -->
-    <service name="createSegmentGroupClassification" engine="simple" default-entity-name="SegmentGroupClassification"
-            location="component://marketing/script/org/ofbiz/marketing/segment/SegmentServices.xml" invoke="createSegmentGroupClassification">
-        <description>create SegmentGroupClassification</description>
+    <service name="createSegmentGroupClassification" default-entity-name="SegmentGroupClassification" engine="entity-auto" invoke="create" auth="true">
+        <description>Create a SegmentGroupClassification</description>
+        <permission-service service-name="marketingPermissionService" main-action="CREATE"/>
         <auto-attributes mode="IN" include="pk" optional="false"/>
         <auto-attributes mode="IN" include="nonpk" optional="true"/>
     </service>
-    <service name="updateSegmentGroupClassification" engine="simple" default-entity-name="SegmentGroupClassification"
-        location="component://marketing/script/org/ofbiz/marketing/segment/SegmentServices.xml" invoke="updateSegmentGroupClassification">
-        <description>update SegmentGroupClassification</description>
+    <service name="updateSegmentGroupClassification" default-entity-name="SegmentGroupClassification" engine="entity-auto" invoke="update" auth="true">
+        <description>Update a SegmentGroupClassification</description>
+        <permission-service service-name="marketingPermissionService" main-action="UPDATE"/>
         <auto-attributes mode="IN" include="pk" optional="false"/>
         <auto-attributes mode="IN" include="nonpk" optional="true"/>
     </service>
-    <service name="deleteSegmentGroupClassification" engine="simple" default-entity-name="SegmentGroupClassification"
-            location="component://marketing/script/org/ofbiz/marketing/segment/SegmentServices.xml" invoke="deleteSegmentGroupClassification">
-        <description>delete SegmentGroupClassification</description>
+    <service name="deleteSegmentGroupClassification" default-entity-name="SegmentGroupClassification" engine="entity-auto" invoke="delete" auth="true">
+        <description>Delete a SegmentGroupClassification</description>
+        <permission-service service-name="marketingPermissionService" main-action="DELETE"/>
         <auto-attributes mode="IN" include="pk" optional="false"/>
     </service>
 
    <!-- SegmentGroupGeo -->
-    <service name="createSegmentGroupGeo" engine="simple" default-entity-name="SegmentGroupGeo"
-            location="component://marketing/script/org/ofbiz/marketing/segment/SegmentServices.xml" invoke="createSegmentGroupGeo">
-        <description>create SegmentGroupGeo</description>
+    <service name="createSegmentGroupGeo" default-entity-name="SegmentGroupGeo" engine="entity-auto" invoke="create" auth="true">
+        <description>Create a SegmentGroupGeo</description>
+        <permission-service service-name="marketingPermissionService" main-action="CREATE"/>
         <auto-attributes mode="IN" include="pk" optional="false"/>
         <auto-attributes mode="IN" include="nonpk" optional="true"/>
     </service>
-    <service name="updateSegmentGroupGeo" engine="simple" default-entity-name="SegmentGroupGeo"
-        location="component://marketing/script/org/ofbiz/marketing/segment/SegmentServices.xml" invoke="updateSegmentGroupGeo">
-        <description>update SegmentGroupGeo</description>
+    <service name="updateSegmentGroupGeo" default-entity-name="SegmentGroupGeo" engine="entity-auto" invoke="update" auth="true">
+        <description>Update a SegmentGroupGeo</description>
+        <permission-service service-name="marketingPermissionService" main-action="UPDATE"/>
         <auto-attributes mode="IN" include="pk" optional="false"/>
         <auto-attributes mode="IN" include="nonpk" optional="true"/>
     </service>
-    <service name="deleteSegmentGroupGeo" engine="simple" default-entity-name="SegmentGroupGeo"
-            location="component://marketing/script/org/ofbiz/marketing/segment/SegmentServices.xml" invoke="deleteSegmentGroupGeo">
-        <description>delete SegmentGroupGeo</description>
+    <service name="deleteSegmentGroupGeo" default-entity-name="SegmentGroupGeo" engine="entity-auto" invoke="delete" auth="true">
+        <description>Delete a SegmentGroupGeo</description>
+        <permission-service service-name="marketingPermissionService" main-action="DELETE"/>
         <auto-attributes mode="IN" include="pk" optional="false"/>
     </service>
 
    <!-- SegmentGroupRole -->
-    <service name="createSegmentGroupRole" engine="simple" default-entity-name="SegmentGroupRole"
-            location="component://marketing/script/org/ofbiz/marketing/segment/SegmentServices.xml" invoke="createSegmentGroupRole">
-        <description>create SegmentGroupRole</description>
+    <service name="createSegmentGroupRole" default-entity-name="SegmentGroupRole" engine="entity-auto" invoke="create" auth="true">
+        <description>Create a SegmentGroupRole</description>
+        <permission-service service-name="marketingPermissionService" main-action="CREATE"/>
         <auto-attributes mode="IN" include="pk" optional="false"/>
         <auto-attributes mode="IN" include="nonpk" optional="true"/>
     </service>
-    <service name="updateSegmentGroupRole" engine="simple" default-entity-name="SegmentGroupRole"
-        location="component://marketing/script/org/ofbiz/marketing/segment/SegmentServices.xml" invoke="updateSegmentGroupRole">
-        <description>update SegmentGroupRole</description>
+    <service name="updateSegmentGroupRole" default-entity-name="SegmentGroupRole" engine="entity-auto" invoke="update" auth="true">
+        <description>Update a SegmentGroupRole</description>
+        <permission-service service-name="marketingPermissionService" main-action="UPDATE"/>
         <auto-attributes mode="IN" include="pk" optional="false"/>
         <auto-attributes mode="IN" include="nonpk" optional="true"/>
     </service>
-    <service name="deleteSegmentGroupRole" engine="simple" default-entity-name="SegmentGroupRole"
-            location="component://marketing/script/org/ofbiz/marketing/segment/SegmentServices.xml" invoke="deleteSegmentGroupRole">
-        <description>delete SegmentGroupRole</description>
+    <service name="deleteSegmentGroupRole" default-entity-name="SegmentGroupRole" engine="entity-auto" invoke="delete" auth="true">
+        <description>Delete a SegmentGroupRole</description>
+        <permission-service service-name="marketingPermissionService" main-action="DELETE"/>
         <auto-attributes mode="IN" include="pk" optional="false"/>
-<!--         <attribute name="partyId" mode="OUT" optional="false"></attribute> -->
     </service>
 
     <!-- SegmentGroup Related Find Service -->
-    <service name="findPartiesInSegmentGroup" engine="simple"
-        location="component://marketing/script/org/ofbiz/marketing/segment/SegmentServices.xml" invoke="findPartiesInSegmentGroup">
-        <description>Find Parties In a SegmentGroup</description>
-        <attribute name="segmentGroupId" type="String" mode="IN" optional="false"/>
-        <attribute name="roleTypeId" type="String" mode="IN" optional="true"/>
-        <attribute name="partyIdList" type="List" mode="OUT" optional="true"/>
-    </service>
-    <service name="findSegmentGroupsOfParty" engine="simple"
-        location="component://marketing/script/org/ofbiz/marketing/segment/SegmentServices.xml" invoke="findSegmentGroupsOfParty">
-        <description>Find SegmentGroups Of a Party (that a Party is In)</description>
-        <attribute name="partyId" type="String" mode="IN" optional="false"/>
-        <attribute name="roleTypeId" type="String" mode="IN" optional="true"/>
-        <attribute name="segmentGroupIdList" type="List" mode="OUT" optional="true"/>
-    </service>
     <service name="arePartiesRelatedThroughSegmentGroup" engine="simple"
         location="component://marketing/script/org/ofbiz/marketing/segment/SegmentServices.xml" invoke="arePartiesRelatedThroughSegmentGroup">
         <description>Determine: are Parties Related Through SegmentGroup?</description>
+        <permission-service service-name="marketingPermissionService" main-action="VIEW"/>
         <attribute name="partyId" type="String" mode="IN" optional="false"/>
         <attribute name="roleTypeId" type="String" mode="IN" optional="true"/>
         <attribute name="toPartyId" type="String" mode="IN" optional="false"/>

Modified: ofbiz/branches/jackrabbit20100709/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/marketing/src/org/ofbiz/sfa/vcard/VCard.java Tue Sep 20 17:46:13 2011
@@ -167,10 +167,10 @@ public class VCard {
                         }
                         if (UtilValidate.isNotEmpty(phone)) {
                             String[] numberParts = phone.split("\\D");
-                            String telNumber = "";
+                            StringBuilder telNumber = new StringBuilder("");
                             for (String number: numberParts) {
                                 if (number != "") {
-                                    telNumber =  telNumber + number;
+                                    telNumber.append(number);
                                 }
                             }
                             serviceCtx.put("areaCode", telNumber.substring(0, 3));

Modified: ofbiz/branches/jackrabbit20100709/applications/marketing/webapp/marketing/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/marketing/webapp/marketing/WEB-INF/controller.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/marketing/webapp/marketing/WEB-INF/controller.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/marketing/webapp/marketing/WEB-INF/controller.xml Tue Sep 20 17:46:13 2011
@@ -331,7 +331,30 @@ under the License.
         <security https="true" auth="false"/>        
         <event type="service" invoke="updateContactListPartyNoUserLogin"/>
         <response name="success" type="view" value="ContactListOptOut"/>
-    </request-map>   
+    </request-map>
+    <!--  WebSiteContactList request -->
+    <request-map uri="webSiteContactList">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="WebSiteContactList"/>
+    </request-map>
+    <request-map uri="createWebSiteContactList">
+        <security https="true" auth="false"/>
+        <event type="service" invoke="createWebSiteContactList"/>
+        <response name="success" type="view" value="WebSiteContactList"/>
+        <response name="error" type="view" value="WebSiteContactList"/>
+    </request-map>
+    <request-map uri="updateWebSiteContactList">
+        <security https="true" auth="false"/>
+        <event type="service" invoke="updateWebSiteContactList"/>
+        <response name="success" type="view" value="WebSiteContactList"/>
+        <response name="error" type="view" value="WebSiteContactList"/>
+    </request-map>
+    <request-map uri="deleteWebSiteContactList">
+        <security https="true" auth="false"/>
+        <event type="service" invoke="deleteWebSiteContactList"/>
+        <response name="success" type="view" value="WebSiteContactList"/>
+        <response name="error" type="view" value="WebSiteContactList"/>
+    </request-map>
 
     <request-map uri="ListContactListCommEvents"><security https="true" auth="true"/><response name="success" type="view" value="ListContactListCommEvents"/></request-map>
     <request-map uri="EditContactListCommEvent"><security https="true" auth="true"/><response name="success" type="view" value="EditContactListCommEvent"/></request-map>
@@ -443,6 +466,7 @@ under the License.
     <view-map name="EditContactListParty" type="screen" page="component://marketing/widget/ContactListScreens.xml#EditContactListParty"/>
     <view-map name="FindContactListParties" type="screen" page="component://marketing/widget/ContactListScreens.xml#FindContactListParties"/>
     <view-map name="ContactListOptOut" type="screen" page="component://marketing/widget/ContactListScreens.xml#OptOutResponse"/>
+    <view-map name="WebSiteContactList" type="screen" page="component://marketing/widget/ContactListScreens.xml#WebSiteContactList"/>
 
     <view-map name="ListContactListCommEvents" type="screen" page="component://marketing/widget/ContactListScreens.xml#ListContactListCommEvents"/>
     <view-map name="EditContactListCommEvent" type="screen" page="component://marketing/widget/ContactListScreens.xml#EditContactListCommEvent"/>

Modified: ofbiz/branches/jackrabbit20100709/applications/marketing/webapp/marketing/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/marketing/webapp/marketing/WEB-INF/web.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/marketing/webapp/marketing/WEB-INF/web.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/marketing/webapp/marketing/WEB-INF/web.xml Tue Sep 20 17:46:13 2011
@@ -25,11 +25,6 @@ under the License.
   <description>Marketing Manager Module of the Open For Business Project</description>
 
   <context-param>
-      <param-name>webSiteId</param-name>
-      <param-value>MARKETING</param-value>
-      <description>A unique ID used to look up the WebSite entity</description>
-  </context-param>
-  <context-param>
     <param-name>entityDelegatorName</param-name>
     <param-value>default</param-value>
     <description>The Name of the Entity Delegator to use, defined in entityengine.xml</description>

Modified: ofbiz/branches/jackrabbit20100709/applications/marketing/webapp/sfa/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/marketing/webapp/sfa/WEB-INF/controller.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/marketing/webapp/sfa/WEB-INF/controller.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/marketing/webapp/sfa/WEB-INF/controller.xml Tue Sep 20 17:46:13 2011
@@ -299,6 +299,8 @@ under the License.
     <view-map name="LookupLeads" type="screen" page="component://marketing/widget/sfa/LookupScreens.xml#LookupLeads"/>
     <view-map name="LookupAccounts" type="screen" page="component://marketing/widget/sfa/LookupScreens.xml#LookupAccounts"/>
     <view-map name="LookupAccountLeads" type="screen" page="component://marketing/widget/sfa/LookupScreens.xml#LookupAccountLeads"/>
+    
+    <view-map name="ListPartyCommEvents" type="screen" page="component://marketing/widget/sfa/OpportunityScreens.xml#OpportunityCommEvent"/>
 
     <!-- end of view mappings -->
 </site-conf>

Modified: ofbiz/branches/jackrabbit20100709/applications/marketing/webapp/sfa/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/marketing/webapp/sfa/WEB-INF/web.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/marketing/webapp/sfa/WEB-INF/web.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/marketing/webapp/sfa/WEB-INF/web.xml Tue Sep 20 17:46:13 2011
@@ -25,11 +25,6 @@ under the License.
     <description>SFA Manager Module of the Open For Business Project</description>
 
     <context-param>
-        <param-name>webSiteId</param-name>
-        <param-value>SFA</param-value>
-        <description>A unique ID used to look up the WebSite entity</description>
-    </context-param>
-    <context-param>
         <param-name>entityDelegatorName</param-name>
         <param-value>default</param-value>
         <description>The Name of the Entity Delegator to use, defined in entityengine.xml</description>

Modified: ofbiz/branches/jackrabbit20100709/applications/marketing/widget/ContactListForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/marketing/widget/ContactListForms.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/marketing/widget/ContactListForms.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/marketing/widget/ContactListForms.xml Tue Sep 20 17:46:13 2011
@@ -614,4 +614,49 @@ under the License.
         <field name="lastUpdatedStamp" title="${uiLabelMap.FormFieldTitle_lastModifiedDate}"><display/></field>
         <field name="statusId"><display-entity entity-name="StatusItem" description="${description}"/></field>
     </form>    
+    <form name="CreateWebSiteContactList" type="single" target="createWebSiteContactList" 
+            default-map-name="contactList" title="" header-row-style="header-row" default-table-style="basic-table">
+        <actions>
+            <set field="fromDate" value="${groovy: import org.ofbiz.base.util.UtilDateTime; return UtilDateTime.nowTimestamp();}" type="Timestamp"/>
+        </actions>
+        <field name="contactListId"><display/></field>
+        <field name="contactListName"><display/></field>
+        <field name="fromDate"><hidden value="${fromDate}"/></field>
+        <field name="webSiteId">
+            <drop-down allow-empty="true">
+                <entity-options description="${siteName} [${webSiteId}]" entity-name="WebSite" key-field-name="webSiteId"></entity-options>
+            </drop-down>
+        </field>
+        <field name="submitButton" title="${uiLabelMap.CommonCreate}"><submit/></field>
+    </form>
+    <form name="ViewWebSiteContactList" type="list" target="updateWebSiteContactList" list-name="webSiteContactLists" title="" 
+            header-row-style="header-row" default-table-style="basic-table">
+        <actions>
+            <entity-one entity-name="WebSite" value-field="webSite"/>
+        </actions>
+        <row-actions>
+            <entity-one entity-name="WebSite" value-field="webSite">
+                <field-map field-name="webSiteId" from-field="webSiteId"/>
+            </entity-one>
+            <set field="siteName" from-field="webSite.siteName"/>
+        </row-actions>
+        <field name="contactListId"><hidden/></field>
+        <field name="webSiteId"><hidden/></field>
+        <field name="siteName">
+            <display-entity entity-name="WebSite" key-field-name="webSiteId">
+                <sub-hyperlink target="/content/control/EditWebSite" target-type="inter-app" description="[${webSiteId}]" link-style="linktext">
+                    <parameter param-name="webSiteId"/>
+                </sub-hyperlink>
+            </display-entity></field>
+        <field name="fromDate"><display type="date-time"/></field>
+        <field name="thruDate"><date-time/></field>
+        <field name="updateButton" title="${uiLabelMap.CommonUpdate}" widget-style="buttontext"><submit/></field>
+        <field name="deleteButton" title="${uiLabelMap.CommonDelete}" widget-style="buttontext">
+            <hyperlink target="deleteWebSiteContactList" description="${uiLabelMap.CommonDelete}">
+                <parameter param-name="webSiteId"/>
+                <parameter param-name="contactListId"/>
+                <parameter param-name="fromDate"/>
+            </hyperlink>
+        </field>
+    </form>
 </forms>

Modified: ofbiz/branches/jackrabbit20100709/applications/marketing/widget/ContactListMenus.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/marketing/widget/ContactListMenus.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/marketing/widget/ContactListMenus.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/marketing/widget/ContactListMenus.xml Tue Sep 20 17:46:13 2011
@@ -42,6 +42,11 @@ under the License.
                 <parameter param-name="contactListId"/>
             </link>
         </menu-item>
+        <menu-item name="WebSiteContactList" title="${uiLabelMap.MarketingWebSiteContactList}">
+            <link target="webSiteContactList">
+                <parameter param-name="contactListId"/>
+            </link>
+        </menu-item>
     </menu>
 
     <menu name="ContactListCommBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml">

Modified: ofbiz/branches/jackrabbit20100709/applications/marketing/widget/ContactListScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/marketing/widget/ContactListScreens.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/marketing/widget/ContactListScreens.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/marketing/widget/ContactListScreens.xml Tue Sep 20 17:46:13 2011
@@ -474,4 +474,29 @@ under the License.
             </widgets>
         </section>
     </screen>
+    <screen name="WebSiteContactList">
+        <section>
+            <actions>
+                <set field="titleProperty" value="MarketingWebSiteContactList"/>
+                <set field="contactListTabButtonItem" value="WebSiteContactList"/>
+                <entity-one value-field="contactList" entity-name="ContactList"/>
+                <entity-and list="webSiteContactLists" entity-name="WebSiteContactList">
+                    <field-map field-name="contactListId" from-field="contactList.contactListId"/>
+                    <order-by field-name="-fromDate"/>
+                </entity-and>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonContactListDecorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <screenlet title="${uiLabelMap.MarketingWebSiteContactListCreate}">
+                            <include-form location="component://marketing/widget/ContactListForms.xml" name="CreateWebSiteContactList"/>
+                        </screenlet>
+                        <screenlet title="${uiLabelMap.MarketingWebSiteContactListView} of contactListId[${parameters.contactListId}]">
+                            <include-form location="component://marketing/widget/ContactListForms.xml" name="ViewWebSiteContactList"/>
+                        </screenlet>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 </screens>

Modified: ofbiz/branches/jackrabbit20100709/applications/marketing/widget/sfa/OpportunityScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/marketing/widget/sfa/OpportunityScreens.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/marketing/widget/sfa/OpportunityScreens.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/marketing/widget/sfa/OpportunityScreens.xml Tue Sep 20 17:46:13 2011
@@ -117,4 +117,45 @@ under the License.
             </widgets>
         </section>
     </screen>
+    
+    <screen name="OpportunityCommEvent">
+        <section>
+            <actions>
+                <set field="titleProperty" value="PageTitleListCommunications"/>
+                <set field="tabButtonItem" value="PartyCommEvents"/>
+                <set field="subTabButtonItem" value="CommunicationEvent"/>
+                <set field="salesOpportunityId" from-field="parameters.salesOpportunityId"/>
+                <service service-name="findPartyInSalesOpportunityRole" result-map="leadPartyResult">
+                    <field-map field-name="salesOpportunityId" from-field="parameters.salesOpportunityId"/>
+                    <field-map field-name="roleTypeId" value="LEAD"/>
+                </service>
+                <set field="partyId" from-field="leadPartyResult.partyId" default-value="${parameters.partyId}"/>
+                <entity-and entity-name="Party" list="partyperson">
+                    <field-map field-name="partyId" from-field="partyId"/>
+                    <field-map field-name="partyTypeId" value="PERSON"/>
+                </entity-and>
+                <entity-condition entity-name="CommunicationEventAndRole" list="commEvents">
+                    <condition-expr field-name="partyId" operator="equals" value="${partyId}"/>
+                    <order-by field-name="-entryDate"/>
+                </entity-condition>
+                <entity-and list="contacts" entity-name="PartyRelationship" filter-by-date="true">
+                    <field-map field-name="partyIdFrom" from-field="partyId"/>
+                    <field-map field-name="roleTypeIdFrom" value="ACCOUNT"/>
+                    <field-map field-name="roleTypeIdTo" value="CONTACT"/>
+                    <order-by field-name="partyIdTo"/>
+                </entity-and>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonOpportunityDecorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <include-menu location="component://party/widget/partymgr/PartyMenus.xml" name="CommEventTabBar"/>
+                        <include-menu location="component://party/widget/partymgr/PartyMenus.xml" name="CommSubTabBar"/>
+                        <screenlet title="${uiLabelMap.PageTitleListCommunications} ${partyId}">
+                            <include-form location="component://party/widget/partymgr/CommunicationEventForms.xml" name="ListCommEvents"/>
+                        </screenlet>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 </screens>

Modified: ofbiz/branches/jackrabbit20100709/applications/marketing/widget/sfa/SfaMenus.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/marketing/widget/sfa/SfaMenus.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/marketing/widget/sfa/SfaMenus.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/marketing/widget/sfa/SfaMenus.xml Tue Sep 20 17:46:13 2011
@@ -46,6 +46,16 @@ under the License.
             </link>
         </menu-item>
         <menu-item name="PartyCommEvents" title="${uiLabelMap.PartyCommunications}">
+            <condition>
+                <and>
+                    <not><if-empty field="parameters.salesOpportunityId"/></not>
+                    <or>
+                        <not><if-empty field="leadPartyId"/></not>
+                        <not><if-empty field="leadParty.leadPartyId"/></not>
+                        <not><if-empty field="partyId"/></not>
+                    </or>
+                </and>
+            </condition>
             <link target="ListPartyCommEvents">
                 <parameter param-name="salesOpportunityId" from-field="parameters.salesOpportunityId"/>
             </link>

Modified: ofbiz/branches/jackrabbit20100709/applications/order/config/OrderUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/config/OrderUiLabels.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/config/OrderUiLabels.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/config/OrderUiLabels.xml Tue Sep 20 17:46:13 2011
@@ -2821,6 +2821,9 @@
         <value xml:lang="zh_CN">新建报价项</value>
         <value xml:lang="zh_TW">新建報價明細</value>
     </property>
+    <property key="OrderCreateOrderQuoteNote">
+        <value xml:lang="en">Create New Quote Note</value>
+    </property>
     <property key="OrderCreateOrderQuoteRole">
         <value xml:lang="de">Neue Offertrolle erstellen</value>
         <value xml:lang="de_DE">Neue Angebotsrolle erstellen</value>
@@ -6951,6 +6954,12 @@
         <value xml:lang="zh_CN">报价名</value>
         <value xml:lang="zh_TW">報價名稱</value>
     </property>
+    <property key="OrderOrderQuoteNoteList">
+        <value xml:lang="en">Quote Note List</value>
+    </property>
+    <property key="OrderOrderQuoteNotes">
+        <value xml:lang="en">Quote Notes</value>
+    </property>
     <property key="OrderOrderQuotePercProfit">
         <value xml:lang="de">Prozentualer provisorischer Gewinn</value>
         <value xml:lang="en">Quote Percentage Profit</value>
@@ -12873,4 +12882,10 @@
         <value xml:lang="zh">浏览请求</value>
         <value xml:lang="zh_TW">瀏覽要求</value>
     </property>
+    <property key="QuoteEditNote">
+        <value xml:lang="en">Update Note</value>
+    </property>
+    <property key="OrderRent">
+        <value xml:lang="en">Rent</value>
+    </property>
 </resource>

Modified: ofbiz/branches/jackrabbit20100709/applications/order/data/OrderHelpData.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/data/OrderHelpData.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/data/OrderHelpData.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/data/OrderHelpData.xml Tue Sep 20 17:46:13 2011
@@ -29,11 +29,11 @@ under the License.
     <DataResource dataResourceId="HELP_ORDER_VIEW" localeString="en" dataResourceTypeId="OFBIZ_FILE" 
         objectInfo="applications/order/data/helpdata/HELP_ORDER_View.xml" dataTemplateTypeId="NONE" statusId="CTNT_IN_PROGRESS" dataResourceName="Ebay" mimeTypeId="text/xml" isPublic="Y" />
     <Content contentId="HELP_ORDER_VIEW" contentTypeId="DOCUMENT" contentName="Order View Help" templateDataResourceId="HELP_TEMPL" dataResourceId="HELP_ORDER_VIEW" statusId="CTNT_IN_PROGRESS" mimeTypeId="text/html"/>
-    <ContentAssoc contentId="HELP_ORDER" contentIdTo="HELP_ORDER_VIEW" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000" mapKey="OrderEntry_orderview"/>
+    <ContentAssoc contentId="HELP_ORDER" contentIdTo="HELP_ORDER_VIEW" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000" mapKey="ORDER_overview"/>
 
     <!--  Reports -->
     <DataResource dataResourceId="HELP_ORDER_REPORT" localeString="en" dataResourceTypeId="OFBIZ_FILE" 
         objectInfo="applications/order/data/helpdata/HELP_ORDER_Report.xml" dataTemplateTypeId="NONE" statusId="CTNT_IN_PROGRESS" dataResourceName="Ebay" mimeTypeId="text/xml" isPublic="Y" />
     <Content contentId="HELP_ORDER_REPORT" contentTypeId="DOCUMENT" contentName="Order Reports Help" templateDataResourceId="HELP_TEMPL" dataResourceId="HELP_ORDER_REPORT" statusId="CTNT_IN_PROGRESS" mimeTypeId="text/html"/>
-    <ContentAssoc contentId="HELP_ORDER" contentIdTo="HELP_ORDER_REPORT" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000" mapKey="OrderEntry_OrderPurchaseReportOptions"/>
+    <ContentAssoc contentId="HELP_ORDER" contentIdTo="HELP_ORDER_REPORT" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000" mapKey="ORDER_OrderPurchaseReportOptions"/>
 </entity-engine-xml>

Modified: ofbiz/branches/jackrabbit20100709/applications/order/data/OrderTypeData.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/data/OrderTypeData.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/data/OrderTypeData.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/data/OrderTypeData.xml Tue Sep 20 17:46:13 2011
@@ -322,6 +322,9 @@ under the License.
     <ReturnItemTypeMap returnHeaderTypeId="CUSTOMER_RETURN" returnItemMapKey="SURCHARGE_ADJUSTMENT" returnItemTypeId="RET_SURCHARGE_ADJ"/>
     <ReturnItemTypeMap returnHeaderTypeId="CUSTOMER_RETURN" returnItemMapKey="ADDITIONAL_FEATURE" returnItemTypeId="RET_ADD_FEATURE_ADJ"/>
     <ReturnItemTypeMap returnHeaderTypeId="CUSTOMER_RETURN" returnItemMapKey="WARRANTY_ADJUSTMENT" returnItemTypeId="RET_WARRANTY_ADJ"/>
+    <ReturnItemTypeMap returnHeaderTypeId="CUSTOMER_RETURN" returnItemMapKey="RENTAL_ORDER_ITEM" returnItemTypeId="RET_FPROD_ITEM" />
+    <ReturnItemTypeMap returnHeaderTypeId="CUSTOMER_RETURN" returnItemMapKey="ASSET_USAGE_OUT_IN" returnItemTypeId="RET_FPROD_ITEM" />
+    <ReturnItemTypeMap returnHeaderTypeId="CUSTOMER_RETURN" returnItemMapKey="SERVICE_PRODUCT" returnItemTypeId="RET_SPROD_ITEM"/>
     <ReturnItemTypeMap returnHeaderTypeId="VENDOR_RETURN" returnItemMapKey="FINISHED_GOOD" returnItemTypeId="RET_FPROD_ITEM"/>
     <ReturnItemTypeMap returnHeaderTypeId="VENDOR_RETURN" returnItemMapKey="MARKETING_PKG_AUTO" returnItemTypeId="RET_FPROD_ITEM"/>
     <ReturnItemTypeMap returnHeaderTypeId="VENDOR_RETURN" returnItemMapKey="MARKETING_PKG_PICK" returnItemTypeId="RET_FPROD_ITEM"/>
@@ -348,6 +351,7 @@ under the License.
     <ReturnReason sequenceId="04" returnReasonId="RTN_DIG_FILL_FAIL" description="Digital Fulfillment Failed"/>
     <ReturnReason sequenceId="05" returnReasonId="RTN_COD_REJECT" description="COD Payment Rejected"/>
     <ReturnReason sequenceId="06" returnReasonId="RTN_SIZE_EXCHANGE" description="Size Exchange"/>
+    <ReturnReason sequenceId="07" returnReasonId="RTN_NORMAL_RETURN" description="Normal Return"/>
     <!-- Return Types -->
     <ReturnType sequenceId="01" returnTypeId="RTN_CREDIT" description="Store Credit"/>
     <ReturnType sequenceId="02" returnTypeId="RTN_REFUND" description="Refund"/>
@@ -357,6 +361,7 @@ under the License.
     <ReturnType sequenceId="06" returnTypeId="RTN_WAIT_REPLACE_RES" description="Wait Replacement Reserved"/>
     <ReturnType sequenceId="07" returnTypeId="RTN_REPLACE_IMMEDIAT" description="Replace Immediately"/>
     <ReturnType sequenceId="08" returnTypeId="RTN_REFUND_IMMEDIATE" description="Refund immediately"/>
+    <ReturnType sequenceId="09" returnTypeId="RTN_RENTAL" description="Rental"/>
 
     <WorkReqFulfType description="Implements" workReqFulfTypeId="WRF_IMPLEMENTS"/>
     <WorkReqFulfType description="Fixes" workReqFulfTypeId="WRF_FIXES"/>

Modified: ofbiz/branches/jackrabbit20100709/applications/order/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/entitydef/entitymodel.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/entitydef/entitymodel.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/entitydef/entitymodel.xml Tue Sep 20 17:46:13 2011
@@ -391,6 +391,7 @@ under the License.
       <field name="remainingSubTotal" type="currency-amount"></field>
       <field name="grandTotal" type="currency-amount"></field>
       <field name="isViewed" type="indicator"></field>
+      <field name="invoicePerShipment" type="indicator"></field>
       <prim-key field="orderId"/>
       <relation type="one" fk-name="ORDER_HDR_TYPE" rel-entity-name="OrderType">
         <key-map field-name="orderTypeId"/>
@@ -1383,6 +1384,9 @@ under the License.
       <relation type="one" fk-name="QUOTE_CHANNEL" title="SalesChannel" rel-entity-name="Enumeration">
         <key-map field-name="salesChannelEnumId" rel-field-name="enumId"/>
       </relation>
+      <relation type="many" rel-entity-name="QuoteNoteView">
+        <key-map field-name="quoteId"/>
+      </relation>
     </entity>
     <entity entity-name="QuoteAttribute"
             package-name="org.ofbiz.order.quote"
@@ -1465,6 +1469,21 @@ under the License.
         <key-map field-name="custRequestItemSeqId"/>
       </relation>
     </entity>
+    <entity entity-name="QuoteNote"
+            package-name="org.ofbiz.order.quote"
+            never-cache="true"
+            title="Quote Note Entity">
+      <field name="quoteId" type="id-ne"></field>
+      <field name="noteId" type="id-ne"></field>
+      <prim-key field="quoteId"/>
+      <prim-key field="noteId"/>
+      <relation type="one" fk-name="QUOTE_NT_QTE" rel-entity-name="Quote">
+        <key-map field-name="quoteId"/>
+      </relation>
+      <relation type="one" fk-name="QUOTE_NT_NOTE" rel-entity-name="NoteData">
+        <key-map field-name="noteId"/>
+      </relation>
+    </entity>
     <entity entity-name="QuoteRole"
             package-name="org.ofbiz.order.quote"
             title="Quote Role Entity">

Modified: ofbiz/branches/jackrabbit20100709/applications/order/entitydef/entitymodel_view.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/entitydef/entitymodel_view.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/entitydef/entitymodel_view.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/entitydef/entitymodel_view.xml Tue Sep 20 17:46:13 2011
@@ -1428,6 +1428,22 @@ under the License.
         <key-map field-name="noteParty" rel-field-name="partyId"/>
       </view-link>
     </view-entity>
+    <view-entity entity-name="QuoteNoteView"
+            package-name="org.ofbiz.order.quote"
+            never-cache="true"
+            title="Quote Note View Entity">
+      <member-entity entity-alias="QD" entity-name="QuoteNote"/>
+      <member-entity entity-alias="ND" entity-name="NoteData"/>
+      <alias entity-alias="QD" name="quoteId"/>
+      <alias entity-alias="ND" name="noteId"/>
+      <alias entity-alias="ND" name="noteName"/>
+      <alias entity-alias="ND" name="noteInfo"/>
+      <alias entity-alias="ND" name="noteDateTime"/>
+      <alias entity-alias="ND" name="noteParty"/>
+      <view-link entity-alias="QD" rel-entity-alias="ND">
+        <key-map field-name="noteId"/>
+      </view-link>
+    </view-entity>
     <view-entity entity-name="QuoteWorkEffortView"
       package-name="org.ofbiz.order.quote"
       title="Quote And Workeffort">
@@ -1668,7 +1684,7 @@ under the License.
       <key-map field-name="orderId"/>
     </view-link>
   </view-entity>
-  
+
     <view-entity entity-name="OrderItemBillingAndInvoiceAndItem"
           package-name="org.ofbiz.order.order" 
           title="OrderItemBilling and Invoice and InvoiceItem View Entity">
@@ -1691,7 +1707,22 @@ under the License.
         <key-map field-name="invoiceId"/>
         <key-map field-name="invoiceItemSeqId"/>
     </relation>
-    
   </view-entity>
-  
+
+  <view-entity entity-name="OrderItemAndProduct"
+            package-name="org.ofbiz.order.order"
+            never-cache="true"
+            title="OrderItem And Product View Entity">
+      <member-entity entity-alias="OI" entity-name="OrderItem"/>
+      <member-entity entity-alias="PR" entity-name="Product"/>
+      <alias-all entity-alias="OI"/>
+      <alias-all entity-alias="PR"/>
+      <view-link entity-alias="OI" rel-entity-alias="PR">
+        <key-map field-name="productId"/>
+      </view-link>
+      <relation type="one-nofk" rel-entity-name="Product">
+        <key-map field-name="productId"/>
+      </relation>
+  </view-entity>
+
 </entitymodel>

Propchange: ofbiz/branches/jackrabbit20100709/applications/order/script/org/ofbiz/order/customer/CheckoutMapProcs.xml
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Sep 20 17:46:13 2011
@@ -2,4 +2,4 @@
 /ofbiz/branches/dojo1.4/applications/order/script/org/ofbiz/order/customer/CheckoutMapProcs.xml:951708-952957
 /ofbiz/branches/jquery/applications/order/script/org/ofbiz/order/customer/CheckoutMapProcs.xml:952958-1044489
 /ofbiz/branches/multitenant20100310/applications/order/script/org/ofbiz/order/customer/CheckoutMapProcs.xml:921280-927264
-/ofbiz/trunk/applications/order/script/org/ofbiz/order/customer/CheckoutMapProcs.xml:962442-1156267
+/ofbiz/trunk/applications/order/script/org/ofbiz/order/customer/CheckoutMapProcs.xml:962442-1173263

Modified: ofbiz/branches/jackrabbit20100709/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml Tue Sep 20 17:46:13 2011
@@ -1143,4 +1143,64 @@ under the License.
         </if-empty>
         <store-value value-field="returnContactMechMap"/>
      </simple-method>
+
+    <simple-method method-name="createReturnItemForRental" short-description="Create the return item for rental (which items has product type is ASSET_USAGE_OUT_IN)">
+        <entity-one entity-name="OrderHeader" value-field="orderHeader">
+            <field-map field-name="orderId" from-field="parameters.orderId"/>
+        </entity-one>
+
+        <if-compare operator="equals" value="SALES_ORDER" field="orderHeader.orderTypeId">
+            <entity-condition entity-name="OrderRole" list="orderRoles">
+                <condition-list combine="and">
+                    <condition-expr field-name="orderId" operator="equals" from-field="orderHeader.orderId"/>
+                    <condition-expr field-name="roleTypeId" operator="equals" value="BILL_TO_CUSTOMER"/>
+                </condition-list>
+            </entity-condition>
+            <first-from-list entry="orderRole" list="orderRoles"/>
+
+            <get-related-one relation-name="ProductStore" value-field="orderHeader" to-value-field="productStore"/>
+
+            <if-not-empty field="productStore.inventoryFacilityId">
+                <set field="createReturnCtx.destinationFacilityId" from-field="productStore.inventoryFacilityId"/>
+            </if-not-empty>
+
+            <if-not-empty field="productStore.reqReturnInventoryReceive">
+                <set field="updateHeaderCtx.needsInventoryReceive" from-field="productStore.reqReturnInventoryReceive"/>
+            <else>
+                <set field="updateHeaderCtx.needsInventoryReceive" value="N"/>
+            </else>
+            </if-not-empty>
+
+            <set field="createReturnCtx.orderId" from-field="orderHeader.orderId"/>
+            <set field="createReturnCtx.currencyUomId" from-field="orderHeader.currencyUom"/>
+            <set field="createReturnCtx.fromPartyId" from-field="orderRole.partyId"/>
+            <set field="createReturnCtx.toPartyId" from-field="productStore.payToPartyId"/>
+            <set field="createReturnCtx.returnHeaderTypeId" value="CUSTOMER_RETURN"/>
+            <set field="createReturnCtx.returnReasonId" value="RTN_NORMAL_RETURN"/>
+            <set field="createReturnCtx.returnTypeId" value="RTN_RENTAL"/>
+            <set field="createReturnCtx.returnItemTypeId" value="RET_FDPROD_ITEM"/>
+            <set field="createReturnCtx.expectedItemStatus" value="INV_RETURNED"/>
+            <set field="createReturnCtx.returnPrice" value="0.00" type="BigDecimal"/>
+
+            <entity-condition entity-name="OrderItemAndProduct" list="orderItems">
+                <condition-list combine="and">
+                    <condition-expr field-name="orderId" operator="equals" from-field="orderHeader.orderId"/>
+                    <condition-expr field-name="statusId" operator="equals" value="ITEM_COMPLETED"/>
+                    <condition-expr field-name="productTypeId" operator="equals" value="ASSET_USAGE_OUT_IN"/>
+                </condition-list>
+            </entity-condition>
+            <iterate entry="orderItem" list="orderItems">
+                <set field="createReturnCtx.productId" from-field="orderItem.productId"/>
+                <set field="createReturnCtx.orderItemSeqId" from-field="orderItem.orderItemSeqId"/>
+                <set field="createReturnCtx.description" from-field="orderItem.itemDescription"/>
+                <set field="createReturnCtx.returnQuantity" from-field="orderItem.quantity"/>
+                <call-service service-name="createReturnAndItemOrAdjustment" in-map-name="createReturnCtx" include-user-login="true">
+                    <result-to-field result-name="returnId" field="returnId"/>
+                </call-service>
+                <if-not-empty field="returnId">
+                    <set field="createReturnCtx.returnId" from-field="returnId"/>
+                </if-not-empty>
+            </iterate>
+        </if-compare>
+    </simple-method>
 </simple-methods>

Modified: ofbiz/branches/jackrabbit20100709/applications/order/script/org/ofbiz/order/order/OrderServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/script/org/ofbiz/order/order/OrderServices.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/script/org/ofbiz/order/order/OrderServices.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/script/org/ofbiz/order/order/OrderServices.xml Tue Sep 20 17:46:13 2011
@@ -783,13 +783,15 @@ under the License.
         <set-pk-fields map="parameters" value-field="lookupPKMap"/>
         <find-by-primary-key entity-name="OrderItemShipGroup" map="lookupPKMap" value-field="lookedUpValue"/>
         <!-- splitting shipmentMethod request parameter value that contains "@" symbol
-             into "shipmentMethodTypeId" and "carrierPartyId".
+             into "shipmentMethodTypeId", "carrierPartyId" and "carrierRoleTypeId".
         -->
         <call-bsh><![CDATA[
             shipmentMethod = parameters.get("shipmentMethod");
             if(shipmentMethod != null){
-               parameters.put("shipmentMethodTypeId", shipmentMethod.substring(0, shipmentMethod.indexOf("@")));
-               parameters.put("carrierPartyId", shipmentMethod.substring(shipmentMethod.indexOf("@")+1));
+               arr = shipmentMethod.split( "@" );
+               parameters.put("shipmentMethodTypeId", arr[0]);
+               parameters.put("carrierPartyId", arr[1]);
+               parameters.put("carrierRoleTypeId", arr[2]);
             }
         ]]></call-bsh>
         <set-nonpk-fields map="parameters" value-field="lookedUpValue"/>

Modified: ofbiz/branches/jackrabbit20100709/applications/order/script/org/ofbiz/order/quote/QuoteServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/script/org/ofbiz/order/quote/QuoteServices.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/script/org/ofbiz/order/quote/QuoteServices.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/script/org/ofbiz/order/quote/QuoteServices.xml Tue Sep 20 17:46:13 2011
@@ -972,4 +972,22 @@ under the License.
         <set-pk-fields map="parameters" value-field="newEntity"/>
         <remove-value value-field="newEntity"/>
     </simple-method>
+    <simple-method method-name="createQuoteNote" short-description="Create a new Note associated with a Quote">
+        <set-service-fields service-name="createNote" map="parameters" to-map="createNoteMap"/>
+        <!-- passed in field will be noteInfo, which matches entity, but service expects field called note -->
+        <set field="createNoteMap.note" from-field="parameters.noteInfo"/>
+        <call-service service-name="createNote" in-map-name="createNoteMap">
+           <result-to-field result-name="noteId"/>
+       </call-service>
+       <if-empty field="noteId">
+           <add-error>
+               <fail-property resource="OrderErrorUiLabels" property="OrderProblemCreatingTheNoteNoNoteIdReturned"/>
+           </add-error>
+       </if-empty>
+       <check-errors/>
+       <make-value value-field="newQuoteNote" entity-name="QuoteNote"/>
+       <set field="newQuoteNote.quoteId" from-field="parameters.quoteId"/>
+       <set field="newQuoteNote.noteId" from-field="noteId"/>
+       <create-value value-field="newQuoteNote"/>
+   </simple-method>
 </simple-methods>

Modified: ofbiz/branches/jackrabbit20100709/applications/order/script/org/ofbiz/order/test/ShoppingCartTests.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/script/org/ofbiz/order/test/ShoppingCartTests.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/script/org/ofbiz/order/test/ShoppingCartTests.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/script/org/ofbiz/order/test/ShoppingCartTests.xml Tue Sep 20 17:46:13 2011
@@ -104,12 +104,12 @@ under the License.
             <field field="skipInventoryChecks" type="Boolean"/>
             <field field="skipProductChecks" type="Boolean"/>
         </call-object-method>
-        
+
         <set field="itemIdex" from-field="itemIdex" type="Integer"/>
         <call-object-method method-name="findCartItem" obj-field="shoppingCart" ret-field="cartItem">
             <field field="itemIdex" type="int"/>
         </call-object-method>
-        
+
         <set field="groupIdx" value="0" type="Integer"/>
         <call-object-method method-name="setItemShipGroupQty" obj-field="shoppingCart">
             <field field="cartItem" type="org.ofbiz.order.shoppingcart.ShoppingCartItem"/>
@@ -135,7 +135,7 @@ under the License.
         <set field="orderAdjustmentShipping.orderAdjustmentTypeId" value="SHIPPING_CHARGES"/>
         <set field="orderAdjustmentShipping.shipGroupSeqId" value="00001"/>
         <set field="orderAdjustmentShipping.amount" value="12.10" type="BigDecimal"/>
-        
+
         <call-object-method method-name="addAdjustment" obj-field="shoppingCart">
             <field field="orderAdjustmentShipping" type="org.ofbiz.entity.GenericValue"/>
         </call-object-method>
@@ -260,4 +260,320 @@ under the License.
         <assert><not><if-empty field="orderMap.orderId"/></not></assert>
         <check-errors/>
     </simple-method>
+
+    <simple-method method-name="testCreateOrderRentalProduct" short-description="Test create order rental of product" login-required="false">
+        <entity-one entity-name="UserLogin" value-field="userLogin">
+            <field-map field-name="userLoginId" value="DemoCustomer"/>
+        </entity-one>
+
+        <!-- Shopping Cart new Instance -->
+        <set field="delegator" from-field="parameters.delegator" type="Object"/>
+        <set field="dispatcher" from-field="parameters.dispatcher" type="Object"/>
+        <set field="locale" from-field="parameters.locale" type="Object" />
+        <set field="productStoreId" value="9000" type="String"/>
+        <set field="currencyUom" value="USD" type="String"/>
+        <set field="salesChannel" value="WEB_SALES_CHANNEL" type="String"/>
+
+        <set field="partyId" value="DemoCustomer" type="String"/>
+
+        <create-object class-name="org.ofbiz.order.shoppingcart.ShoppingCart" field="shoppingCart">
+            <field field="delegator" type="org.ofbiz.entity.Delegator"/>
+            <field field="productStoreId" type="String"/>
+            <field field="locale" type="java.util.Locale"/>
+            <field field="currencyUom" type="String"/>
+        </create-object>
+
+        <set field="orderType" value="SALES_ORDER" type="String"/>
+        <call-object-method method-name="setOrderType" obj-field="shoppingCart">
+            <field field="orderType" type="String"/>
+        </call-object-method>
+
+        <call-object-method method-name="setChannelType" obj-field="shoppingCart">
+            <field field="salesChannel" type="String"/>
+        </call-object-method>
+
+        <call-object-method method-name="setProductStoreId" obj-field="shoppingCart">
+            <field field="productStoreId" type="String"/>
+        </call-object-method>
+
+        <!-- Shopping Cart Set Billing and Ship to customers -->
+        <call-object-method method-name="setBillToCustomerPartyId" obj-field="shoppingCart">
+            <field field="partyId" type="String"/>
+        </call-object-method>
+
+        <call-object-method method-name="setPlacingCustomerPartyId" obj-field="shoppingCart">
+            <field field="partyId" type="String"/>
+        </call-object-method>
+
+        <call-object-method method-name="setShipToCustomerPartyId" obj-field="shoppingCart">
+            <field field="partyId" type="String"/>
+        </call-object-method>
+
+        <call-object-method method-name="setEndUserCustomerPartyId" obj-field="shoppingCart">
+            <field field="partyId" type="String"/>
+        </call-object-method>
+
+        <call-object-method method-name="setUserLogin" obj-field="shoppingCart">
+            <field field="userLogin" type="org.ofbiz.entity.GenericValue"/>
+            <field field="dispatcher" type="org.ofbiz.service.LocalDispatcher"/>
+        </call-object-method>
+
+        <!-- Add Product Item to Shopping Cart -->
+        <set field="nextDate" value="${groovy:org.ofbiz.base.util.UtilDateTime.addDaysToTimestamp(org.ofbiz.base.util.UtilDateTime.nowTimestamp(), +1)}" type="Timestamp"/>
+        <set field="prodCatalogId" value="DemoCatalog" type="String"/>
+        <set field="productId" value="RentalShip" type="String"/>
+        <set field="reservStart" from-field="nextDate" type="Timestamp"/>
+        <set field="reservLength" value="3" type="BigDecimal"/>
+        <set field="reservPersons" value="1" type="BigDecimal"/>
+        <set field="quantity" value="1" type="BigDecimal"/>
+        <set field="unitPrice" value="15.99" type="BigDecimal"/>
+        <set field="itemType" value="RENTAL_ORDER_ITEM" type="String"/>
+        
+        <call-object-method method-name="addOrIncreaseItem" obj-field="shoppingCart">
+            <field field="productId" type="String"/>
+            <field field="selectedAmount" type="BigDecimal"/>
+            <field field="quantity" type="BigDecimal"/>
+            <field field="reservStart" type="Timestamp"/>
+            <field field="reservLength" type="BigDecimal"/>
+            <field field="reservPersons" type="BigDecimal"/>
+            <field field="accommodationMapId" type="String"/>
+            <field field="accommodationSpotId" type="String"/>
+            <field field="shipBeforeDate" type="Timestamp"/>
+            <field field="shipAfterDate" type="Timestamp"/>
+            <field field="features" type="Map"/>
+            <field field="attributes" type="Map"/>
+            <field field="prodCatalogId" type="String"/>
+            <field field="configWrapper" type="org.ofbiz.product.config.ProductConfigWrapper"/>
+            <field field="itemType" type="String"/>
+            <field field="itemGroupNumber" type="String"/>
+            <field field="parentProductId" type="String"/>
+            <field field="dispatcher" type="org.ofbiz.service.LocalDispatcher"/>
+        </call-object-method>
+
+        <call-object-method method-name="setDefaultCheckoutOptions" obj-field="shoppingCart">
+            <field field="dispatcher" type="org.ofbiz.service.LocalDispatcher"/>
+        </call-object-method>
+
+        <!-- Create order -->
+        <create-object class-name="org.ofbiz.order.shoppingcart.CheckOutHelper" field="checkOutHelper">
+            <field field="dispatcher" type="org.ofbiz.service.LocalDispatcher"/>
+            <field field="delegator" type="org.ofbiz.entity.Delegator"/>
+            <field field="shoppingCart" type="org.ofbiz.order.shoppingcart.ShoppingCart"/>
+        </create-object>
+
+        <call-object-method method-name="createOrder" obj-field="checkOutHelper" ret-field="orderCreateResult">
+            <field field="userLogin" type="org.ofbiz.entity.GenericValue"/>
+        </call-object-method>
+        
+        <set field="orderId" from-field="orderCreateResult.orderId" type="String"/>
+        <if-not-empty field="orderId">
+            <log level="info" message="------------ ORDERID : [${orderId}] ------------"/>
+            
+            <!-- Change order status to approved -->
+            <call-class-method method-name="approveOrder" class-name="org.ofbiz.order.order.OrderChangeHelper" ret-field="approved">
+                <field field="dispatcher" type="org.ofbiz.service.LocalDispatcher"/>
+                <field field="userLogin" type="org.ofbiz.entity.GenericValue"/>
+                <field field="orderId" type="String"/>
+            </call-class-method>
+            <log level="info" message="----Test order with id: [${orderId}] has been approved: [${approved}]----"/>
+            
+            <entity-one entity-name="UserLogin" value-field="userLoginSystem">
+                <field-map field-name="userLoginId" value="system"/>
+            </entity-one>
+            
+            <!-- Quick Ship Entire Order -->
+            <set field="quickShipEntireOrderMap.orderId" from-field="orderId"/>
+            <set field="quickShipEntireOrderMap.userLogin" from-field="userLoginSystem"/>
+            <call-service service-name="quickShipEntireOrder" in-map-name="quickShipEntireOrderMap"/>
+            <log level="info" message="----Test sales order with id: [${orderId}] has been shipped----"/>
+        </if-not-empty>
+        
+        <assert><not><if-empty field="orderId"/></not></assert>
+        <check-errors/>
+    </simple-method>
+
+    <simple-method method-name="testCreateOrderServiceProduct" short-description="Test create an order using a service product" login-required="false">
+        <entity-one entity-name="UserLogin" value-field="userLogin">
+            <field-map field-name="userLoginId" value="DemoCustomer"/>
+        </entity-one>
+
+        <!-- Shopping Cart new Instance -->
+        <set field="delegator" from-field="parameters.delegator" type="Object"/>
+        <set field="dispatcher" from-field="parameters.dispatcher" type="Object"/>
+        <set field="locale" from-field="parameters.locale" type="Object" />
+        <set field="productStoreId" value="9000" type="String"/>
+        <set field="currencyUom" value="USD" type="String"/>
+        <set field="salesChannel" value="WEB_SALES_CHANNEL" type="String"/>
+
+        <set field="partyId" value="DemoCustomer" type="String"/>
+
+        <create-object class-name="org.ofbiz.order.shoppingcart.ShoppingCart" field="shoppingCart">
+            <field field="delegator" type="org.ofbiz.entity.Delegator"/>
+            <field field="productStoreId" type="String"/>
+            <field field="locale" type="java.util.Locale"/>
+            <field field="currencyUom" type="String"/>
+        </create-object>
+
+        <set field="orderType" value="SALES_ORDER" type="String"/>
+        <call-object-method method-name="setOrderType" obj-field="shoppingCart">
+            <field field="orderType" type="String"/>
+        </call-object-method>
+
+        <call-object-method method-name="setChannelType" obj-field="shoppingCart">
+            <field field="salesChannel" type="String"/>
+        </call-object-method>
+
+        <call-object-method method-name="setProductStoreId" obj-field="shoppingCart">
+            <field field="productStoreId" type="String"/>
+        </call-object-method>
+
+        <call-object-method method-name="setBillToCustomerPartyId" obj-field="shoppingCart">
+            <field field="partyId" type="String"/>
+        </call-object-method>
+
+        <call-object-method method-name="setPlacingCustomerPartyId" obj-field="shoppingCart">
+            <field field="partyId" type="String"/>
+        </call-object-method>
+
+        <call-object-method method-name="setShipToCustomerPartyId" obj-field="shoppingCart">
+            <field field="partyId" type="String"/>
+        </call-object-method>
+
+        <call-object-method method-name="setEndUserCustomerPartyId" obj-field="shoppingCart">
+            <field field="partyId" type="String"/>
+        </call-object-method>
+
+        <call-object-method method-name="setUserLogin" obj-field="shoppingCart">
+            <field field="userLogin" type="org.ofbiz.entity.GenericValue"/>
+            <field field="dispatcher" type="org.ofbiz.service.LocalDispatcher"/>
+        </call-object-method>
+
+        <set field="productId" value="SV-1001" type="String"/>
+        <set field="prodCatalogId" value="DemoCatalog" type="String"/>
+        <set field="quantity" value="1" type="BigDecimal"/>
+
+        <call-object-method method-name="addOrIncreaseItem" obj-field="shoppingCart">
+            <field field="productId" type="String"/>
+            <field field="selectedAmount" type="BigDecimal"/>
+            <field field="quantity" type="BigDecimal"/>
+            <field field="reservStart" type="Timestamp"/>
+            <field field="reservLength" type="BigDecimal"/>
+            <field field="reservPersons" type="BigDecimal"/>
+            <field field="shipBeforeDate" type="Timestamp"/>
+            <field field="shipAfterDate" type="Timestamp"/>
+            <field field="features" type="Map"/>
+            <field field="attributes" type="Map"/>
+            <field field="prodCatalogId" type="String"/>
+            <field field="configWrapper" type="org.ofbiz.product.config.ProductConfigWrapper"/>
+            <field field="itemType" type="String"/>
+            <field field="itemGroupNumber" type="String"/>
+            <field field="parentProductId" type="String"/>
+            <field field="dispatcher" type="org.ofbiz.service.LocalDispatcher"/>
+        </call-object-method>
+
+        <call-object-method method-name="setDefaultCheckoutOptions" obj-field="shoppingCart">
+            <field field="dispatcher" type="org.ofbiz.service.LocalDispatcher"/>
+        </call-object-method>
+
+        <create-object class-name="org.ofbiz.order.shoppingcart.CheckOutHelper" field="checkOutHelper">
+            <field field="dispatcher" type="org.ofbiz.service.LocalDispatcher"/>
+            <field field="delegator" type="org.ofbiz.entity.Delegator"/>
+            <field field="shoppingCart" type="org.ofbiz.order.shoppingcart.ShoppingCart"/>
+        </create-object>
+
+        <call-object-method method-name="createOrder" obj-field="checkOutHelper" ret-field="orderCreateResult">
+            <field field="userLogin" type="org.ofbiz.entity.GenericValue"/>
+        </call-object-method>
+        <set field="orderId" from-field="orderCreateResult.orderId" type="String"/>
+        <if-not-empty field="orderId">
+            <call-class-method method-name="approveOrder" class-name="org.ofbiz.order.order.OrderChangeHelper" ret-field="approved">
+                <field field="dispatcher" type="org.ofbiz.service.LocalDispatcher"/>
+                <field field="userLogin" type="org.ofbiz.entity.GenericValue"/>
+                <field field="orderId" type="String"/>
+            </call-class-method>
+            <log level="info" message="======== Test order with id: [${orderId}] has been approved: [${approved}]========"/>
+
+            <entity-one entity-name="UserLogin" value-field="systemUserLogin">
+                <field-map field-name="userLoginId" value="system"/>
+            </entity-one>
+
+        <set field="quickShipEntireOrderMap.orderId" from-field="orderId"/>
+        <set field="quickShipEntireOrderMap.userLogin" from-field="systemUserLogin"/>
+        <call-service service-name="quickShipEntireOrder" in-map-name="quickShipEntireOrderMap"/>
+        <log level="info" message="========Test order with id: [${orderId}] has been shipped"/>
+        </if-not-empty>
+
+        <assert><not><if-empty field="orderId"/></not></assert>
+        <check-errors/>
+    </simple-method>
+
+    <simple-method method-name="testLoadCartFromQuote" short-description="Test loading shopping cart from quote" login-required="false">
+        <entity-one entity-name="UserLogin" value-field="userLogin">
+            <field-map field-name="userLoginId" value="system"/>
+        </entity-one>
+
+        <set field="createQuoteMap.userLogin" from-field="userLogin"/>
+        <set field="createQuoteMap.partyId" value="DemoCustomer"/>
+        <set field="createQuoteMap.currencyUomId" value="USD"/>
+        <set field="createQuoteMap.description" value="Test quote"/>
+        <set field="createQuoteMap.issueDate" value="2011-11-01 10:00:00.0" type="Timestamp"/>
+        <set field="createQuoteMap.productStoreId" value="9000"/>
+        <set field="createQuoteMap.quoteName" value="Test quote"/>
+        <set field="createQuoteMap.quoteTypeId" value="PRODUCT_QUOTE"/>
+        <set field="createQuoteMap.statusId" value="QUO_APPROVED"/>
+        <set field="createQuoteMap.validFromDate" value="2011-11-01 10:00:00.0"  type="Timestamp"/>
+        <call-service service-name="createQuote" in-map-name="createQuoteMap">
+            <result-to-field result-name="quoteId"/>
+        </call-service>
+        <check-errors/>
+
+        <set field="createQuoteItemMap.userLogin" from-field="userLogin"/>
+        <set field="createQuoteItemMap.quoteId" from-field="quoteId"/>
+        <set field="createQuoteItemMap.productId" value="GZ-1000"/>
+        <set field="createQuoteItemMap.quantity" value="10" type="BigDecimal"/>
+        <set field="createQuoteItemMap.quoteUnitPrice" value="15.00" type="BigDecimal"/>
+        <call-service service-name="createQuoteItem" in-map-name="createQuoteItemMap">
+            <result-to-field result-name="quoteItemSeqNo"/>
+        </call-service>
+        <check-errors/>
+
+        <set field="createQuoteAdjustmentMap.userLogin" from-field="userLogin"/>
+        <set field="createQuoteAdjustmentMap.quoteId" from-field="quoteId"/>
+        <set field="createQuoteAdjustmentMap.quoteItemSeqId" from-field="quoteItemSeqId"/>
+        <set field="createQuoteAdjustmentMap.amount" value="15.00" type="BigDecimal"/>
+        <set field="createQuoteAdjustmentMap.includeInShipping	" value="N"/>
+        <set field="createQuoteAdjustmentMap.includeInTax" value="Y"/>
+        <set field="createQuoteAdjustmentMap.quoteAdjustmentTypeId" value="SALES_TAX"/>
+        <set field="createQuoteAdjustmentMap.taxAuthGeoId" value="UT"/>
+        <set field="createQuoteAdjustmentMap.taxAuthPartyId" value="UT_TAXMAN"/>
+        <call-service service-name="createQuoteAdjustment" in-map-name="createQuoteAdjustmentMap">
+            <result-to-field result-name="quoteAdjustmentId"/>
+        </call-service>
+        <check-errors/>
+
+        <set field="loadCartFromQuoteMap.userLogin" from-field="userLogin"/>
+        <set field="loadCartFromQuoteMap.quoteId" from-field="quoteId"/>
+        <set field="loadCartFromQuoteMap.applyQuoteAdjustments" value="true"/>
+        <call-service service-name="loadCartFromQuote" in-map-name="loadCartFromQuoteMap">
+            <result-to-field result-name="shoppingCart"/>
+        </call-service>
+        <check-errors/>
+
+        <set field="expected" value="15.00" type="BigDecimal"/>
+
+        <call-object-method obj-field="shoppingCart" method-name="getTotalSalesTax" ret-field="totalSalesTax"/>
+        <assert><if-compare-field operator="equals" field="totalSalesTax" to-field="expected"/></assert>
+
+        <set field="shipGroupNumber" value="0" type="Integer"/>
+        <call-object-method obj-field="shoppingCart" method-name="getTotalSalesTax" ret-field="totalSalesTax">
+            <field field="shipGroupNumber" type="int"/>
+        </call-object-method>
+        <assert><if-compare-field operator="equals" field="totalSalesTax" to-field="expected"/></assert>
+
+        <set field="expected" value="165.00" type="BigDecimal"/>
+        <call-object-method obj-field="shoppingCart" method-name="getGrandTotal" ret-field="grandTotal"/>
+        <assert><if-compare-field operator="equals" field="grandTotal" to-field="expected"/></assert>
+        <check-errors/>
+    </simple-method>
+
 </simple-methods>

Modified: ofbiz/branches/jackrabbit20100709/applications/order/servicedef/secas.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/servicedef/secas.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/servicedef/secas.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/servicedef/secas.xml Tue Sep 20 17:46:13 2011
@@ -90,8 +90,10 @@ under the License.
     <eca service="changeOrderStatus" event="global-commit" 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="createInvoiceFromOrder" mode="sync"/>
         <action service="resetGrandTotal" mode="sync"/>
         <action service="sendOrderCompleteNotification" mode="async" persist="true"/>
+        <action service="createReturnItemForRental" mode="sync"/>
     </eca>
     <eca service="changeOrderStatus" event="commit" run-on-error="false">
         <condition field-name="orderTypeId" operator="equals" value="PURCHASE_ORDER"/>

Modified: ofbiz/branches/jackrabbit20100709/applications/order/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/servicedef/services.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/servicedef/services.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/servicedef/services.xml Tue Sep 20 17:46:13 2011
@@ -521,8 +521,8 @@ under the License.
         <attribute name="orderId" type="String" mode="IN" optional="false"/>
         <attribute name="shippingAmount" type="BigDecimal" mode="OUT" optional="false"/>
     </service>
-    <service name="getOrderStatus" engine="simple" export="true"
-            location="component://order/script/org/ofbiz/order/order/OrderServices.xml" invoke="getOrderStatus" auth="false">
+    <service name="getOrderStatus" engine="simple" location="component://order/script/org/ofbiz/order/order/OrderServices.xml"
+            invoke="getOrderStatus" auth="false">
         <description>Gets the order status</description>
         <attribute name="orderId" type="String" mode="IN" optional="false"/>
         <attribute name="statusId" type="String" mode="OUT" optional="false"/>
@@ -1122,4 +1122,9 @@ under the License.
         <description>Create Order Payment Application</description>
         <attribute name="paymentId" type="String" mode="IN" optional="false"/>
     </service>
+    
+    <service name="createTestOrderRentalProduct" engine="simple" auth="true"
+         location="component://order/script/org/ofbiz/order/test/ShoppingCartTests.xml" invoke="testCreateOrderRentalProduct">
+         <description>Create Test Order Rental of an asset which is shipped from and returned to inventory</description>
+    </service>
 </services>

Modified: ofbiz/branches/jackrabbit20100709/applications/order/servicedef/services_quote.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/servicedef/services_quote.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/servicedef/services_quote.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/servicedef/services_quote.xml Tue Sep 20 17:46:13 2011
@@ -251,4 +251,11 @@ under the License.
         <attribute name="quoteAdjustments" type="List" mode="IN" optional="true"/>
         <attribute name="quoteId" type="String" mode="OUT" optional="false"/>
     </service>
+    <service name="createQuoteNote" engine="simple"
+            location="component://order/script/org/ofbiz/order/quote/QuoteServices.xml" invoke="createQuoteNote" auth="true">
+        <description>Create a note item and associate with a quote</description>
+        <attribute name="quoteId" type="String" mode="IN"/>
+        <attribute name="noteInfo" type="String" mode="IN" allow-html="safe"/>
+        <attribute name="noteName" type="String" mode="IN" optional="true"/>
+    </service>
 </services>

Modified: ofbiz/branches/jackrabbit20100709/applications/order/servicedef/services_return.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/servicedef/services_return.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/servicedef/services_return.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/servicedef/services_return.xml Tue Sep 20 17:46:13 2011
@@ -369,4 +369,12 @@ under the License.
         <description>Delete a ReturnContactMech</description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
     </service>
+
+    <!-- Item Return Service -->
+    <service name="createReturnItemForRental" engine="simple"
+            location="component://order/script/org/ofbiz/order/order/OrderReturnServices.xml" invoke="createReturnItemForRental">
+        <description>Create the return item for rental (which items has product type is ASSET_USAGE_OUT_IN)</description>
+        <attribute name="orderId" type="String" mode="IN" optional="false"/>
+        <attribute name="returnId" type="String" mode="OUT" optional="false"/>
+    </service>
 </services>

Modified: ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java Tue Sep 20 17:46:13 2011
@@ -2536,13 +2536,11 @@ public class OrderReadHelper {
         BigDecimal promoAdjTotal = ZERO;
 
         List<GenericValue> promoAdjustments = EntityUtil.filterByAnd(allOrderAdjustments, UtilMisc.toMap("orderAdjustmentTypeId", "PROMOTION_ADJUSTMENT"));
-
-        if (!promoAdjustments.isEmpty()) {
-
+        
+        if (UtilValidate.isNotEmpty(promoAdjustments)) {
             Iterator<GenericValue> promoAdjIter = promoAdjustments.iterator();
             while (promoAdjIter.hasNext()) {
                 GenericValue promoAdjustment = promoAdjIter.next();
-
                 if (promoAdjustment != null) {
                     BigDecimal amount = promoAdjustment.getBigDecimal("amount").setScale(taxCalcScale, taxRounding);
                     promoAdjTotal = promoAdjTotal.add(amount);

Modified: ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java Tue Sep 20 17:46:13 2011
@@ -2607,7 +2607,7 @@ public class OrderReturnServices {
         String serviceName = UtilValidate.isNotEmpty(orderItemSeqId) ? "createReturnItem" : "createReturnAdjustment";
         Debug.logInfo("serviceName:" + serviceName, module);
         try {
-            Map<String, Object> inMap = filterServiceContext(dctx, serviceName, context);
+            Map<String, Object> inMap = dctx.makeValidContext(serviceName, "IN", context);
             if ("createReturnItem".equals(serviceName)) {
                 // we don't want to automatically include the adjustments
                 // when the return item is created because they are selectable by the user
@@ -2630,7 +2630,7 @@ public class OrderReturnServices {
         String serviceName = UtilValidate.isEmpty(returnAdjustmentId) ? "updateReturnItem" : "updateReturnAdjustment";
         Debug.logInfo("serviceName:" + serviceName, module);
         try {
-            return dispatcher.runSync(serviceName, filterServiceContext(dctx, serviceName, context));
+            return dispatcher.runSync(serviceName, dctx.makeValidContext(serviceName, "IN", context));
         } catch (org.ofbiz.service.GenericServiceException e) {
             Debug.logError(e, module);
             return ServiceUtil.returnError(e.getMessage());
@@ -2683,26 +2683,12 @@ public class OrderReturnServices {
      * @param context   context before clean up
      * @return filtered context
      * @throws GenericServiceException
+     * 
+     * @deprecated - Use DispatchContext.makeValidContext(String, String, Map) instead
      */
+    @Deprecated
     public static Map<String, Object> filterServiceContext(DispatchContext dctx, String serviceName, Map<String, ? extends Object> context) throws GenericServiceException {
-        ModelService modelService = dctx.getModelService(serviceName);
-
-        if (modelService == null) {
-            throw new GenericServiceException("Problems getting the service model");
-        }
-        Map<String, Object> serviceContext = FastMap.newInstance();
-        List<ModelParam> modelParmInList = modelService.getInModelParamList();
-        Iterator<ModelParam> modelParmInIter = modelParmInList.iterator();
-        while (modelParmInIter.hasNext()) {
-            ModelParam modelParam = modelParmInIter.next();
-            String paramName =  modelParam.name;
-
-            Object value = context.get(paramName);
-            if (value != null) {
-                serviceContext.put(paramName, value);
-            }
-        }
-        return serviceContext;
+        return dctx.makeValidContext(serviceName, "IN", context);
     }
 
     /**