svn commit: r1813961 - /ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1813961 - /ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java

Deepak Dixit-5
Author: deepak
Date: Wed Nov  1 10:37:51 2017
New Revision: 1813961

URL: http://svn.apache.org/viewvc?rev=1813961&view=rev
Log:
Fixed: Added check in checkoutValidation method, as it should validate only for Sales order, as shipping method, and payment mehtod not set in purchase order (OFBIZ-9755)

Modified:
    ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java

Modified: ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java?rev=1813961&r1=1813960&r2=1813961&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/CheckOutEvents.java Wed Nov  1 10:37:51 2017
@@ -423,6 +423,7 @@ public class CheckOutEvents {
     // Check for payment method and shipping method exist for checkout process of anonymous user
     public static String checkoutValidation(HttpServletRequest request, HttpServletResponse response) {
         ShoppingCart cart = (ShoppingCart) request.getSession().getAttribute("shoppingCart");
+        if (cart.isSalesOrder()) {
         List<GenericValue> paymentMethodTypes = cart.getPaymentMethodTypes();
         if (UtilValidate.isEmpty(paymentMethodTypes)) {
             String errMsg = UtilProperties.getMessage(resource_error, "OrderNoPaymentMethodTypeSelected", (cart != null ? cart.getLocale() : UtilHttp.getLocale(request)));
@@ -435,6 +436,7 @@ public class CheckOutEvents {
             request.setAttribute("_ERROR_MESSAGE_",errMsg);
             return "error";
         }
+        }
         return "success";
     }
     // Create order event - uses createOrder service for processing