Index: applications/order/widget/ordermgr/OrderEntryScreens.xml
===================================================================
--- applications/order/widget/ordermgr/OrderEntryScreens.xml	(revision 600143)
+++ applications/order/widget/ordermgr/OrderEntryScreens.xml	(working copy)
@@ -153,5 +153,41 @@
             </widgets>
         </section>
     </screen>
-
+    
+    <!-- New order entry screens -->
+    <screen name="InitSalesOrder">
+        <section>
+            <actions>
+                <set field="titleProperty" value="PageTitleOrderInits"/>
+                <set field="headerItem" value="salesorderentry"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/sales/initSalesOrder.bsh"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/orderagreements.bsh"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <platform-specific><html><html-template location="component://order/webapp/ordermgr/entry/sales/initSalesOrder.ftl"/></html></platform-specific>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+    <screen name="InitPurchaseOrder">
+        <section>
+            <actions>
+                <set field="titleProperty" value="PageTitleOrderInits"/>
+                <set field="headerItem" value="poentry"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/purchase/initPurchaseOrder.bsh"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/orderagreements.bsh"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <platform-specific><html><html-template location="component://order/webapp/ordermgr/entry/purchase/initPurchaseOrder.ftl"/></html></platform-specific>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+    
 </screens>
Index: applications/order/widget/ordermgr/OrderEntryCommonScreens.xml
===================================================================
--- applications/order/widget/ordermgr/OrderEntryCommonScreens.xml	(revision 600143)
+++ applications/order/widget/ordermgr/OrderEntryCommonScreens.xml	(working copy)
@@ -43,6 +43,56 @@
             </widgets>
         </section>
     </screen>
+    <screen name="CommonSalesOrderEntryDecorator">
+        <section>
+            <actions>
+                <set field="leftbarScreenName" value="leftbar"/>
+                <set field="leftbarScreenLocation" value="component://order/widget/ordermgr/OrderEntryCommonScreens.xml"/>
+                <set field="MainColumnStyle" value="leftonly"/>
+                <set field="headerItem" value="salesorderentry"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/SetShoppingCart.bsh"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <section>
+                            <widgets>
+                                <platform-specific>
+                                    <html><html-template location="component://order/webapp/ordermgr/entry/OrderEntryTabBar.ftl"/></html>
+                                </platform-specific>
+                                <decorator-section-include name="body"/>
+                            </widgets>
+                        </section>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+    <screen name="CommonPurchaseOrderEntryDecorator">
+        <section>
+            <actions>
+                <set field="leftbarScreenName" value="leftbar"/>
+                <set field="leftbarScreenLocation" value="component://order/widget/ordermgr/OrderEntryCommonScreens.xml"/>
+                <set field="MainColumnStyle" value="leftonly"/>
+                <set field="headerItem" value="poentry"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/SetShoppingCart.bsh"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <section>
+                            <widgets>
+                                <platform-specific>
+                                    <html><html-template location="component://order/webapp/ordermgr/entry/OrderEntryTabBar.ftl"/></html>
+                                </platform-specific>
+                                <decorator-section-include name="body"/>
+                            </widgets>
+                        </section>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
     <screen name="CommonOrderCatalogDecorator">
         <section>
             <actions>
Index: applications/order/widget/ordermgr/OrderEntryCartScreens.xml
===================================================================
--- applications/order/widget/ordermgr/OrderEntryCartScreens.xml	(revision 600143)
+++ applications/order/widget/ordermgr/OrderEntryCartScreens.xml	(working copy)
@@ -199,4 +199,57 @@
             </widgets>
         </section>
     </screen>
