svn commit: r1759070 - in /ofbiz/trunk/applications/order: config/ src/main/java/org/apache/ofbiz/order/order/ src/main/java/org/apache/ofbiz/order/shoppinglist/

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

svn commit: r1759070 - in /ofbiz/trunk/applications/order: config/ src/main/java/org/apache/ofbiz/order/order/ src/main/java/org/apache/ofbiz/order/shoppinglist/

Deepak Dixit-5
Author: deepak
Date: Sat Sep  3 10:40:04 2016
New Revision: 1759070

URL: http://svn.apache.org/viewvc?rev=1759070&view=rev
Log:
(OFBIZ-7994) Applied patch from jira issue
=====================================
Add UI labels for success / error messages in order component
=====================================
Thanks Tanmay for your contribution.

Modified:
    ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml
    ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java
    ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java
    ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppinglist/ShoppingListServices.java

Modified: ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml?rev=1759070&r1=1759069&r2=1759070&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml (original)
+++ ofbiz/trunk/applications/order/config/OrderErrorUiLabels.xml Sat Sep  3 10:40:04 2016
@@ -536,6 +536,9 @@
         <value xml:lang="zh">无法选择另一个礼品,没有找到用于 # ${alternateGwpLine} 的购物车行明细。 </value>
         <value xml:lang="zh-TW">無法選擇另一個禮品,沒有找到用于 # ${alternateGwpLine} 的購物車行明細。 </value>
     </property>
+    <property key="OrderCouldNotSetGrantTotalOnOrderHeader">
+        <value xml:lang="en">ERROR: Could not set grantTotal on OrderHeader entity: ${errorString}</value>
+    </property>
     <property key="OrderCreateCommunicationEventProductPermissionError">
         <value xml:lang="ar">خطأ إذن السلعة في خلق حدث الإتصال</value>
         <value xml:lang="de">Berechtigungsfehler bei Produkt-Kommunikations-Ereignis</value>
@@ -548,6 +551,9 @@
         <value xml:lang="zh">创建沟通事件时出现产品权限错误</value>
         <value xml:lang="zh-TW">創建溝通事件時出現產品權限錯誤</value>
     </property>
+    <property key="OrderDatabaseErrorCheckingIfWeShouldChangeOrderHeaderStatusToApproved">
+        <value xml:lang="en">Database error checking if we should change order header status to approved: ${e.toString()}</value>
+    </property>
     <property key="OrderDispatcherOrDelegatorOrCartArgumentIsNull">
         <value xml:lang="ar">المرسل أو المفوض أو حجة العربة فارغا</value>
         <value xml:lang="de">Dispatcher, Delegator oder Warenkorb ist null</value>
@@ -1687,6 +1693,12 @@
         <value xml:lang="vi">Không thể cập nhật trạng thái phần đầu trả về (return header status)</value>
         <value xml:lang="zh">无法更新退货头状态</value>
     </property>
+    <property key="OrderErrorWhileCreatingNewShoppingListBasedOnOrder">
+        <value xml:lang="en">Error while creating new shopping list based on order ${errorString}</value>
+    </property>
+    <property key="OrderErrorWhileCreatingNewShoppingListBasedAutomaticReorder">
+        <value xml:lang="en">Error while creating new shopping list based automatic reorder ${errorString}</value>
+    </property>
     <property key="OrderErrorWithCreateBillingAccount">
         <value xml:lang="ar">خطأ في خلق حساب فوترة</value>
         <value xml:lang="de">Fehler bei Erstellung des Rechnungskontos: </value>
@@ -1804,6 +1816,9 @@
         <value xml:lang="zh">没有找到固定资产,固定资产标识:${fixedAssetId}</value>
         <value xml:lang="zh-TW">沒有找到固定資產,固定資產ID:${fixedAssetId}</value>
     </property>
+    <property key="OrderFixedAssetSoldOut">
+        <value xml:lang="en">ERROR: fixed_Asset_sold_out AssetId: ${fixedAssetId} on date: ${exceptionDateStartTime}</value>
+    </property>
     <property key="OrderFrequencyOrIntervalWasNotSpecified">
         <value xml:lang="ar">لم يحدد التردد أو الفاصل</value>
         <value xml:lang="de">Frequenz oder Intervall nicht angegeben</value>
@@ -1943,6 +1958,9 @@
         <value xml:lang="zh">用于购物列表重复发生的频率无效</value>
         <value xml:lang="zh-TW">用于購物列表重複發生的頻率無效</value>
     </property>
+    <property key="OrderItemShipGroupDoesNotExist">
+        <value xml:lang="en">Order Item Ship Group Does Not Exist</value>
+    </property>
     <property key="OrderItemStatusNotChangedIsNotAValidChange">
         <value xml:lang="ar">لم يتم التغيير لحالة البند لأن التغيير ${orderStatusId} -&gt; ${statusId} غير صحيح</value>
         <value xml:lang="de">Positionsstatus nicht geändert ${orderStatusId} -&gt; ${statusId} ist kein gültiger Wechsel. </value>
