You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by Vikas Mayur <vi...@hotwaxmedia.com> on 2009/07/21 12:33:32 UTC

Re: svn commit: r795883 - in /ofbiz/trunk: applications/order/src/org/ofbiz/order/shoppingcart/ applications/order/webapp/ordermgr/WEB-INF/actions/entry/ applications/order/webapp/ordermgr/WEB-INF/actions/order/ applications/order/webapp/ordermgr/entry/ ap...

The functionality of receiving a Purchase Order is broken just after  
this commit. ProductStore is referred while creating an invoice for  
purchase order. See the reference in InvoiceServices class.

Steps to reproduce:
1. Create a purchase order.
2. Approve the order.
3. Under Actions block, Click on Quick Receive Purchase Order
4. Select the Shipment to Receive and click on Receive Selected Shipment
5. Select the checkbox Set Shipment As Received.
6. Click on Receive Selected Product(s)

Please update the trunk with the fix or revert this commit if it takes  
too much time.

Vikas

On Jul 20, 2009, at 9:22 PM, eckardjf@apache.org wrote:

> Author: eckardjf
> Date: Mon Jul 20 15:52:05 2009
> New Revision: 795883
>
> URL: http://svn.apache.org/viewvc?rev=795883&view=rev
> Log:
> Changes to ShoppingCart & order entry to allow PO entry without  
> requiring a ProductStore; updated seed data to remove productStoreId  
> from the OrderEntry website
>
> Modified:
>    ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
> CheckOutHelper.java
>    ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
> ShoppingCart.java
>    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
> entry/OptionSettings.groovy
>    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
> entry/OrderAgreements.groovy
>    ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
> order/OrderView.groovy
>    ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/ 
> showcartitems.ftl
>    ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
> optionsettings.ftl
>    ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
> orderagreements.ftl
>    ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml
>
> Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/ 
> shoppingcart/CheckOutHelper.java
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java?rev=795883&r1=795882&r2=795883&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
> CheckOutHelper.java (original)
> +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
> CheckOutHelper.java Mon Jul 20 15:52:05 2009
> @@ -789,8 +789,6 @@
>     }
>
>     private Map makeTaxContext(int shipGroup, GenericValue  
> shipAddress, Map shoppingCartItemIndexMap) throws GeneralException {
> -        String productStoreId = cart.getProductStoreId();
> -        String billToPartyId = cart.getBillToCustomerPartyId();
>         ShoppingCart.CartShipInfo csi = cart.getShipInfo(shipGroup);
>         int totalItems = csi.shipItemInfo.size();
>
> @@ -839,8 +837,9 @@
>             }
>         }
>
> -        Map serviceContext = UtilMisc.toMap("productStoreId",  
> productStoreId);
> -        serviceContext.put("billToPartyId", billToPartyId);
> +        Map serviceContext = UtilMisc.toMap("productStoreId",  
> cart.getProductStoreId());
> +        serviceContext.put("payToPartyId",  
> cart.getBillFromVendorPartyId());
> +        serviceContext.put("billToPartyId",  
> cart.getBillToCustomerPartyId());
>         serviceContext.put("itemProductList", product);
>         serviceContext.put("itemAmountList", amount);
>         serviceContext.put("itemPriceList", price);
>
> Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/ 
> shoppingcart/ShoppingCart.java
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java?rev=795883&r1=795882&r2=795883&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
> ShoppingCart.java (original)
> +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
> ShoppingCart.java Mon Jul 20 15:52:05 2009
> @@ -231,38 +231,35 @@
>
>     /** Creates new empty ShoppingCart object. */
>     public ShoppingCart(GenericDelegator delegator, String  
> productStoreId, String webSiteId, Locale locale, String currencyUom,  
> String billToCustomerPartyId, String billFromVendorPartyId) {
> +
>         this.delegator = delegator;
>         this.delegatorName = delegator.getDelegatorName();
>         this.productStoreId = productStoreId;
>         this.webSiteId = webSiteId;
> -        this.currencyUom = currencyUom;
> -        this.locale = locale;
> -        if (this.locale == null) {
> -            this.locale = Locale.getDefault();
> -        }
> +        this.locale = (locale != null) ? locale :  
> Locale.getDefault();
> +        this.currencyUom = (currencyUom != null) ? currencyUom :  
> UtilProperties.getPropertyValue("general.properties",  
> "currency.uom.id.default", "USD");
> +        this.billToCustomerPartyId = billToCustomerPartyId;
> +        this.billFromVendorPartyId = billFromVendorPartyId;
>
> -        if (productStoreId == null) {
> -            throw new IllegalArgumentException("productStoreId  
> cannot be null");
> -        }
> +        if (productStoreId != null) {
>
> -        // set the default view cart on add for this store
> -        GenericValue productStore =  
> ProductStoreWorker.getProductStore(productStoreId, delegator);
> -        if (productStore == null) {
> -            throw new IllegalArgumentException("Unable to locate  
> ProductStore by ID [" + productStoreId + "]");
> -        }
> +            // set the default view cart on add for this store
> +            GenericValue productStore =  
> ProductStoreWorker.getProductStore(productStoreId, delegator);
> +            if (productStore == null) {
> +                throw new IllegalArgumentException("Unable to  
> locate ProductStore by ID [" + productStoreId + "]");
> +            }
>
> -        String storeViewCartOnAdd =  
> productStore.getString("viewCartOnAdd");
> -        if (storeViewCartOnAdd != null &&  
> "Y".equalsIgnoreCase(storeViewCartOnAdd)) {
> -            this.viewCartOnAdd = true;
> -        }
> +            String storeViewCartOnAdd =  
> productStore.getString("viewCartOnAdd");
> +            if (storeViewCartOnAdd != null &&  
> "Y".equalsIgnoreCase(storeViewCartOnAdd)) {
> +                this.viewCartOnAdd = true;
> +            }
>
> -        if (billFromVendorPartyId == null) {
> -            // since default cart is of type SALES_ORDER, set to  
> store's payToPartyId
> -            this.billFromVendorPartyId =  
> productStore.getString("payToPartyId");
> -        } else {
> -            this.billFromVendorPartyId = billFromVendorPartyId;
> +            if (billFromVendorPartyId == null) {
> +                // since default cart is of type SALES_ORDER, set  
> to store's payToPartyId
> +                this.billFromVendorPartyId =  
> productStore.getString("payToPartyId");
> +            }
>         }
> -        this.billToCustomerPartyId = billToCustomerPartyId;
> +
>     }
>
>
>
> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/ 
> actions/entry/OptionSettings.groovy
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OptionSettings.groovy?rev=795883&r1=795882&r2=795883&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
> entry/OptionSettings.groovy (original)
> +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
> entry/OptionSettings.groovy Mon Jul 20 15:52:05 2009
> @@ -26,9 +26,13 @@
>
> cart = session.getAttribute("shoppingCart");
> context.cart = cart;
> +
> productStore = ProductStoreWorker.getProductStore(request);
> -productStoreId = productStore.productStoreId;
> -context.productStore = productStore;
> +if (productStore) {
> +    context.productStore = productStore;
> +    context.carrierShipmentMethodList =  
> delegator.findByAndCache('ProductStoreShipmentMethView',  
> [productStoreId: productStore.productStoreId], ['sequenceNumber']);
> +}
> +
> // nuke the event messages
> request.removeAttribute("_EVENT_MESSAGE_");
>
> @@ -39,7 +43,6 @@
>     context.orderPartyId = orderPartyId;
> }
>
> -context.carrierShipmentMethodList =  
> delegator.findByAndCache("ProductStoreShipmentMethView",  
> [productStoreId : productStoreId], ["sequenceNumber"]);
> context.emailList = ContactHelper.getContactMechByType(orderPartyId,  
> "EMAIL_ADDRESS", false);
>
> // create the beforeDate for calendar
> @@ -65,3 +68,4 @@
> toTs = new Timestamp(toCal.getTimeInMillis());
> toStr = toTs.toString();
> context.afterDateStr = toStr;
> +
>
> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/ 
> actions/entry/OrderAgreements.groovy
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OrderAgreements.groovy?rev=795883&r1=795882&r2=795883&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
> entry/OrderAgreements.groovy (original)
> +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
> entry/OrderAgreements.groovy Mon Jul 20 15:52:05 2009
> @@ -17,85 +17,80 @@
>  * under the License.
>  */
>
> -import org.ofbiz.service.*;
> -import org.ofbiz.entity.*;
> -import org.ofbiz.entity.condition.*;
> -import org.ofbiz.entity.util.*;
> -import org.ofbiz.base.util.*;
> -import org.ofbiz.order.shoppingcart.*;
> -import org.ofbiz.party.party.PartyWorker;
> -import org.ofbiz.product.catalog.CatalogWorker;
> -import org.ofbiz.product.store.ProductStoreWorker;
> -import org.ofbiz.order.shoppingcart.product.ProductDisplayWorker;
> -import org.ofbiz.order.shoppingcart.product.ProductPromoWorker;
> import org.ofbiz.entity.condition.EntityCondition;
> -import org.ofbiz.entity.condition.EntityExpr;
> import org.ofbiz.entity.condition.EntityOperator;
> -import javolution.util.FastList;
> +import org.ofbiz.entity.util.EntityUtil;
> +import org.ofbiz.order.shoppingcart.*;
> +import org.ofbiz.product.catalog.CatalogWorker;
>
>
> -// Get the Cart and Prepare Size
> shoppingCart = ShoppingCartEvents.getCartObject(request);
> context.cart = shoppingCart;
>
> -// check the selected product store
> +// get applicable agreements for order entry
> +if ('PURCHASE_ORDER'.equals(shoppingCart.getOrderType())) {
> +
> +    // for a purchase order, orderPartyId = billFromVendor (the  
> supplier)
> +    supplierPartyId = shoppingCart.getOrderPartyId();
> +    customerPartyId = shoppingCart.getBillToCustomerPartyId();
> +
> +    // the agreement for a purchse order is from us to the supplier
> +    agreementCondition = EntityCondition.makeCondition([
> +            EntityCondition.makeCondition('partyIdTo',  
> EntityOperator.EQUALS, supplierPartyId),
> +            EntityCondition.makeCondition('partyIdFrom',  
> EntityOperator.EQUALS, customerPartyId)
> +    ], EntityOperator.AND);
> +
> +    agreementRoleCondition = EntityCondition.makeCondition([
> +            EntityCondition.makeCondition('partyId',  
> EntityOperator.EQUALS, supplierPartyId),
> +            EntityCondition.makeCondition('roleTypeId',  
> EntityOperator.EQUALS, 'SUPPLIER')
> +    ], EntityOperator.AND);
> +
> +} else {
> +
> +    // for a sales order, orderPartyId = billToCustomer (the  
> customer)
> +    customerPartyId = shoppingCart.getOrderPartyId();
> +    companyPartyId = shoppingCart.getBillFromVendorPartyId();
> +
> +    // the agreement for a sales order is from the customer to us
> +    agreementCondition = EntityCondition.makeCondition([
> +            EntityCondition.makeCondition('partyIdTo',  
> EntityOperator.EQUALS, companyPartyId),
> +            EntityCondition.makeCondition('partyIdFrom',  
> EntityOperator.EQUALS, customerPartyId)
> +    ], EntityOperator.AND);
> +
> +    agreementRoleCondition = EntityCondition.makeCondition([
> +            EntityCondition.makeCondition('partyId',  
> EntityOperator.EQUALS, customerPartyId),
> +            EntityCondition.makeCondition('roleTypeId',  
> EntityOperator.EQUALS, 'CUSTOMER')
> +    ], EntityOperator.AND);
> +
> +}
> +
> +agreements = delegator.findList('Agreement', agreementCondition,  
> null, null, null, true);
> +agreements = EntityUtil.filterByDate(agreements);
> +if (agreements) {
> +    context.agreements = agreements;
> +}
> +
> +agreementRoles = delegator.findList('AgreementRole',  
> agreementRoleCondition, null, null, null, true);
> +if (agreementRoles) {
> +    context.agreementRoles = agreementRoles;
> +}
> +
> +// catalog id collection, current catalog id and name
> productStoreId = shoppingCart.getProductStoreId();
> -productStore = null;
> -if (productStoreId) {
> -    productStore =  
> ProductStoreWorker.getProductStore(productStoreId, delegator);
> -    if (productStore) {
> -        // put in the default currency, to help selecting a  
> currency for a purchase order
> -        context.defaultCurrencyUomId =  
> productStore.defaultCurrencyUomId;
> -        payToPartyId = productStore.payToPartyId;
> -        partyId = shoppingCart.getOrderPartyId();
> -
> -        exprsAgreements = FastList.newInstance();
> -        exprsAgreementRoles = FastList.newInstance();
> -        // get applicable agreements for order entry
> -        if ("PURCHASE_ORDER".equals(shoppingCart.getOrderType())) {
> -            // the agreement for a PO is from customer to  
> payToParty (ie, us)
> -             
> exprsAgreements.add(EntityCondition.makeCondition("partyIdTo",  
> EntityOperator.EQUALS, partyId));
> -             
> exprsAgreements.add(EntityCondition.makeCondition("partyIdFrom",  
> EntityOperator.EQUALS, payToPartyId));
> -            agreements = delegator.findList("Agreement",  
> EntityCondition.makeCondition(exprsAgreements, EntityOperator.AND),  
> null, null, null, true);
> -             
> exprsAgreementRoles.add(EntityCondition.makeCondition("partyId",  
> EntityOperator.EQUALS, partyId));
> -             
> exprsAgreementRoles.add(EntityCondition.makeCondition("roleTypeId",  
> EntityOperator.EQUALS, "SUPPLIER"));
> -            agreementRoles = delegator.findList("AgreementRole",  
> EntityCondition.makeCondition(exprsAgreementRoles,  
> EntityOperator.AND), null, null, null, true);
> -            catalogCol = CatalogWorker.getAllCatalogIds(request);
> -        } else {
> -            // the agreement for a sales order is from us to the  
> customer
> -             
> exprsAgreements.add(EntityCondition.makeCondition("partyIdTo",  
> EntityOperator.EQUALS, payToPartyId));
> -             
> exprsAgreements.add(EntityCondition.makeCondition("partyIdFrom",  
> EntityOperator.EQUALS, partyId));
> -            agreements = delegator.findList("Agreement",  
> EntityCondition.makeCondition(exprsAgreements, EntityOperator.AND),  
> null, null, null, true);
> -             
> exprsAgreementRoles.add(EntityCondition.makeCondition("partyId",  
> EntityOperator.EQUALS, partyId));
> -             
> exprsAgreementRoles.add(EntityCondition.makeCondition("roleTypeId",  
> EntityOperator.EQUALS, "CUSTOMER"));
> -            agreementRoles = delegator.findList("AgreementRole",  
> EntityCondition.makeCondition(exprsAgreementRoles,  
> EntityOperator.AND), null, null, null, true);
> -            catalogCol =  
> CatalogWorker.getCatalogIdsAvailable(delegator, productStoreId,  
> partyId);
> -        }
> -
> -        agreements = EntityUtil.filterByDate(agreements);
> -        if (agreements) {
> -            context.agreements = agreements;
> -        }
> -        if (agreementRoles) {
> -            context.agreementRoles =agreementRoles;
> -        }
> -
> -
> -        if (catalogCol) {
> -            currentCatalogId = catalogCol.get(0);
> -            currentCatalogName =  
> CatalogWorker.getCatalogName(request, currentCatalogId);
> -            context.catalogCol = catalogCol;
> -            context.currentCatalogId = currentCatalogId;
> -            context.currentCatalogName = currentCatalogName;
> -        }
> -    }
> +if ('SALES_ORDER' == shoppingCart.getOrderType() && productStoreId) {
> +    catalogCol = CatalogWorker.getCatalogIdsAvailable(delegator,  
> productStoreId, shoppingCart.getOrderPartyId());
> +} else {
> +    catalogCol = CatalogWorker.getAllCatalogIds(request);
> }
>
> -partyId = shoppingCart.getPartyId();
> -if ("_NA_".equals(partyId)) partyId = null;
> -context.partyId = partyId;
> +if (catalogCol) {
> +    context.catalogCol = catalogCol;
> +
> +    currentCatalogId = catalogCol.get(0);
> +    context.currentCatalogId = currentCatalogId;
> +    context.currentCatalogName =  
> CatalogWorker.getCatalogName(request, currentCatalogId);
> +}
>
> // currencies and shopping cart currency
> -currencies = delegator.findByAndCache("Uom", [uomTypeId :  
> "CURRENCY_MEASURE"]);
> -context.currencies = currencies;
> +context.currencies = delegator.findByAndCache('Uom', [uomTypeId:  
> 'CURRENCY_MEASURE']);
> context.currencyUomId = shoppingCart.getCurrency();
>
> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/ 
> actions/order/OrderView.groovy
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy?rev=795883&r1=795882&r2=795883&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
> order/OrderView.groovy (original)
> +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
> order/OrderView.groovy Mon Jul 20 15:52:05 2009
> @@ -386,9 +386,9 @@
>     context.shippingContactMechList = shippingContactMechList;
>
>     // list to find all the shipmentMethods from the view named  
> "ProductStoreShipmentMethView".
> -    productStoreId =  
> orderHeader.getRelatedOne("ProductStore").productStoreId;
> -    productStoreShipmentMethList =  
> delegator.findByAndCache("ProductStoreShipmentMethView",  
> [productStoreId : productStoreId], ["sequenceNumber"]);
> -    context.productStoreShipmentMethList =  
> productStoreShipmentMethList;
> +    if (productStore) {
> +        context.productStoreShipmentMethList =  
> delegator.findByAndCache('ProductStoreShipmentMethView',  
> [productStoreId: productStore.productStoreId], ['sequenceNumber']);
> +    }
>
>     // Get a map of returnable items
>     returnableItems = [:];
> @@ -400,8 +400,8 @@
>
>     // get the catalogIds for appending items
>     if (context.request != null) {
> -        if ("SALES_ORDER".equals(orderType)) {
> -            catalogCol =  
> CatalogWorker.getCatalogIdsAvailable(delegator, productStoreId,  
> partyId);
> +        if ("SALES_ORDER".equals(orderType) && productStore) {
> +            catalogCol =  
> CatalogWorker.getCatalogIdsAvailable(delegator,  
> productStore.productStoreId, partyId);
>         } else {
>             catalogCol = CatalogWorker.getAllCatalogIds(request);
>         }
> @@ -441,8 +441,8 @@
>         context.shipmentRouteSegmentId =  
> shipmentRouteSegment.shipmentRouteSegmentId;
>         context.pickedShipmentId = pickedShipmentId;
>         if (pickedShipmentId &&  
> shipmentRouteSegment.trackingIdNumber) {
> -            if ("UPS" == shipmentRouteSegment.carrierPartyId) {
> -                resultMap =  
> dispatcher.runSync("upsShipmentAlternateRatesEstimate", 
> [productStoreId : productStoreId, shipmentId : pickedShipmentId]);
> +            if ("UPS" == shipmentRouteSegment.carrierPartyId &&  
> productStore) {
> +                resultMap =  
> dispatcher.runSync('upsShipmentAlternateRatesEstimate',  
> [productStoreId: productStore.productStoreId, shipmentId:  
> pickedShipmentId]);
>                 shippingRates = resultMap.shippingRates;
>                 shippingRateList = [];
>                 shippingRates.each { shippingRate ->
>
> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/ 
> showcartitems.ftl
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/showcartitems.ftl?rev=795883&r1=795882&r2=795883&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/ 
> showcartitems.ftl (original)
> +++ ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/ 
> showcartitems.ftl Mon Jul 20 15:52:05 2009
> @@ -39,7 +39,7 @@
>           <td colspan="2">
>             <div>
>               <b>${uiLabelMap.ProductProduct}</b>
> -              <#if productStore.showCheckoutGiftOptions?if_exists ! 
> = "N">
> +              <#if (shoppingCart.getOrderType() == 'SALES_ORDER')  
> && (productStore.showCheckoutGiftOptions)?default('Y') != 'N'>
>                   <select name="GWALL"  
> onchange="javascript:gwAll(this);">
>                     <option value="">$ 
> {uiLabelMap.OrderGiftWrapAllItems}</option>
>                     <option value="NO^">$ 
> {uiLabelMap.OrderNoGiftWrap}</option>
>
> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
> optionsettings.ftl
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/optionsettings.ftl?rev=795883&r1=795882&r2=795883&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
> optionsettings.ftl (original)
> +++ ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
> optionsettings.ftl Mon Jul 20 15:52:05 2009
> @@ -139,34 +139,34 @@
>                     <textarea cols="30" rows="3" name="$ 
> {shipGroupIndex?default("0")}_shipping_instructions">$ 
> {cart.getShippingInstructions(shipGroupIndex)?if_exists}</textarea>
>                   </td>
>                 </tr>
> -                <#if productStore.showCheckoutGiftOptions? 
> if_exists != "N">
> -                <tr>
> -                  <td colspan="2">
> -                    <#if cart.getOrderType() = "PURCHASE_ORDER">
> -                       <input type='hidden' name='${shipGroupIndex? 
> default("0")}_is_gift' value='false'>
> -                    <#else>
> -                    <div>
> -                      <span class="h2"><b>$ 
> {uiLabelMap.OrderIsThisGift}</b></span>
> -                      <input type='radio' <#if  
> cart.getIsGift(shipGroupIndex)?default("Y") == "Y">checked</#if>  
> name='${shipGroupIndex?default("0")}_is_gift' value='true'><span  
> class='tabletext'>${uiLabelMap.CommonYes}</span>
> -                      <input type='radio' <#if  
> cart.getIsGift(shipGroupIndex)?default("N") == "N">checked</#if>  
> name='${shipGroupIndex?default("0")}_is_gift' value='false'><span  
> class='tabletext'>${uiLabelMap.CommonNo}</span>
> -                    </div>
> +
> +                <#if cart.getOrderType() == 'PURCHASE_ORDER'>
> +                    <input type="hidden" name="${shipGroupIndex? 
> default('0')}_is_gift" value="false">
> +                <#else>
> +                    <#if (productStore.showCheckoutGiftOptions)? 
> default('Y') != 'N'>
> +                        <tr>
> +                            <td colspan="2">
> +                                <div>
> +                                    <span class="h2"><b>$ 
> {uiLabelMap.OrderIsThisGift}</b></span>
> +                                    <input type="radio" <#if  
> cart.getIsGift(shipGroupIndex)?default('Y') ==  
> 'Y'>checked="checked"</#if> name="${shipGroupIndex? 
> default('0')}_is_gift" value="true"><span class="tabletext">$ 
> {uiLabelMap.CommonYes}</span>
> +                                    <input type="radio" <#if  
> cart.getIsGift(shipGroupIndex)?default('N') ==  
> 'N'>checked="checked"</#if> name="${shipGroupIndex? 
> default('0')}_is_gift" value="false"><span class="tabletext">$ 
> {uiLabelMap.CommonNo}</span>
> +                                </div>
> +                            </td>
> +                        </tr>
>                     </#if>
> -                  </td>
> -                </tr>
> -                <#if cart.getOrderType() != "PURCHASE_ORDER">
> -                <tr><td colspan="2"><hr/></td></tr>
> -                <tr>
> -                  <td colspan="2">
> -                    <h2>${uiLabelMap.OrderGiftMessage}</h2>
> -                  </td>
> -                </tr>
> -                <tr>
> -                  <td colspan="2">
> -                    <textarea cols="30" rows="3" name="$ 
> {shipGroupIndex?default("0")}_gift_message">$ 
> {cart.getGiftMessage(shipGroupIndex)?if_exists}</textarea>
> -                  </td>
> -                </tr>
> -                 </#if>
> +                    <tr><td colspan="2"><hr /></td></tr>
> +                    <tr>
> +                        <td colspan="2">
> +                            <h2>${uiLabelMap.OrderGiftMessage}</h2>
> +                        </td>
> +                    </tr>
> +                    <tr>
> +                        <td colspan="2">
> +                            <textarea cols="30" rows="3" name="$ 
> {shipGroupIndex?default('0')}_gift_message">$ 
> {cart.getGiftMessage(shipGroupIndex)?if_exists}</textarea>
> +                        </td>
> +                    </tr>
>                 </#if>
> +
>                    <tr>
>                       <td colspan="2"></td>
>                    </tr>
>
> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
> orderagreements.ftl
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/orderagreements.ftl?rev=795883&r1=795882&r2=795883&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
> orderagreements.ftl (original)
> +++ ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
> orderagreements.ftl Mon Jul 20 15:52:05 2009
> @@ -128,7 +128,7 @@
>             <select 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>
> +              <option value="${currency.uomId}" <#if currencyUomId? 
> default('') == currency.uomId>selected="selected"</#if> >$ 
> {currency.uomId}</option>
>               </#list>
>             </select>
>           </div>
> @@ -143,11 +143,9 @@
>         <td>&nbsp;</td>
>         <td>
>            <select name='CURRENT_CATALOG_ID'>
> -            <option value='${currentCatalogId}'>$ 
> {currentCatalogName}</option>
> -            <option value='${currentCatalogId}'></option>
> -            <#list catalogCol as catalogId>
> +            <#list catalogCol?if_exists as catalogId>
>               <#assign thisCatalogName =  
> Static 
> ["org.ofbiz.product.catalog.CatalogWorker"].getCatalogName(request,  
> catalogId)>
> -              <option value='${catalogId}'>${thisCatalogName}</ 
> option>
> +              <option value="${catalogId}" <#if currentCatalogId? 
> default('') == catalogId>selected="selected"</#if> >$ 
> {thisCatalogName}</option>
>             </#list>
>           </select>
>         </td>
>
> Modified: ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml?rev=795883&r1=795882&r2=795883&view=diff
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml  
> (original)
> +++ ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml Mon  
> Jul 20 15:52:05 2009
> @@ -111,8 +111,6 @@
>
>     <WebSite webSiteId="WebStore" siteName="eCommerce Web Site"  
> productStoreId="9000" visualThemeSetId="ECOMMERCE"/>
>     <WebSite webSiteId="WebStoreClone" siteName="Cloned eCommerce  
> Web Site" productStoreId="9000" visualThemeSetId="ECOMMERCE"/>
> -    <!-- the following item is defined in the OrderTypeData.xml  
> file and just the productStoreId is being associated with it here -->
> -    <WebSite webSiteId="OrderEntry" productStoreId="9000"/>
>
>     <ProdCatalog prodCatalogId="DemoCatalog" catalogName="Demo  
> Catalog" useQuickAdd="Y"/>
>     <ProdCatalog prodCatalogId="TestCatalog" catalogName="Test  
> Catalog" useQuickAdd="N"/>
>
>


Re: svn commit: r795883 - in /ofbiz/trunk: applications/order/src/org/ofbiz/order/shoppingcart/ applications/order/webapp/ordermgr/WEB-INF/actions/entry/ applications/order/webapp/ordermgr/WEB-INF/actions/order/ applications/order/webapp/ordermgr/entry/ ap...

Posted by Joe Eckard <jo...@redrocketcorp.com>.
Can you be more specific?

On Jul 22, 2009, at 5:31 AM, Sumit Pandit wrote:

> Hello Joe,
>
> PO is still breaking, I am blocked! Please do needful to get this  
> issue fixed.
>
> --
> Thanks And Regards
> Sumit Pandit
> On Jul 21, 2009, at 9:05 PM, Joe Eckard wrote:
>
>> Thanks for the report - there is an initial fix in place now with  
>> rev. 796349. Some of the assumptions being made now need a good  
>> review, I will continue looking into it as I can find some time.
>>
>> -Joe
>>
>> On Jul 21, 2009, at 6:33 AM, Vikas Mayur wrote:
>>
>>> The functionality of receiving a Purchase Order is broken just  
>>> after this commit. ProductStore is referred while creating an  
>>> invoice for purchase order. See the reference in InvoiceServices  
>>> class.
>>>
>>> Steps to reproduce:
>>> 1. Create a purchase order.
>>> 2. Approve the order.
>>> 3. Under Actions block, Click on Quick Receive Purchase Order
>>> 4. Select the Shipment to Receive and click on Receive Selected  
>>> Shipment
>>> 5. Select the checkbox Set Shipment As Received.
>>> 6. Click on Receive Selected Product(s)
>>>
>>> Please update the trunk with the fix or revert this commit if it  
>>> takes too much time.
>>>
>>> Vikas
>>>
>>> On Jul 20, 2009, at 9:22 PM, eckardjf@apache.org wrote:
>>>
>>>> Author: eckardjf
>>>> Date: Mon Jul 20 15:52:05 2009
>>>> New Revision: 795883
>>>>
>>>> URL: http://svn.apache.org/viewvc?rev=795883&view=rev
>>>> Log:
>>>> Changes to ShoppingCart & order entry to allow PO entry without  
>>>> requiring a ProductStore; updated seed data to remove  
>>>> productStoreId from the OrderEntry website
>>>>
>>>> Modified:
>>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>>>> CheckOutHelper.java
>>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>>>> ShoppingCart.java
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>> entry/OptionSettings.groovy
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>> entry/OrderAgreements.groovy
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>> order/OrderView.groovy
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/ 
>>>> showcartitems.ftl
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>>> optionsettings.ftl
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>>> orderagreements.ftl
>>>> ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml
>>>>
>>


Re: svn commit: r795883 - in /ofbiz/trunk: applications/order/src/org/ofbiz/order/shoppingcart/ applications/order/webapp/ordermgr/WEB-INF/actions/entry/ applications/order/webapp/ordermgr/WEB-INF/actions/order/ applications/order/webapp/ordermgr/entry/ ap...

Posted by Sumit Pandit <su...@hotwaxmedia.com>.
Joe,
Recently I took update and My issue would fixed in r796823.

--
Thanks For the Contribution.
Sumit Pandit

On Jul 23, 2009, at 11:10 AM, Sumit Pandit wrote:

> Hello Joe,
>
> I am not able to add any product at "addItem" page, when I tried  
> then got NullPointerException.  (Tried with product ids  - GZ-2644  
> or GZ-8544 or MAT_A_COST  ....)
> Where when I tried to add any product via "BulkAddProducts" I can do  
> it successfully.
> I am getting above issue with fresh database. (I am at Revision:  
> 796630)
>
> Let me know if I am missing any thing.
>
> --
> Thanks And Regards
> Sumit Pandit
>
>
> On Jul 22, 2009, at 8:00 PM, Joe Eckard wrote:
>
>> I was able to place and receive POs (and create invoices) after  
>> this patch following the steps below.
>>
>> -Joe
>>
>> On Jul 22, 2009, at 5:31 AM, Sumit Pandit wrote:
>>
>>> Hello Joe,
>>>
>>> PO is still breaking, I am blocked! Please do needful to get this  
>>> issue fixed.
>>>
>>> --
>>> Thanks And Regards
>>> Sumit Pandit
>>> On Jul 21, 2009, at 9:05 PM, Joe Eckard wrote:
>>>
>>>> Thanks for the report - there is an initial fix in place now with  
>>>> rev. 796349. Some of the assumptions being made now need a good  
>>>> review, I will continue looking into it as I can find some time.
>>>>
>>>> -Joe
>>>>
>>>> On Jul 21, 2009, at 6:33 AM, Vikas Mayur wrote:
>>>>
>>>>> The functionality of receiving a Purchase Order is broken just  
>>>>> after this commit. ProductStore is referred while creating an  
>>>>> invoice for purchase order. See the reference in InvoiceServices  
>>>>> class.
>>>>>
>>>>> Steps to reproduce:
>>>>> 1. Create a purchase order.
>>>>> 2. Approve the order.
>>>>> 3. Under Actions block, Click on Quick Receive Purchase Order
>>>>> 4. Select the Shipment to Receive and click on Receive Selected  
>>>>> Shipment
>>>>> 5. Select the checkbox Set Shipment As Received.
>>>>> 6. Click on Receive Selected Product(s)
>>>>>
>>>>> Please update the trunk with the fix or revert this commit if it  
>>>>> takes too much time.
>>>>>
>>>>> Vikas
>>>>>
>>>>> On Jul 20, 2009, at 9:22 PM, eckardjf@apache.org wrote:
>>>>>
>>>>>> Author: eckardjf
>>>>>> Date: Mon Jul 20 15:52:05 2009
>>>>>> New Revision: 795883
>>>>>>
>>>>>> URL: http://svn.apache.org/viewvc?rev=795883&view=rev
>>>>>> Log:
>>>>>> Changes to ShoppingCart & order entry to allow PO entry without  
>>>>>> requiring a ProductStore; updated seed data to remove  
>>>>>> productStoreId from the OrderEntry website
>>>>>>
>>>>>> Modified:
>>>>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>>>>>> CheckOutHelper.java
>>>>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>>>>>> ShoppingCart.java
>>>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>>>> entry/OptionSettings.groovy
>>>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>>>> entry/OrderAgreements.groovy
>>>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>>>> order/OrderView.groovy
>>>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/ 
>>>>>> showcartitems.ftl
>>>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>>>>> optionsettings.ftl
>>>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>>>>> orderagreements.ftl
>>>>>> ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml
>>>>>>
>>>>
>>
>


Re: svn commit: r795883 - in /ofbiz/trunk: applications/order/src/org/ofbiz/order/shoppingcart/ applications/order/webapp/ordermgr/WEB-INF/actions/entry/ applications/order/webapp/ordermgr/WEB-INF/actions/order/ applications/order/webapp/ordermgr/entry/ ap...

Posted by Sumit Pandit <su...@hotwaxmedia.com>.
Hello Joe,

I am not able to add any product at "addItem" page, when I tried then  
got NullPointerException.  (Tried with product ids  - GZ-2644 or  
GZ-8544 or MAT_A_COST  ....)
Where when I tried to add any product via "BulkAddProducts" I can do  
it successfully.
I am getting above issue with fresh database. (I am at Revision: 796630)

Let me know if I am missing any thing.

--
Thanks And Regards
Sumit Pandit


On Jul 22, 2009, at 8:00 PM, Joe Eckard wrote:

> I was able to place and receive POs (and create invoices) after this  
> patch following the steps below.
>
> -Joe
>
> On Jul 22, 2009, at 5:31 AM, Sumit Pandit wrote:
>
>> Hello Joe,
>>
>> PO is still breaking, I am blocked! Please do needful to get this  
>> issue fixed.
>>
>> --
>> Thanks And Regards
>> Sumit Pandit
>> On Jul 21, 2009, at 9:05 PM, Joe Eckard wrote:
>>
>>> Thanks for the report - there is an initial fix in place now with  
>>> rev. 796349. Some of the assumptions being made now need a good  
>>> review, I will continue looking into it as I can find some time.
>>>
>>> -Joe
>>>
>>> On Jul 21, 2009, at 6:33 AM, Vikas Mayur wrote:
>>>
>>>> The functionality of receiving a Purchase Order is broken just  
>>>> after this commit. ProductStore is referred while creating an  
>>>> invoice for purchase order. See the reference in InvoiceServices  
>>>> class.
>>>>
>>>> Steps to reproduce:
>>>> 1. Create a purchase order.
>>>> 2. Approve the order.
>>>> 3. Under Actions block, Click on Quick Receive Purchase Order
>>>> 4. Select the Shipment to Receive and click on Receive Selected  
>>>> Shipment
>>>> 5. Select the checkbox Set Shipment As Received.
>>>> 6. Click on Receive Selected Product(s)
>>>>
>>>> Please update the trunk with the fix or revert this commit if it  
>>>> takes too much time.
>>>>
>>>> Vikas
>>>>
>>>> On Jul 20, 2009, at 9:22 PM, eckardjf@apache.org wrote:
>>>>
>>>>> Author: eckardjf
>>>>> Date: Mon Jul 20 15:52:05 2009
>>>>> New Revision: 795883
>>>>>
>>>>> URL: http://svn.apache.org/viewvc?rev=795883&view=rev
>>>>> Log:
>>>>> Changes to ShoppingCart & order entry to allow PO entry without  
>>>>> requiring a ProductStore; updated seed data to remove  
>>>>> productStoreId from the OrderEntry website
>>>>>
>>>>> Modified:
>>>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>>>>> CheckOutHelper.java
>>>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>>>>> ShoppingCart.java
>>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>>> entry/OptionSettings.groovy
>>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>>> entry/OrderAgreements.groovy
>>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>>> order/OrderView.groovy
>>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/ 
>>>>> showcartitems.ftl
>>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>>>> optionsettings.ftl
>>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>>>> orderagreements.ftl
>>>>> ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml
>>>>>
>>>
>


Re: svn commit: r795883 - in /ofbiz/trunk: applications/order/src/org/ofbiz/order/shoppingcart/ applications/order/webapp/ordermgr/WEB-INF/actions/entry/ applications/order/webapp/ordermgr/WEB-INF/actions/order/ applications/order/webapp/ordermgr/entry/ ap...

Posted by Jacopo Cappellato <ja...@hotwaxmedia.com>.
I am not reporting any error, my comment was a response to David's mail.

Jacopo


On Jul 22, 2009, at 5:21 PM, Joe Eckard wrote:

> It doesn't appear to be broken for me, could you describe what  
> errors you see?
>
> -Joe
>
> On Jul 22, 2009, at 10:56 AM, Jacopo Cappellato wrote:
>
>> Hi Joe,
>>
>> On Jul 22, 2009, at 4:30 PM, Joe Eckard wrote:
>>
>>> I was able to place and receive POs (and create invoices) after  
>>> this patch following the steps below.
>>>
>>
>> What you describe above is the 'high level' process I was referring  
>> to.
>>
>> Jacopo
>>
>>
>>> -Joe
>>>
>>> On Jul 22, 2009, at 5:31 AM, Sumit Pandit wrote:
>>>
>>>> Hello Joe,
>>>>
>>>> PO is still breaking, I am blocked! Please do needful to get this  
>>>> issue fixed.
>>>>
>>>> --
>>>> Thanks And Regards
>>>> Sumit Pandit
>>>> On Jul 21, 2009, at 9:05 PM, Joe Eckard wrote:
>>>>
>>>>> Thanks for the report - there is an initial fix in place now  
>>>>> with rev. 796349. Some of the assumptions being made now need a  
>>>>> good review, I will continue looking into it as I can find some  
>>>>> time.
>>>>>
>>>>> -Joe
>>>>>
>>>>> On Jul 21, 2009, at 6:33 AM, Vikas Mayur wrote:
>>>>>
>>>>>> The functionality of receiving a Purchase Order is broken just  
>>>>>> after this commit. ProductStore is referred while creating an  
>>>>>> invoice for purchase order. See the reference in  
>>>>>> InvoiceServices class.
>>>>>>
>>>>>> Steps to reproduce:
>>>>>> 1. Create a purchase order.
>>>>>> 2. Approve the order.
>>>>>> 3. Under Actions block, Click on Quick Receive Purchase Order
>>>>>> 4. Select the Shipment to Receive and click on Receive Selected  
>>>>>> Shipment
>>>>>> 5. Select the checkbox Set Shipment As Received.
>>>>>> 6. Click on Receive Selected Product(s)
>>>>>>
>>>>>> Please update the trunk with the fix or revert this commit if  
>>>>>> it takes too much time.
>>>>>>
>>>>>> Vikas
>>>>>>
>>>>>> On Jul 20, 2009, at 9:22 PM, eckardjf@apache.org wrote:
>>>>>>
>>>>>>> Author: eckardjf
>>>>>>> Date: Mon Jul 20 15:52:05 2009
>>>>>>> New Revision: 795883
>>>>>>>
>>>>>>> URL: http://svn.apache.org/viewvc?rev=795883&view=rev
>>>>>>> Log:
>>>>>>> Changes to ShoppingCart & order entry to allow PO entry  
>>>>>>> without requiring a ProductStore; updated seed data to remove  
>>>>>>> productStoreId from the OrderEntry website
>>>>>>>
>>>>>>> Modified:
>>>>>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/ 
>>>>>>> shoppingcart/CheckOutHelper.java
>>>>>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/ 
>>>>>>> shoppingcart/ShoppingCart.java
>>>>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>>>>> entry/OptionSettings.groovy
>>>>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>>>>> entry/OrderAgreements.groovy
>>>>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>>>>> order/OrderView.groovy
>>>>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/ 
>>>>>>> showcartitems.ftl
>>>>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>>>>>> optionsettings.ftl
>>>>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>>>>>> orderagreements.ftl
>>>>>>> ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml
>>>>>>>
>>>>>
>>>
>


Re: svn commit: r795883 - in /ofbiz/trunk: applications/order/src/org/ofbiz/order/shoppingcart/ applications/order/webapp/ordermgr/WEB-INF/actions/entry/ applications/order/webapp/ordermgr/WEB-INF/actions/order/ applications/order/webapp/ordermgr/entry/ ap...

Posted by Joe Eckard <jo...@redrocketcorp.com>.
It doesn't appear to be broken for me, could you describe what errors  
you see?

-Joe

On Jul 22, 2009, at 10:56 AM, Jacopo Cappellato wrote:

> Hi Joe,
>
> On Jul 22, 2009, at 4:30 PM, Joe Eckard wrote:
>
>> I was able to place and receive POs (and create invoices) after  
>> this patch following the steps below.
>>
>
> What you describe above is the 'high level' process I was referring  
> to.
>
> Jacopo
>
>
>> -Joe
>>
>> On Jul 22, 2009, at 5:31 AM, Sumit Pandit wrote:
>>
>>> Hello Joe,
>>>
>>> PO is still breaking, I am blocked! Please do needful to get this  
>>> issue fixed.
>>>
>>> --
>>> Thanks And Regards
>>> Sumit Pandit
>>> On Jul 21, 2009, at 9:05 PM, Joe Eckard wrote:
>>>
>>>> Thanks for the report - there is an initial fix in place now with  
>>>> rev. 796349. Some of the assumptions being made now need a good  
>>>> review, I will continue looking into it as I can find some time.
>>>>
>>>> -Joe
>>>>
>>>> On Jul 21, 2009, at 6:33 AM, Vikas Mayur wrote:
>>>>
>>>>> The functionality of receiving a Purchase Order is broken just  
>>>>> after this commit. ProductStore is referred while creating an  
>>>>> invoice for purchase order. See the reference in InvoiceServices  
>>>>> class.
>>>>>
>>>>> Steps to reproduce:
>>>>> 1. Create a purchase order.
>>>>> 2. Approve the order.
>>>>> 3. Under Actions block, Click on Quick Receive Purchase Order
>>>>> 4. Select the Shipment to Receive and click on Receive Selected  
>>>>> Shipment
>>>>> 5. Select the checkbox Set Shipment As Received.
>>>>> 6. Click on Receive Selected Product(s)
>>>>>
>>>>> Please update the trunk with the fix or revert this commit if it  
>>>>> takes too much time.
>>>>>
>>>>> Vikas
>>>>>
>>>>> On Jul 20, 2009, at 9:22 PM, eckardjf@apache.org wrote:
>>>>>
>>>>>> Author: eckardjf
>>>>>> Date: Mon Jul 20 15:52:05 2009
>>>>>> New Revision: 795883
>>>>>>
>>>>>> URL: http://svn.apache.org/viewvc?rev=795883&view=rev
>>>>>> Log:
>>>>>> Changes to ShoppingCart & order entry to allow PO entry without  
>>>>>> requiring a ProductStore; updated seed data to remove  
>>>>>> productStoreId from the OrderEntry website
>>>>>>
>>>>>> Modified:
>>>>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>>>>>> CheckOutHelper.java
>>>>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>>>>>> ShoppingCart.java
>>>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>>>> entry/OptionSettings.groovy
>>>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>>>> entry/OrderAgreements.groovy
>>>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>>>> order/OrderView.groovy
>>>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/ 
>>>>>> showcartitems.ftl
>>>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>>>>> optionsettings.ftl
>>>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>>>>> orderagreements.ftl
>>>>>> ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml
>>>>>>
>>>>
>>


Re: svn commit: r795883 - in /ofbiz/trunk: applications/order/src/org/ofbiz/order/shoppingcart/ applications/order/webapp/ordermgr/WEB-INF/actions/entry/ applications/order/webapp/ordermgr/WEB-INF/actions/order/ applications/order/webapp/ordermgr/entry/ ap...

Posted by Jacopo Cappellato <ja...@hotwaxmedia.com>.
Hi Joe,

On Jul 22, 2009, at 4:30 PM, Joe Eckard wrote:

> I was able to place and receive POs (and create invoices) after this  
> patch following the steps below.
>

What you describe above is the 'high level' process I was referring to.

Jacopo


> -Joe
>
> On Jul 22, 2009, at 5:31 AM, Sumit Pandit wrote:
>
>> Hello Joe,
>>
>> PO is still breaking, I am blocked! Please do needful to get this  
>> issue fixed.
>>
>> --
>> Thanks And Regards
>> Sumit Pandit
>> On Jul 21, 2009, at 9:05 PM, Joe Eckard wrote:
>>
>>> Thanks for the report - there is an initial fix in place now with  
>>> rev. 796349. Some of the assumptions being made now need a good  
>>> review, I will continue looking into it as I can find some time.
>>>
>>> -Joe
>>>
>>> On Jul 21, 2009, at 6:33 AM, Vikas Mayur wrote:
>>>
>>>> The functionality of receiving a Purchase Order is broken just  
>>>> after this commit. ProductStore is referred while creating an  
>>>> invoice for purchase order. See the reference in InvoiceServices  
>>>> class.
>>>>
>>>> Steps to reproduce:
>>>> 1. Create a purchase order.
>>>> 2. Approve the order.
>>>> 3. Under Actions block, Click on Quick Receive Purchase Order
>>>> 4. Select the Shipment to Receive and click on Receive Selected  
>>>> Shipment
>>>> 5. Select the checkbox Set Shipment As Received.
>>>> 6. Click on Receive Selected Product(s)
>>>>
>>>> Please update the trunk with the fix or revert this commit if it  
>>>> takes too much time.
>>>>
>>>> Vikas
>>>>
>>>> On Jul 20, 2009, at 9:22 PM, eckardjf@apache.org wrote:
>>>>
>>>>> Author: eckardjf
>>>>> Date: Mon Jul 20 15:52:05 2009
>>>>> New Revision: 795883
>>>>>
>>>>> URL: http://svn.apache.org/viewvc?rev=795883&view=rev
>>>>> Log:
>>>>> Changes to ShoppingCart & order entry to allow PO entry without  
>>>>> requiring a ProductStore; updated seed data to remove  
>>>>> productStoreId from the OrderEntry website
>>>>>
>>>>> Modified:
>>>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>>>>> CheckOutHelper.java
>>>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>>>>> ShoppingCart.java
>>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>>> entry/OptionSettings.groovy
>>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>>> entry/OrderAgreements.groovy
>>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>>> order/OrderView.groovy
>>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/ 
>>>>> showcartitems.ftl
>>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>>>> optionsettings.ftl
>>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>>>> orderagreements.ftl
>>>>> ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml
>>>>>
>>>
>


Re: svn commit: r795883 - in /ofbiz/trunk: applications/order/src/org/ofbiz/order/shoppingcart/ applications/order/webapp/ordermgr/WEB-INF/actions/entry/ applications/order/webapp/ordermgr/WEB-INF/actions/order/ applications/order/webapp/ordermgr/entry/ ap...

Posted by Joe Eckard <jo...@redrocketcorp.com>.
I was able to place and receive POs (and create invoices) after this  
patch following the steps below.

-Joe

On Jul 22, 2009, at 5:31 AM, Sumit Pandit wrote:

> Hello Joe,
>
> PO is still breaking, I am blocked! Please do needful to get this  
> issue fixed.
>
> --
> Thanks And Regards
> Sumit Pandit
> On Jul 21, 2009, at 9:05 PM, Joe Eckard wrote:
>
>> Thanks for the report - there is an initial fix in place now with  
>> rev. 796349. Some of the assumptions being made now need a good  
>> review, I will continue looking into it as I can find some time.
>>
>> -Joe
>>
>> On Jul 21, 2009, at 6:33 AM, Vikas Mayur wrote:
>>
>>> The functionality of receiving a Purchase Order is broken just  
>>> after this commit. ProductStore is referred while creating an  
>>> invoice for purchase order. See the reference in InvoiceServices  
>>> class.
>>>
>>> Steps to reproduce:
>>> 1. Create a purchase order.
>>> 2. Approve the order.
>>> 3. Under Actions block, Click on Quick Receive Purchase Order
>>> 4. Select the Shipment to Receive and click on Receive Selected  
>>> Shipment
>>> 5. Select the checkbox Set Shipment As Received.
>>> 6. Click on Receive Selected Product(s)
>>>
>>> Please update the trunk with the fix or revert this commit if it  
>>> takes too much time.
>>>
>>> Vikas
>>>
>>> On Jul 20, 2009, at 9:22 PM, eckardjf@apache.org wrote:
>>>
>>>> Author: eckardjf
>>>> Date: Mon Jul 20 15:52:05 2009
>>>> New Revision: 795883
>>>>
>>>> URL: http://svn.apache.org/viewvc?rev=795883&view=rev
>>>> Log:
>>>> Changes to ShoppingCart & order entry to allow PO entry without  
>>>> requiring a ProductStore; updated seed data to remove  
>>>> productStoreId from the OrderEntry website
>>>>
>>>> Modified:
>>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>>>> CheckOutHelper.java
>>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>>>> ShoppingCart.java
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>> entry/OptionSettings.groovy
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>> entry/OrderAgreements.groovy
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>> order/OrderView.groovy
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/ 
>>>> showcartitems.ftl
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>>> optionsettings.ftl
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>>> orderagreements.ftl
>>>> ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml
>>>>
>>


Re: svn commit: r795883 - in /ofbiz/trunk: applications/order/src/org/ofbiz/order/shoppingcart/ applications/order/webapp/ordermgr/WEB-INF/actions/entry/ applications/order/webapp/ordermgr/WEB-INF/actions/order/ applications/order/webapp/ordermgr/entry/ ap...

Posted by Sumit Pandit <su...@hotwaxmedia.com>.
Hello Joe,

PO is still breaking, I am blocked! Please do needful to get this  
issue fixed.

--
Thanks And Regards
Sumit Pandit
On Jul 21, 2009, at 9:05 PM, Joe Eckard wrote:

> Thanks for the report - there is an initial fix in place now with  
> rev. 796349. Some of the assumptions being made now need a good  
> review, I will continue looking into it as I can find some time.
>
> -Joe
>
> On Jul 21, 2009, at 6:33 AM, Vikas Mayur wrote:
>
>> The functionality of receiving a Purchase Order is broken just  
>> after this commit. ProductStore is referred while creating an  
>> invoice for purchase order. See the reference in InvoiceServices  
>> class.
>>
>> Steps to reproduce:
>> 1. Create a purchase order.
>> 2. Approve the order.
>> 3. Under Actions block, Click on Quick Receive Purchase Order
>> 4. Select the Shipment to Receive and click on Receive Selected  
>> Shipment
>> 5. Select the checkbox Set Shipment As Received.
>> 6. Click on Receive Selected Product(s)
>>
>> Please update the trunk with the fix or revert this commit if it  
>> takes too much time.
>>
>> Vikas
>>
>> On Jul 20, 2009, at 9:22 PM, eckardjf@apache.org wrote:
>>
>>> Author: eckardjf
>>> Date: Mon Jul 20 15:52:05 2009
>>> New Revision: 795883
>>>
>>> URL: http://svn.apache.org/viewvc?rev=795883&view=rev
>>> Log:
>>> Changes to ShoppingCart & order entry to allow PO entry without  
>>> requiring a ProductStore; updated seed data to remove  
>>> productStoreId from the OrderEntry website
>>>
>>> Modified:
>>>  ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>>> CheckOutHelper.java
>>>  ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>>> ShoppingCart.java
>>>  ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>> entry/OptionSettings.groovy
>>>  ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>> entry/OrderAgreements.groovy
>>>  ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>> order/OrderView.groovy
>>>  ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/ 
>>> showcartitems.ftl
>>>  ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>> optionsettings.ftl
>>>  ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>> orderagreements.ftl
>>>  ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml
>>>
>


Re: svn commit: r795883 - in /ofbiz/trunk: applications/order/src/org/ofbiz/order/shoppingcart/ applications/order/webapp/ordermgr/WEB-INF/actions/entry/ applications/order/webapp/ordermgr/WEB-INF/actions/order/ applications/order/webapp/ordermgr/entry/ ap...

Posted by Joe Eckard <jo...@redrocketcorp.com>.
Thanks for the report - there is an initial fix in place now with rev.  
796349. Some of the assumptions being made now need a good review, I  
will continue looking into it as I can find some time.

-Joe

On Jul 21, 2009, at 6:33 AM, Vikas Mayur wrote:

> The functionality of receiving a Purchase Order is broken just after  
> this commit. ProductStore is referred while creating an invoice for  
> purchase order. See the reference in InvoiceServices class.
>
> Steps to reproduce:
> 1. Create a purchase order.
> 2. Approve the order.
> 3. Under Actions block, Click on Quick Receive Purchase Order
> 4. Select the Shipment to Receive and click on Receive Selected  
> Shipment
> 5. Select the checkbox Set Shipment As Received.
> 6. Click on Receive Selected Product(s)
>
> Please update the trunk with the fix or revert this commit if it  
> takes too much time.
>
> Vikas
>
> On Jul 20, 2009, at 9:22 PM, eckardjf@apache.org wrote:
>
>> Author: eckardjf
>> Date: Mon Jul 20 15:52:05 2009
>> New Revision: 795883
>>
>> URL: http://svn.apache.org/viewvc?rev=795883&view=rev
>> Log:
>> Changes to ShoppingCart & order entry to allow PO entry without  
>> requiring a ProductStore; updated seed data to remove  
>> productStoreId from the OrderEntry website
>>
>> Modified:
>>   ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>> CheckOutHelper.java
>>   ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>> ShoppingCart.java
>>   ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>> entry/OptionSettings.groovy
>>   ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>> entry/OrderAgreements.groovy
>>   ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>> order/OrderView.groovy
>>   ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/ 
>> showcartitems.ftl
>>   ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>> optionsettings.ftl
>>   ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>> orderagreements.ftl
>>   ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml
>>


Re: svn commit: r795883 - in /ofbiz/trunk: applications/order/src/org/ofbiz/order/shoppingcart/ applications/order/webapp/ordermgr/WEB-INF/actions/entry/ applications/order/webapp/ordermgr/WEB-INF/actions/order/ applications/order/webapp/ordermgr/entry/ ap...

Posted by Joe Eckard <jo...@redrocketcorp.com>.
Which 'high level' processes are broken?

-Joe

On Jul 22, 2009, at 4:23 AM, Jacopo Cappellato wrote:

> I agree that using the ProductStore for POs is a bad implementation  
> that should be fixed. But I would prefer to see incremental fixes to  
> refactor the wrong processes without breaking the 'high level'  
> processes that are currently supported.
>
> Jacopo
>
>
> On Jul 21, 2009, at 9:21 PM, David E Jones wrote:
>
>>
>> Whatever future fixes go in they should ALL go in the direction of  
>> not requiring a ProductStore for a purchase order.
>>
>> The bug here is that a ProductStore is required for a purchase  
>> order, or is used at all for a purchase order. ProductStore  
>> information should ONLY be used for sales order.
>>
>> If any code doesn't follow that it's a bug, and IMO a partial fix  
>> is better than no fix at all...
>>
>> -David
>>
>>
>> On Jul 21, 2009, at 4:33 AM, Vikas Mayur wrote:
>>
>>> The functionality of receiving a Purchase Order is broken just  
>>> after this commit. ProductStore is referred while creating an  
>>> invoice for purchase order. See the reference in InvoiceServices  
>>> class.
>>>
>>> Steps to reproduce:
>>> 1. Create a purchase order.
>>> 2. Approve the order.
>>> 3. Under Actions block, Click on Quick Receive Purchase Order
>>> 4. Select the Shipment to Receive and click on Receive Selected  
>>> Shipment
>>> 5. Select the checkbox Set Shipment As Received.
>>> 6. Click on Receive Selected Product(s)
>>>
>>> Please update the trunk with the fix or revert this commit if it  
>>> takes too much time.
>>>
>>> Vikas
>>>
>>> On Jul 20, 2009, at 9:22 PM, eckardjf@apache.org wrote:
>>>
>>>> Author: eckardjf
>>>> Date: Mon Jul 20 15:52:05 2009
>>>> New Revision: 795883
>>>>
>>>> URL: http://svn.apache.org/viewvc?rev=795883&view=rev
>>>> Log:
>>>> Changes to ShoppingCart & order entry to allow PO entry without  
>>>> requiring a ProductStore; updated seed data to remove  
>>>> productStoreId from the OrderEntry website
>>>>
>>>> Modified:
>>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>>>> CheckOutHelper.java
>>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>>>> ShoppingCart.java
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>> entry/OptionSettings.groovy
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>> entry/OrderAgreements.groovy
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>> order/OrderView.groovy
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/ 
>>>> showcartitems.ftl
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>>> optionsettings.ftl
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>>> orderagreements.ftl
>>>> ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml
>>>>
>>>> Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/ 
>>>> shoppingcart/CheckOutHelper.java
>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java?rev=795883&r1=795882&r2=795883&view=diff
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> ===================================================================
>>>> --- ofbiz/trunk/applications/order/src/org/ofbiz/order/ 
>>>> shoppingcart/CheckOutHelper.java (original)
>>>> +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/ 
>>>> shoppingcart/CheckOutHelper.java Mon Jul 20 15:52:05 2009
>>>> @@ -789,8 +789,6 @@
>>>>  }
>>>>
>>>>  private Map makeTaxContext(int shipGroup, GenericValue  
>>>> shipAddress, Map shoppingCartItemIndexMap) throws  
>>>> GeneralException {
>>>> -        String productStoreId = cart.getProductStoreId();
>>>> -        String billToPartyId = cart.getBillToCustomerPartyId();
>>>>      ShoppingCart.CartShipInfo csi = cart.getShipInfo(shipGroup);
>>>>      int totalItems = csi.shipItemInfo.size();
>>>>
>>>> @@ -839,8 +837,9 @@
>>>>          }
>>>>      }
>>>>
>>>> -        Map serviceContext = UtilMisc.toMap("productStoreId",  
>>>> productStoreId);
>>>> -        serviceContext.put("billToPartyId", billToPartyId);
>>>> +        Map serviceContext = UtilMisc.toMap("productStoreId",  
>>>> cart.getProductStoreId());
>>>> +        serviceContext.put("payToPartyId",  
>>>> cart.getBillFromVendorPartyId());
>>>> +        serviceContext.put("billToPartyId",  
>>>> cart.getBillToCustomerPartyId());
>>>>      serviceContext.put("itemProductList", product);
>>>>      serviceContext.put("itemAmountList", amount);
>>>>      serviceContext.put("itemPriceList", price);
>>>>
>>>> Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/ 
>>>> shoppingcart/ShoppingCart.java
>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java?rev=795883&r1=795882&r2=795883&view=diff
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> ===================================================================
>>>> --- ofbiz/trunk/applications/order/src/org/ofbiz/order/ 
>>>> shoppingcart/ShoppingCart.java (original)
>>>> +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/ 
>>>> shoppingcart/ShoppingCart.java Mon Jul 20 15:52:05 2009
>>>> @@ -231,38 +231,35 @@
>>>>
>>>>  /** Creates new empty ShoppingCart object. */
>>>>  public ShoppingCart(GenericDelegator delegator, String  
>>>> productStoreId, String webSiteId, Locale locale, String  
>>>> currencyUom, String billToCustomerPartyId, String  
>>>> billFromVendorPartyId) {
>>>> +
>>>>      this.delegator = delegator;
>>>>      this.delegatorName = delegator.getDelegatorName();
>>>>      this.productStoreId = productStoreId;
>>>>      this.webSiteId = webSiteId;
>>>> -        this.currencyUom = currencyUom;
>>>> -        this.locale = locale;
>>>> -        if (this.locale == null) {
>>>> -            this.locale = Locale.getDefault();
>>>> -        }
>>>> +        this.locale = (locale != null) ? locale :  
>>>> Locale.getDefault();
>>>> +        this.currencyUom = (currencyUom != null) ? currencyUom :  
>>>> UtilProperties.getPropertyValue("general.properties",  
>>>> "currency.uom.id.default", "USD");
>>>> +        this.billToCustomerPartyId = billToCustomerPartyId;
>>>> +        this.billFromVendorPartyId = billFromVendorPartyId;
>>>>
>>>> -        if (productStoreId == null) {
>>>> -            throw new IllegalArgumentException("productStoreId  
>>>> cannot be null");
>>>> -        }
>>>> +        if (productStoreId != null) {
>>>>
>>>> -        // set the default view cart on add for this store
>>>> -        GenericValue productStore =  
>>>> ProductStoreWorker.getProductStore(productStoreId, delegator);
>>>> -        if (productStore == null) {
>>>> -            throw new IllegalArgumentException("Unable to locate  
>>>> ProductStore by ID [" + productStoreId + "]");
>>>> -        }
>>>> +            // set the default view cart on add for this store
>>>> +            GenericValue productStore =  
>>>> ProductStoreWorker.getProductStore(productStoreId, delegator);
>>>> +            if (productStore == null) {
>>>> +                throw new IllegalArgumentException("Unable to  
>>>> locate ProductStore by ID [" + productStoreId + "]");
>>>> +            }
>>>>
>>>> -        String storeViewCartOnAdd =  
>>>> productStore.getString("viewCartOnAdd");
>>>> -        if (storeViewCartOnAdd != null &&  
>>>> "Y".equalsIgnoreCase(storeViewCartOnAdd)) {
>>>> -            this.viewCartOnAdd = true;
>>>> -        }
>>>> +            String storeViewCartOnAdd =  
>>>> productStore.getString("viewCartOnAdd");
>>>> +            if (storeViewCartOnAdd != null &&  
>>>> "Y".equalsIgnoreCase(storeViewCartOnAdd)) {
>>>> +                this.viewCartOnAdd = true;
>>>> +            }
>>>>
>>>> -        if (billFromVendorPartyId == null) {
>>>> -            // since default cart is of type SALES_ORDER, set to  
>>>> store's payToPartyId
>>>> -            this.billFromVendorPartyId =  
>>>> productStore.getString("payToPartyId");
>>>> -        } else {
>>>> -            this.billFromVendorPartyId = billFromVendorPartyId;
>>>> +            if (billFromVendorPartyId == null) {
>>>> +                // since default cart is of type SALES_ORDER,  
>>>> set to store's payToPartyId
>>>> +                this.billFromVendorPartyId =  
>>>> productStore.getString("payToPartyId");
>>>> +            }
>>>>      }
>>>> -        this.billToCustomerPartyId = billToCustomerPartyId;
>>>> +
>>>>  }
>>>>
>>>>
>>>>
>>>> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/ 
>>>> actions/entry/OptionSettings.groovy
>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OptionSettings.groovy?rev=795883&r1=795882&r2=795883&view=diff
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> ===================================================================
>>>> --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/ 
>>>> actions/entry/OptionSettings.groovy (original)
>>>> +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/ 
>>>> actions/entry/OptionSettings.groovy Mon Jul 20 15:52:05 2009
>>>> @@ -26,9 +26,13 @@
>>>>
>>>> cart = session.getAttribute("shoppingCart");
>>>> context.cart = cart;
>>>> +
>>>> productStore = ProductStoreWorker.getProductStore(request);
>>>> -productStoreId = productStore.productStoreId;
>>>> -context.productStore = productStore;
>>>> +if (productStore) {
>>>> +    context.productStore = productStore;
>>>> +    context.carrierShipmentMethodList =  
>>>> delegator.findByAndCache('ProductStoreShipmentMethView',  
>>>> [productStoreId: productStore.productStoreId], ['sequenceNumber']);
>>>> +}
>>>> +
>>>> // nuke the event messages
>>>> request.removeAttribute("_EVENT_MESSAGE_");
>>>>
>>>> @@ -39,7 +43,6 @@
>>>>  context.orderPartyId = orderPartyId;
>>>> }
>>>>
>>>> -context.carrierShipmentMethodList =  
>>>> delegator.findByAndCache("ProductStoreShipmentMethView",  
>>>> [productStoreId : productStoreId], ["sequenceNumber"]);
>>>> context.emailList =  
>>>> ContactHelper.getContactMechByType(orderPartyId, "EMAIL_ADDRESS",  
>>>> false);
>>>>
>>>> // create the beforeDate for calendar
>>>> @@ -65,3 +68,4 @@
>>>> toTs = new Timestamp(toCal.getTimeInMillis());
>>>> toStr = toTs.toString();
>>>> context.afterDateStr = toStr;
>>>> +
>>>>
>>>> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/ 
>>>> actions/entry/OrderAgreements.groovy
>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OrderAgreements.groovy?rev=795883&r1=795882&r2=795883&view=diff
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> ===================================================================
>>>> --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/ 
>>>> actions/entry/OrderAgreements.groovy (original)
>>>> +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/ 
>>>> actions/entry/OrderAgreements.groovy Mon Jul 20 15:52:05 2009
>>>> @@ -17,85 +17,80 @@
>>>> * under the License.
>>>> */
>>>>
>>>> -import org.ofbiz.service.*;
>>>> -import org.ofbiz.entity.*;
>>>> -import org.ofbiz.entity.condition.*;
>>>> -import org.ofbiz.entity.util.*;
>>>> -import org.ofbiz.base.util.*;
>>>> -import org.ofbiz.order.shoppingcart.*;
>>>> -import org.ofbiz.party.party.PartyWorker;
>>>> -import org.ofbiz.product.catalog.CatalogWorker;
>>>> -import org.ofbiz.product.store.ProductStoreWorker;
>>>> -import org.ofbiz.order.shoppingcart.product.ProductDisplayWorker;
>>>> -import org.ofbiz.order.shoppingcart.product.ProductPromoWorker;
>>>> import org.ofbiz.entity.condition.EntityCondition;
>>>> -import org.ofbiz.entity.condition.EntityExpr;
>>>> import org.ofbiz.entity.condition.EntityOperator;
>>>> -import javolution.util.FastList;
>>>> +import org.ofbiz.entity.util.EntityUtil;
>>>> +import org.ofbiz.order.shoppingcart.*;
>>>> +import org.ofbiz.product.catalog.CatalogWorker;
>>>>
>>>>
>>>> -// Get the Cart and Prepare Size
>>>> shoppingCart = ShoppingCartEvents.getCartObject(request);
>>>> context.cart = shoppingCart;
>>>>
>>>> -// check the selected product store
>>>> +// get applicable agreements for order entry
>>>> +if ('PURCHASE_ORDER'.equals(shoppingCart.getOrderType())) {
>>>> +
>>>> +    // for a purchase order, orderPartyId = billFromVendor (the  
>>>> supplier)
>>>> +    supplierPartyId = shoppingCart.getOrderPartyId();
>>>> +    customerPartyId = shoppingCart.getBillToCustomerPartyId();
>>>> +
>>>> +    // the agreement for a purchse order is from us to the  
>>>> supplier
>>>> +    agreementCondition = EntityCondition.makeCondition([
>>>> +            EntityCondition.makeCondition('partyIdTo',  
>>>> EntityOperator.EQUALS, supplierPartyId),
>>>> +            EntityCondition.makeCondition('partyIdFrom',  
>>>> EntityOperator.EQUALS, customerPartyId)
>>>> +    ], EntityOperator.AND);
>>>> +
>>>> +    agreementRoleCondition = EntityCondition.makeCondition([
>>>> +            EntityCondition.makeCondition('partyId',  
>>>> EntityOperator.EQUALS, supplierPartyId),
>>>> +            EntityCondition.makeCondition('roleTypeId',  
>>>> EntityOperator.EQUALS, 'SUPPLIER')
>>>> +    ], EntityOperator.AND);
>>>> +
>>>> +} else {
>>>> +
>>>> +    // for a sales order, orderPartyId = billToCustomer (the  
>>>> customer)
>>>> +    customerPartyId = shoppingCart.getOrderPartyId();
>>>> +    companyPartyId = shoppingCart.getBillFromVendorPartyId();
>>>> +
>>>> +    // the agreement for a sales order is from the customer to us
>>>> +    agreementCondition = EntityCondition.makeCondition([
>>>> +            EntityCondition.makeCondition('partyIdTo',  
>>>> EntityOperator.EQUALS, companyPartyId),
>>>> +            EntityCondition.makeCondition('partyIdFrom',  
>>>> EntityOperator.EQUALS, customerPartyId)
>>>> +    ], EntityOperator.AND);
>>>> +
>>>> +    agreementRoleCondition = EntityCondition.makeCondition([
>>>> +            EntityCondition.makeCondition('partyId',  
>>>> EntityOperator.EQUALS, customerPartyId),
>>>> +            EntityCondition.makeCondition('roleTypeId',  
>>>> EntityOperator.EQUALS, 'CUSTOMER')
>>>> +    ], EntityOperator.AND);
>>>> +
>>>> +}
>>>> +
>>>> +agreements = delegator.findList('Agreement', agreementCondition,  
>>>> null, null, null, true);
>>>> +agreements = EntityUtil.filterByDate(agreements);
>>>> +if (agreements) {
>>>> +    context.agreements = agreements;
>>>> +}
>>>> +
>>>> +agreementRoles = delegator.findList('AgreementRole',  
>>>> agreementRoleCondition, null, null, null, true);
>>>> +if (agreementRoles) {
>>>> +    context.agreementRoles = agreementRoles;
>>>> +}
>>>> +
>>>> +// catalog id collection, current catalog id and name
>>>> productStoreId = shoppingCart.getProductStoreId();
>>>> -productStore = null;
>>>> -if (productStoreId) {
>>>> -    productStore =  
>>>> ProductStoreWorker.getProductStore(productStoreId, delegator);
>>>> -    if (productStore) {
>>>> -        // put in the default currency, to help selecting a  
>>>> currency for a purchase order
>>>> -        context.defaultCurrencyUomId =  
>>>> productStore.defaultCurrencyUomId;
>>>> -        payToPartyId = productStore.payToPartyId;
>>>> -        partyId = shoppingCart.getOrderPartyId();
>>>> -
>>>> -        exprsAgreements = FastList.newInstance();
>>>> -        exprsAgreementRoles = FastList.newInstance();
>>>> -        // get applicable agreements for order entry
>>>> -        if  
>>>> ("PURCHASE_ORDER".equals(shoppingCart.getOrderType())) {
>>>> -            // the agreement for a PO is from customer to  
>>>> payToParty (ie, us)
>>>> -             
>>>> exprsAgreements.add(EntityCondition.makeCondition("partyIdTo",  
>>>> EntityOperator.EQUALS, partyId));
>>>> -             
>>>> exprsAgreements.add(EntityCondition.makeCondition("partyIdFrom",  
>>>> EntityOperator.EQUALS, payToPartyId));
>>>> -            agreements = delegator.findList("Agreement",  
>>>> EntityCondition.makeCondition(exprsAgreements,  
>>>> EntityOperator.AND), null, null, null, true);
>>>> -             
>>>> exprsAgreementRoles.add(EntityCondition.makeCondition("partyId",  
>>>> EntityOperator.EQUALS, partyId));
>>>> -             
>>>> exprsAgreementRoles 
>>>> .add(EntityCondition.makeCondition("roleTypeId",  
>>>> EntityOperator.EQUALS, "SUPPLIER"));
>>>> -            agreementRoles = delegator.findList("AgreementRole",  
>>>> EntityCondition.makeCondition(exprsAgreementRoles,  
>>>> EntityOperator.AND), null, null, null, true);
>>>> -            catalogCol = CatalogWorker.getAllCatalogIds(request);
>>>> -        } else {
>>>> -            // the agreement for a sales order is from us to the  
>>>> customer
>>>> -             
>>>> exprsAgreements.add(EntityCondition.makeCondition("partyIdTo",  
>>>> EntityOperator.EQUALS, payToPartyId));
>>>> -             
>>>> exprsAgreements.add(EntityCondition.makeCondition("partyIdFrom",  
>>>> EntityOperator.EQUALS, partyId));
>>>> -            agreements = delegator.findList("Agreement",  
>>>> EntityCondition.makeCondition(exprsAgreements,  
>>>> EntityOperator.AND), null, null, null, true);
>>>> -             
>>>> exprsAgreementRoles.add(EntityCondition.makeCondition("partyId",  
>>>> EntityOperator.EQUALS, partyId));
>>>> -             
>>>> exprsAgreementRoles 
>>>> .add(EntityCondition.makeCondition("roleTypeId",  
>>>> EntityOperator.EQUALS, "CUSTOMER"));
>>>> -            agreementRoles = delegator.findList("AgreementRole",  
>>>> EntityCondition.makeCondition(exprsAgreementRoles,  
>>>> EntityOperator.AND), null, null, null, true);
>>>> -            catalogCol =  
>>>> CatalogWorker.getCatalogIdsAvailable(delegator, productStoreId,  
>>>> partyId);
>>>> -        }
>>>> -
>>>> -        agreements = EntityUtil.filterByDate(agreements);
>>>> -        if (agreements) {
>>>> -            context.agreements = agreements;
>>>> -        }
>>>> -        if (agreementRoles) {
>>>> -            context.agreementRoles =agreementRoles;
>>>> -        }
>>>> -
>>>> -
>>>> -        if (catalogCol) {
>>>> -            currentCatalogId = catalogCol.get(0);
>>>> -            currentCatalogName =  
>>>> CatalogWorker.getCatalogName(request, currentCatalogId);
>>>> -            context.catalogCol = catalogCol;
>>>> -            context.currentCatalogId = currentCatalogId;
>>>> -            context.currentCatalogName = currentCatalogName;
>>>> -        }
>>>> -    }
>>>> +if ('SALES_ORDER' == shoppingCart.getOrderType() &&  
>>>> productStoreId) {
>>>> +    catalogCol = CatalogWorker.getCatalogIdsAvailable(delegator,  
>>>> productStoreId, shoppingCart.getOrderPartyId());
>>>> +} else {
>>>> +    catalogCol = CatalogWorker.getAllCatalogIds(request);
>>>> }
>>>>
>>>> -partyId = shoppingCart.getPartyId();
>>>> -if ("_NA_".equals(partyId)) partyId = null;
>>>> -context.partyId = partyId;
>>>> +if (catalogCol) {
>>>> +    context.catalogCol = catalogCol;
>>>> +
>>>> +    currentCatalogId = catalogCol.get(0);
>>>> +    context.currentCatalogId = currentCatalogId;
>>>> +    context.currentCatalogName =  
>>>> CatalogWorker.getCatalogName(request, currentCatalogId);
>>>> +}
>>>>
>>>> // currencies and shopping cart currency
>>>> -currencies = delegator.findByAndCache("Uom", [uomTypeId :  
>>>> "CURRENCY_MEASURE"]);
>>>> -context.currencies = currencies;
>>>> +context.currencies = delegator.findByAndCache('Uom', [uomTypeId:  
>>>> 'CURRENCY_MEASURE']);
>>>> context.currencyUomId = shoppingCart.getCurrency();
>>>>
>>>> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/ 
>>>> actions/order/OrderView.groovy
>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy?rev=795883&r1=795882&r2=795883&view=diff
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> ===================================================================
>>>> --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/ 
>>>> actions/order/OrderView.groovy (original)
>>>> +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/ 
>>>> actions/order/OrderView.groovy Mon Jul 20 15:52:05 2009
>>>> @@ -386,9 +386,9 @@
>>>>  context.shippingContactMechList = shippingContactMechList;
>>>>
>>>>  // list to find all the shipmentMethods from the view named  
>>>> "ProductStoreShipmentMethView".
>>>> -    productStoreId =  
>>>> orderHeader.getRelatedOne("ProductStore").productStoreId;
>>>> -    productStoreShipmentMethList =  
>>>> delegator.findByAndCache("ProductStoreShipmentMethView",  
>>>> [productStoreId : productStoreId], ["sequenceNumber"]);
>>>> -    context.productStoreShipmentMethList =  
>>>> productStoreShipmentMethList;
>>>> +    if (productStore) {
>>>> +        context.productStoreShipmentMethList =  
>>>> delegator.findByAndCache('ProductStoreShipmentMethView',  
>>>> [productStoreId: productStore.productStoreId], ['sequenceNumber']);
>>>> +    }
>>>>
>>>>  // Get a map of returnable items
>>>>  returnableItems = [:];
>>>> @@ -400,8 +400,8 @@
>>>>
>>>>  // get the catalogIds for appending items
>>>>  if (context.request != null) {
>>>> -        if ("SALES_ORDER".equals(orderType)) {
>>>> -            catalogCol =  
>>>> CatalogWorker.getCatalogIdsAvailable(delegator, productStoreId,  
>>>> partyId);
>>>> +        if ("SALES_ORDER".equals(orderType) && productStore) {
>>>> +            catalogCol =  
>>>> CatalogWorker.getCatalogIdsAvailable(delegator,  
>>>> productStore.productStoreId, partyId);
>>>>      } else {
>>>>          catalogCol = CatalogWorker.getAllCatalogIds(request);
>>>>      }
>>>> @@ -441,8 +441,8 @@
>>>>      context.shipmentRouteSegmentId =  
>>>> shipmentRouteSegment.shipmentRouteSegmentId;
>>>>      context.pickedShipmentId = pickedShipmentId;
>>>>      if (pickedShipmentId &&  
>>>> shipmentRouteSegment.trackingIdNumber) {
>>>> -            if ("UPS" == shipmentRouteSegment.carrierPartyId) {
>>>> -                resultMap =  
>>>> dispatcher.runSync("upsShipmentAlternateRatesEstimate", 
>>>> [productStoreId : productStoreId, shipmentId : pickedShipmentId]);
>>>> +            if ("UPS" == shipmentRouteSegment.carrierPartyId &&  
>>>> productStore) {
>>>> +                resultMap =  
>>>> dispatcher.runSync('upsShipmentAlternateRatesEstimate',  
>>>> [productStoreId: productStore.productStoreId, shipmentId:  
>>>> pickedShipmentId]);
>>>>              shippingRates = resultMap.shippingRates;
>>>>              shippingRateList = [];
>>>>              shippingRates.each { shippingRate ->
>>>>
>>>> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>>> cart/showcartitems.ftl
>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/showcartitems.ftl?rev=795883&r1=795882&r2=795883&view=diff
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> ===================================================================
>>>> --- ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/ 
>>>> showcartitems.ftl (original)
>>>> +++ ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/ 
>>>> showcartitems.ftl Mon Jul 20 15:52:05 2009
>>>> @@ -39,7 +39,7 @@
>>>>        <td colspan="2">
>>>>          <div>
>>>>            <b>${uiLabelMap.ProductProduct}</b>
>>>> -              <#if productStore.showCheckoutGiftOptions? 
>>>> if_exists != "N">
>>>> +              <#if (shoppingCart.getOrderType() ==  
>>>> 'SALES_ORDER') && (productStore.showCheckoutGiftOptions)? 
>>>> default('Y') != 'N'>
>>>>                <select name="GWALL"  
>>>> onchange="javascript:gwAll(this);">
>>>>                  <option value="">$ 
>>>> {uiLabelMap.OrderGiftWrapAllItems}</option>
>>>>                  <option value="NO^">$ 
>>>> {uiLabelMap.OrderNoGiftWrap}</option>
>>>>
>>>> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>>> optionsettings.ftl
>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/optionsettings.ftl?rev=795883&r1=795882&r2=795883&view=diff
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> ===================================================================
>>>> --- ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>>> optionsettings.ftl (original)
>>>> +++ ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>>> optionsettings.ftl Mon Jul 20 15:52:05 2009
>>>> @@ -139,34 +139,34 @@
>>>>                  <textarea cols="30" rows="3" name="$ 
>>>> {shipGroupIndex?default("0")}_shipping_instructions">$ 
>>>> {cart.getShippingInstructions(shipGroupIndex)?if_exists}</textarea>
>>>>                </td>
>>>>              </tr>
>>>> -                <#if productStore.showCheckoutGiftOptions? 
>>>> if_exists != "N">
>>>> -                <tr>
>>>> -                  <td colspan="2">
>>>> -                    <#if cart.getOrderType() = "PURCHASE_ORDER">
>>>> -                       <input type='hidden' name='$ 
>>>> {shipGroupIndex?default("0")}_is_gift' value='false'>
>>>> -                    <#else>
>>>> -                    <div>
>>>> -                      <span class="h2"><b>$ 
>>>> {uiLabelMap.OrderIsThisGift}</b></span>
>>>> -                      <input type='radio' <#if  
>>>> cart.getIsGift(shipGroupIndex)?default("Y") == "Y">checked</#if>  
>>>> name='${shipGroupIndex?default("0")}_is_gift' value='true'><span  
>>>> class='tabletext'>${uiLabelMap.CommonYes}</span>
>>>> -                      <input type='radio' <#if  
>>>> cart.getIsGift(shipGroupIndex)?default("N") == "N">checked</#if>  
>>>> name='${shipGroupIndex?default("0")}_is_gift' value='false'><span  
>>>> class='tabletext'>${uiLabelMap.CommonNo}</span>
>>>> -                    </div>
>>>> +
>>>> +                <#if cart.getOrderType() == 'PURCHASE_ORDER'>
>>>> +                    <input type="hidden" name="${shipGroupIndex? 
>>>> default('0')}_is_gift" value="false">
>>>> +                <#else>
>>>> +                    <#if (productStore.showCheckoutGiftOptions)? 
>>>> default('Y') != 'N'>
>>>> +                        <tr>
>>>> +                            <td colspan="2">
>>>> +                                <div>
>>>> +                                    <span class="h2"><b>$ 
>>>> {uiLabelMap.OrderIsThisGift}</b></span>
>>>> +                                    <input type="radio" <#if  
>>>> cart.getIsGift(shipGroupIndex)?default('Y') ==  
>>>> 'Y'>checked="checked"</#if> name="${shipGroupIndex? 
>>>> default('0')}_is_gift" value="true"><span class="tabletext">$ 
>>>> {uiLabelMap.CommonYes}</span>
>>>> +                                    <input type="radio" <#if  
>>>> cart.getIsGift(shipGroupIndex)?default('N') ==  
>>>> 'N'>checked="checked"</#if> name="${shipGroupIndex? 
>>>> default('0')}_is_gift" value="false"><span class="tabletext">$ 
>>>> {uiLabelMap.CommonNo}</span>
>>>> +                                </div>
>>>> +                            </td>
>>>> +                        </tr>
>>>>                  </#if>
>>>> -                  </td>
>>>> -                </tr>
>>>> -                <#if cart.getOrderType() != "PURCHASE_ORDER">
>>>> -                <tr><td colspan="2"><hr/></td></tr>
>>>> -                <tr>
>>>> -                  <td colspan="2">
>>>> -                    <h2>${uiLabelMap.OrderGiftMessage}</h2>
>>>> -                  </td>
>>>> -                </tr>
>>>> -                <tr>
>>>> -                  <td colspan="2">
>>>> -                    <textarea cols="30" rows="3" name="$ 
>>>> {shipGroupIndex?default("0")}_gift_message">$ 
>>>> {cart.getGiftMessage(shipGroupIndex)?if_exists}</textarea>
>>>> -                  </td>
>>>> -                </tr>
>>>> -                 </#if>
>>>> +                    <tr><td colspan="2"><hr /></td></tr>
>>>> +                    <tr>
>>>> +                        <td colspan="2">
>>>> +                            <h2>${uiLabelMap.OrderGiftMessage}</ 
>>>> h2>
>>>> +                        </td>
>>>> +                    </tr>
>>>> +                    <tr>
>>>> +                        <td colspan="2">
>>>> +                            <textarea cols="30" rows="3" name="$ 
>>>> {shipGroupIndex?default('0')}_gift_message">$ 
>>>> {cart.getGiftMessage(shipGroupIndex)?if_exists}</textarea>
>>>> +                        </td>
>>>> +                    </tr>
>>>>              </#if>
>>>> +
>>>>                 <tr>
>>>>                    <td colspan="2"></td>
>>>>                 </tr>
>>>>
>>>> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>>> orderagreements.ftl
>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/orderagreements.ftl?rev=795883&r1=795882&r2=795883&view=diff
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> ===================================================================
>>>> --- ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>>> orderagreements.ftl (original)
>>>> +++ ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>>> orderagreements.ftl Mon Jul 20 15:52:05 2009
>>>> @@ -128,7 +128,7 @@
>>>>          <select 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>
>>>> +              <option value="${currency.uomId}" <#if  
>>>> currencyUomId?default('') == currency.uomId>selected="selected"</ 
>>>> #if> >${currency.uomId}</option>
>>>>            </#list>
>>>>          </select>
>>>>        </div>
>>>> @@ -143,11 +143,9 @@
>>>>      <td>&nbsp;</td>
>>>>      <td>
>>>>         <select name='CURRENT_CATALOG_ID'>
>>>> -            <option value='${currentCatalogId}'>$ 
>>>> {currentCatalogName}</option>
>>>> -            <option value='${currentCatalogId}'></option>
>>>> -            <#list catalogCol as catalogId>
>>>> +            <#list catalogCol?if_exists as catalogId>
>>>>            <#assign thisCatalogName =  
>>>> Static 
>>>> ["org 
>>>> .ofbiz.product.catalog.CatalogWorker"].getCatalogName(request,  
>>>> catalogId)>
>>>> -              <option value='${catalogId}'>${thisCatalogName}</ 
>>>> option>
>>>> +              <option value="${catalogId}" <#if currentCatalogId? 
>>>> default('') == catalogId>selected="selected"</#if> >$ 
>>>> {thisCatalogName}</option>
>>>>          </#list>
>>>>        </select>
>>>>      </td>
>>>>
>>>> Modified: ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml
>>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml?rev=795883&r1=795882&r2=795883&view=diff
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> ===================================================================
>>>> --- ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml  
>>>> (original)
>>>> +++ ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml Mon  
>>>> Jul 20 15:52:05 2009
>>>> @@ -111,8 +111,6 @@
>>>>
>>>>  <WebSite webSiteId="WebStore" siteName="eCommerce Web Site"  
>>>> productStoreId="9000" visualThemeSetId="ECOMMERCE"/>
>>>>  <WebSite webSiteId="WebStoreClone" siteName="Cloned eCommerce  
>>>> Web Site" productStoreId="9000" visualThemeSetId="ECOMMERCE"/>
>>>> -    <!-- the following item is defined in the OrderTypeData.xml  
>>>> file and just the productStoreId is being associated with it here  
>>>> -->
>>>> -    <WebSite webSiteId="OrderEntry" productStoreId="9000"/>
>>>>
>>>>  <ProdCatalog prodCatalogId="DemoCatalog" catalogName="Demo  
>>>> Catalog" useQuickAdd="Y"/>
>>>>  <ProdCatalog prodCatalogId="TestCatalog" catalogName="Test  
>>>> Catalog" useQuickAdd="N"/>
>>>>
>>>>
>>>
>>


Re: svn commit: r795883 - in /ofbiz/trunk: applications/order/src/org/ofbiz/order/shoppingcart/ applications/order/webapp/ordermgr/WEB-INF/actions/entry/ applications/order/webapp/ordermgr/WEB-INF/actions/order/ applications/order/webapp/ordermgr/entry/ ap...

Posted by Jacopo Cappellato <ja...@hotwaxmedia.com>.
I agree that using the ProductStore for POs is a bad implementation  
that should be fixed. But I would prefer to see incremental fixes to  
refactor the wrong processes without breaking the 'high level'  
processes that are currently supported.

Jacopo


On Jul 21, 2009, at 9:21 PM, David E Jones wrote:

>
> Whatever future fixes go in they should ALL go in the direction of  
> not requiring a ProductStore for a purchase order.
>
> The bug here is that a ProductStore is required for a purchase  
> order, or is used at all for a purchase order. ProductStore  
> information should ONLY be used for sales order.
>
> If any code doesn't follow that it's a bug, and IMO a partial fix is  
> better than no fix at all...
>
> -David
>
>
> On Jul 21, 2009, at 4:33 AM, Vikas Mayur wrote:
>
>> The functionality of receiving a Purchase Order is broken just  
>> after this commit. ProductStore is referred while creating an  
>> invoice for purchase order. See the reference in InvoiceServices  
>> class.
>>
>> Steps to reproduce:
>> 1. Create a purchase order.
>> 2. Approve the order.
>> 3. Under Actions block, Click on Quick Receive Purchase Order
>> 4. Select the Shipment to Receive and click on Receive Selected  
>> Shipment
>> 5. Select the checkbox Set Shipment As Received.
>> 6. Click on Receive Selected Product(s)
>>
>> Please update the trunk with the fix or revert this commit if it  
>> takes too much time.
>>
>> Vikas
>>
>> On Jul 20, 2009, at 9:22 PM, eckardjf@apache.org wrote:
>>
>>> Author: eckardjf
>>> Date: Mon Jul 20 15:52:05 2009
>>> New Revision: 795883
>>>
>>> URL: http://svn.apache.org/viewvc?rev=795883&view=rev
>>> Log:
>>> Changes to ShoppingCart & order entry to allow PO entry without  
>>> requiring a ProductStore; updated seed data to remove  
>>> productStoreId from the OrderEntry website
>>>
>>> Modified:
>>>  ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>>> CheckOutHelper.java
>>>  ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>>> ShoppingCart.java
>>>  ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>> entry/OptionSettings.groovy
>>>  ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>> entry/OrderAgreements.groovy
>>>  ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>> order/OrderView.groovy
>>>  ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/ 
>>> showcartitems.ftl
>>>  ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>> optionsettings.ftl
>>>  ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>> orderagreements.ftl
>>>  ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml
>>>
>>> Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/ 
>>> shoppingcart/CheckOutHelper.java
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java?rev=795883&r1=795882&r2=795883&view=diff
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> ====================================================================
>>> --- ofbiz/trunk/applications/order/src/org/ofbiz/order/ 
>>> shoppingcart/CheckOutHelper.java (original)
>>> +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/ 
>>> shoppingcart/CheckOutHelper.java Mon Jul 20 15:52:05 2009
>>> @@ -789,8 +789,6 @@
>>>   }
>>>
>>>   private Map makeTaxContext(int shipGroup, GenericValue  
>>> shipAddress, Map shoppingCartItemIndexMap) throws GeneralException {
>>> -        String productStoreId = cart.getProductStoreId();
>>> -        String billToPartyId = cart.getBillToCustomerPartyId();
>>>       ShoppingCart.CartShipInfo csi = cart.getShipInfo(shipGroup);
>>>       int totalItems = csi.shipItemInfo.size();
>>>
>>> @@ -839,8 +837,9 @@
>>>           }
>>>       }
>>>
>>> -        Map serviceContext = UtilMisc.toMap("productStoreId",  
>>> productStoreId);
>>> -        serviceContext.put("billToPartyId", billToPartyId);
>>> +        Map serviceContext = UtilMisc.toMap("productStoreId",  
>>> cart.getProductStoreId());
>>> +        serviceContext.put("payToPartyId",  
>>> cart.getBillFromVendorPartyId());
>>> +        serviceContext.put("billToPartyId",  
>>> cart.getBillToCustomerPartyId());
>>>       serviceContext.put("itemProductList", product);
>>>       serviceContext.put("itemAmountList", amount);
>>>       serviceContext.put("itemPriceList", price);
>>>
>>> Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/ 
>>> shoppingcart/ShoppingCart.java
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java?rev=795883&r1=795882&r2=795883&view=diff
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> ====================================================================
>>> --- ofbiz/trunk/applications/order/src/org/ofbiz/order/ 
>>> shoppingcart/ShoppingCart.java (original)
>>> +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/ 
>>> shoppingcart/ShoppingCart.java Mon Jul 20 15:52:05 2009
>>> @@ -231,38 +231,35 @@
>>>
>>>   /** Creates new empty ShoppingCart object. */
>>>   public ShoppingCart(GenericDelegator delegator, String  
>>> productStoreId, String webSiteId, Locale locale, String  
>>> currencyUom, String billToCustomerPartyId, String  
>>> billFromVendorPartyId) {
>>> +
>>>       this.delegator = delegator;
>>>       this.delegatorName = delegator.getDelegatorName();
>>>       this.productStoreId = productStoreId;
>>>       this.webSiteId = webSiteId;
>>> -        this.currencyUom = currencyUom;
>>> -        this.locale = locale;
>>> -        if (this.locale == null) {
>>> -            this.locale = Locale.getDefault();
>>> -        }
>>> +        this.locale = (locale != null) ? locale :  
>>> Locale.getDefault();
>>> +        this.currencyUom = (currencyUom != null) ? currencyUom :  
>>> UtilProperties.getPropertyValue("general.properties",  
>>> "currency.uom.id.default", "USD");
>>> +        this.billToCustomerPartyId = billToCustomerPartyId;
>>> +        this.billFromVendorPartyId = billFromVendorPartyId;
>>>
>>> -        if (productStoreId == null) {
>>> -            throw new IllegalArgumentException("productStoreId  
>>> cannot be null");
>>> -        }
>>> +        if (productStoreId != null) {
>>>
>>> -        // set the default view cart on add for this store
>>> -        GenericValue productStore =  
>>> ProductStoreWorker.getProductStore(productStoreId, delegator);
>>> -        if (productStore == null) {
>>> -            throw new IllegalArgumentException("Unable to locate  
>>> ProductStore by ID [" + productStoreId + "]");
>>> -        }
>>> +            // set the default view cart on add for this store
>>> +            GenericValue productStore =  
>>> ProductStoreWorker.getProductStore(productStoreId, delegator);
>>> +            if (productStore == null) {
>>> +                throw new IllegalArgumentException("Unable to  
>>> locate ProductStore by ID [" + productStoreId + "]");
>>> +            }
>>>
>>> -        String storeViewCartOnAdd =  
>>> productStore.getString("viewCartOnAdd");
>>> -        if (storeViewCartOnAdd != null &&  
>>> "Y".equalsIgnoreCase(storeViewCartOnAdd)) {
>>> -            this.viewCartOnAdd = true;
>>> -        }
>>> +            String storeViewCartOnAdd =  
>>> productStore.getString("viewCartOnAdd");
>>> +            if (storeViewCartOnAdd != null &&  
>>> "Y".equalsIgnoreCase(storeViewCartOnAdd)) {
>>> +                this.viewCartOnAdd = true;
>>> +            }
>>>
>>> -        if (billFromVendorPartyId == null) {
>>> -            // since default cart is of type SALES_ORDER, set to  
>>> store's payToPartyId
>>> -            this.billFromVendorPartyId =  
>>> productStore.getString("payToPartyId");
>>> -        } else {
>>> -            this.billFromVendorPartyId = billFromVendorPartyId;
>>> +            if (billFromVendorPartyId == null) {
>>> +                // since default cart is of type SALES_ORDER, set  
>>> to store's payToPartyId
>>> +                this.billFromVendorPartyId =  
>>> productStore.getString("payToPartyId");
>>> +            }
>>>       }
>>> -        this.billToCustomerPartyId = billToCustomerPartyId;
>>> +
>>>   }
>>>
>>>
>>>
>>> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/ 
>>> actions/entry/OptionSettings.groovy
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OptionSettings.groovy?rev=795883&r1=795882&r2=795883&view=diff
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> ====================================================================
>>> --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>> entry/OptionSettings.groovy (original)
>>> +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>> entry/OptionSettings.groovy Mon Jul 20 15:52:05 2009
>>> @@ -26,9 +26,13 @@
>>>
>>> cart = session.getAttribute("shoppingCart");
>>> context.cart = cart;
>>> +
>>> productStore = ProductStoreWorker.getProductStore(request);
>>> -productStoreId = productStore.productStoreId;
>>> -context.productStore = productStore;
>>> +if (productStore) {
>>> +    context.productStore = productStore;
>>> +    context.carrierShipmentMethodList =  
>>> delegator.findByAndCache('ProductStoreShipmentMethView',  
>>> [productStoreId: productStore.productStoreId], ['sequenceNumber']);
>>> +}
>>> +
>>> // nuke the event messages
>>> request.removeAttribute("_EVENT_MESSAGE_");
>>>
>>> @@ -39,7 +43,6 @@
>>>   context.orderPartyId = orderPartyId;
>>> }
>>>
>>> -context.carrierShipmentMethodList =  
>>> delegator.findByAndCache("ProductStoreShipmentMethView",  
>>> [productStoreId : productStoreId], ["sequenceNumber"]);
>>> context.emailList =  
>>> ContactHelper.getContactMechByType(orderPartyId, "EMAIL_ADDRESS",  
>>> false);
>>>
>>> // create the beforeDate for calendar
>>> @@ -65,3 +68,4 @@
>>> toTs = new Timestamp(toCal.getTimeInMillis());
>>> toStr = toTs.toString();
>>> context.afterDateStr = toStr;
>>> +
>>>
>>> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/ 
>>> actions/entry/OrderAgreements.groovy
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OrderAgreements.groovy?rev=795883&r1=795882&r2=795883&view=diff
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> ====================================================================
>>> --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>> entry/OrderAgreements.groovy (original)
>>> +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>> entry/OrderAgreements.groovy Mon Jul 20 15:52:05 2009
>>> @@ -17,85 +17,80 @@
>>> * under the License.
>>> */
>>>
>>> -import org.ofbiz.service.*;
>>> -import org.ofbiz.entity.*;
>>> -import org.ofbiz.entity.condition.*;
>>> -import org.ofbiz.entity.util.*;
>>> -import org.ofbiz.base.util.*;
>>> -import org.ofbiz.order.shoppingcart.*;
>>> -import org.ofbiz.party.party.PartyWorker;
>>> -import org.ofbiz.product.catalog.CatalogWorker;
>>> -import org.ofbiz.product.store.ProductStoreWorker;
>>> -import org.ofbiz.order.shoppingcart.product.ProductDisplayWorker;
>>> -import org.ofbiz.order.shoppingcart.product.ProductPromoWorker;
>>> import org.ofbiz.entity.condition.EntityCondition;
>>> -import org.ofbiz.entity.condition.EntityExpr;
>>> import org.ofbiz.entity.condition.EntityOperator;
>>> -import javolution.util.FastList;
>>> +import org.ofbiz.entity.util.EntityUtil;
>>> +import org.ofbiz.order.shoppingcart.*;
>>> +import org.ofbiz.product.catalog.CatalogWorker;
>>>
>>>
>>> -// Get the Cart and Prepare Size
>>> shoppingCart = ShoppingCartEvents.getCartObject(request);
>>> context.cart = shoppingCart;
>>>
>>> -// check the selected product store
>>> +// get applicable agreements for order entry
>>> +if ('PURCHASE_ORDER'.equals(shoppingCart.getOrderType())) {
>>> +
>>> +    // for a purchase order, orderPartyId = billFromVendor (the  
>>> supplier)
>>> +    supplierPartyId = shoppingCart.getOrderPartyId();
>>> +    customerPartyId = shoppingCart.getBillToCustomerPartyId();
>>> +
>>> +    // the agreement for a purchse order is from us to the supplier
>>> +    agreementCondition = EntityCondition.makeCondition([
>>> +            EntityCondition.makeCondition('partyIdTo',  
>>> EntityOperator.EQUALS, supplierPartyId),
>>> +            EntityCondition.makeCondition('partyIdFrom',  
>>> EntityOperator.EQUALS, customerPartyId)
>>> +    ], EntityOperator.AND);
>>> +
>>> +    agreementRoleCondition = EntityCondition.makeCondition([
>>> +            EntityCondition.makeCondition('partyId',  
>>> EntityOperator.EQUALS, supplierPartyId),
>>> +            EntityCondition.makeCondition('roleTypeId',  
>>> EntityOperator.EQUALS, 'SUPPLIER')
>>> +    ], EntityOperator.AND);
>>> +
>>> +} else {
>>> +
>>> +    // for a sales order, orderPartyId = billToCustomer (the  
>>> customer)
>>> +    customerPartyId = shoppingCart.getOrderPartyId();
>>> +    companyPartyId = shoppingCart.getBillFromVendorPartyId();
>>> +
>>> +    // the agreement for a sales order is from the customer to us
>>> +    agreementCondition = EntityCondition.makeCondition([
>>> +            EntityCondition.makeCondition('partyIdTo',  
>>> EntityOperator.EQUALS, companyPartyId),
>>> +            EntityCondition.makeCondition('partyIdFrom',  
>>> EntityOperator.EQUALS, customerPartyId)
>>> +    ], EntityOperator.AND);
>>> +
>>> +    agreementRoleCondition = EntityCondition.makeCondition([
>>> +            EntityCondition.makeCondition('partyId',  
>>> EntityOperator.EQUALS, customerPartyId),
>>> +            EntityCondition.makeCondition('roleTypeId',  
>>> EntityOperator.EQUALS, 'CUSTOMER')
>>> +    ], EntityOperator.AND);
>>> +
>>> +}
>>> +
>>> +agreements = delegator.findList('Agreement', agreementCondition,  
>>> null, null, null, true);
>>> +agreements = EntityUtil.filterByDate(agreements);
>>> +if (agreements) {
>>> +    context.agreements = agreements;
>>> +}
>>> +
>>> +agreementRoles = delegator.findList('AgreementRole',  
>>> agreementRoleCondition, null, null, null, true);
>>> +if (agreementRoles) {
>>> +    context.agreementRoles = agreementRoles;
>>> +}
>>> +
>>> +// catalog id collection, current catalog id and name
>>> productStoreId = shoppingCart.getProductStoreId();
>>> -productStore = null;
>>> -if (productStoreId) {
>>> -    productStore =  
>>> ProductStoreWorker.getProductStore(productStoreId, delegator);
>>> -    if (productStore) {
>>> -        // put in the default currency, to help selecting a  
>>> currency for a purchase order
>>> -        context.defaultCurrencyUomId =  
>>> productStore.defaultCurrencyUomId;
>>> -        payToPartyId = productStore.payToPartyId;
>>> -        partyId = shoppingCart.getOrderPartyId();
>>> -
>>> -        exprsAgreements = FastList.newInstance();
>>> -        exprsAgreementRoles = FastList.newInstance();
>>> -        // get applicable agreements for order entry
>>> -        if ("PURCHASE_ORDER".equals(shoppingCart.getOrderType())) {
>>> -            // the agreement for a PO is from customer to  
>>> payToParty (ie, us)
>>> -             
>>> exprsAgreements.add(EntityCondition.makeCondition("partyIdTo",  
>>> EntityOperator.EQUALS, partyId));
>>> -             
>>> exprsAgreements.add(EntityCondition.makeCondition("partyIdFrom",  
>>> EntityOperator.EQUALS, payToPartyId));
>>> -            agreements = delegator.findList("Agreement",  
>>> EntityCondition.makeCondition(exprsAgreements,  
>>> EntityOperator.AND), null, null, null, true);
>>> -             
>>> exprsAgreementRoles.add(EntityCondition.makeCondition("partyId",  
>>> EntityOperator.EQUALS, partyId));
>>> -             
>>> exprsAgreementRoles 
>>> .add(EntityCondition.makeCondition("roleTypeId",  
>>> EntityOperator.EQUALS, "SUPPLIER"));
>>> -            agreementRoles = delegator.findList("AgreementRole",  
>>> EntityCondition.makeCondition(exprsAgreementRoles,  
>>> EntityOperator.AND), null, null, null, true);
>>> -            catalogCol = CatalogWorker.getAllCatalogIds(request);
>>> -        } else {
>>> -            // the agreement for a sales order is from us to the  
>>> customer
>>> -             
>>> exprsAgreements.add(EntityCondition.makeCondition("partyIdTo",  
>>> EntityOperator.EQUALS, payToPartyId));
>>> -             
>>> exprsAgreements.add(EntityCondition.makeCondition("partyIdFrom",  
>>> EntityOperator.EQUALS, partyId));
>>> -            agreements = delegator.findList("Agreement",  
>>> EntityCondition.makeCondition(exprsAgreements,  
>>> EntityOperator.AND), null, null, null, true);
>>> -             
>>> exprsAgreementRoles.add(EntityCondition.makeCondition("partyId",  
>>> EntityOperator.EQUALS, partyId));
>>> -             
>>> exprsAgreementRoles 
>>> .add(EntityCondition.makeCondition("roleTypeId",  
>>> EntityOperator.EQUALS, "CUSTOMER"));
>>> -            agreementRoles = delegator.findList("AgreementRole",  
>>> EntityCondition.makeCondition(exprsAgreementRoles,  
>>> EntityOperator.AND), null, null, null, true);
>>> -            catalogCol =  
>>> CatalogWorker.getCatalogIdsAvailable(delegator, productStoreId,  
>>> partyId);
>>> -        }
>>> -
>>> -        agreements = EntityUtil.filterByDate(agreements);
>>> -        if (agreements) {
>>> -            context.agreements = agreements;
>>> -        }
>>> -        if (agreementRoles) {
>>> -            context.agreementRoles =agreementRoles;
>>> -        }
>>> -
>>> -
>>> -        if (catalogCol) {
>>> -            currentCatalogId = catalogCol.get(0);
>>> -            currentCatalogName =  
>>> CatalogWorker.getCatalogName(request, currentCatalogId);
>>> -            context.catalogCol = catalogCol;
>>> -            context.currentCatalogId = currentCatalogId;
>>> -            context.currentCatalogName = currentCatalogName;
>>> -        }
>>> -    }
>>> +if ('SALES_ORDER' == shoppingCart.getOrderType() &&  
>>> productStoreId) {
>>> +    catalogCol = CatalogWorker.getCatalogIdsAvailable(delegator,  
>>> productStoreId, shoppingCart.getOrderPartyId());
>>> +} else {
>>> +    catalogCol = CatalogWorker.getAllCatalogIds(request);
>>> }
>>>
>>> -partyId = shoppingCart.getPartyId();
>>> -if ("_NA_".equals(partyId)) partyId = null;
>>> -context.partyId = partyId;
>>> +if (catalogCol) {
>>> +    context.catalogCol = catalogCol;
>>> +
>>> +    currentCatalogId = catalogCol.get(0);
>>> +    context.currentCatalogId = currentCatalogId;
>>> +    context.currentCatalogName =  
>>> CatalogWorker.getCatalogName(request, currentCatalogId);
>>> +}
>>>
>>> // currencies and shopping cart currency
>>> -currencies = delegator.findByAndCache("Uom", [uomTypeId :  
>>> "CURRENCY_MEASURE"]);
>>> -context.currencies = currencies;
>>> +context.currencies = delegator.findByAndCache('Uom', [uomTypeId:  
>>> 'CURRENCY_MEASURE']);
>>> context.currencyUomId = shoppingCart.getCurrency();
>>>
>>> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/ 
>>> actions/order/OrderView.groovy
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy?rev=795883&r1=795882&r2=795883&view=diff
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> ====================================================================
>>> --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>> order/OrderView.groovy (original)
>>> +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>> order/OrderView.groovy Mon Jul 20 15:52:05 2009
>>> @@ -386,9 +386,9 @@
>>>   context.shippingContactMechList = shippingContactMechList;
>>>
>>>   // list to find all the shipmentMethods from the view named  
>>> "ProductStoreShipmentMethView".
>>> -    productStoreId =  
>>> orderHeader.getRelatedOne("ProductStore").productStoreId;
>>> -    productStoreShipmentMethList =  
>>> delegator.findByAndCache("ProductStoreShipmentMethView",  
>>> [productStoreId : productStoreId], ["sequenceNumber"]);
>>> -    context.productStoreShipmentMethList =  
>>> productStoreShipmentMethList;
>>> +    if (productStore) {
>>> +        context.productStoreShipmentMethList =  
>>> delegator.findByAndCache('ProductStoreShipmentMethView',  
>>> [productStoreId: productStore.productStoreId], ['sequenceNumber']);
>>> +    }
>>>
>>>   // Get a map of returnable items
>>>   returnableItems = [:];
>>> @@ -400,8 +400,8 @@
>>>
>>>   // get the catalogIds for appending items
>>>   if (context.request != null) {
>>> -        if ("SALES_ORDER".equals(orderType)) {
>>> -            catalogCol =  
>>> CatalogWorker.getCatalogIdsAvailable(delegator, productStoreId,  
>>> partyId);
>>> +        if ("SALES_ORDER".equals(orderType) && productStore) {
>>> +            catalogCol =  
>>> CatalogWorker.getCatalogIdsAvailable(delegator,  
>>> productStore.productStoreId, partyId);
>>>       } else {
>>>           catalogCol = CatalogWorker.getAllCatalogIds(request);
>>>       }
>>> @@ -441,8 +441,8 @@
>>>       context.shipmentRouteSegmentId =  
>>> shipmentRouteSegment.shipmentRouteSegmentId;
>>>       context.pickedShipmentId = pickedShipmentId;
>>>       if (pickedShipmentId &&  
>>> shipmentRouteSegment.trackingIdNumber) {
>>> -            if ("UPS" == shipmentRouteSegment.carrierPartyId) {
>>> -                resultMap =  
>>> dispatcher.runSync("upsShipmentAlternateRatesEstimate", 
>>> [productStoreId : productStoreId, shipmentId : pickedShipmentId]);
>>> +            if ("UPS" == shipmentRouteSegment.carrierPartyId &&  
>>> productStore) {
>>> +                resultMap =  
>>> dispatcher.runSync('upsShipmentAlternateRatesEstimate',  
>>> [productStoreId: productStore.productStoreId, shipmentId:  
>>> pickedShipmentId]);
>>>               shippingRates = resultMap.shippingRates;
>>>               shippingRateList = [];
>>>               shippingRates.each { shippingRate ->
>>>
>>> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>> cart/showcartitems.ftl
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/showcartitems.ftl?rev=795883&r1=795882&r2=795883&view=diff
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> ====================================================================
>>> --- ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/ 
>>> showcartitems.ftl (original)
>>> +++ ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/ 
>>> showcartitems.ftl Mon Jul 20 15:52:05 2009
>>> @@ -39,7 +39,7 @@
>>>         <td colspan="2">
>>>           <div>
>>>             <b>${uiLabelMap.ProductProduct}</b>
>>> -              <#if productStore.showCheckoutGiftOptions? 
>>> if_exists != "N">
>>> +              <#if (shoppingCart.getOrderType() == 'SALES_ORDER')  
>>> && (productStore.showCheckoutGiftOptions)?default('Y') != 'N'>
>>>                 <select name="GWALL"  
>>> onchange="javascript:gwAll(this);">
>>>                   <option value="">$ 
>>> {uiLabelMap.OrderGiftWrapAllItems}</option>
>>>                   <option value="NO^">$ 
>>> {uiLabelMap.OrderNoGiftWrap}</option>
>>>
>>> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>> optionsettings.ftl
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/optionsettings.ftl?rev=795883&r1=795882&r2=795883&view=diff
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> ====================================================================
>>> --- ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>> optionsettings.ftl (original)
>>> +++ ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>> optionsettings.ftl Mon Jul 20 15:52:05 2009
>>> @@ -139,34 +139,34 @@
>>>                   <textarea cols="30" rows="3" name="$ 
>>> {shipGroupIndex?default("0")}_shipping_instructions">$ 
>>> {cart.getShippingInstructions(shipGroupIndex)?if_exists}</textarea>
>>>                 </td>
>>>               </tr>
>>> -                <#if productStore.showCheckoutGiftOptions? 
>>> if_exists != "N">
>>> -                <tr>
>>> -                  <td colspan="2">
>>> -                    <#if cart.getOrderType() = "PURCHASE_ORDER">
>>> -                       <input type='hidden' name='$ 
>>> {shipGroupIndex?default("0")}_is_gift' value='false'>
>>> -                    <#else>
>>> -                    <div>
>>> -                      <span class="h2"><b>$ 
>>> {uiLabelMap.OrderIsThisGift}</b></span>
>>> -                      <input type='radio' <#if  
>>> cart.getIsGift(shipGroupIndex)?default("Y") == "Y">checked</#if>  
>>> name='${shipGroupIndex?default("0")}_is_gift' value='true'><span  
>>> class='tabletext'>${uiLabelMap.CommonYes}</span>
>>> -                      <input type='radio' <#if  
>>> cart.getIsGift(shipGroupIndex)?default("N") == "N">checked</#if>  
>>> name='${shipGroupIndex?default("0")}_is_gift' value='false'><span  
>>> class='tabletext'>${uiLabelMap.CommonNo}</span>
>>> -                    </div>
>>> +
>>> +                <#if cart.getOrderType() == 'PURCHASE_ORDER'>
>>> +                    <input type="hidden" name="${shipGroupIndex? 
>>> default('0')}_is_gift" value="false">
>>> +                <#else>
>>> +                    <#if (productStore.showCheckoutGiftOptions)? 
>>> default('Y') != 'N'>
>>> +                        <tr>
>>> +                            <td colspan="2">
>>> +                                <div>
>>> +                                    <span class="h2"><b>$ 
>>> {uiLabelMap.OrderIsThisGift}</b></span>
>>> +                                    <input type="radio" <#if  
>>> cart.getIsGift(shipGroupIndex)?default('Y') ==  
>>> 'Y'>checked="checked"</#if> name="${shipGroupIndex? 
>>> default('0')}_is_gift" value="true"><span class="tabletext">$ 
>>> {uiLabelMap.CommonYes}</span>
>>> +                                    <input type="radio" <#if  
>>> cart.getIsGift(shipGroupIndex)?default('N') ==  
>>> 'N'>checked="checked"</#if> name="${shipGroupIndex? 
>>> default('0')}_is_gift" value="false"><span class="tabletext">$ 
>>> {uiLabelMap.CommonNo}</span>
>>> +                                </div>
>>> +                            </td>
>>> +                        </tr>
>>>                   </#if>
>>> -                  </td>
>>> -                </tr>
>>> -                <#if cart.getOrderType() != "PURCHASE_ORDER">
>>> -                <tr><td colspan="2"><hr/></td></tr>
>>> -                <tr>
>>> -                  <td colspan="2">
>>> -                    <h2>${uiLabelMap.OrderGiftMessage}</h2>
>>> -                  </td>
>>> -                </tr>
>>> -                <tr>
>>> -                  <td colspan="2">
>>> -                    <textarea cols="30" rows="3" name="$ 
>>> {shipGroupIndex?default("0")}_gift_message">$ 
>>> {cart.getGiftMessage(shipGroupIndex)?if_exists}</textarea>
>>> -                  </td>
>>> -                </tr>
>>> -                 </#if>
>>> +                    <tr><td colspan="2"><hr /></td></tr>
>>> +                    <tr>
>>> +                        <td colspan="2">
>>> +                            <h2>${uiLabelMap.OrderGiftMessage}</h2>
>>> +                        </td>
>>> +                    </tr>
>>> +                    <tr>
>>> +                        <td colspan="2">
>>> +                            <textarea cols="30" rows="3" name="$ 
>>> {shipGroupIndex?default('0')}_gift_message">$ 
>>> {cart.getGiftMessage(shipGroupIndex)?if_exists}</textarea>
>>> +                        </td>
>>> +                    </tr>
>>>               </#if>
>>> +
>>>                  <tr>
>>>                     <td colspan="2"></td>
>>>                  </tr>
>>>
>>> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>> orderagreements.ftl
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/orderagreements.ftl?rev=795883&r1=795882&r2=795883&view=diff
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> ====================================================================
>>> --- ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>> orderagreements.ftl (original)
>>> +++ ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>> orderagreements.ftl Mon Jul 20 15:52:05 2009
>>> @@ -128,7 +128,7 @@
>>>           <select 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>
>>> +              <option value="${currency.uomId}" <#if  
>>> currencyUomId?default('') == currency.uomId>selected="selected"</ 
>>> #if> >${currency.uomId}</option>
>>>             </#list>
>>>           </select>
>>>         </div>
>>> @@ -143,11 +143,9 @@
>>>       <td>&nbsp;</td>
>>>       <td>
>>>          <select name='CURRENT_CATALOG_ID'>
>>> -            <option value='${currentCatalogId}'>$ 
>>> {currentCatalogName}</option>
>>> -            <option value='${currentCatalogId}'></option>
>>> -            <#list catalogCol as catalogId>
>>> +            <#list catalogCol?if_exists as catalogId>
>>>             <#assign thisCatalogName =  
>>> Static 
>>> ["org 
>>> .ofbiz.product.catalog.CatalogWorker"].getCatalogName(request,  
>>> catalogId)>
>>> -              <option value='${catalogId}'>${thisCatalogName}</ 
>>> option>
>>> +              <option value="${catalogId}" <#if currentCatalogId? 
>>> default('') == catalogId>selected="selected"</#if> >$ 
>>> {thisCatalogName}</option>
>>>           </#list>
>>>         </select>
>>>       </td>
>>>
>>> Modified: ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml
>>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml?rev=795883&r1=795882&r2=795883&view=diff
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> = 
>>> ====================================================================
>>> --- ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml  
>>> (original)
>>> +++ ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml Mon  
>>> Jul 20 15:52:05 2009
>>> @@ -111,8 +111,6 @@
>>>
>>>   <WebSite webSiteId="WebStore" siteName="eCommerce Web Site"  
>>> productStoreId="9000" visualThemeSetId="ECOMMERCE"/>
>>>   <WebSite webSiteId="WebStoreClone" siteName="Cloned eCommerce  
>>> Web Site" productStoreId="9000" visualThemeSetId="ECOMMERCE"/>
>>> -    <!-- the following item is defined in the OrderTypeData.xml  
>>> file and just the productStoreId is being associated with it here  
>>> -->
>>> -    <WebSite webSiteId="OrderEntry" productStoreId="9000"/>
>>>
>>>   <ProdCatalog prodCatalogId="DemoCatalog" catalogName="Demo  
>>> Catalog" useQuickAdd="Y"/>
>>>   <ProdCatalog prodCatalogId="TestCatalog" catalogName="Test  
>>> Catalog" useQuickAdd="N"/>
>>>
>>>
>>
>


Re: svn commit: r795883 - in /ofbiz/trunk: applications/order/src/org/ofbiz/order/shoppingcart/ applications/order/webapp/ordermgr/WEB-INF/actions/entry/ applications/order/webapp/ordermgr/WEB-INF/actions/order/ applications/order/webapp/ordermgr/entry/ ap...

Posted by David E Jones <de...@me.com>.
Whatever future fixes go in they should ALL go in the direction of not  
requiring a ProductStore for a purchase order.

The bug here is that a ProductStore is required for a purchase order,  
or is used at all for a purchase order. ProductStore information  
should ONLY be used for sales order.

If any code doesn't follow that it's a bug, and IMO a partial fix is  
better than no fix at all...

-David


On Jul 21, 2009, at 4:33 AM, Vikas Mayur wrote:

> The functionality of receiving a Purchase Order is broken just after  
> this commit. ProductStore is referred while creating an invoice for  
> purchase order. See the reference in InvoiceServices class.
>
> Steps to reproduce:
> 1. Create a purchase order.
> 2. Approve the order.
> 3. Under Actions block, Click on Quick Receive Purchase Order
> 4. Select the Shipment to Receive and click on Receive Selected  
> Shipment
> 5. Select the checkbox Set Shipment As Received.
> 6. Click on Receive Selected Product(s)
>
> Please update the trunk with the fix or revert this commit if it  
> takes too much time.
>
> Vikas
>
> On Jul 20, 2009, at 9:22 PM, eckardjf@apache.org wrote:
>
>> Author: eckardjf
>> Date: Mon Jul 20 15:52:05 2009
>> New Revision: 795883
>>
>> URL: http://svn.apache.org/viewvc?rev=795883&view=rev
>> Log:
>> Changes to ShoppingCart & order entry to allow PO entry without  
>> requiring a ProductStore; updated seed data to remove  
>> productStoreId from the OrderEntry website
>>
>> Modified:
>>   ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>> CheckOutHelper.java
>>   ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>> ShoppingCart.java
>>   ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>> entry/OptionSettings.groovy
>>   ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>> entry/OrderAgreements.groovy
>>   ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>> order/OrderView.groovy
>>   ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/ 
>> showcartitems.ftl
>>   ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>> optionsettings.ftl
>>   ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>> orderagreements.ftl
>>   ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml
>>
>> Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/ 
>> shoppingcart/CheckOutHelper.java
>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java?rev=795883&r1=795882&r2=795883&view=diff
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> =====================================================================
>> --- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>> CheckOutHelper.java (original)
>> +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>> CheckOutHelper.java Mon Jul 20 15:52:05 2009
>> @@ -789,8 +789,6 @@
>>    }
>>
>>    private Map makeTaxContext(int shipGroup, GenericValue  
>> shipAddress, Map shoppingCartItemIndexMap) throws GeneralException {
>> -        String productStoreId = cart.getProductStoreId();
>> -        String billToPartyId = cart.getBillToCustomerPartyId();
>>        ShoppingCart.CartShipInfo csi = cart.getShipInfo(shipGroup);
>>        int totalItems = csi.shipItemInfo.size();
>>
>> @@ -839,8 +837,9 @@
>>            }
>>        }
>>
>> -        Map serviceContext = UtilMisc.toMap("productStoreId",  
>> productStoreId);
>> -        serviceContext.put("billToPartyId", billToPartyId);
>> +        Map serviceContext = UtilMisc.toMap("productStoreId",  
>> cart.getProductStoreId());
>> +        serviceContext.put("payToPartyId",  
>> cart.getBillFromVendorPartyId());
>> +        serviceContext.put("billToPartyId",  
>> cart.getBillToCustomerPartyId());
>>        serviceContext.put("itemProductList", product);
>>        serviceContext.put("itemAmountList", amount);
>>        serviceContext.put("itemPriceList", price);
>>
>> Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/ 
>> shoppingcart/ShoppingCart.java
>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java?rev=795883&r1=795882&r2=795883&view=diff
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> =====================================================================
>> --- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>> ShoppingCart.java (original)
>> +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>> ShoppingCart.java Mon Jul 20 15:52:05 2009
>> @@ -231,38 +231,35 @@
>>
>>    /** Creates new empty ShoppingCart object. */
>>    public ShoppingCart(GenericDelegator delegator, String  
>> productStoreId, String webSiteId, Locale locale, String  
>> currencyUom, String billToCustomerPartyId, String  
>> billFromVendorPartyId) {
>> +
>>        this.delegator = delegator;
>>        this.delegatorName = delegator.getDelegatorName();
>>        this.productStoreId = productStoreId;
>>        this.webSiteId = webSiteId;
>> -        this.currencyUom = currencyUom;
>> -        this.locale = locale;
>> -        if (this.locale == null) {
>> -            this.locale = Locale.getDefault();
>> -        }
>> +        this.locale = (locale != null) ? locale :  
>> Locale.getDefault();
>> +        this.currencyUom = (currencyUom != null) ? currencyUom :  
>> UtilProperties.getPropertyValue("general.properties",  
>> "currency.uom.id.default", "USD");
>> +        this.billToCustomerPartyId = billToCustomerPartyId;
>> +        this.billFromVendorPartyId = billFromVendorPartyId;
>>
>> -        if (productStoreId == null) {
>> -            throw new IllegalArgumentException("productStoreId  
>> cannot be null");
>> -        }
>> +        if (productStoreId != null) {
>>
>> -        // set the default view cart on add for this store
>> -        GenericValue productStore =  
>> ProductStoreWorker.getProductStore(productStoreId, delegator);
>> -        if (productStore == null) {
>> -            throw new IllegalArgumentException("Unable to locate  
>> ProductStore by ID [" + productStoreId + "]");
>> -        }
>> +            // set the default view cart on add for this store
>> +            GenericValue productStore =  
>> ProductStoreWorker.getProductStore(productStoreId, delegator);
>> +            if (productStore == null) {
>> +                throw new IllegalArgumentException("Unable to  
>> locate ProductStore by ID [" + productStoreId + "]");
>> +            }
>>
>> -        String storeViewCartOnAdd =  
>> productStore.getString("viewCartOnAdd");
>> -        if (storeViewCartOnAdd != null &&  
>> "Y".equalsIgnoreCase(storeViewCartOnAdd)) {
>> -            this.viewCartOnAdd = true;
>> -        }
>> +            String storeViewCartOnAdd =  
>> productStore.getString("viewCartOnAdd");
>> +            if (storeViewCartOnAdd != null &&  
>> "Y".equalsIgnoreCase(storeViewCartOnAdd)) {
>> +                this.viewCartOnAdd = true;
>> +            }
>>
>> -        if (billFromVendorPartyId == null) {
>> -            // since default cart is of type SALES_ORDER, set to  
>> store's payToPartyId
>> -            this.billFromVendorPartyId =  
>> productStore.getString("payToPartyId");
>> -        } else {
>> -            this.billFromVendorPartyId = billFromVendorPartyId;
>> +            if (billFromVendorPartyId == null) {
>> +                // since default cart is of type SALES_ORDER, set  
>> to store's payToPartyId
>> +                this.billFromVendorPartyId =  
>> productStore.getString("payToPartyId");
>> +            }
>>        }
>> -        this.billToCustomerPartyId = billToCustomerPartyId;
>> +
>>    }
>>
>>
>>
>> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/ 
>> actions/entry/OptionSettings.groovy
>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OptionSettings.groovy?rev=795883&r1=795882&r2=795883&view=diff
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> =====================================================================
>> --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>> entry/OptionSettings.groovy (original)
>> +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>> entry/OptionSettings.groovy Mon Jul 20 15:52:05 2009
>> @@ -26,9 +26,13 @@
>>
>> cart = session.getAttribute("shoppingCart");
>> context.cart = cart;
>> +
>> productStore = ProductStoreWorker.getProductStore(request);
>> -productStoreId = productStore.productStoreId;
>> -context.productStore = productStore;
>> +if (productStore) {
>> +    context.productStore = productStore;
>> +    context.carrierShipmentMethodList =  
>> delegator.findByAndCache('ProductStoreShipmentMethView',  
>> [productStoreId: productStore.productStoreId], ['sequenceNumber']);
>> +}
>> +
>> // nuke the event messages
>> request.removeAttribute("_EVENT_MESSAGE_");
>>
>> @@ -39,7 +43,6 @@
>>    context.orderPartyId = orderPartyId;
>> }
>>
>> -context.carrierShipmentMethodList =  
>> delegator.findByAndCache("ProductStoreShipmentMethView",  
>> [productStoreId : productStoreId], ["sequenceNumber"]);
>> context.emailList =  
>> ContactHelper.getContactMechByType(orderPartyId, "EMAIL_ADDRESS",  
>> false);
>>
>> // create the beforeDate for calendar
>> @@ -65,3 +68,4 @@
>> toTs = new Timestamp(toCal.getTimeInMillis());
>> toStr = toTs.toString();
>> context.afterDateStr = toStr;
>> +
>>
>> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/ 
>> actions/entry/OrderAgreements.groovy
>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OrderAgreements.groovy?rev=795883&r1=795882&r2=795883&view=diff
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> =====================================================================
>> --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>> entry/OrderAgreements.groovy (original)
>> +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>> entry/OrderAgreements.groovy Mon Jul 20 15:52:05 2009
>> @@ -17,85 +17,80 @@
>> * under the License.
>> */
>>
>> -import org.ofbiz.service.*;
>> -import org.ofbiz.entity.*;
>> -import org.ofbiz.entity.condition.*;
>> -import org.ofbiz.entity.util.*;
>> -import org.ofbiz.base.util.*;
>> -import org.ofbiz.order.shoppingcart.*;
>> -import org.ofbiz.party.party.PartyWorker;
>> -import org.ofbiz.product.catalog.CatalogWorker;
>> -import org.ofbiz.product.store.ProductStoreWorker;
>> -import org.ofbiz.order.shoppingcart.product.ProductDisplayWorker;
>> -import org.ofbiz.order.shoppingcart.product.ProductPromoWorker;
>> import org.ofbiz.entity.condition.EntityCondition;
>> -import org.ofbiz.entity.condition.EntityExpr;
>> import org.ofbiz.entity.condition.EntityOperator;
>> -import javolution.util.FastList;
>> +import org.ofbiz.entity.util.EntityUtil;
>> +import org.ofbiz.order.shoppingcart.*;
>> +import org.ofbiz.product.catalog.CatalogWorker;
>>
>>
>> -// Get the Cart and Prepare Size
>> shoppingCart = ShoppingCartEvents.getCartObject(request);
>> context.cart = shoppingCart;
>>
>> -// check the selected product store
>> +// get applicable agreements for order entry
>> +if ('PURCHASE_ORDER'.equals(shoppingCart.getOrderType())) {
>> +
>> +    // for a purchase order, orderPartyId = billFromVendor (the  
>> supplier)
>> +    supplierPartyId = shoppingCart.getOrderPartyId();
>> +    customerPartyId = shoppingCart.getBillToCustomerPartyId();
>> +
>> +    // the agreement for a purchse order is from us to the supplier
>> +    agreementCondition = EntityCondition.makeCondition([
>> +            EntityCondition.makeCondition('partyIdTo',  
>> EntityOperator.EQUALS, supplierPartyId),
>> +            EntityCondition.makeCondition('partyIdFrom',  
>> EntityOperator.EQUALS, customerPartyId)
>> +    ], EntityOperator.AND);
>> +
>> +    agreementRoleCondition = EntityCondition.makeCondition([
>> +            EntityCondition.makeCondition('partyId',  
>> EntityOperator.EQUALS, supplierPartyId),
>> +            EntityCondition.makeCondition('roleTypeId',  
>> EntityOperator.EQUALS, 'SUPPLIER')
>> +    ], EntityOperator.AND);
>> +
>> +} else {
>> +
>> +    // for a sales order, orderPartyId = billToCustomer (the  
>> customer)
>> +    customerPartyId = shoppingCart.getOrderPartyId();
>> +    companyPartyId = shoppingCart.getBillFromVendorPartyId();
>> +
>> +    // the agreement for a sales order is from the customer to us
>> +    agreementCondition = EntityCondition.makeCondition([
>> +            EntityCondition.makeCondition('partyIdTo',  
>> EntityOperator.EQUALS, companyPartyId),
>> +            EntityCondition.makeCondition('partyIdFrom',  
>> EntityOperator.EQUALS, customerPartyId)
>> +    ], EntityOperator.AND);
>> +
>> +    agreementRoleCondition = EntityCondition.makeCondition([
>> +            EntityCondition.makeCondition('partyId',  
>> EntityOperator.EQUALS, customerPartyId),
>> +            EntityCondition.makeCondition('roleTypeId',  
>> EntityOperator.EQUALS, 'CUSTOMER')
>> +    ], EntityOperator.AND);
>> +
>> +}
>> +
>> +agreements = delegator.findList('Agreement', agreementCondition,  
>> null, null, null, true);
>> +agreements = EntityUtil.filterByDate(agreements);
>> +if (agreements) {
>> +    context.agreements = agreements;
>> +}
>> +
>> +agreementRoles = delegator.findList('AgreementRole',  
>> agreementRoleCondition, null, null, null, true);
>> +if (agreementRoles) {
>> +    context.agreementRoles = agreementRoles;
>> +}
>> +
>> +// catalog id collection, current catalog id and name
>> productStoreId = shoppingCart.getProductStoreId();
>> -productStore = null;
>> -if (productStoreId) {
>> -    productStore =  
>> ProductStoreWorker.getProductStore(productStoreId, delegator);
>> -    if (productStore) {
>> -        // put in the default currency, to help selecting a  
>> currency for a purchase order
>> -        context.defaultCurrencyUomId =  
>> productStore.defaultCurrencyUomId;
>> -        payToPartyId = productStore.payToPartyId;
>> -        partyId = shoppingCart.getOrderPartyId();
>> -
>> -        exprsAgreements = FastList.newInstance();
>> -        exprsAgreementRoles = FastList.newInstance();
>> -        // get applicable agreements for order entry
>> -        if ("PURCHASE_ORDER".equals(shoppingCart.getOrderType())) {
>> -            // the agreement for a PO is from customer to  
>> payToParty (ie, us)
>> -             
>> exprsAgreements.add(EntityCondition.makeCondition("partyIdTo",  
>> EntityOperator.EQUALS, partyId));
>> -             
>> exprsAgreements.add(EntityCondition.makeCondition("partyIdFrom",  
>> EntityOperator.EQUALS, payToPartyId));
>> -            agreements = delegator.findList("Agreement",  
>> EntityCondition.makeCondition(exprsAgreements, EntityOperator.AND),  
>> null, null, null, true);
>> -             
>> exprsAgreementRoles.add(EntityCondition.makeCondition("partyId",  
>> EntityOperator.EQUALS, partyId));
>> -             
>> exprsAgreementRoles.add(EntityCondition.makeCondition("roleTypeId",  
>> EntityOperator.EQUALS, "SUPPLIER"));
>> -            agreementRoles = delegator.findList("AgreementRole",  
>> EntityCondition.makeCondition(exprsAgreementRoles,  
>> EntityOperator.AND), null, null, null, true);
>> -            catalogCol = CatalogWorker.getAllCatalogIds(request);
>> -        } else {
>> -            // the agreement for a sales order is from us to the  
>> customer
>> -             
>> exprsAgreements.add(EntityCondition.makeCondition("partyIdTo",  
>> EntityOperator.EQUALS, payToPartyId));
>> -             
>> exprsAgreements.add(EntityCondition.makeCondition("partyIdFrom",  
>> EntityOperator.EQUALS, partyId));
>> -            agreements = delegator.findList("Agreement",  
>> EntityCondition.makeCondition(exprsAgreements, EntityOperator.AND),  
>> null, null, null, true);
>> -             
>> exprsAgreementRoles.add(EntityCondition.makeCondition("partyId",  
>> EntityOperator.EQUALS, partyId));
>> -             
>> exprsAgreementRoles.add(EntityCondition.makeCondition("roleTypeId",  
>> EntityOperator.EQUALS, "CUSTOMER"));
>> -            agreementRoles = delegator.findList("AgreementRole",  
>> EntityCondition.makeCondition(exprsAgreementRoles,  
>> EntityOperator.AND), null, null, null, true);
>> -            catalogCol =  
>> CatalogWorker.getCatalogIdsAvailable(delegator, productStoreId,  
>> partyId);
>> -        }
>> -
>> -        agreements = EntityUtil.filterByDate(agreements);
>> -        if (agreements) {
>> -            context.agreements = agreements;
>> -        }
>> -        if (agreementRoles) {
>> -            context.agreementRoles =agreementRoles;
>> -        }
>> -
>> -
>> -        if (catalogCol) {
>> -            currentCatalogId = catalogCol.get(0);
>> -            currentCatalogName =  
>> CatalogWorker.getCatalogName(request, currentCatalogId);
>> -            context.catalogCol = catalogCol;
>> -            context.currentCatalogId = currentCatalogId;
>> -            context.currentCatalogName = currentCatalogName;
>> -        }
>> -    }
>> +if ('SALES_ORDER' == shoppingCart.getOrderType() &&  
>> productStoreId) {
>> +    catalogCol = CatalogWorker.getCatalogIdsAvailable(delegator,  
>> productStoreId, shoppingCart.getOrderPartyId());
>> +} else {
>> +    catalogCol = CatalogWorker.getAllCatalogIds(request);
>> }
>>
>> -partyId = shoppingCart.getPartyId();
>> -if ("_NA_".equals(partyId)) partyId = null;
>> -context.partyId = partyId;
>> +if (catalogCol) {
>> +    context.catalogCol = catalogCol;
>> +
>> +    currentCatalogId = catalogCol.get(0);
>> +    context.currentCatalogId = currentCatalogId;
>> +    context.currentCatalogName =  
>> CatalogWorker.getCatalogName(request, currentCatalogId);
>> +}
>>
>> // currencies and shopping cart currency
>> -currencies = delegator.findByAndCache("Uom", [uomTypeId :  
>> "CURRENCY_MEASURE"]);
>> -context.currencies = currencies;
>> +context.currencies = delegator.findByAndCache('Uom', [uomTypeId:  
>> 'CURRENCY_MEASURE']);
>> context.currencyUomId = shoppingCart.getCurrency();
>>
>> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/ 
>> actions/order/OrderView.groovy
>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy?rev=795883&r1=795882&r2=795883&view=diff
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> =====================================================================
>> --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>> order/OrderView.groovy (original)
>> +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>> order/OrderView.groovy Mon Jul 20 15:52:05 2009
>> @@ -386,9 +386,9 @@
>>    context.shippingContactMechList = shippingContactMechList;
>>
>>    // list to find all the shipmentMethods from the view named  
>> "ProductStoreShipmentMethView".
>> -    productStoreId =  
>> orderHeader.getRelatedOne("ProductStore").productStoreId;
>> -    productStoreShipmentMethList =  
>> delegator.findByAndCache("ProductStoreShipmentMethView",  
>> [productStoreId : productStoreId], ["sequenceNumber"]);
>> -    context.productStoreShipmentMethList =  
>> productStoreShipmentMethList;
>> +    if (productStore) {
>> +        context.productStoreShipmentMethList =  
>> delegator.findByAndCache('ProductStoreShipmentMethView',  
>> [productStoreId: productStore.productStoreId], ['sequenceNumber']);
>> +    }
>>
>>    // Get a map of returnable items
>>    returnableItems = [:];
>> @@ -400,8 +400,8 @@
>>
>>    // get the catalogIds for appending items
>>    if (context.request != null) {
>> -        if ("SALES_ORDER".equals(orderType)) {
>> -            catalogCol =  
>> CatalogWorker.getCatalogIdsAvailable(delegator, productStoreId,  
>> partyId);
>> +        if ("SALES_ORDER".equals(orderType) && productStore) {
>> +            catalogCol =  
>> CatalogWorker.getCatalogIdsAvailable(delegator,  
>> productStore.productStoreId, partyId);
>>        } else {
>>            catalogCol = CatalogWorker.getAllCatalogIds(request);
>>        }
>> @@ -441,8 +441,8 @@
>>        context.shipmentRouteSegmentId =  
>> shipmentRouteSegment.shipmentRouteSegmentId;
>>        context.pickedShipmentId = pickedShipmentId;
>>        if (pickedShipmentId &&  
>> shipmentRouteSegment.trackingIdNumber) {
>> -            if ("UPS" == shipmentRouteSegment.carrierPartyId) {
>> -                resultMap =  
>> dispatcher.runSync("upsShipmentAlternateRatesEstimate", 
>> [productStoreId : productStoreId, shipmentId : pickedShipmentId]);
>> +            if ("UPS" == shipmentRouteSegment.carrierPartyId &&  
>> productStore) {
>> +                resultMap =  
>> dispatcher.runSync('upsShipmentAlternateRatesEstimate',  
>> [productStoreId: productStore.productStoreId, shipmentId:  
>> pickedShipmentId]);
>>                shippingRates = resultMap.shippingRates;
>>                shippingRateList = [];
>>                shippingRates.each { shippingRate ->
>>
>> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/ 
>> showcartitems.ftl
>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/showcartitems.ftl?rev=795883&r1=795882&r2=795883&view=diff
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> =====================================================================
>> --- ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/ 
>> showcartitems.ftl (original)
>> +++ ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/ 
>> showcartitems.ftl Mon Jul 20 15:52:05 2009
>> @@ -39,7 +39,7 @@
>>          <td colspan="2">
>>            <div>
>>              <b>${uiLabelMap.ProductProduct}</b>
>> -              <#if productStore.showCheckoutGiftOptions?if_exists ! 
>> = "N">
>> +              <#if (shoppingCart.getOrderType() == 'SALES_ORDER')  
>> && (productStore.showCheckoutGiftOptions)?default('Y') != 'N'>
>>                  <select name="GWALL"  
>> onchange="javascript:gwAll(this);">
>>                    <option value="">$ 
>> {uiLabelMap.OrderGiftWrapAllItems}</option>
>>                    <option value="NO^">$ 
>> {uiLabelMap.OrderNoGiftWrap}</option>
>>
>> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>> optionsettings.ftl
>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/optionsettings.ftl?rev=795883&r1=795882&r2=795883&view=diff
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> =====================================================================
>> --- ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>> optionsettings.ftl (original)
>> +++ ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>> optionsettings.ftl Mon Jul 20 15:52:05 2009
>> @@ -139,34 +139,34 @@
>>                    <textarea cols="30" rows="3" name="$ 
>> {shipGroupIndex?default("0")}_shipping_instructions">$ 
>> {cart.getShippingInstructions(shipGroupIndex)?if_exists}</textarea>
>>                  </td>
>>                </tr>
>> -                <#if productStore.showCheckoutGiftOptions? 
>> if_exists != "N">
>> -                <tr>
>> -                  <td colspan="2">
>> -                    <#if cart.getOrderType() = "PURCHASE_ORDER">
>> -                       <input type='hidden' name='${shipGroupIndex? 
>> default("0")}_is_gift' value='false'>
>> -                    <#else>
>> -                    <div>
>> -                      <span class="h2"><b>$ 
>> {uiLabelMap.OrderIsThisGift}</b></span>
>> -                      <input type='radio' <#if  
>> cart.getIsGift(shipGroupIndex)?default("Y") == "Y">checked</#if>  
>> name='${shipGroupIndex?default("0")}_is_gift' value='true'><span  
>> class='tabletext'>${uiLabelMap.CommonYes}</span>
>> -                      <input type='radio' <#if  
>> cart.getIsGift(shipGroupIndex)?default("N") == "N">checked</#if>  
>> name='${shipGroupIndex?default("0")}_is_gift' value='false'><span  
>> class='tabletext'>${uiLabelMap.CommonNo}</span>
>> -                    </div>
>> +
>> +                <#if cart.getOrderType() == 'PURCHASE_ORDER'>
>> +                    <input type="hidden" name="${shipGroupIndex? 
>> default('0')}_is_gift" value="false">
>> +                <#else>
>> +                    <#if (productStore.showCheckoutGiftOptions)? 
>> default('Y') != 'N'>
>> +                        <tr>
>> +                            <td colspan="2">
>> +                                <div>
>> +                                    <span class="h2"><b>$ 
>> {uiLabelMap.OrderIsThisGift}</b></span>
>> +                                    <input type="radio" <#if  
>> cart.getIsGift(shipGroupIndex)?default('Y') ==  
>> 'Y'>checked="checked"</#if> name="${shipGroupIndex? 
>> default('0')}_is_gift" value="true"><span class="tabletext">$ 
>> {uiLabelMap.CommonYes}</span>
>> +                                    <input type="radio" <#if  
>> cart.getIsGift(shipGroupIndex)?default('N') ==  
>> 'N'>checked="checked"</#if> name="${shipGroupIndex? 
>> default('0')}_is_gift" value="false"><span class="tabletext">$ 
>> {uiLabelMap.CommonNo}</span>
>> +                                </div>
>> +                            </td>
>> +                        </tr>
>>                    </#if>
>> -                  </td>
>> -                </tr>
>> -                <#if cart.getOrderType() != "PURCHASE_ORDER">
>> -                <tr><td colspan="2"><hr/></td></tr>
>> -                <tr>
>> -                  <td colspan="2">
>> -                    <h2>${uiLabelMap.OrderGiftMessage}</h2>
>> -                  </td>
>> -                </tr>
>> -                <tr>
>> -                  <td colspan="2">
>> -                    <textarea cols="30" rows="3" name="$ 
>> {shipGroupIndex?default("0")}_gift_message">$ 
>> {cart.getGiftMessage(shipGroupIndex)?if_exists}</textarea>
>> -                  </td>
>> -                </tr>
>> -                 </#if>
>> +                    <tr><td colspan="2"><hr /></td></tr>
>> +                    <tr>
>> +                        <td colspan="2">
>> +                            <h2>${uiLabelMap.OrderGiftMessage}</h2>
>> +                        </td>
>> +                    </tr>
>> +                    <tr>
>> +                        <td colspan="2">
>> +                            <textarea cols="30" rows="3" name="$ 
>> {shipGroupIndex?default('0')}_gift_message">$ 
>> {cart.getGiftMessage(shipGroupIndex)?if_exists}</textarea>
>> +                        </td>
>> +                    </tr>
>>                </#if>
>> +
>>                   <tr>
>>                      <td colspan="2"></td>
>>                   </tr>
>>
>> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>> orderagreements.ftl
>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/orderagreements.ftl?rev=795883&r1=795882&r2=795883&view=diff
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> =====================================================================
>> --- ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>> orderagreements.ftl (original)
>> +++ ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>> orderagreements.ftl Mon Jul 20 15:52:05 2009
>> @@ -128,7 +128,7 @@
>>            <select 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>
>> +              <option value="${currency.uomId}" <#if currencyUomId? 
>> default('') == currency.uomId>selected="selected"</#if> >$ 
>> {currency.uomId}</option>
>>              </#list>
>>            </select>
>>          </div>
>> @@ -143,11 +143,9 @@
>>        <td>&nbsp;</td>
>>        <td>
>>           <select name='CURRENT_CATALOG_ID'>
>> -            <option value='${currentCatalogId}'>$ 
>> {currentCatalogName}</option>
>> -            <option value='${currentCatalogId}'></option>
>> -            <#list catalogCol as catalogId>
>> +            <#list catalogCol?if_exists as catalogId>
>>              <#assign thisCatalogName =  
>> Static 
>> ["org.ofbiz.product.catalog.CatalogWorker"].getCatalogName(request,  
>> catalogId)>
>> -              <option value='${catalogId}'>${thisCatalogName}</ 
>> option>
>> +              <option value="${catalogId}" <#if currentCatalogId? 
>> default('') == catalogId>selected="selected"</#if> >$ 
>> {thisCatalogName}</option>
>>            </#list>
>>          </select>
>>        </td>
>>
>> Modified: ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml
>> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml?rev=795883&r1=795882&r2=795883&view=diff
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> =====================================================================
>> --- ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml  
>> (original)
>> +++ ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml Mon  
>> Jul 20 15:52:05 2009
>> @@ -111,8 +111,6 @@
>>
>>    <WebSite webSiteId="WebStore" siteName="eCommerce Web Site"  
>> productStoreId="9000" visualThemeSetId="ECOMMERCE"/>
>>    <WebSite webSiteId="WebStoreClone" siteName="Cloned eCommerce  
>> Web Site" productStoreId="9000" visualThemeSetId="ECOMMERCE"/>
>> -    <!-- the following item is defined in the OrderTypeData.xml  
>> file and just the productStoreId is being associated with it here -->
>> -    <WebSite webSiteId="OrderEntry" productStoreId="9000"/>
>>
>>    <ProdCatalog prodCatalogId="DemoCatalog" catalogName="Demo  
>> Catalog" useQuickAdd="Y"/>
>>    <ProdCatalog prodCatalogId="TestCatalog" catalogName="Test  
>> Catalog" useQuickAdd="N"/>
>>
>>
>


Re: svn commit: r795883 - in /ofbiz/trunk: applications/order/src/org/ofbiz/order/shoppingcart/ applications/order/webapp/ordermgr/WEB-INF/actions/entry/ applications/order/webapp/ordermgr/WEB-INF/actions/order/ applications/order/webapp/ordermgr/entry/ ap...

Posted by Jacopo Cappellato <ja...@hotwaxmedia.com>.
On Jul 22, 2009, at 3:10 AM, David E Jones wrote:

>
> Most parameters needed are probably best specified when the PO is  
> created, and I say that because I don't think there are very many.  
> The main ones needed are the internal organization that is doing the  
> purchasing, the destination facility, agreement(s) to use for the  
> pricing, and there may be others.

IMO agreements could be used here; but they will need to be cleaned  
up, expanded and enhanced.

Jacopo


Re: svn commit: r795883 - in /ofbiz/trunk: applications/order/src/org/ofbiz/order/shoppingcart/ applications/order/webapp/ordermgr/WEB-INF/actions/entry/ applications/order/webapp/ordermgr/WEB-INF/actions/order/ applications/order/webapp/ordermgr/entry/ ap...

Posted by David E Jones <de...@me.com>.
On Jul 21, 2009, at 2:04 PM, BJ Freeman wrote:

> I am all in favor of the PO no being tied to the product store.
> question is what entity(ies) should be used to tie thing to say a
> partyID that has a role of internal organization. Where to store the
> current flags and lookups that are in the product store that would be
> used for a PO.

Most parameters needed are probably best specified when the PO is  
created, and I say that because I don't think there are very many. The  
main ones needed are the internal organization that is doing the  
purchasing, the destination facility, agreement(s) to use for the  
pricing, and there may be others.

> Also it seems a lot of shared code for orders may have to be  
> refactored.

Hopefully not. At one point a few years ago POs did not require a  
ProductStore at all. I know that because I worked on it... but it has  
been a while. Only changes since then should be causing problems, and  
hopefully there are not very many.

-David


> David E Jones sent the following on 7/21/2009 12:21 PM:
>>
>> Whatever future fixes go in they should ALL go in the direction of  
>> not
>> requiring a ProductStore for a purchase order.
>>
>> The bug here is that a ProductStore is required for a purchase  
>> order, or
>> is used at all for a purchase order. ProductStore information should
>> ONLY be used for sales order.
>>
>> If any code doesn't follow that it's a bug, and IMO a partial fix is
>> better than no fix at all...
>>
>> -David
>>
>>
>> On Jul 21, 2009, at 4:33 AM, Vikas Mayur wrote:
>>
>>> The functionality of receiving a Purchase Order is broken just after
>>> this commit. ProductStore is referred while creating an invoice for
>>> purchase order. See the reference in InvoiceServices class.
>>>
>>> Steps to reproduce:
>>> 1. Create a purchase order.
>>> 2. Approve the order.
>>> 3. Under Actions block, Click on Quick Receive Purchase Order
>>> 4. Select the Shipment to Receive and click on Receive Selected  
>>> Shipment
>>> 5. Select the checkbox Set Shipment As Received.
>>> 6. Click on Receive Selected Product(s)
>>>
>>> Please update the trunk with the fix or revert this commit if it  
>>> takes
>>> too much time.
>>>
>>> Vikas
>>>
>>> On Jul 20, 2009, at 9:22 PM, eckardjf@apache.org wrote:
>>>
>>>> Author: eckardjf
>>>> Date: Mon Jul 20 15:52:05 2009
>>>> New Revision: 795883
>>>>
>>>> URL: http://svn.apache.org/viewvc?rev=795883&view=rev
>>>> Log:
>>>> Changes to ShoppingCart & order entry to allow PO entry without
>>>> requiring a ProductStore; updated seed data to remove  
>>>> productStoreId
>>>> from the OrderEntry website
>>>>
>>>> Modified:
>>>>
>>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>>>> CheckOutHelper.java
>>>>
>>>>
>>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>>>> ShoppingCart.java
>>>>
>>>>
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>> entry/OptionSettings.groovy
>>>>
>>>>
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>> entry/OrderAgreements.groovy
>>>>
>>>>
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>> order/OrderView.groovy
>>>>
>>>>
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/ 
>>>> showcartitems.ftl
>>>>
>>>>
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>>> optionsettings.ftl
>>>>
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>>> orderagreements.ftl
>>>>  ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml
>>>>
>>>> Modified:
>>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>>>> CheckOutHelper.java
>>>>
>>>> URL:
>>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java?rev=795883&r1=795882&r2=795883&view=diff
>>>>
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> ===================================================================
>>>>
>>>> ---
>>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>>>> CheckOutHelper.java
>>>> (original)
>>>> +++
>>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>>>> CheckOutHelper.java
>>>> Mon Jul 20 15:52:05 2009
>>>> @@ -789,8 +789,6 @@
>>>>   }
>>>>
>>>>   private Map makeTaxContext(int shipGroup, GenericValue
>>>> shipAddress, Map shoppingCartItemIndexMap) throws  
>>>> GeneralException {
>>>> -        String productStoreId = cart.getProductStoreId();
>>>> -        String billToPartyId = cart.getBillToCustomerPartyId();
>>>>       ShoppingCart.CartShipInfo csi = cart.getShipInfo(shipGroup);
>>>>       int totalItems = csi.shipItemInfo.size();
>>>>
>>>> @@ -839,8 +837,9 @@
>>>>           }
>>>>       }
>>>>
>>>> -        Map serviceContext = UtilMisc.toMap("productStoreId",
>>>> productStoreId);
>>>> -        serviceContext.put("billToPartyId", billToPartyId);
>>>> +        Map serviceContext = UtilMisc.toMap("productStoreId",
>>>> cart.getProductStoreId());
>>>> +        serviceContext.put("payToPartyId",
>>>> cart.getBillFromVendorPartyId());
>>>> +        serviceContext.put("billToPartyId",
>>>> cart.getBillToCustomerPartyId());
>>>>       serviceContext.put("itemProductList", product);
>>>>       serviceContext.put("itemAmountList", amount);
>>>>       serviceContext.put("itemPriceList", price);
>>>>
>>>> Modified:
>>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>>>> ShoppingCart.java
>>>>
>>>> URL:
>>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java?rev=795883&r1=795882&r2=795883&view=diff
>>>>
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> ===================================================================
>>>>
>>>> ---
>>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>>>> ShoppingCart.java
>>>> (original)
>>>> +++
>>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ 
>>>> ShoppingCart.java
>>>> Mon Jul 20 15:52:05 2009
>>>> @@ -231,38 +231,35 @@
>>>>
>>>>   /** Creates new empty ShoppingCart object. */
>>>>   public ShoppingCart(GenericDelegator delegator, String
>>>> productStoreId, String webSiteId, Locale locale, String  
>>>> currencyUom,
>>>> String billToCustomerPartyId, String billFromVendorPartyId) {
>>>> +
>>>>       this.delegator = delegator;
>>>>       this.delegatorName = delegator.getDelegatorName();
>>>>       this.productStoreId = productStoreId;
>>>>       this.webSiteId = webSiteId;
>>>> -        this.currencyUom = currencyUom;
>>>> -        this.locale = locale;
>>>> -        if (this.locale == null) {
>>>> -            this.locale = Locale.getDefault();
>>>> -        }
>>>> +        this.locale = (locale != null) ? locale :  
>>>> Locale.getDefault();
>>>> +        this.currencyUom = (currencyUom != null) ? currencyUom :
>>>> UtilProperties.getPropertyValue("general.properties",
>>>> "currency.uom.id.default", "USD");
>>>> +        this.billToCustomerPartyId = billToCustomerPartyId;
>>>> +        this.billFromVendorPartyId = billFromVendorPartyId;
>>>>
>>>> -        if (productStoreId == null) {
>>>> -            throw new IllegalArgumentException("productStoreId
>>>> cannot be null");
>>>> -        }
>>>> +        if (productStoreId != null) {
>>>>
>>>> -        // set the default view cart on add for this store
>>>> -        GenericValue productStore =
>>>> ProductStoreWorker.getProductStore(productStoreId, delegator);
>>>> -        if (productStore == null) {
>>>> -            throw new IllegalArgumentException("Unable to locate
>>>> ProductStore by ID [" + productStoreId + "]");
>>>> -        }
>>>> +            // set the default view cart on add for this store
>>>> +            GenericValue productStore =
>>>> ProductStoreWorker.getProductStore(productStoreId, delegator);
>>>> +            if (productStore == null) {
>>>> +                throw new IllegalArgumentException("Unable to  
>>>> locate
>>>> ProductStore by ID [" + productStoreId + "]");
>>>> +            }
>>>>
>>>> -        String storeViewCartOnAdd =
>>>> productStore.getString("viewCartOnAdd");
>>>> -        if (storeViewCartOnAdd != null &&
>>>> "Y".equalsIgnoreCase(storeViewCartOnAdd)) {
>>>> -            this.viewCartOnAdd = true;
>>>> -        }
>>>> +            String storeViewCartOnAdd =
>>>> productStore.getString("viewCartOnAdd");
>>>> +            if (storeViewCartOnAdd != null &&
>>>> "Y".equalsIgnoreCase(storeViewCartOnAdd)) {
>>>> +                this.viewCartOnAdd = true;
>>>> +            }
>>>>
>>>> -        if (billFromVendorPartyId == null) {
>>>> -            // since default cart is of type SALES_ORDER, set to
>>>> store's payToPartyId
>>>> -            this.billFromVendorPartyId =
>>>> productStore.getString("payToPartyId");
>>>> -        } else {
>>>> -            this.billFromVendorPartyId = billFromVendorPartyId;
>>>> +            if (billFromVendorPartyId == null) {
>>>> +                // since default cart is of type SALES_ORDER,  
>>>> set to
>>>> store's payToPartyId
>>>> +                this.billFromVendorPartyId =
>>>> productStore.getString("payToPartyId");
>>>> +            }
>>>>       }
>>>> -        this.billToCustomerPartyId = billToCustomerPartyId;
>>>> +
>>>>   }
>>>>
>>>>
>>>>
>>>> Modified:
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>> entry/OptionSettings.groovy
>>>>
>>>> URL:
>>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OptionSettings.groovy?rev=795883&r1=795882&r2=795883&view=diff
>>>>
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> ===================================================================
>>>>
>>>> ---
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>> entry/OptionSettings.groovy
>>>> (original)
>>>> +++
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>> entry/OptionSettings.groovy
>>>> Mon Jul 20 15:52:05 2009
>>>> @@ -26,9 +26,13 @@
>>>>
>>>> cart = session.getAttribute("shoppingCart");
>>>> context.cart = cart;
>>>> +
>>>> productStore = ProductStoreWorker.getProductStore(request);
>>>> -productStoreId = productStore.productStoreId;
>>>> -context.productStore = productStore;
>>>> +if (productStore) {
>>>> +    context.productStore = productStore;
>>>> +    context.carrierShipmentMethodList =
>>>> delegator.findByAndCache('ProductStoreShipmentMethView',
>>>> [productStoreId: productStore.productStoreId], ['sequenceNumber']);
>>>> +}
>>>> +
>>>> // nuke the event messages
>>>> request.removeAttribute("_EVENT_MESSAGE_");
>>>>
>>>> @@ -39,7 +43,6 @@
>>>>   context.orderPartyId = orderPartyId;
>>>> }
>>>>
>>>> -context.carrierShipmentMethodList =
>>>> delegator.findByAndCache("ProductStoreShipmentMethView",
>>>> [productStoreId : productStoreId], ["sequenceNumber"]);
>>>> context.emailList =  
>>>> ContactHelper.getContactMechByType(orderPartyId,
>>>> "EMAIL_ADDRESS", false);
>>>>
>>>> // create the beforeDate for calendar
>>>> @@ -65,3 +68,4 @@
>>>> toTs = new Timestamp(toCal.getTimeInMillis());
>>>> toStr = toTs.toString();
>>>> context.afterDateStr = toStr;
>>>> +
>>>>
>>>> Modified:
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>> entry/OrderAgreements.groovy
>>>>
>>>> URL:
>>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OrderAgreements.groovy?rev=795883&r1=795882&r2=795883&view=diff
>>>>
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> ===================================================================
>>>>
>>>> ---
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>> entry/OrderAgreements.groovy
>>>> (original)
>>>> +++
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>> entry/OrderAgreements.groovy
>>>> Mon Jul 20 15:52:05 2009
>>>> @@ -17,85 +17,80 @@
>>>> * under the License.
>>>> */
>>>>
>>>> -import org.ofbiz.service.*;
>>>> -import org.ofbiz.entity.*;
>>>> -import org.ofbiz.entity.condition.*;
>>>> -import org.ofbiz.entity.util.*;
>>>> -import org.ofbiz.base.util.*;
>>>> -import org.ofbiz.order.shoppingcart.*;
>>>> -import org.ofbiz.party.party.PartyWorker;
>>>> -import org.ofbiz.product.catalog.CatalogWorker;
>>>> -import org.ofbiz.product.store.ProductStoreWorker;
>>>> -import org.ofbiz.order.shoppingcart.product.ProductDisplayWorker;
>>>> -import org.ofbiz.order.shoppingcart.product.ProductPromoWorker;
>>>> import org.ofbiz.entity.condition.EntityCondition;
>>>> -import org.ofbiz.entity.condition.EntityExpr;
>>>> import org.ofbiz.entity.condition.EntityOperator;
>>>> -import javolution.util.FastList;
>>>> +import org.ofbiz.entity.util.EntityUtil;
>>>> +import org.ofbiz.order.shoppingcart.*;
>>>> +import org.ofbiz.product.catalog.CatalogWorker;
>>>>
>>>>
>>>> -// Get the Cart and Prepare Size
>>>> shoppingCart = ShoppingCartEvents.getCartObject(request);
>>>> context.cart = shoppingCart;
>>>>
>>>> -// check the selected product store
>>>> +// get applicable agreements for order entry
>>>> +if ('PURCHASE_ORDER'.equals(shoppingCart.getOrderType())) {
>>>> +
>>>> +    // for a purchase order, orderPartyId = billFromVendor (the
>>>> supplier)
>>>> +    supplierPartyId = shoppingCart.getOrderPartyId();
>>>> +    customerPartyId = shoppingCart.getBillToCustomerPartyId();
>>>> +
>>>> +    // the agreement for a purchse order is from us to the  
>>>> supplier
>>>> +    agreementCondition = EntityCondition.makeCondition([
>>>> +            EntityCondition.makeCondition('partyIdTo',
>>>> EntityOperator.EQUALS, supplierPartyId),
>>>> +            EntityCondition.makeCondition('partyIdFrom',
>>>> EntityOperator.EQUALS, customerPartyId)
>>>> +    ], EntityOperator.AND);
>>>> +
>>>> +    agreementRoleCondition = EntityCondition.makeCondition([
>>>> +            EntityCondition.makeCondition('partyId',
>>>> EntityOperator.EQUALS, supplierPartyId),
>>>> +            EntityCondition.makeCondition('roleTypeId',
>>>> EntityOperator.EQUALS, 'SUPPLIER')
>>>> +    ], EntityOperator.AND);
>>>> +
>>>> +} else {
>>>> +
>>>> +    // for a sales order, orderPartyId = billToCustomer (the  
>>>> customer)
>>>> +    customerPartyId = shoppingCart.getOrderPartyId();
>>>> +    companyPartyId = shoppingCart.getBillFromVendorPartyId();
>>>> +
>>>> +    // the agreement for a sales order is from the customer to us
>>>> +    agreementCondition = EntityCondition.makeCondition([
>>>> +            EntityCondition.makeCondition('partyIdTo',
>>>> EntityOperator.EQUALS, companyPartyId),
>>>> +            EntityCondition.makeCondition('partyIdFrom',
>>>> EntityOperator.EQUALS, customerPartyId)
>>>> +    ], EntityOperator.AND);
>>>> +
>>>> +    agreementRoleCondition = EntityCondition.makeCondition([
>>>> +            EntityCondition.makeCondition('partyId',
>>>> EntityOperator.EQUALS, customerPartyId),
>>>> +            EntityCondition.makeCondition('roleTypeId',
>>>> EntityOperator.EQUALS, 'CUSTOMER')
>>>> +    ], EntityOperator.AND);
>>>> +
>>>> +}
>>>> +
>>>> +agreements = delegator.findList('Agreement', agreementCondition,
>>>> null, null, null, true);
>>>> +agreements = EntityUtil.filterByDate(agreements);
>>>> +if (agreements) {
>>>> +    context.agreements = agreements;
>>>> +}
>>>> +
>>>> +agreementRoles = delegator.findList('AgreementRole',
>>>> agreementRoleCondition, null, null, null, true);
>>>> +if (agreementRoles) {
>>>> +    context.agreementRoles = agreementRoles;
>>>> +}
>>>> +
>>>> +// catalog id collection, current catalog id and name
>>>> productStoreId = shoppingCart.getProductStoreId();
>>>> -productStore = null;
>>>> -if (productStoreId) {
>>>> -    productStore =
>>>> ProductStoreWorker.getProductStore(productStoreId, delegator);
>>>> -    if (productStore) {
>>>> -        // put in the default currency, to help selecting a  
>>>> currency
>>>> for a purchase order
>>>> -        context.defaultCurrencyUomId =
>>>> productStore.defaultCurrencyUomId;
>>>> -        payToPartyId = productStore.payToPartyId;
>>>> -        partyId = shoppingCart.getOrderPartyId();
>>>> -
>>>> -        exprsAgreements = FastList.newInstance();
>>>> -        exprsAgreementRoles = FastList.newInstance();
>>>> -        // get applicable agreements for order entry
>>>> -        if  
>>>> ("PURCHASE_ORDER".equals(shoppingCart.getOrderType())) {
>>>> -            // the agreement for a PO is from customer to  
>>>> payToParty
>>>> (ie, us)
>>>> -
>>>> exprsAgreements.add(EntityCondition.makeCondition("partyIdTo",
>>>> EntityOperator.EQUALS, partyId));
>>>> -
>>>> exprsAgreements.add(EntityCondition.makeCondition("partyIdFrom",
>>>> EntityOperator.EQUALS, payToPartyId));
>>>> -            agreements = delegator.findList("Agreement",
>>>> EntityCondition.makeCondition(exprsAgreements, EntityOperator.AND),
>>>> null, null, null, true);
>>>> -
>>>> exprsAgreementRoles.add(EntityCondition.makeCondition("partyId",
>>>> EntityOperator.EQUALS, partyId));
>>>> -
>>>> exprsAgreementRoles.add(EntityCondition.makeCondition("roleTypeId",
>>>> EntityOperator.EQUALS, "SUPPLIER"));
>>>> -            agreementRoles = delegator.findList("AgreementRole",
>>>> EntityCondition.makeCondition(exprsAgreementRoles,
>>>> EntityOperator.AND), null, null, null, true);
>>>> -            catalogCol = CatalogWorker.getAllCatalogIds(request);
>>>> -        } else {
>>>> -            // the agreement for a sales order is from us to the
>>>> customer
>>>> -
>>>> exprsAgreements.add(EntityCondition.makeCondition("partyIdTo",
>>>> EntityOperator.EQUALS, payToPartyId));
>>>> -
>>>> exprsAgreements.add(EntityCondition.makeCondition("partyIdFrom",
>>>> EntityOperator.EQUALS, partyId));
>>>> -            agreements = delegator.findList("Agreement",
>>>> EntityCondition.makeCondition(exprsAgreements, EntityOperator.AND),
>>>> null, null, null, true);
>>>> -
>>>> exprsAgreementRoles.add(EntityCondition.makeCondition("partyId",
>>>> EntityOperator.EQUALS, partyId));
>>>> -
>>>> exprsAgreementRoles.add(EntityCondition.makeCondition("roleTypeId",
>>>> EntityOperator.EQUALS, "CUSTOMER"));
>>>> -            agreementRoles = delegator.findList("AgreementRole",
>>>> EntityCondition.makeCondition(exprsAgreementRoles,
>>>> EntityOperator.AND), null, null, null, true);
>>>> -            catalogCol =
>>>> CatalogWorker.getCatalogIdsAvailable(delegator, productStoreId,
>>>> partyId);
>>>> -        }
>>>> -
>>>> -        agreements = EntityUtil.filterByDate(agreements);
>>>> -        if (agreements) {
>>>> -            context.agreements = agreements;
>>>> -        }
>>>> -        if (agreementRoles) {
>>>> -            context.agreementRoles =agreementRoles;
>>>> -        }
>>>> -
>>>> -
>>>> -        if (catalogCol) {
>>>> -            currentCatalogId = catalogCol.get(0);
>>>> -            currentCatalogName =
>>>> CatalogWorker.getCatalogName(request, currentCatalogId);
>>>> -            context.catalogCol = catalogCol;
>>>> -            context.currentCatalogId = currentCatalogId;
>>>> -            context.currentCatalogName = currentCatalogName;
>>>> -        }
>>>> -    }
>>>> +if ('SALES_ORDER' == shoppingCart.getOrderType() &&  
>>>> productStoreId) {
>>>> +    catalogCol = CatalogWorker.getCatalogIdsAvailable(delegator,
>>>> productStoreId, shoppingCart.getOrderPartyId());
>>>> +} else {
>>>> +    catalogCol = CatalogWorker.getAllCatalogIds(request);
>>>> }
>>>>
>>>> -partyId = shoppingCart.getPartyId();
>>>> -if ("_NA_".equals(partyId)) partyId = null;
>>>> -context.partyId = partyId;
>>>> +if (catalogCol) {
>>>> +    context.catalogCol = catalogCol;
>>>> +
>>>> +    currentCatalogId = catalogCol.get(0);
>>>> +    context.currentCatalogId = currentCatalogId;
>>>> +    context.currentCatalogName =
>>>> CatalogWorker.getCatalogName(request, currentCatalogId);
>>>> +}
>>>>
>>>> // currencies and shopping cart currency
>>>> -currencies = delegator.findByAndCache("Uom", [uomTypeId :
>>>> "CURRENCY_MEASURE"]);
>>>> -context.currencies = currencies;
>>>> +context.currencies = delegator.findByAndCache('Uom', [uomTypeId:
>>>> 'CURRENCY_MEASURE']);
>>>> context.currencyUomId = shoppingCart.getCurrency();
>>>>
>>>> Modified:
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>> order/OrderView.groovy
>>>>
>>>> URL:
>>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy?rev=795883&r1=795882&r2=795883&view=diff
>>>>
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> ===================================================================
>>>>
>>>> ---
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>> order/OrderView.groovy
>>>> (original)
>>>> +++
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/ 
>>>> order/OrderView.groovy
>>>> Mon Jul 20 15:52:05 2009
>>>> @@ -386,9 +386,9 @@
>>>>   context.shippingContactMechList = shippingContactMechList;
>>>>
>>>>   // list to find all the shipmentMethods from the view named
>>>> "ProductStoreShipmentMethView".
>>>> -    productStoreId =
>>>> orderHeader.getRelatedOne("ProductStore").productStoreId;
>>>> -    productStoreShipmentMethList =
>>>> delegator.findByAndCache("ProductStoreShipmentMethView",
>>>> [productStoreId : productStoreId], ["sequenceNumber"]);
>>>> -    context.productStoreShipmentMethList =
>>>> productStoreShipmentMethList;
>>>> +    if (productStore) {
>>>> +        context.productStoreShipmentMethList =
>>>> delegator.findByAndCache('ProductStoreShipmentMethView',
>>>> [productStoreId: productStore.productStoreId], ['sequenceNumber']);
>>>> +    }
>>>>
>>>>   // Get a map of returnable items
>>>>   returnableItems = [:];
>>>> @@ -400,8 +400,8 @@
>>>>
>>>>   // get the catalogIds for appending items
>>>>   if (context.request != null) {
>>>> -        if ("SALES_ORDER".equals(orderType)) {
>>>> -            catalogCol =
>>>> CatalogWorker.getCatalogIdsAvailable(delegator, productStoreId,
>>>> partyId);
>>>> +        if ("SALES_ORDER".equals(orderType) && productStore) {
>>>> +            catalogCol =
>>>> CatalogWorker.getCatalogIdsAvailable(delegator,
>>>> productStore.productStoreId, partyId);
>>>>       } else {
>>>>           catalogCol = CatalogWorker.getAllCatalogIds(request);
>>>>       }
>>>> @@ -441,8 +441,8 @@
>>>>       context.shipmentRouteSegmentId =
>>>> shipmentRouteSegment.shipmentRouteSegmentId;
>>>>       context.pickedShipmentId = pickedShipmentId;
>>>>       if (pickedShipmentId &&  
>>>> shipmentRouteSegment.trackingIdNumber) {
>>>> -            if ("UPS" == shipmentRouteSegment.carrierPartyId) {
>>>> -                resultMap =
>>>> dispatcher.runSync("upsShipmentAlternateRatesEstimate", 
>>>> [productStoreId
>>>> : productStoreId, shipmentId : pickedShipmentId]);
>>>> +            if ("UPS" == shipmentRouteSegment.carrierPartyId &&
>>>> productStore) {
>>>> +                resultMap =
>>>> dispatcher.runSync('upsShipmentAlternateRatesEstimate',
>>>> [productStoreId: productStore.productStoreId, shipmentId:
>>>> pickedShipmentId]);
>>>>               shippingRates = resultMap.shippingRates;
>>>>               shippingRateList = [];
>>>>               shippingRates.each { shippingRate ->
>>>>
>>>> Modified:
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/ 
>>>> showcartitems.ftl
>>>>
>>>> URL:
>>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/showcartitems.ftl?rev=795883&r1=795882&r2=795883&view=diff
>>>>
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> ===================================================================
>>>>
>>>> ---
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/ 
>>>> showcartitems.ftl
>>>> (original)
>>>> +++
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/ 
>>>> showcartitems.ftl
>>>> Mon Jul 20 15:52:05 2009
>>>> @@ -39,7 +39,7 @@
>>>>         <td colspan="2">
>>>>           <div>
>>>>             <b>${uiLabelMap.ProductProduct}</b>
>>>> -              <#if productStore.showCheckoutGiftOptions? 
>>>> if_exists !=
>>>> "N">
>>>> +              <#if (shoppingCart.getOrderType() ==  
>>>> 'SALES_ORDER') &&
>>>> (productStore.showCheckoutGiftOptions)?default('Y') != 'N'>
>>>>                 <select name="GWALL"
>>>> onchange="javascript:gwAll(this);">
>>>>                   <option
>>>> value="">${uiLabelMap.OrderGiftWrapAllItems}</option>
>>>>                   <option
>>>> value="NO^">${uiLabelMap.OrderNoGiftWrap}</option>
>>>>
>>>> Modified:
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>>> optionsettings.ftl
>>>> URL:
>>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/optionsettings.ftl?rev=795883&r1=795882&r2=795883&view=diff
>>>>
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> ===================================================================
>>>>
>>>> ---
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>>> optionsettings.ftl
>>>> (original)
>>>> +++
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>>> optionsettings.ftl
>>>> Mon Jul 20 15:52:05 2009
>>>> @@ -139,34 +139,34 @@
>>>>                   <textarea cols="30" rows="3"
>>>> name="${shipGroupIndex?default("0")}_shipping_instructions">$ 
>>>> {cart.getShippingInstructions(shipGroupIndex)?if_exists}</textarea>
>>>>
>>>>                 </td>
>>>>               </tr>
>>>> -                <#if productStore.showCheckoutGiftOptions? 
>>>> if_exists
>>>> != "N">
>>>> -                <tr>
>>>> -                  <td colspan="2">
>>>> -                    <#if cart.getOrderType() = "PURCHASE_ORDER">
>>>> -                       <input type='hidden'
>>>> name='${shipGroupIndex?default("0")}_is_gift' value='false'>
>>>> -                    <#else>
>>>> -                    <div>
>>>> -                      <span
>>>> class="h2"><b>${uiLabelMap.OrderIsThisGift}</b></span>
>>>> -                      <input type='radio' <#if
>>>> cart.getIsGift(shipGroupIndex)?default("Y") == "Y">checked</#if>
>>>> name='${shipGroupIndex?default("0")}_is_gift' value='true'><span
>>>> class='tabletext'>${uiLabelMap.CommonYes}</span>
>>>> -                      <input type='radio' <#if
>>>> cart.getIsGift(shipGroupIndex)?default("N") == "N">checked</#if>
>>>> name='${shipGroupIndex?default("0")}_is_gift' value='false'><span
>>>> class='tabletext'>${uiLabelMap.CommonNo}</span>
>>>> -                    </div>
>>>> +
>>>> +                <#if cart.getOrderType() == 'PURCHASE_ORDER'>
>>>> +                    <input type="hidden"
>>>> name="${shipGroupIndex?default('0')}_is_gift" value="false">
>>>> +                <#else>
>>>> +                    <#if
>>>> (productStore.showCheckoutGiftOptions)?default('Y') != 'N'>
>>>> +                        <tr>
>>>> +                            <td colspan="2">
>>>> +                                <div>
>>>> +                                    <span
>>>> class="h2"><b>${uiLabelMap.OrderIsThisGift}</b></span>
>>>> +                                    <input type="radio" <#if
>>>> cart.getIsGift(shipGroupIndex)?default('Y') ==
>>>> 'Y'>checked="checked"</#if>
>>>> name="${shipGroupIndex?default('0')}_is_gift" value="true"><span
>>>> class="tabletext">${uiLabelMap.CommonYes}</span>
>>>> +                                    <input type="radio" <#if
>>>> cart.getIsGift(shipGroupIndex)?default('N') ==
>>>> 'N'>checked="checked"</#if>
>>>> name="${shipGroupIndex?default('0')}_is_gift" value="false"><span
>>>> class="tabletext">${uiLabelMap.CommonNo}</span>
>>>> +                                </div>
>>>> +                            </td>
>>>> +                        </tr>
>>>>                   </#if>
>>>> -                  </td>
>>>> -                </tr>
>>>> -                <#if cart.getOrderType() != "PURCHASE_ORDER">
>>>> -                <tr><td colspan="2"><hr/></td></tr>
>>>> -                <tr>
>>>> -                  <td colspan="2">
>>>> -                    <h2>${uiLabelMap.OrderGiftMessage}</h2>
>>>> -                  </td>
>>>> -                </tr>
>>>> -                <tr>
>>>> -                  <td colspan="2">
>>>> -                    <textarea cols="30" rows="3"
>>>> name="${shipGroupIndex?default("0")}_gift_message">$ 
>>>> {cart.getGiftMessage(shipGroupIndex)?if_exists}</textarea>
>>>>
>>>> -                  </td>
>>>> -                </tr>
>>>> -                 </#if>
>>>> +                    <tr><td colspan="2"><hr /></td></tr>
>>>> +                    <tr>
>>>> +                        <td colspan="2">
>>>> +                            <h2>${uiLabelMap.OrderGiftMessage}</ 
>>>> h2>
>>>> +                        </td>
>>>> +                    </tr>
>>>> +                    <tr>
>>>> +                        <td colspan="2">
>>>> +                            <textarea cols="30" rows="3"
>>>> name="${shipGroupIndex?default('0')}_gift_message">$ 
>>>> {cart.getGiftMessage(shipGroupIndex)?if_exists}</textarea>
>>>>
>>>> +                        </td>
>>>> +                    </tr>
>>>>               </#if>
>>>> +
>>>>                  <tr>
>>>>                     <td colspan="2"></td>
>>>>                  </tr>
>>>>
>>>> Modified:
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>>> orderagreements.ftl
>>>> URL:
>>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/orderagreements.ftl?rev=795883&r1=795882&r2=795883&view=diff
>>>>
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> ===================================================================
>>>>
>>>> ---
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>>> orderagreements.ftl
>>>> (original)
>>>> +++
>>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/ 
>>>> orderagreements.ftl
>>>> Mon Jul 20 15:52:05 2009
>>>> @@ -128,7 +128,7 @@
>>>>           <select 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>
>>>> +              <option value="${currency.uomId}" <#if
>>>> currencyUomId?default('') == currency.uomId>selected="selected"</ 
>>>> #if>
>>>>> ${currency.uomId}</option>
>>>>             </#list>
>>>>           </select>
>>>>         </div>
>>>> @@ -143,11 +143,9 @@
>>>>       <td>&nbsp;</td>
>>>>       <td>
>>>>          <select name='CURRENT_CATALOG_ID'>
>>>> -            <option
>>>> value='${currentCatalogId}'>${currentCatalogName}</option>
>>>> -            <option value='${currentCatalogId}'></option>
>>>> -            <#list catalogCol as catalogId>
>>>> +            <#list catalogCol?if_exists as catalogId>
>>>>             <#assign thisCatalogName =
>>>> Static 
>>>> ["org.ofbiz.product.catalog.CatalogWorker"].getCatalogName(request,
>>>> catalogId)>
>>>> -              <option value='${catalogId}'>${thisCatalogName}</ 
>>>> option>
>>>> +              <option value="${catalogId}" <#if
>>>> currentCatalogId?default('') == catalogId>selected="selected"</#if>
>>>>> ${thisCatalogName}</option>
>>>>           </#list>
>>>>         </select>
>>>>       </td>
>>>>
>>>> Modified: ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml
>>>> URL:
>>>> http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml?rev=795883&r1=795882&r2=795883&view=diff
>>>>
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> = 
>>>> ===================================================================
>>>>
>>>> --- ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml  
>>>> (original)
>>>> +++ ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml Mon  
>>>> Jul
>>>> 20 15:52:05 2009
>>>> @@ -111,8 +111,6 @@
>>>>
>>>>   <WebSite webSiteId="WebStore" siteName="eCommerce Web Site"
>>>> productStoreId="9000" visualThemeSetId="ECOMMERCE"/>
>>>>   <WebSite webSiteId="WebStoreClone" siteName="Cloned eCommerce Web
>>>> Site" productStoreId="9000" visualThemeSetId="ECOMMERCE"/>
>>>> -    <!-- the following item is defined in the OrderTypeData.xml  
>>>> file
>>>> and just the productStoreId is being associated with it here -->
>>>> -    <WebSite webSiteId="OrderEntry" productStoreId="9000"/>
>>>>
>>>>   <ProdCatalog prodCatalogId="DemoCatalog" catalogName="Demo
>>>> Catalog" useQuickAdd="Y"/>
>>>>   <ProdCatalog prodCatalogId="TestCatalog" catalogName="Test
>>>> Catalog" useQuickAdd="N"/>
>>>>
>>>>
>>>
>>
>>
>
> -- 
> BJ Freeman
> http://www.businessesnetwork.com/automation
> http://bjfreeman.elance.com
> http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro
> Systems Integrator.
>


Re: svn commit: r795883 - in /ofbiz/trunk: applications/order/src/org/ofbiz/order/shoppingcart/ applications/order/webapp/ordermgr/WEB-INF/actions/entry/ applications/order/webapp/ordermgr/WEB-INF/actions/order/ applications/order/webapp/ordermgr/entry/ ap...

Posted by BJ Freeman <bj...@free-man.net>.
I am all in favor of the PO no being tied to the product store.
question is what entity(ies) should be used to tie thing to say a
partyID that has a role of internal organization. Where to store the
current flags and lookups that are in the product store that would be
used for a PO.
Also it seems a lot of shared code for orders may have to be refactored.


David E Jones sent the following on 7/21/2009 12:21 PM:
> 
> Whatever future fixes go in they should ALL go in the direction of not
> requiring a ProductStore for a purchase order.
> 
> The bug here is that a ProductStore is required for a purchase order, or
> is used at all for a purchase order. ProductStore information should
> ONLY be used for sales order.
> 
> If any code doesn't follow that it's a bug, and IMO a partial fix is
> better than no fix at all...
> 
> -David
> 
> 
> On Jul 21, 2009, at 4:33 AM, Vikas Mayur wrote:
> 
>> The functionality of receiving a Purchase Order is broken just after
>> this commit. ProductStore is referred while creating an invoice for
>> purchase order. See the reference in InvoiceServices class.
>>
>> Steps to reproduce:
>> 1. Create a purchase order.
>> 2. Approve the order.
>> 3. Under Actions block, Click on Quick Receive Purchase Order
>> 4. Select the Shipment to Receive and click on Receive Selected Shipment
>> 5. Select the checkbox Set Shipment As Received.
>> 6. Click on Receive Selected Product(s)
>>
>> Please update the trunk with the fix or revert this commit if it takes
>> too much time.
>>
>> Vikas
>>
>> On Jul 20, 2009, at 9:22 PM, eckardjf@apache.org wrote:
>>
>>> Author: eckardjf
>>> Date: Mon Jul 20 15:52:05 2009
>>> New Revision: 795883
>>>
>>> URL: http://svn.apache.org/viewvc?rev=795883&view=rev
>>> Log:
>>> Changes to ShoppingCart & order entry to allow PO entry without
>>> requiring a ProductStore; updated seed data to remove productStoreId
>>> from the OrderEntry website
>>>
>>> Modified:
>>>  
>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
>>>
>>>  
>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
>>>
>>>  
>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OptionSettings.groovy
>>>
>>>  
>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OrderAgreements.groovy
>>>
>>>  
>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy
>>>
>>>  
>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/showcartitems.ftl
>>>
>>>  
>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/optionsettings.ftl
>>>  
>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/orderagreements.ftl
>>>   ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml
>>>
>>> Modified:
>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
>>>
>>> URL:
>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java?rev=795883&r1=795882&r2=795883&view=diff
>>>
>>> ==============================================================================
>>>
>>> ---
>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
>>> (original)
>>> +++
>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutHelper.java
>>> Mon Jul 20 15:52:05 2009
>>> @@ -789,8 +789,6 @@
>>>    }
>>>
>>>    private Map makeTaxContext(int shipGroup, GenericValue
>>> shipAddress, Map shoppingCartItemIndexMap) throws GeneralException {
>>> -        String productStoreId = cart.getProductStoreId();
>>> -        String billToPartyId = cart.getBillToCustomerPartyId();
>>>        ShoppingCart.CartShipInfo csi = cart.getShipInfo(shipGroup);
>>>        int totalItems = csi.shipItemInfo.size();
>>>
>>> @@ -839,8 +837,9 @@
>>>            }
>>>        }
>>>
>>> -        Map serviceContext = UtilMisc.toMap("productStoreId",
>>> productStoreId);
>>> -        serviceContext.put("billToPartyId", billToPartyId);
>>> +        Map serviceContext = UtilMisc.toMap("productStoreId",
>>> cart.getProductStoreId());
>>> +        serviceContext.put("payToPartyId",
>>> cart.getBillFromVendorPartyId());
>>> +        serviceContext.put("billToPartyId",
>>> cart.getBillToCustomerPartyId());
>>>        serviceContext.put("itemProductList", product);
>>>        serviceContext.put("itemAmountList", amount);
>>>        serviceContext.put("itemPriceList", price);
>>>
>>> Modified:
>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
>>>
>>> URL:
>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java?rev=795883&r1=795882&r2=795883&view=diff
>>>
>>> ==============================================================================
>>>
>>> ---
>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
>>> (original)
>>> +++
>>> ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
>>> Mon Jul 20 15:52:05 2009
>>> @@ -231,38 +231,35 @@
>>>
>>>    /** Creates new empty ShoppingCart object. */
>>>    public ShoppingCart(GenericDelegator delegator, String
>>> productStoreId, String webSiteId, Locale locale, String currencyUom,
>>> String billToCustomerPartyId, String billFromVendorPartyId) {
>>> +
>>>        this.delegator = delegator;
>>>        this.delegatorName = delegator.getDelegatorName();
>>>        this.productStoreId = productStoreId;
>>>        this.webSiteId = webSiteId;
>>> -        this.currencyUom = currencyUom;
>>> -        this.locale = locale;
>>> -        if (this.locale == null) {
>>> -            this.locale = Locale.getDefault();
>>> -        }
>>> +        this.locale = (locale != null) ? locale : Locale.getDefault();
>>> +        this.currencyUom = (currencyUom != null) ? currencyUom :
>>> UtilProperties.getPropertyValue("general.properties",
>>> "currency.uom.id.default", "USD");
>>> +        this.billToCustomerPartyId = billToCustomerPartyId;
>>> +        this.billFromVendorPartyId = billFromVendorPartyId;
>>>
>>> -        if (productStoreId == null) {
>>> -            throw new IllegalArgumentException("productStoreId
>>> cannot be null");
>>> -        }
>>> +        if (productStoreId != null) {
>>>
>>> -        // set the default view cart on add for this store
>>> -        GenericValue productStore =
>>> ProductStoreWorker.getProductStore(productStoreId, delegator);
>>> -        if (productStore == null) {
>>> -            throw new IllegalArgumentException("Unable to locate
>>> ProductStore by ID [" + productStoreId + "]");
>>> -        }
>>> +            // set the default view cart on add for this store
>>> +            GenericValue productStore =
>>> ProductStoreWorker.getProductStore(productStoreId, delegator);
>>> +            if (productStore == null) {
>>> +                throw new IllegalArgumentException("Unable to locate
>>> ProductStore by ID [" + productStoreId + "]");
>>> +            }
>>>
>>> -        String storeViewCartOnAdd =
>>> productStore.getString("viewCartOnAdd");
>>> -        if (storeViewCartOnAdd != null &&
>>> "Y".equalsIgnoreCase(storeViewCartOnAdd)) {
>>> -            this.viewCartOnAdd = true;
>>> -        }
>>> +            String storeViewCartOnAdd =
>>> productStore.getString("viewCartOnAdd");
>>> +            if (storeViewCartOnAdd != null &&
>>> "Y".equalsIgnoreCase(storeViewCartOnAdd)) {
>>> +                this.viewCartOnAdd = true;
>>> +            }
>>>
>>> -        if (billFromVendorPartyId == null) {
>>> -            // since default cart is of type SALES_ORDER, set to
>>> store's payToPartyId
>>> -            this.billFromVendorPartyId =
>>> productStore.getString("payToPartyId");
>>> -        } else {
>>> -            this.billFromVendorPartyId = billFromVendorPartyId;
>>> +            if (billFromVendorPartyId == null) {
>>> +                // since default cart is of type SALES_ORDER, set to
>>> store's payToPartyId
>>> +                this.billFromVendorPartyId =
>>> productStore.getString("payToPartyId");
>>> +            }
>>>        }
>>> -        this.billToCustomerPartyId = billToCustomerPartyId;
>>> +
>>>    }
>>>
>>>
>>>
>>> Modified:
>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OptionSettings.groovy
>>>
>>> URL:
>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OptionSettings.groovy?rev=795883&r1=795882&r2=795883&view=diff
>>>
>>> ==============================================================================
>>>
>>> ---
>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OptionSettings.groovy
>>> (original)
>>> +++
>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OptionSettings.groovy
>>> Mon Jul 20 15:52:05 2009
>>> @@ -26,9 +26,13 @@
>>>
>>> cart = session.getAttribute("shoppingCart");
>>> context.cart = cart;
>>> +
>>> productStore = ProductStoreWorker.getProductStore(request);
>>> -productStoreId = productStore.productStoreId;
>>> -context.productStore = productStore;
>>> +if (productStore) {
>>> +    context.productStore = productStore;
>>> +    context.carrierShipmentMethodList =
>>> delegator.findByAndCache('ProductStoreShipmentMethView',
>>> [productStoreId: productStore.productStoreId], ['sequenceNumber']);
>>> +}
>>> +
>>> // nuke the event messages
>>> request.removeAttribute("_EVENT_MESSAGE_");
>>>
>>> @@ -39,7 +43,6 @@
>>>    context.orderPartyId = orderPartyId;
>>> }
>>>
>>> -context.carrierShipmentMethodList =
>>> delegator.findByAndCache("ProductStoreShipmentMethView",
>>> [productStoreId : productStoreId], ["sequenceNumber"]);
>>> context.emailList = ContactHelper.getContactMechByType(orderPartyId,
>>> "EMAIL_ADDRESS", false);
>>>
>>> // create the beforeDate for calendar
>>> @@ -65,3 +68,4 @@
>>> toTs = new Timestamp(toCal.getTimeInMillis());
>>> toStr = toTs.toString();
>>> context.afterDateStr = toStr;
>>> +
>>>
>>> Modified:
>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OrderAgreements.groovy
>>>
>>> URL:
>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OrderAgreements.groovy?rev=795883&r1=795882&r2=795883&view=diff
>>>
>>> ==============================================================================
>>>
>>> ---
>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OrderAgreements.groovy
>>> (original)
>>> +++
>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/OrderAgreements.groovy
>>> Mon Jul 20 15:52:05 2009
>>> @@ -17,85 +17,80 @@
>>> * under the License.
>>> */
>>>
>>> -import org.ofbiz.service.*;
>>> -import org.ofbiz.entity.*;
>>> -import org.ofbiz.entity.condition.*;
>>> -import org.ofbiz.entity.util.*;
>>> -import org.ofbiz.base.util.*;
>>> -import org.ofbiz.order.shoppingcart.*;
>>> -import org.ofbiz.party.party.PartyWorker;
>>> -import org.ofbiz.product.catalog.CatalogWorker;
>>> -import org.ofbiz.product.store.ProductStoreWorker;
>>> -import org.ofbiz.order.shoppingcart.product.ProductDisplayWorker;
>>> -import org.ofbiz.order.shoppingcart.product.ProductPromoWorker;
>>> import org.ofbiz.entity.condition.EntityCondition;
>>> -import org.ofbiz.entity.condition.EntityExpr;
>>> import org.ofbiz.entity.condition.EntityOperator;
>>> -import javolution.util.FastList;
>>> +import org.ofbiz.entity.util.EntityUtil;
>>> +import org.ofbiz.order.shoppingcart.*;
>>> +import org.ofbiz.product.catalog.CatalogWorker;
>>>
>>>
>>> -// Get the Cart and Prepare Size
>>> shoppingCart = ShoppingCartEvents.getCartObject(request);
>>> context.cart = shoppingCart;
>>>
>>> -// check the selected product store
>>> +// get applicable agreements for order entry
>>> +if ('PURCHASE_ORDER'.equals(shoppingCart.getOrderType())) {
>>> +
>>> +    // for a purchase order, orderPartyId = billFromVendor (the
>>> supplier)
>>> +    supplierPartyId = shoppingCart.getOrderPartyId();
>>> +    customerPartyId = shoppingCart.getBillToCustomerPartyId();
>>> +
>>> +    // the agreement for a purchse order is from us to the supplier
>>> +    agreementCondition = EntityCondition.makeCondition([
>>> +            EntityCondition.makeCondition('partyIdTo',
>>> EntityOperator.EQUALS, supplierPartyId),
>>> +            EntityCondition.makeCondition('partyIdFrom',
>>> EntityOperator.EQUALS, customerPartyId)
>>> +    ], EntityOperator.AND);
>>> +
>>> +    agreementRoleCondition = EntityCondition.makeCondition([
>>> +            EntityCondition.makeCondition('partyId',
>>> EntityOperator.EQUALS, supplierPartyId),
>>> +            EntityCondition.makeCondition('roleTypeId',
>>> EntityOperator.EQUALS, 'SUPPLIER')
>>> +    ], EntityOperator.AND);
>>> +
>>> +} else {
>>> +
>>> +    // for a sales order, orderPartyId = billToCustomer (the customer)
>>> +    customerPartyId = shoppingCart.getOrderPartyId();
>>> +    companyPartyId = shoppingCart.getBillFromVendorPartyId();
>>> +
>>> +    // the agreement for a sales order is from the customer to us
>>> +    agreementCondition = EntityCondition.makeCondition([
>>> +            EntityCondition.makeCondition('partyIdTo',
>>> EntityOperator.EQUALS, companyPartyId),
>>> +            EntityCondition.makeCondition('partyIdFrom',
>>> EntityOperator.EQUALS, customerPartyId)
>>> +    ], EntityOperator.AND);
>>> +
>>> +    agreementRoleCondition = EntityCondition.makeCondition([
>>> +            EntityCondition.makeCondition('partyId',
>>> EntityOperator.EQUALS, customerPartyId),
>>> +            EntityCondition.makeCondition('roleTypeId',
>>> EntityOperator.EQUALS, 'CUSTOMER')
>>> +    ], EntityOperator.AND);
>>> +
>>> +}
>>> +
>>> +agreements = delegator.findList('Agreement', agreementCondition,
>>> null, null, null, true);
>>> +agreements = EntityUtil.filterByDate(agreements);
>>> +if (agreements) {
>>> +    context.agreements = agreements;
>>> +}
>>> +
>>> +agreementRoles = delegator.findList('AgreementRole',
>>> agreementRoleCondition, null, null, null, true);
>>> +if (agreementRoles) {
>>> +    context.agreementRoles = agreementRoles;
>>> +}
>>> +
>>> +// catalog id collection, current catalog id and name
>>> productStoreId = shoppingCart.getProductStoreId();
>>> -productStore = null;
>>> -if (productStoreId) {
>>> -    productStore =
>>> ProductStoreWorker.getProductStore(productStoreId, delegator);
>>> -    if (productStore) {
>>> -        // put in the default currency, to help selecting a currency
>>> for a purchase order
>>> -        context.defaultCurrencyUomId =
>>> productStore.defaultCurrencyUomId;
>>> -        payToPartyId = productStore.payToPartyId;
>>> -        partyId = shoppingCart.getOrderPartyId();
>>> -
>>> -        exprsAgreements = FastList.newInstance();
>>> -        exprsAgreementRoles = FastList.newInstance();
>>> -        // get applicable agreements for order entry
>>> -        if ("PURCHASE_ORDER".equals(shoppingCart.getOrderType())) {
>>> -            // the agreement for a PO is from customer to payToParty
>>> (ie, us)
>>> -           
>>> exprsAgreements.add(EntityCondition.makeCondition("partyIdTo",
>>> EntityOperator.EQUALS, partyId));
>>> -           
>>> exprsAgreements.add(EntityCondition.makeCondition("partyIdFrom",
>>> EntityOperator.EQUALS, payToPartyId));
>>> -            agreements = delegator.findList("Agreement",
>>> EntityCondition.makeCondition(exprsAgreements, EntityOperator.AND),
>>> null, null, null, true);
>>> -           
>>> exprsAgreementRoles.add(EntityCondition.makeCondition("partyId",
>>> EntityOperator.EQUALS, partyId));
>>> -           
>>> exprsAgreementRoles.add(EntityCondition.makeCondition("roleTypeId",
>>> EntityOperator.EQUALS, "SUPPLIER"));
>>> -            agreementRoles = delegator.findList("AgreementRole",
>>> EntityCondition.makeCondition(exprsAgreementRoles,
>>> EntityOperator.AND), null, null, null, true);
>>> -            catalogCol = CatalogWorker.getAllCatalogIds(request);
>>> -        } else {
>>> -            // the agreement for a sales order is from us to the
>>> customer
>>> -           
>>> exprsAgreements.add(EntityCondition.makeCondition("partyIdTo",
>>> EntityOperator.EQUALS, payToPartyId));
>>> -           
>>> exprsAgreements.add(EntityCondition.makeCondition("partyIdFrom",
>>> EntityOperator.EQUALS, partyId));
>>> -            agreements = delegator.findList("Agreement",
>>> EntityCondition.makeCondition(exprsAgreements, EntityOperator.AND),
>>> null, null, null, true);
>>> -           
>>> exprsAgreementRoles.add(EntityCondition.makeCondition("partyId",
>>> EntityOperator.EQUALS, partyId));
>>> -           
>>> exprsAgreementRoles.add(EntityCondition.makeCondition("roleTypeId",
>>> EntityOperator.EQUALS, "CUSTOMER"));
>>> -            agreementRoles = delegator.findList("AgreementRole",
>>> EntityCondition.makeCondition(exprsAgreementRoles,
>>> EntityOperator.AND), null, null, null, true);
>>> -            catalogCol =
>>> CatalogWorker.getCatalogIdsAvailable(delegator, productStoreId,
>>> partyId);
>>> -        }
>>> -
>>> -        agreements = EntityUtil.filterByDate(agreements);
>>> -        if (agreements) {
>>> -            context.agreements = agreements;
>>> -        }
>>> -        if (agreementRoles) {
>>> -            context.agreementRoles =agreementRoles;
>>> -        }
>>> -
>>> -
>>> -        if (catalogCol) {
>>> -            currentCatalogId = catalogCol.get(0);
>>> -            currentCatalogName =
>>> CatalogWorker.getCatalogName(request, currentCatalogId);
>>> -            context.catalogCol = catalogCol;
>>> -            context.currentCatalogId = currentCatalogId;
>>> -            context.currentCatalogName = currentCatalogName;
>>> -        }
>>> -    }
>>> +if ('SALES_ORDER' == shoppingCart.getOrderType() && productStoreId) {
>>> +    catalogCol = CatalogWorker.getCatalogIdsAvailable(delegator,
>>> productStoreId, shoppingCart.getOrderPartyId());
>>> +} else {
>>> +    catalogCol = CatalogWorker.getAllCatalogIds(request);
>>> }
>>>
>>> -partyId = shoppingCart.getPartyId();
>>> -if ("_NA_".equals(partyId)) partyId = null;
>>> -context.partyId = partyId;
>>> +if (catalogCol) {
>>> +    context.catalogCol = catalogCol;
>>> +
>>> +    currentCatalogId = catalogCol.get(0);
>>> +    context.currentCatalogId = currentCatalogId;
>>> +    context.currentCatalogName =
>>> CatalogWorker.getCatalogName(request, currentCatalogId);
>>> +}
>>>
>>> // currencies and shopping cart currency
>>> -currencies = delegator.findByAndCache("Uom", [uomTypeId :
>>> "CURRENCY_MEASURE"]);
>>> -context.currencies = currencies;
>>> +context.currencies = delegator.findByAndCache('Uom', [uomTypeId:
>>> 'CURRENCY_MEASURE']);
>>> context.currencyUomId = shoppingCart.getCurrency();
>>>
>>> Modified:
>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy
>>>
>>> URL:
>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy?rev=795883&r1=795882&r2=795883&view=diff
>>>
>>> ==============================================================================
>>>
>>> ---
>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy
>>> (original)
>>> +++
>>> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy
>>> Mon Jul 20 15:52:05 2009
>>> @@ -386,9 +386,9 @@
>>>    context.shippingContactMechList = shippingContactMechList;
>>>
>>>    // list to find all the shipmentMethods from the view named
>>> "ProductStoreShipmentMethView".
>>> -    productStoreId =
>>> orderHeader.getRelatedOne("ProductStore").productStoreId;
>>> -    productStoreShipmentMethList =
>>> delegator.findByAndCache("ProductStoreShipmentMethView",
>>> [productStoreId : productStoreId], ["sequenceNumber"]);
>>> -    context.productStoreShipmentMethList =
>>> productStoreShipmentMethList;
>>> +    if (productStore) {
>>> +        context.productStoreShipmentMethList =
>>> delegator.findByAndCache('ProductStoreShipmentMethView',
>>> [productStoreId: productStore.productStoreId], ['sequenceNumber']);
>>> +    }
>>>
>>>    // Get a map of returnable items
>>>    returnableItems = [:];
>>> @@ -400,8 +400,8 @@
>>>
>>>    // get the catalogIds for appending items
>>>    if (context.request != null) {
>>> -        if ("SALES_ORDER".equals(orderType)) {
>>> -            catalogCol =
>>> CatalogWorker.getCatalogIdsAvailable(delegator, productStoreId,
>>> partyId);
>>> +        if ("SALES_ORDER".equals(orderType) && productStore) {
>>> +            catalogCol =
>>> CatalogWorker.getCatalogIdsAvailable(delegator,
>>> productStore.productStoreId, partyId);
>>>        } else {
>>>            catalogCol = CatalogWorker.getAllCatalogIds(request);
>>>        }
>>> @@ -441,8 +441,8 @@
>>>        context.shipmentRouteSegmentId =
>>> shipmentRouteSegment.shipmentRouteSegmentId;
>>>        context.pickedShipmentId = pickedShipmentId;
>>>        if (pickedShipmentId && shipmentRouteSegment.trackingIdNumber) {
>>> -            if ("UPS" == shipmentRouteSegment.carrierPartyId) {
>>> -                resultMap =
>>> dispatcher.runSync("upsShipmentAlternateRatesEstimate",[productStoreId
>>> : productStoreId, shipmentId : pickedShipmentId]);
>>> +            if ("UPS" == shipmentRouteSegment.carrierPartyId &&
>>> productStore) {
>>> +                resultMap =
>>> dispatcher.runSync('upsShipmentAlternateRatesEstimate',
>>> [productStoreId: productStore.productStoreId, shipmentId:
>>> pickedShipmentId]);
>>>                shippingRates = resultMap.shippingRates;
>>>                shippingRateList = [];
>>>                shippingRates.each { shippingRate ->
>>>
>>> Modified:
>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/showcartitems.ftl
>>>
>>> URL:
>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/showcartitems.ftl?rev=795883&r1=795882&r2=795883&view=diff
>>>
>>> ==============================================================================
>>>
>>> ---
>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/showcartitems.ftl
>>> (original)
>>> +++
>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/cart/showcartitems.ftl
>>> Mon Jul 20 15:52:05 2009
>>> @@ -39,7 +39,7 @@
>>>          <td colspan="2">
>>>            <div>
>>>              <b>${uiLabelMap.ProductProduct}</b>
>>> -              <#if productStore.showCheckoutGiftOptions?if_exists !=
>>> "N">
>>> +              <#if (shoppingCart.getOrderType() == 'SALES_ORDER') &&
>>> (productStore.showCheckoutGiftOptions)?default('Y') != 'N'>
>>>                  <select name="GWALL"
>>> onchange="javascript:gwAll(this);">
>>>                    <option
>>> value="">${uiLabelMap.OrderGiftWrapAllItems}</option>
>>>                    <option
>>> value="NO^">${uiLabelMap.OrderNoGiftWrap}</option>
>>>
>>> Modified:
>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/optionsettings.ftl
>>> URL:
>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/optionsettings.ftl?rev=795883&r1=795882&r2=795883&view=diff
>>>
>>> ==============================================================================
>>>
>>> ---
>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/optionsettings.ftl
>>> (original)
>>> +++
>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/optionsettings.ftl
>>> Mon Jul 20 15:52:05 2009
>>> @@ -139,34 +139,34 @@
>>>                    <textarea cols="30" rows="3"
>>> name="${shipGroupIndex?default("0")}_shipping_instructions">${cart.getShippingInstructions(shipGroupIndex)?if_exists}</textarea>
>>>
>>>                  </td>
>>>                </tr>
>>> -                <#if productStore.showCheckoutGiftOptions?if_exists
>>> != "N">
>>> -                <tr>
>>> -                  <td colspan="2">
>>> -                    <#if cart.getOrderType() = "PURCHASE_ORDER">
>>> -                       <input type='hidden'
>>> name='${shipGroupIndex?default("0")}_is_gift' value='false'>
>>> -                    <#else>
>>> -                    <div>
>>> -                      <span
>>> class="h2"><b>${uiLabelMap.OrderIsThisGift}</b></span>
>>> -                      <input type='radio' <#if
>>> cart.getIsGift(shipGroupIndex)?default("Y") == "Y">checked</#if>
>>> name='${shipGroupIndex?default("0")}_is_gift' value='true'><span
>>> class='tabletext'>${uiLabelMap.CommonYes}</span>
>>> -                      <input type='radio' <#if
>>> cart.getIsGift(shipGroupIndex)?default("N") == "N">checked</#if>
>>> name='${shipGroupIndex?default("0")}_is_gift' value='false'><span
>>> class='tabletext'>${uiLabelMap.CommonNo}</span>
>>> -                    </div>
>>> +
>>> +                <#if cart.getOrderType() == 'PURCHASE_ORDER'>
>>> +                    <input type="hidden"
>>> name="${shipGroupIndex?default('0')}_is_gift" value="false">
>>> +                <#else>
>>> +                    <#if
>>> (productStore.showCheckoutGiftOptions)?default('Y') != 'N'>
>>> +                        <tr>
>>> +                            <td colspan="2">
>>> +                                <div>
>>> +                                    <span
>>> class="h2"><b>${uiLabelMap.OrderIsThisGift}</b></span>
>>> +                                    <input type="radio" <#if
>>> cart.getIsGift(shipGroupIndex)?default('Y') ==
>>> 'Y'>checked="checked"</#if>
>>> name="${shipGroupIndex?default('0')}_is_gift" value="true"><span
>>> class="tabletext">${uiLabelMap.CommonYes}</span>
>>> +                                    <input type="radio" <#if
>>> cart.getIsGift(shipGroupIndex)?default('N') ==
>>> 'N'>checked="checked"</#if>
>>> name="${shipGroupIndex?default('0')}_is_gift" value="false"><span
>>> class="tabletext">${uiLabelMap.CommonNo}</span>
>>> +                                </div>
>>> +                            </td>
>>> +                        </tr>
>>>                    </#if>
>>> -                  </td>
>>> -                </tr>
>>> -                <#if cart.getOrderType() != "PURCHASE_ORDER">
>>> -                <tr><td colspan="2"><hr/></td></tr>
>>> -                <tr>
>>> -                  <td colspan="2">
>>> -                    <h2>${uiLabelMap.OrderGiftMessage}</h2>
>>> -                  </td>
>>> -                </tr>
>>> -                <tr>
>>> -                  <td colspan="2">
>>> -                    <textarea cols="30" rows="3"
>>> name="${shipGroupIndex?default("0")}_gift_message">${cart.getGiftMessage(shipGroupIndex)?if_exists}</textarea>
>>>
>>> -                  </td>
>>> -                </tr>
>>> -                 </#if>
>>> +                    <tr><td colspan="2"><hr /></td></tr>
>>> +                    <tr>
>>> +                        <td colspan="2">
>>> +                            <h2>${uiLabelMap.OrderGiftMessage}</h2>
>>> +                        </td>
>>> +                    </tr>
>>> +                    <tr>
>>> +                        <td colspan="2">
>>> +                            <textarea cols="30" rows="3"
>>> name="${shipGroupIndex?default('0')}_gift_message">${cart.getGiftMessage(shipGroupIndex)?if_exists}</textarea>
>>>
>>> +                        </td>
>>> +                    </tr>
>>>                </#if>
>>> +
>>>                   <tr>
>>>                      <td colspan="2"></td>
>>>                   </tr>
>>>
>>> Modified:
>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/orderagreements.ftl
>>> URL:
>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/entry/orderagreements.ftl?rev=795883&r1=795882&r2=795883&view=diff
>>>
>>> ==============================================================================
>>>
>>> ---
>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/orderagreements.ftl
>>> (original)
>>> +++
>>> ofbiz/trunk/applications/order/webapp/ordermgr/entry/orderagreements.ftl
>>> Mon Jul 20 15:52:05 2009
>>> @@ -128,7 +128,7 @@
>>>            <select 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>
>>> +              <option value="${currency.uomId}" <#if
>>> currencyUomId?default('') == currency.uomId>selected="selected"</#if>
>>> >${currency.uomId}</option>
>>>              </#list>
>>>            </select>
>>>          </div>
>>> @@ -143,11 +143,9 @@
>>>        <td>&nbsp;</td>
>>>        <td>
>>>           <select name='CURRENT_CATALOG_ID'>
>>> -            <option
>>> value='${currentCatalogId}'>${currentCatalogName}</option>
>>> -            <option value='${currentCatalogId}'></option>
>>> -            <#list catalogCol as catalogId>
>>> +            <#list catalogCol?if_exists as catalogId>
>>>              <#assign thisCatalogName =
>>> Static["org.ofbiz.product.catalog.CatalogWorker"].getCatalogName(request,
>>> catalogId)>
>>> -              <option value='${catalogId}'>${thisCatalogName}</option>
>>> +              <option value="${catalogId}" <#if
>>> currentCatalogId?default('') == catalogId>selected="selected"</#if>
>>> >${thisCatalogName}</option>
>>>            </#list>
>>>          </select>
>>>        </td>
>>>
>>> Modified: ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml
>>> URL:
>>> http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml?rev=795883&r1=795882&r2=795883&view=diff
>>>
>>> ==============================================================================
>>>
>>> --- ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml (original)
>>> +++ ofbiz/trunk/specialpurpose/ecommerce/data/DemoProduct.xml Mon Jul
>>> 20 15:52:05 2009
>>> @@ -111,8 +111,6 @@
>>>
>>>    <WebSite webSiteId="WebStore" siteName="eCommerce Web Site"
>>> productStoreId="9000" visualThemeSetId="ECOMMERCE"/>
>>>    <WebSite webSiteId="WebStoreClone" siteName="Cloned eCommerce Web
>>> Site" productStoreId="9000" visualThemeSetId="ECOMMERCE"/>
>>> -    <!-- the following item is defined in the OrderTypeData.xml file
>>> and just the productStoreId is being associated with it here -->
>>> -    <WebSite webSiteId="OrderEntry" productStoreId="9000"/>
>>>
>>>    <ProdCatalog prodCatalogId="DemoCatalog" catalogName="Demo
>>> Catalog" useQuickAdd="Y"/>
>>>    <ProdCatalog prodCatalogId="TestCatalog" catalogName="Test
>>> Catalog" useQuickAdd="N"/>
>>>
>>>
>>
> 
> 

-- 
BJ Freeman
http://www.businessesnetwork.com/automation
http://bjfreeman.elance.com
http://www.linkedin.com/profile?viewProfile=&key=1237480&locale=en_US&trk=tab_pro
Systems Integrator.