+    <screen name="ShowSalesOrderCart">
+        <section>
+            <actions>
+                <set field="titleProperty" value="PageTitleOrderShowCart"/>
+                <set field="productsummaryScreen" value="component://order/widget/ordermgr/OrderEntryCatalogScreens.xml#productsummary"/>
+                <set field="promoUseDetailsInlineScreen" value="component://order/widget/ordermgr/OrderEntryCartScreens.xml#promoUseDetailsInline"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/showcart.bsh"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/showpromotext.bsh"/>
+                <entity-condition entity-name="ProductPromo" list-name="allProductPromos">
+                    <order-by field-name="productPromoId"/>
+                </entity-condition>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonSalesOrderEntryDecorator" location="component://order/widget/ordermgr/OrderEntryCommonScreens.xml">
+                    <decorator-section name="body">
+                        <platform-specific><html><html-template location="component://order/webapp/ordermgr/entry/cart/javascript.ftl"/></html></platform-specific>
+                        <platform-specific><html><html-template location="component://order/webapp/ordermgr/entry/cart/showsalescart.ftl"/></html></platform-specific>
+                        <platform-specific><html><html-template location="component://order/webapp/ordermgr/entry/cart/addItemsToShoppingList.ftl"/></html></platform-specific>
+                        <platform-specific><html><html-template location="component://order/webapp/ordermgr/entry/cart/showcartitems.ftl"/></html></platform-specific>
+                        <platform-specific><html><html-template location="component://order/webapp/ordermgr/entry/cart/promoCodes.ftl"/></html></platform-specific>
+                        <platform-specific><html><html-template location="component://order/webapp/ordermgr/entry/cart/manualPromotions.ftl"/></html></platform-specific>
+                        <platform-specific><html><html-template location="component://order/webapp/ordermgr/entry/cart/promoText.ftl"/></html></platform-specific>
+                        <platform-specific><html><html-template location="component://order/webapp/ordermgr/entry/cart/associatedProducts.ftl"/></html></platform-specific>
+                        <platform-specific><html><html-template location="component://order/webapp/ordermgr/entry/cart/promotionsApplied.ftl"/></html></platform-specific>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+    <screen name="ShowPurchaseOrderCart">
+        <section>
+            <actions>
+                <set field="titleProperty" value="PageTitleOrderShowCart"/>
+                <set field="promoUseDetailsInlineScreen" value="component://order/widget/ordermgr/OrderEntryCartScreens.xml#promoUseDetailsInline"/>
+                <script location="component://order/webapp/ordermgr/WEB-INF/actions/entry/showcart.bsh"/>
+                <entity-condition entity-name="ProductPromo" list-name="allProductPromos">
+                    <order-by field-name="productPromoId"/>
+                </entity-condition>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonPurchaseOrderEntryDecorator" location="component://order/widget/ordermgr/OrderEntryCommonScreens.xml">
+                    <decorator-section name="body">
+                        <platform-specific><html><html-template location="component://order/webapp/ordermgr/entry/cart/javascript.ftl"/></html></platform-specific>
+                        <platform-specific><html><html-template location="component://order/webapp/ordermgr/entry/cart/showpurchasecart.ftl"/></html></platform-specific>
+                        <platform-specific><html><html-template location="component://order/webapp/ordermgr/entry/cart/addItemsToShoppingList.ftl"/></html></platform-specific>
+                        <platform-specific><html><html-template location="component://order/webapp/ordermgr/entry/cart/showcartitems.ftl"/></html></platform-specific>
+                        <platform-specific><html><html-template location="component://order/webapp/ordermgr/entry/cart/manualPromotions.ftl"/></html></platform-specific>
+                        <platform-specific><html><html-template location="component://order/webapp/ordermgr/entry/cart/promotionsApplied.ftl"/></html></platform-specific>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 </screens>
Index: applications/order/script/org/ofbiz/order/order/CheckOutEvents.xml
===================================================================
--- applications/order/script/org/ofbiz/order/order/CheckOutEvents.xml	(revision 0)
+++ applications/order/script/org/ofbiz/order/order/CheckOutEvents.xml	(revision 0)
@@ -0,0 +1,193 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
+
+    <simple-method method-name="initializeSalesOrder" short-description="Initialilze Sales Order Entry">
+        <request-to-field field-name="delegator" request-name="delegator"/>
+        <request-to-field field-name="security" request-name="security"/>
+        <session-to-field field-name="userLogin" session-name="userLogin"/>
+        <call-class-method method-name="getCartObject" class-name="org.ofbiz.order.shoppingcart.ShoppingCartEvents" ret-field-name="cart">
+            <field field-name="request" type="javax.servlet.http.HttpServletRequest"/>
+        </call-class-method>
+        <call-object-method obj-field-name="cart" method-name="getOrderType" ret-field-name="orderType"/>
+        <if-compare value="SALES_ORDER" field-name="orderType" operator="equals">
+            <return response-code="success"/>
+        </if-compare>
+        <call-object-method obj-field-name="cart" method-name="setOrderType">
+            <string value="SALES_ORDER"/>
+        </call-object-method>
+        <call-object-method obj-field-name="request" method-name="getSession" ret-field-name="session"/>
+        <set field="hasPermission" value="false"/>
+        <if-not-empty field-name="parameters.productStoreId">
+            <field-to-session field-name="parameters.productStoreId" session-name="productStoreId"/>
+            <call-class-method method-name="getProductStore" class-name="org.ofbiz.product.store.ProductStoreWorker" ret-field-name="productStore">
+                <field field-name="parameters.productStoreId" type="String"/>
+                <field field-name="delegator" type="org.ofbiz.entity.GenericDelegator"/>
+            </call-class-method>
+            <if-not-empty field-name="productStore">
+                <if-has-permission permission="ORDERMGR" action="_SALES_CREATE">
+                    <set field="hasPermission" value="true"/>
+                <else>
+                    <set field="productStoreRoleCtx.productStoreId" from-field="productStore.productStoreId"/>
+                    <set field="productStoreRoleCtx.partyId" from-field="userLogin.partyId"/>
+                    <set field="productStoreRoleCtx.roleTypeId" value="SALES_REP"/>
+                    <find-by-and entity-name="ProductStoreRole" list-name="storeReps" map-name="productStoreRoleCtx"/>
+                    <filter-list-by-date list-name="storeRepos" to-list-name="storeRepos"/>
+                    <if-not-empty field-name="storeRepos">
+                        <set field="hasPermission" value="true"/>
+                    </if-not-empty>
+                </else>
+                </if-has-permission>
+                <if-compare value="true" field-name="hasPermission" operator="equals">
+                    <set field="locale" value=" "/>
+                    <clear-field field-name="locale"/>
+                    <call-class-method method-name="getCartObject" class-name="org.ofbiz.order.shoppingcart.ShoppingCartEvents" ret-field-name="cart">
+                        <field field-name="request" type="javax.servlet.http.HttpServletRequest"/>
+                        <field field-name="locale" type="java.util.Locale"/>
+                        <field field-name="productStore.defaultCurrencyUomId" type="String"/>
+                    </call-class-method>
+                <else>
+                    <add-error><fail-property resource="OrderUiLabels" property="OrderYouDoNotHavePermissionToTakeOrdersForThisStore"/></add-error>
+                    <call-object-method obj-field-name="cart" method-name="clear"/>
+                    <return response-code="error"/>
+                </else>
+                </if-compare>
+                <call-object-method obj-field-name="cart" method-name="setProductStoreId">
+                    <field field-name="parameters.productStoreId" type="String"/>
+                </call-object-method>
+            </if-not-empty>
+            <else>
+                <add-error><fail-property resource="OrderUiLabels" property="OrderAProductStoreMustBeSelectedForASalesOrder"/></add-error>
+                <call-object-method obj-field-name="cart" method-name="clear"/>
+                <return response-code="error"/>
+            </else>
+        </if-not-empty>
+        <if-not-empty field-name="parameters.salesChannelEnumId">
+            <call-object-method obj-field-name="cart" method-name="setChannelType">
+                <field field-name="parameters.salesChannelEnumId" type="String"/>
+            </call-object-method>
+        </if-not-empty>
+        <set field="partyId" from-field="parameters.partyId"/>
+        <if-empty field-name="partyId">
+            <if-not-empty field-name="parameters.userLoginId">
+                <set field="thisUserLoginCtx.userLoginId" from-field="parameters.userLoginId"/>
+                <find-by-primary-key value-name="thisUserLogin" map-name="thisUserLoginCtx" entity-name="UserLogin"/>
+                <if-not-empty field-name="thisUserLogin">
+                    <set field="partyId" from-field="thisUserLogin.partyId"/>
+                <else>
+                    <set field="partyId" from-field="parameters.userLoginId"/>
+                </else>
+                </if-not-empty>
+            </if-not-empty>
+        </if-empty>
+        <if-not-empty field-name="partyId">
+            <set field="partyCtx.partyId" from-field="parameters.partyId"/>
+            <find-by-primary-key value-name="party" map-name="partyCtx" entity-name="Party"/>
+            <if-not-empty field-name="party">
+                <call-object-method obj-field-name="cart" method-name="setOrderPartyId">
+                    <field field-name="party.partyId" type="String"/>
+                </call-object-method>
+            <else>
+                <add-error><fail-property resource="OrderUiLabels" property="OrderCouldNotLocateTheSelectedParty"/></add-error>
+                <return response-code="error"/>
+            </else>
+            </if-not-empty>
+        <else>
+            <call-object-method obj-field-name="cart" method-name="setOrderPartyId">
+                <field field-name="userLogin.partyId" type="String"/>
+            </call-object-method>
+        </else>
+        </if-not-empty>
+    </simple-method>
+    
+    <simple-method method-name="setOrderCurrencyAgreementShipDates" short-description="Handles setting the currency, agreement and shipment dates of an order.">
+        <request-to-field field-name="delegator" request-name="delegator"/>
+        <request-to-field field-name="dispatcher" request-name="dispatcher"/>
+        <call-class-method method-name="getCartObject" class-name="org.ofbiz.order.shoppingcart.ShoppingCartEvents" ret-field-name="cart">
+            <field field-name="request" type="javax.servlet.http.HttpServletRequest"/>
+        </call-class-method>
+        <call-object-method obj-field-name="cart" method-name="getOrderType" ret-field-name="orderType"/>
+        <if-compare value="SALES_ORDER" field-name="orderType" operator="equals">
+            <return response-code="success"/>
+        </if-compare>
+        <create-object class-name="org.ofbiz.order.shoppingcart.ShoppingCartHelper" field-name="cartHelper">
+            <field field-name="delegator" type="org.ofbiz.entity.GenericDelegator"/>
+            <field field-name="dispatcher" type="org.ofbiz.service.LocalDispatcher"/>
+            <field field-name="cart" type="org.ofbiz.order.shoppingcart.ShoppingCart"/>
+        </create-object>
+        <set field="agreementId" from-field="parameters.agreementId"/>
+        <set field="currencyUomId" from-field="parameters.currencyUomId"/>
+        <set field="workEffortId" from-field="parameters.workEffortId"/>
+        <set field="shipBeforeDateStr" from-field="parameters.shipBeforeDate"/>
+        <set field="shipAfterDateStr" from-field="parameters.shipAfterDate"/>
+        <set field="orderName" from-field="parameters.orderName"/>
+        <set field="correspondingPoId" from-field="parameters.correspondingPoId"/>
+        <if-not-empty field-name="agreementId">
+            <call-object-method obj-field-name="cartHelper" method-name="selectAgreement" ret-field-name="result">
+                <field field-name="agreementId" type="String"/>
+            </call-object-method>
+        <else>
+            <call-object-method obj-field-name="cartHelper" method-name="setCurrency" ret-field-name="result">
+                <field field-name="currencyUomId" type="String"/>
+            </call-object-method>
+        </else>
+        </if-not-empty>
+        <call-class-method method-name="isError" class-name="org.ofbiz.service.ServiceUtil" ret-field-name="flag">
+            <field field-name="result" type="java.util.Map"/>
+        </call-class-method>
+        <if-compare field-name="flag" operator="equals" value="true" type="Boolean">
+            <call-class-method method-name="getErrorMessage" class-name="org.ofbiz.service.ServiceUtil" ret-field-name="errMsg">
+                <field field-name="result" type="java.util.Map"/>
+            </call-class-method>
+            <add-error>
+               <fail-message message="${errMsg}"/>
+            </add-error>
+            <return response-code="error"/>
+        </if-compare>
+        <call-object-method obj-field-name="cart" method-name="setWorkEffortId">
+            <field field-name="workEffortId" type="String"/>
+        </call-object-method>
+        <call-object-method obj-field-name="cart" method-name="setOrderName">
+            <field field-name="orderName" type="String"/>
+        </call-object-method>
+        <call-object-method obj-field-name="cart" method-name="setPoNumber">
+            <field field-name="correspondingPoId" type="String"/>
+        </call-object-method>
+        <if-not-empty field-name="shipBeforeDateStr">
+            <call-class-method method-name="valueOf" class-name="java.sql.Timestamp" ret-field-name="shipBeforeDate">
+                <field field-name="shipBeforDateStr" type="String"/>
+            </call-class-method>
+            <call-object-method obj-field-name="cart" method-name="setDefaultShipBeforeDate">
+                <field field-name="shipBeforeDate" type="java.sql.Timestamp"/>
+            </call-object-method>
+        </if-not-empty>
+        <if-not-empty field-name="shipAfterDateStr">
+            <call-class-method method-name="valueOf" class-name="java.sql.Timestamp" ret-field-name="shipAfterDate">
+                <field field-name="shipAfterDateStr" type="String"/>
+            </call-class-method>
+            <call-object-method obj-field-name="cart" method-name="setDefaultShipAfterDate">
+                <field field-name="shipAfterDate" type="java.sql.Timestamp"/>
+            </call-object-method>
+        </if-not-empty>
+    </simple-method>
+   
+</simple-methods>
\ No newline at end of file