@@ -2111,6 +2129,9 @@
         <value xml:lang="zh">没有产品店铺,无法创建支付</value>
         <value xml:lang="zh-TW">沒有產品店鋪,無法創建支付</value>
     </property>
+    <property key="OrderNoReturnAmountFound">
+        <value xml:lang="en">No returnAmount found for order: ${orderId}</value>
+    </property>
     <property key="OrderNoReturnQuantityAvailablePreviousReturnsMayExist">
         <value xml:lang="ar">كمية المسترجع غير متوفرة: احتمال وجود مسترجعات سابقة.</value>
         <value xml:lang="de">Retourenmenge nicht vorhanden; vorherige Retouren könnten vorhanden sein.</value>
@@ -3295,6 +3316,9 @@
         <value xml:lang="zh">预定长度应该是一个正数</value>
         <value xml:lang="zh-TW">預定長度應該是一個正數</value>
     </property>
+    <property key="OrderReturnItemResponseNotFound">
+        <value xml:lang="en">${errorMsg} Return Item Response not found with ID [${responseId}].</value>
+    </property>
     <property key="OrderReturnItemTypeIsNotDefined">
         <value xml:lang="ar">نوع البند المسترجع غير معرف لهذا البند: أو لا يوجد تربيط</value>
         <value xml:lang="de">Retourenpositionsart ist für diese Position nicht definiert; oder es wurde keine Zuordnung gefunden.</value>

