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} -> ${statusId} غÙر صØÙØ</value> <value xml:lang="de">Positionsstatus nicht geändert ${orderStatusId} -> ${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 { |
Free forum by Nabble | Edit this page |