Property changes on: applications/order/script/org/ofbiz/order/order/CheckOutEvents.xml
___________________________________________________________________
Name: svn:executable
   + *

Index: applications/order/config/OrderUiLabels.properties
===================================================================
--- applications/order/config/OrderUiLabels.properties	(revision 600143)
+++ applications/order/config/OrderUiLabels.properties	(working copy)
@@ -720,6 +720,7 @@
 OrderProductStore=Product Store
 OrderPromotionCouponCodes=Promotion/Coupon Codes
 OrderPurchaseOrder=Purchase Order
+OrderPurchaseOrderEntry=Purchase Order Entry
 OrderPurchaseReportOptions=Order Purchase Report Options
 OrderPurchasedFrom=Purchased From
 OrderQty=Qty
@@ -816,6 +817,7 @@
 OrderRunStorePromotions=Run Store Promotions
 OrderSalesChannel=Sales Channel
 OrderSalesOrder=Sales Order
+OrderSalesOrderEntry=Sales Order Entry
 OrderSalesTax=Sales Tax
 OrderScheduleDelivery=Schedule Delivery
 OrderScore=Score
Index: applications/order/webapp/ordermgr/entry/sales/initSalesOrder.ftl
===================================================================
--- applications/order/webapp/ordermgr/entry/sales/initSalesOrder.ftl	(revision 0)
+++ applications/order/webapp/ordermgr/entry/sales/initSalesOrder.ftl	(revision 0)
@@ -0,0 +1,238 @@
+<#--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<#assign shoppingCartOrderType = "">
+<#assign shoppingCartProductStore = "NA">
+<#assign shoppingCartChannelType = "">
+<#if shoppingCart?exists>
+  <#assign shoppingCartOrderType = shoppingCart.getOrderType()>
+  <#assign shoppingCartProductStore = shoppingCart.getProductStoreId()?default("NA")>
+  <#assign shoppingCartChannelType = shoppingCart.getChannelType()?default("")>
+</#if>
+
+<#if security.hasEntityPermission("ORDERMGR", "_CREATE", session)>
+<form method="post" name="salesentryform" action="<@ofbizUrl>initializeSalesOrder</@ofbizUrl>">
+  <div class="screenlet">
+    <div class="screenlet-title-bar">
+      <ul>
+        <li class="head3">${uiLabelMap.OrderSalesOrder}<#if shoppingCart?exists>&nbsp;${uiLabelMap.OrderInProgress}</#if></li>
+        <li><a href="javascript:document.salesentryform.submit();">${uiLabelMap.CommonContinue}</a></li>
+        <li><a href="/partymgr/control/findparty?externalLoginKey=${externalLoginKey}">${uiLabelMap.PartyFindParty}</a></li>
+        <li><a href="<@ofbizUrl>ManageOrdersFromEbay</@ofbizUrl>">${uiLabelMap.OrderImportOrdersFromEbay}</a></li>
+      </ul>
+      <br class="clear"/>
+    </div>
+    <div class="screenlet-body">
+        <input type="hidden" name="finalizeMode" value="type"/>
+        <input type="hidden" name="orderMode" value="SALES_ORDER"/>
+        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="boxbottom">
+          <tr>
+            <td >&nbsp;</td>
+            <td align='right' valign='middle' nowrap><div class='tableheadtext'>${uiLabelMap.ProductProductStore}</div></td>
+            <td >&nbsp;</td>
+            <td valign='middle'>
+              <div class='tabletext' valign='top'>
+                <select class="selectBox" name="productStoreId"<#if sessionAttributes.orderMode?exists> disabled</#if>>
+                  <#assign currentStore = shoppingCartProductStore>
+                  <#if defaultProductStore?has_content>
+                    <option value="${defaultProductStore.productStoreId}">${defaultProductStore.storeName?if_exists}</option>
+                    <option value="${defaultProductStore.productStoreId}">----</option>
+                  </#if>               
+                  <#list productStores as productStore>
+                    <option value="${productStore.productStoreId}"<#if productStore.productStoreId == currentStore> selected</#if>>${productStore.storeName?if_exists}</option>
+                  </#list>
+                </select>
+                <#if sessionAttributes.orderMode?exists>${uiLabelMap.OrderCannotBeChanged}</#if>
+              </div>
+            </td>
+          </tr>
+          <tr><td colspan="4">&nbsp;</td></tr>
+          <tr>
+            <td>&nbsp;</td>
+            <td align='right' valign='middle' nowrap><div class='tableheadtext'>${uiLabelMap.OrderSalesChannel}</div></td>
+            <td>&nbsp;</td>
+            <td valign='middle'>
+              <div class='tabletext' valign='top'>
+                <select class="selectBox" name="salesChannelEnumId">
+                <#assign currentChannel = shoppingCartChannelType>
+                  <#if defaultSalesChannel?has_content>
+                    <option value="${defaultSalesChannel.enumId}">${defaultSalesChannel.description?if_exists}</option>
+                    <option value="${defaultSalesChannel.enumId}"> ---- </option>
+                  </#if>                
+                  <option value="">${uiLabelMap.OrderNoChannel}</option>                
+                  <#list salesChannels as salesChannel>
+                    <option value="${salesChannel.enumId}" <#if (salesChannel.enumId == currentChannel)>selected</#if>>${salesChannel.get("description",locale)}</option>
+                  </#list>
+                </select>
+              </div>
+            </td>
+          </tr>
+          <tr><td colspan="4">&nbsp;</td></tr>
+          <#if partyId?exists>
+            <#assign thisPartyId = partyId>
+          <#else>
+            <#assign thisPartyId = requestParameters.partyId?if_exists>
+          </#if>
+          <tr>
+            <td>&nbsp;</td>
+            <td align='right' valign='middle' nowrap><div class='tableheadtext'>${uiLabelMap.PartyUserLoginId}</div></td>
+            <td>&nbsp;</td>
+            <td valign='middle'>
+              <div class='tabletext' valign='top'>
+                <input type="text" class="inputBox" name="userLoginId" value="${requestParameters.userLoginId?if_exists}"/>
+                <a href="javascript:call_fieldlookup2(document.salesentryform.userLoginId,'LookupUserLoginAndPartyDetails');">
+                  <img src='/images/fieldlookup.gif' width='15' height='14' border='0' alt='Click here For Field Lookup'/>
+                </a>
+              </div>
+            </td>
+          </tr>
+          <tr>
+            <td>&nbsp;</td>
+            <td align='right' valign='middle' nowrap><div class='tableheadtext'>${uiLabelMap.PartyPartyId}</div></td>
+            <td>&nbsp;</td>
+            <td valign='middle'>
+              <div class='tabletext' valign='top'>
+                <input type='text' class='inputBox' name='partyId' value='${thisPartyId?if_exists}'/>
+                <a href="javascript:call_fieldlookup2(document.salesentryform.partyId,'LookupPartyName');">
+                  <img src='/images/fieldlookup.gif' width='15' height='14' border='0' alt='Click here For Field Lookup'/>
+                </a>
+              </div>
+            </td>
+          </tr>
+        </table>
+    </div>
+  </div>  
+  <div class="screenlet">
+  <div class="screenlet-title-bar">
+      <ul>
+        <li class="head3">${uiLabelMap.OrderOrderEntryCurrencyAgreementShipDates}</li>
+      </ul>
+      <br class="clear" />
+  </div>
+  <div class="screenlet-body">
+    <table>
+      <tr><td colspan="4">&nbsp;</td></tr>
+      <#if agreements?exists>
+      <input type='hidden' name='hasAgreements' value='Y'/>
+      <tr>
+        <td>&nbsp;</td>
+        <td align='right' valign='top' nowrap>
+          <div class='tableheadtext'>
+            ${uiLabelMap.OrderSelectAgreement}
+          </div>
+        </td>
+        <td>&nbsp;</td>
+        <td valign='middle'>
+          <div class='tabletext' valign='top'>
+            <select name="agreementId" class="inputBox">
+            <option value="">${uiLabelMap.CommonNone}</option>
+            <#list agreements as agreement>
+            <option value='${agreement.agreementId}' >${agreement.agreementId} - ${agreement.description?if_exists}</option>
+            </#list>
+            </select>
+          </div>
+        </td>
+      </tr>
+      <#else><input type='hidden' name='hasAgreements' value='N'/>
+      </#if>
+      <tr>
+        <td>&nbsp;</td>
+        <td align='right' valign='middle' class='tableheadtext' nowrap>
+           ${uiLabelMap.OrderOrderName}
+        </td>
+        <td>&nbsp;</td>
+        <td align='left'>
+          <input type='text' class="inputBox" size='60' maxlength='100' name='orderName'/>
+        </td>
+      </tr>
+      <tr>
+        <td>&nbsp;</td>
+        <td align='right' valign='middle' class='tableheadtext' nowrap>
+          ${uiLabelMap.OrderPONumber}
+        </td>
+        <td>&nbsp;</td>
+        <td align='left'>
+          <input type="text" class='inputBox' name="correspondingPoId" size="15">
+        </td>
+      </tr>                                                           
+      <tr>
+        <td>&nbsp;</td>
+        <td align='right' valign='middle' nowrap>
+          <div class='tableheadtext'>
+            <#if agreements?exists>${uiLabelMap.OrderSelectCurrencyOr}
+            <#else>${uiLabelMap.OrderSelectCurrency}
+            </#if>
+          </div>
+        </td>
+        <td>&nbsp;</td>
+        <td valign='middle'>
+          <div class='tabletext' valign='top'>
+            <select class="selectBox" name="currencyUomId">
+              <option value=""></option>
+              <#list currencies as currency>
+              <option value="${currency.uomId}" <#if (defaultCurrencyUomId?has_content) && (currency.uomId == defaultCurrencyUomId)>selected</#if>>${currency.uomId}</option>
+              </#list>
+            </select>
+          </div>
+        </td>
+      </tr>
+      <tr>
+        <td>&nbsp;</td>
+        <td class="tableheadtext" align="right">
+          ${uiLabelMap.WorkEffortWorkEffortId}
+        </td>
+        <td>&nbsp;</td>
+        <td align="left">
+          <input type="text" name="workEffortId" size="15"/>
+          <a href="javascript:call_fieldlookup2(document.salesentryform.workEffortId,'LookupWorkEffort');"><img src='/images/fieldlookup.gif' width='15' height='14' border='0' alt='Click here For Field Lookup'/></a>
+        </td>
+      </tr>
+      <tr>
+        <td>&nbsp;</td>
+        <td align='right' valign='top' nowrap>
+          <div class='tableheadtext'>
+            ${uiLabelMap.OrderShipAfterDateDefault}
+          </div>
+        </td>
+        <td>&nbsp;</td>
+        <td><input type="text" name="shipAfterDate" size="20" maxlength="30" class="inputBox"/>
+          <a href="javascript:call_cal(document.salesentryform.shipAfterDate,'');">
+            <img src='/images/cal.gif' width='16' height='16' border='0' alt='Calendar'/>
+          </a>
+        </td>
+      </tr>
+      <tr>
+        <td>&nbsp;</td>
+        <td align='right' valign='top' nowrap>
+          <div class='tableheadtext'>
+            ${uiLabelMap.OrderShipBeforeDateDefault}
+          </div>
+        </td>
+        <td>&nbsp;</td>
+        <td><input type="text" name="shipBeforeDate" size="20" maxlength="30" class="inputBox"/>
+          <a href="javascript:call_cal(document.salesentryform.shipBeforeDate,'');">
+            <img src='/images/cal.gif' width='16' height='16' border='0' alt='Calendar'/>
+          </a>
+        </td>
+      </tr>
+    </table>
+  </div>
+</div>
+</form>
+</#if>
\ No newline at end of file