Modified: ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java?rev=1759070&r1=1759069&r2=1759070&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java (original)
+++ ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderReturnServices.java Sat Sep  3 10:40:04 2016
@@ -1588,6 +1588,7 @@ public class OrderReturnServices {
     public static Map<String, Object> createPaymentApplicationsFromReturnItemResponse(DispatchContext dctx, Map<String, ? extends Object> context) {
         LocalDispatcher dispatcher = dctx.getDispatcher();
         Delegator delegator = dctx.getDelegator();
+        Locale locale = (Locale) context.get("locale");
         GenericValue userLogin = (GenericValue) context.get("userLogin");
 
         // the strategy for this service is to get a list of return invoices via the return items -> return item billing relationships
@@ -1597,7 +1598,7 @@ public class OrderReturnServices {
         try {
             GenericValue response = EntityQuery.use(delegator).from("ReturnItemResponse").where("returnItemResponseId", responseId).queryOne();
             if (response == null) {
-                return ServiceUtil.returnError(errorMsg + "Return Item Response not found with ID [" + responseId + "].");
+             return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "OrderReturnItemResponseNotFound", UtilMisc.toMap("errorMsg", errorMsg,"responseId", responseId), locale));
             }
             BigDecimal responseAmount = response.getBigDecimal("responseAmount").setScale(decimals, rounding);
             String paymentId = response.getString("paymentId");
@@ -2314,7 +2315,7 @@ public class OrderReturnServices {
             for (String orderId : returnAmountByOrder.keySet()) {
                 BigDecimal returnAmount = returnAmountByOrder.get(orderId);
                 if (returnAmount == null) {
-                    return ServiceUtil.returnError("No returnAmount found for order:" + orderId);
+                    return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "OrderNoReturnAmountFound", UtilMisc.toMap("orderId", orderId), locale));
                 }
                 if (returnAmount.abs().compareTo(new BigDecimal("0.000001")) < 0) {
                     Debug.logError("Order [" + orderId + "] refund amount[ " + returnAmount + "] less than zero", module);

Modified: ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java?rev=1759070&r1=1759069&r2=1759070&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java (original)
+++ ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java Sat Sep  3 10:40:04 2016
@@ -759,7 +759,7 @@ public class OrderServices {
                     // check to see if the requested quantity is available on the requested day but only when the maximum capacity is set on the fixed asset
                     if (fixedAsset.get("productionCapacity") != null)    {
                        if (newUsedCapacity.compareTo(techDataCalendarExcDay.getBigDecimal("exceptionCapacity")) > 0)    {
-                            String errMsg = "ERROR: fixed_Asset_sold_out AssetId: " + workEffort.get("fixedAssetId") + " on date: " + techDataCalendarExcDay.getString("exceptionDateStartTime");
+                            String errMsg = UtilProperties.getMessage(resource_error, "OrderFixedAssetSoldOut", UtilMisc.toMap("fixedAssetId", workEffort.get("fixedAssetId"), "exceptionDateStartTime", techDataCalendarExcDay.getString("exceptionDateStartTime")), locale);
                             Debug.logError(errMsg, module);
                             errorMessages.add(errMsg);
                             continue;
@@ -1424,6 +1424,7 @@ public class OrderServices {
     /** Service for resetting the OrderHeader grandTotal */
     public static Map<String, Object> resetGrandTotal(DispatchContext ctx, Map<String, ? extends Object> context) {
         Delegator delegator = ctx.getDelegator();
+        Locale locale = (Locale) context.get("locale");
         //appears to not be used: GenericValue userLogin = (GenericValue) context.get("userLogin");
         String orderId = (String) context.get("orderId");
 
@@ -1431,7 +1432,7 @@ public class OrderServices {
         try {
             orderHeader = EntityQuery.use(delegator).from("OrderHeader").where("orderId", orderId).queryOne();
         } catch (GenericEntityException e) {
-            String errMsg = "ERROR: Could not set grantTotal on OrderHeader entity: " + e.toString();
+            String errMsg = UtilProperties.getMessage(resource_error, "OrderCouldNotSetGrantTotalOnOrderHeader", UtilMisc.toMap("errorString", e.toString()), locale);
             Debug.logError(e, errMsg, module);
             return ServiceUtil.returnError(errMsg);
         }
@@ -1475,7 +1476,7 @@ public class OrderServices {
                 try {
                     orderHeader.store();
                 } catch (GenericEntityException e) {
-                    String errMsg = "ERROR: Could not set grandTotal on OrderHeader entity: " + e.toString();
+                    String errMsg = UtilProperties.getMessage(resource_error, "OrderCouldNotSetGrantTotalOnOrderHeader", UtilMisc.toMap("errorString", e.toString()), locale);
                     Debug.logError(e, errMsg, module);
                     return ServiceUtil.returnError(errMsg);
                 }
@@ -1955,7 +1956,7 @@ public class OrderServices {
                             }
                         }
                     } catch (GenericEntityException e) {
-                        String errMsg = "Database error checking if we should change order header status to approved: " + e.toString();
+                     String errMsg = UtilProperties.getMessage(resource_error, "OrderDatabaseErrorCheckingIfWeShouldChangeOrderHeaderStatusToApproved", UtilMisc.toMap("errorString", e.toString()), locale);
                         Debug.logError(e, errMsg, module);
                         return ServiceUtil.returnError(errMsg);
                     }
@@ -5784,6 +5785,7 @@ public class OrderServices {
      */
     public static Map deleteOrderItemShipGroup(DispatchContext ctx, Map context) throws GenericEntityException {
         Delegator delegator = ctx.getDelegator();
+        Locale locale = (Locale) context.get("locale" );
         Map<String, Object> result = new HashMap<String, Object>();
         
         GenericValue orderItemShipGroup = (GenericValue) context.get("orderItemShipGroup");
@@ -5794,7 +5796,7 @@ public class OrderServices {
             if (UtilValidate.isNotEmpty(orderHeader) && UtilValidate.isNotEmpty(shipGroupSeqId)) {
                 orderItemShipGroup = EntityQuery.use(delegator).from("OrderItemShipGroup").where("orderId", orderId, "shipGroupSeqId", shipGroupSeqId).queryOne();
                 if (UtilValidate.isEmpty(orderItemShipGroup)) {
-                    return ServiceUtil.returnError("OrderItemShipGroup Does Not Exist");
+                    return ServiceUtil.returnError(UtilProperties.getMessage(resource_error, "OrderItemShipGroupDoesNotExist", locale));
                 }
             }
         }

Modified: ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppinglist/ShoppingListServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppinglist/ShoppingListServices.java?rev=1759070&r1=1759069&r2=1759070&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppinglist/ShoppingListServices.java (original)
+++ ofbiz/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppinglist/ShoppingListServices.java Sat Sep  3 10:40:04 2016
@@ -210,7 +210,7 @@ public class ShoppingListServices {
                 Debug.logError(e2, "[Delegator] Could not rollback transaction: " + e2.toString(), module);
             }
 
-            String errMsg = "Error while creating new shopping list based automatic reorder" + e.toString();
+            String errMsg = UtilProperties.getMessage(resource_error, "OrderErrorWhileCreatingNewShoppingListBasedAutomaticReorder", UtilMisc.toMap("errorString", e.toString()), locale);
             Debug.logError(e, errMsg, module);
             return ServiceUtil.returnError(errMsg);
         } finally {
@@ -393,7 +393,7 @@ public class ShoppingListServices {
                 Debug.logError(e2, "[Delegator] Could not rollback transaction: " + e2.toString(), module);
             }
 
-            String errMsg = "Error while creating new shopping list based on order" + e.toString();
+            String errMsg = UtilProperties.getMessage(resource_error, "OrderErrorWhileCreatingNewShoppingListBasedOnOrder", UtilMisc.toMap("errorString", e.toString()), locale);
             Debug.logError(e, errMsg, module);
             return ServiceUtil.returnError(errMsg);
         } finally {