Property changes on: applications/order/webapp/ordermgr/entry/sales/initSalesOrder.ftl
___________________________________________________________________
Name: svn:executable
   + *

Index: applications/order/webapp/ordermgr/entry/purchase/initPurchaseOrder.ftl
===================================================================
--- applications/order/webapp/ordermgr/entry/purchase/initPurchaseOrder.ftl	(revision 0)
+++ applications/order/webapp/ordermgr/entry/purchase/initPurchaseOrder.ftl	(revision 0)
@@ -0,0 +1,203 @@
+<#--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<#assign shoppingCartOrderType = "">
+<#assign shoppingCartProductStore = "NA">
+<#assign shoppingCartChannelType = "">
+<#if shoppingCart?exists>
+  <#assign shoppingCartOrderType = shoppingCart.getOrderType()>
+  <#assign shoppingCartProductStore = shoppingCart.getProductStoreId()?default("NA")>
+  <#assign shoppingCartChannelType = shoppingCart.getChannelType()?default("")>
+</#if>
+
+<#if security.hasEntityPermission("ORDERMGR", "_PURCHASE_CREATE", session)>
+<form method="post" name="poentryform" action="<@ofbizUrl>initializePurchaseOrder</@ofbizUrl>">
+  <div class="screenlet">
+    <div class="screenlet-title-bar">
+      <ul>
+        <li class="head3">${uiLabelMap.OrderPurchaseOrder}<#if shoppingCart?exists>&nbsp;${uiLabelMap.OrderInProgress}</#if></li>
+        <li><a href="javascript:document.poentryform.submit();">${uiLabelMap.CommonContinue}</a></li>
+        <li><a href="/partymgr/control/findparty?externalLoginKey=${externalLoginKey}">${uiLabelMap.PartyFindParty}</a></li>
+      </ul>
+      <br class="clear"/>
+    </div>
+    <div class="screenlet-body">
+      <input type='hidden' name='finalizeMode' value='type'/>
+      <input type='hidden' name='orderMode' value='PURCHASE_ORDER'/>
+      <table width="100%" border='0' cellspacing='0' cellpadding='0' class='boxbottom'>
+        <#if partyId?exists>
+          <#assign thisPartyId = partyId>
+        <#else>
+          <#assign thisPartyId = requestParameters.partyId?if_exists>
+        </#if>
+        <tr>
+          <td>&nbsp;</td>
+          <td align='right' valign='middle' nowrap><div class='tableheadtext'>${uiLabelMap.OrderOrderEntryInternalOrganziation}</div></td>
+          <td>&nbsp;</td>
+          <td valign='middle'>
+            <div class='tabletext' valign='top'>
+              <select class="selectBox" name="billToCustomerPartyId">
+                <#list organizations as organization>
+                  <#assign organizationName = Static["org.ofbiz.party.party.PartyHelper"].getPartyName(organization, true)/>
+                    <#if (organizationName.length() != 0)>
+                      <option value="${organization.partyId}">${organization.partyId} - ${organizationName}</option>
+                    </#if>
+                </#list>
+              </select>
+            </div>
+          </td>
+        </tr>
+        <tr>
+          <td>&nbsp;</td>
+          <td align='right' valign='middle' nowrap><div class='tableheadtext'>${uiLabelMap.PartySupplier}</div></td>
+          <td>&nbsp;</td>
+          <td valign='middle'>
+            <div class='tabletext' valign='top'>
+              <select class="selectBox" name="supplierPartyId">
+                <option value="">${uiLabelMap.PartyNoSupplier}</option>
+                <#list suppliers as supplier>
+                  <option value="${supplier.partyId}"<#if supplier.partyId == thisPartyId> selected</#if>>${Static["org.ofbiz.party.party.PartyHelper"].getPartyName(supplier, true)}</option>
+                </#list>
+              </select>
+            </div>
+          </td>
+        </tr>
+        <tr>
+          <td>&nbsp;</td>
+          <td align='right' valign='middle' nowrap><div class='tableheadtext'>${uiLabelMap.PartyUserLoginId}</div></td>
+          <td>&nbsp;</td>
+          <td valign='middle'>
+            <div class='tabletext' valign='top'>
+              <input type='text' class='inputBox' name='userLoginId' value='${requestParameters.userLoginId?if_exists}'/>
+              <a href="javascript:call_fieldlookup2(document.poentryform.userLoginId,'LookupUserLoginAndPartyDetails');">
+                <img src='/images/fieldlookup.gif' width='15' height='14' border='0' alt='Click here For Field Lookup'/>
+              </a>
+            </div>
+          </td>
+        </tr>
+      </table>
+    </div>
+    <div class="screenlet-title-bar">
+      <ul>
+        <li class="head3">${uiLabelMap.OrderOrderEntryCurrencyAgreementShipDates}</li>
+        <li><a href="javascript:document.agreementForm.submit()">${uiLabelMap.CommonContinue}</a></li>
+      </ul>
+      <br class="clear" />
+    </div>
+    <div class="screenlet-body">
+      <table>
+        <tr><td colspan="4">&nbsp;</td></tr>
+        <#if agreements?exists>
+        <input type='hidden' name='hasAgreements' value='Y'/>
+        <tr>
+          <td>&nbsp;</td>
+          <td align='right' valign='top' nowrap>
+            <div class='tableheadtext'>
+              ${uiLabelMap.OrderSelectAgreement}
+            </div>
+          </td>
+          <td>&nbsp;</td>
+          <td valign='middle'>
+            <div class='tabletext' valign='top'>
+              <select name="agreementId" class="inputBox">
+                <option value="">${uiLabelMap.CommonNone}</option>
+                <#list agreements as agreement>
+                  <option value='${agreement.agreementId}' >${agreement.agreementId} - ${agreement.description?if_exists}</option>
+                </#list>
+              </select>
+            </div>
+          </td>
+        </tr>
+        <#else><input type='hidden' name='hasAgreements' value='N'/>
+        </#if>
+        <tr>
+          <td>&nbsp;</td>
+          <td align='right' valign='middle' class='tableheadtext' nowrap>
+             ${uiLabelMap.OrderOrderName}
+          </td>
+          <td>&nbsp;</td>
+          <td align='left'>
+            <input type='text' class="inputBox" size='60' maxlength='100' name='orderName'/>
+          </td>
+        </tr>
+        <tr>
+          <td>&nbsp;</td>
+          <td align='right' valign='middle' nowrap>
+            <div class='tableheadtext'>
+              <#if agreements?exists>${uiLabelMap.OrderSelectCurrencyOr}
+              <#else>${uiLabelMap.OrderSelectCurrency}
+              </#if>
+            </div>
+          </td>
+          <td>&nbsp;</td>
+          <td valign='middle'>
+            <div class='tabletext' valign='top'>
+              <select class="selectBox" name="currencyUomId">
+                <option value=""></option>
+                <#list currencies as currency>
+                  <option value="${currency.uomId}" <#if (defaultCurrencyUomId?has_content) && (currency.uomId == defaultCurrencyUomId)>selected</#if>>${currency.uomId}</option>
+                </#list>
+              </select>
+            </div>
+          </td>
+        </tr>
+        <tr>
+          <td>&nbsp;</td>
+          <td class="tableheadtext" align="right">
+            ${uiLabelMap.WorkEffortWorkEffortId}
+          </td>
+          <td>&nbsp;</td>
+          <td align="left">
+            <input type="text" name="workEffortId" size="15"/>
+            <a href="javascript:call_fieldlookup2(document.agreementForm.workEffortId,'LookupWorkEffort');"><img src='/images/fieldlookup.gif' width='15' height='14' border='0' alt='Click here For Field Lookup'/></a>
+          </td>
+        </tr>
+        <tr>
+          <td>&nbsp;</td>
+          <td align='right' valign='top' nowrap>
+            <div class='tableheadtext'>
+              ${uiLabelMap.OrderShipAfterDateDefault}
+            </div>
+          </td>
+          <td>&nbsp;</td>
+          <td><input type="text" name="shipAfterDate" size="20" maxlength="30" class="inputBox"/>
+            <a href="javascript:call_cal(document.agreementForm.shipAfterDate,'');">
+              <img src='/images/cal.gif' width='16' height='16' border='0' alt='Calendar'/>
+            </a>
+          </td>
+        </tr>
+        <tr>
+          <td>&nbsp;</td>
+          <td align='right' valign='top' nowrap>
+            <div class='tableheadtext'>
+              ${uiLabelMap.OrderShipBeforeDateDefault}
+            </div>
+          </td>
+          <td>&nbsp;</td>
+          <td><input type="text" name="shipBeforeDate" size="20" maxlength="30" class="inputBox"/>
+            <a href="javascript:call_cal(document.agreementForm.shipBeforeDate,'');">
+              <img src='/images/cal.gif' width='16' height='16' border='0' alt='Calendar'/>
+            </a>
+          </td>
+        </tr>
+      </table>
+    </div>
+  </div>
+</form>
+</#if>
\ No newline at end of file

Property changes on: applications/order/webapp/ordermgr/entry/purchase/initPurchaseOrder.ftl
___________________________________________________________________
Name: svn:executable
   + *

Index: applications/order/webapp/ordermgr/includes/appheader.ftl
===================================================================
--- applications/order/webapp/ordermgr/includes/appheader.ftl	(revision 600143)
+++ applications/order/webapp/ordermgr/includes/appheader.ftl	(working copy)
@@ -35,6 +35,12 @@
     <#if (security.hasEntityPermission("ORDERMGR", "_CREATE", session) || security.hasEntityPermission("ORDERMGR", "_PURCHASE_CREATE", session))>
     <li<#if selected = "orderentry"> class="selected"</#if>><a href="<@ofbizUrl>orderentry</@ofbizUrl>">${uiLabelMap.OrderOrderEntry}</a></li>
     </#if>
+    <#if (security.hasEntityPermission("ORDERMGR", "_CREATE", session) || security.hasEntityPermission("ORDERMGR", "_PURCHASE_CREATE", session))>
+    <li<#if selected = "salesorderentry"> class="selected"</#if>><a href="<@ofbizUrl>salesorderentry</@ofbizUrl>">${uiLabelMap.OrderSalesOrderEntry}</a></li>
+    </#if>
+    <#if (security.hasEntityPermission("ORDERMGR", "_CREATE", session) || security.hasEntityPermission("ORDERMGR", "_PURCHASE_CREATE", session))>
+    <li<#if selected = "poentry"> class="selected"</#if>><a href="<@ofbizUrl>poentry</@ofbizUrl>">${uiLabelMap.OrderPurchaseOrderEntry}</a></li>
+    </#if>
     <#if security.hasEntityPermission("ORDERMGR", "_RETURN", session)>
     <li<#if selected = "return"> class="selected"</#if>><a href="<@ofbizUrl>findreturn</@ofbizUrl>">${uiLabelMap.OrderOrderReturns}</a></li>
     </#if>
Index: applications/order/webapp/ordermgr/WEB-INF/controller.xml
===================================================================
--- applications/order/webapp/ordermgr/WEB-INF/controller.xml	(revision 600143)
+++ applications/order/webapp/ordermgr/WEB-INF/controller.xml	(working copy)
@@ -366,6 +366,38 @@
         <response name="cart" type="view" value="showcart"/>
         <response name="error" type="view" value="checkinits"/>
     </request-map>
+    <request-map uri="salesorderentry">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="initSalesOrder"/>
+    </request-map>
+    <request-map uri="poentry">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="initPurchaseOrder"/>
+    </request-map>
+    <request-map uri="initializeSalesOrder">
+        <security https="true" auth="true"/>
+        <event type="simple" path="org/ofbiz/order/order/CheckOutEvents.xml" invoke="initializeSalesOrder"/>
+        <response name="success" type="request" value="setSalesOrderCurrencyAgreementShipDates"/>
+        <response name="error" type="view" value="initSalesOrder"/>
+    </request-map>
+    <request-map uri="initializePurchaseOrder">
+        <security https="true" auth="true"/>
+        <event type="simple" path="org/ofbiz/order/order/CheckOutEvents.xml" invoke="initializePurchaseOrder"/>
+        <response name="success" type="request" value="setPurchaseOrderCurrencyAgreementShipDates"/>
+        <response name="error" type="view" value="initPurchaseOrder"/>
+    </request-map>
+    <request-map uri="setSalesOrderCurrencyAgreementShipDates">
+        <security https="true" auth="true"/>
+        <event type="simple" path="org/ofbiz/order/order/CheckOutEvents.xml" invoke="setOrderCurrencyAgreementShipDates"/>
+        <response name="success" type="view" value="showcart"/>
+        <response name="error" type="view" value="initSalesOrder"/>
+    </request-map>
+    <request-map uri="setPurchaseOrderCurrencyAgreementShipDates">
+        <security https="true" auth="true"/>
+        <event type="simple" path="org/ofbiz/order/order/CheckOutEvents.xml" invoke="setOrderCurrencyAgreementShipDates"/>
+        <response name="success" type="view" value="showcart"/>
+        <response name="error" type="view" value="initPurchaseOrder"/>
+    </request-map>
     <request-map uri="initorderentry">
         <security https="true" auth="true"/>
         <event type="java" path="org.ofbiz.order.shoppingcart.ShoppingCartEvents" invoke="initializeOrderEntry"/>
@@ -415,9 +447,9 @@
     <request-map uri="additem">
         <security https="true" auth="true"/>
         <event type="java" path="org.ofbiz.order.shoppingcart.ShoppingCartEvents" invoke="addToCart"/>
-        <response name="success" type="request" value="orderentry"/>
+        <response name="success" type="view" value="showcart"/>
         <response name="survey" type="view" value="survey"/>
-        <response name="error" type="request" value="orderentry"/>
+        <response name="error" type="request" value="showcart"/>
     </request-map>
     <request-map uri="additemsurvey">
         <security https="true" auth="true"/>
@@ -1558,6 +1590,8 @@
     <view-map name="survey" type="screen" page="component://order/widget/ordermgr/OrderEntryCartScreens.xml#survey"/>
     <view-map name="showcart" type="screen" page="component://order/widget/ordermgr/OrderEntryCartScreens.xml#ShowCart"/>
     <view-map name="checkinits" type="screen" page="component://order/widget/ordermgr/OrderEntryScreens.xml#CheckInits"/>
+    <view-map name="initSalesOrder" type="screen" page="component://order/widget/ordermgr/OrderEntryScreens.xml#InitSalesOrder"/>
+    <view-map name="initPurchaseOrder" type="screen" page="component://order/widget/ordermgr/OrderEntryScreens.xml#InitPurchaseOrder"/>
     <view-map name="orderagreements" type="screen" page="component://order/widget/ordermgr/OrderEntryScreens.xml#OrderAgreements"/>
     <view-map name="viewshoppinglists" type="screen" page="component://order/widget/ordermgr/OrderEntryScreens.xml#ViewShoppingLists"/>
     <view-map name="addfromshoppinglist" type="screen" page="component://order/widget/ordermgr/OrderEntryScreens.xml#AddFromShoppingList"/>
