You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by de...@apache.org on 2016/09/03 08:35:42 UTC

svn commit: r1759056 - in /ofbiz/trunk/applications/accounting: config/ src/main/java/org/apache/ofbiz/accounting/invoice/ src/main/java/org/apache/ofbiz/accounting/payment/ src/main/java/org/apache/ofbiz/accounting/thirdparty/authorizedotnet/

Author: deepak
Date: Sat Sep  3 08:35:41 2016
New Revision: 1759056

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

Modified:
    ofbiz/trunk/applications/accounting/config/AccountingErrorUiLabels.xml
    ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml
    ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceServices.java
    ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java
    ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java

Modified: ofbiz/trunk/applications/accounting/config/AccountingErrorUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/AccountingErrorUiLabels.xml?rev=1759056&r1=1759055&r2=1759056&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/config/AccountingErrorUiLabels.xml (original)
+++ ofbiz/trunk/applications/accounting/config/AccountingErrorUiLabels.xml Sat Sep  3 08:35:41 2016
@@ -84,6 +84,9 @@
         <value xml:lang="zh">会员标识 ${partyId} 不是支付方法 ${paymentMethodId} 的拥有者,无权修改它。</value>
         <value xml:lang="zh-TW">團體標識 ${partyId} 不是支付方法 ${paymentMethodId} 的擁有者,無權修改它.</value>
     </property>
+    <property key="AccountingFailedToProcessCaptureResult">
+        <value xml:lang="en">Failed to process capture result: Could not find invoice ${invoiceId} due to entity error: ${errorString}</value>
+    </property>
     <property key="AccountingFinAccountAuthorizationExpired">
         <value xml:lang="ar">انتهت صلاحية عملية التصريح ${paymentGatewayResponseId} منذ ${authExpiration}</value>
         <value xml:lang="de">Authorisierungs-Transaktion ${paymentGatewayResponseId} ist seit ${authExpiration} abgelaufen</value>
@@ -711,6 +714,9 @@
         <value xml:lang="zh">与贝宝联系时发生了一个未知的错误</value>
         <value xml:lang="zh-TW">與PayPal聯絡時發生了一個未知的錯誤</value>
     </property>
+    <property key="AccountingReturnTypeCannotBeNull">
+        <value xml:lang="en">Return type cannot be null</value>
+    </property>
     <property key="AccountingTaxIdInvalidFormat">
         <value xml:lang="ar">دليل الضريبة ${parameters.partyTaxId} لم يدخل بطريقة صحيحة للمصلحة الضريبية المختارة ${taxAuthority.taxIdFormatPattern}</value>
         <value xml:lang="de">Die Steuer ID ${parameters.partyTaxId} war in einem ungültigen Format für die gewählte Steuerbehörde ${taxAuthority.taxIdFormatPattern}</value>
@@ -729,6 +735,12 @@
         <value xml:lang="zh">获取税务设置时数据错误:${errorString}</value>
         <value xml:lang="zh-TW">獲取稅務設定時資料錯誤:${errorString}</value>
     </property>
+    <property key="AccountingUploadedFileDataNotFound">
+        <value xml:lang="en">Uploaded file data not found</value>
+    </property>
+    <property key="AccountingValidationFailedInvalidValues">
+        <value xml:lang="en">Validation Failed - invalid values</value>
+    </property>
     <property key="idealEvents.failedToExecuteServiceCreatePaymentFromPreference">
         <value xml:lang="ar">فشل في تنفيذ خدمة CreatePaymentFromPreference</value>
         <value xml:lang="de">Ausführen des Service CreatePaymentFromPreference fehlgeschlagen</value>
@@ -977,5 +989,4 @@
         <value xml:lang="zh">获取订单头时出错</value>
         <value xml:lang="zh-TW">獲取訂單頭時出錯</value>
     </property>
-    
 </resource>

Modified: ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml?rev=1759056&r1=1759055&r2=1759056&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml (original)
+++ ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml Sat Sep  3 08:35:41 2016
@@ -1714,6 +1714,9 @@
         <value xml:lang="zh">不能执行一个作废金额的交易:授权金额 ${authAmount} 不同于作废金额 ${refundAmount}</value>
         <value xml:lang="zh-TW">不能執行一個作廢金額的交易:授權金額 ${authAmount} 不同于作廢金額 ${refundAmount}</value>
     </property>
+    <property key="AccountingAuthorizeNetccCreditUnsupported">
+        <value xml:lang="en">Authorize.net ccCredit unsupported with version 3.1</value>
+    </property>
     <property key="AccountingAuthorizeNetCpDevice">
         <value xml:lang="ar">نوع الجهاز للبطاقة الحالية</value>
         <value xml:lang="de">Karten Gerätetyp</value>
@@ -9809,6 +9812,9 @@
         <value xml:lang="zh">新建标准费用</value>
         <value xml:lang="zh-TW">新建標準費用</value>
     </property>
+    <property key="AccountingNewInvoicesCreated">
+        <value xml:lang="en">${invoicesCreated} new invoice(s) created</value>
+    </property>
     <property key="AccountingNewPayment">
         <value xml:lang="ar">دفعة جديدة</value>
         <value xml:lang="de">Neue Zahlung</value>
@@ -12509,6 +12515,9 @@
         <value xml:lang="zh">状态变为"未付"</value>
         <value xml:lang="zh-TW">狀態變為"未付"</value>
     </property>
+    <property key="AccountingPaymentRefundedSuccessfully">
+        <value xml:lang="en">Payment #${paymentId} is refunded successfully with amount ${refundAmount} for manual transaction.</value>
+    </property>
     <property key="AccountingPaymentTabApplications">
         <value xml:lang="ar">التطبيقات</value>
         <value xml:lang="de">Zuweisungen</value>

Modified: ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceServices.java?rev=1759056&r1=1759055&r2=1759056&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/invoice/InvoiceServices.java Sat Sep  3 08:35:41 2016
@@ -1896,7 +1896,7 @@ public class InvoiceServices {
             // get the return header
             GenericValue returnHeader = EntityQuery.use(delegator).from("ReturnHeader").where("returnId", returnId).queryOne();
             if (returnHeader == null || returnHeader.get("returnHeaderTypeId") == null) {
-                return ServiceUtil.returnError("Return type cannot be null");                                                      
+            	 return ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingReturnTypeCannotBeNull", locale));                                                      
             }
             
             if (returnHeader.getString("returnHeaderTypeId").startsWith("CUSTOMER_")) {
@@ -3374,6 +3374,7 @@ public class InvoiceServices {
     }
     
     public static Map<String, Object> importInvoice(DispatchContext dctx, Map<String, Object> context) {
+    	 Locale locale = (Locale) context.get("locale");
         Delegator delegator = dctx.getDelegator();
         LocalDispatcher dispatcher = dctx.getDispatcher();
         GenericValue userLogin = (GenericValue) context.get("userLogin");
@@ -3391,7 +3392,7 @@ public class InvoiceServices {
         int invoicesCreated = 0;
 
         if (fileBytes == null) {
-            return ServiceUtil.returnError("Uploaded file data not found");
+            return ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingUploadedFileDataNotFound", locale));
         }
 
         try {
@@ -3531,7 +3532,7 @@ public class InvoiceServices {
             return ServiceUtil.returnError(errMsgs);
         }
 
-        Map<String, Object> result = ServiceUtil.returnSuccess(invoicesCreated + " new invoice(s) created");
+        Map<String, Object> result = ServiceUtil.returnSuccess(UtilProperties.getMessage(resource, "AccountingNewInvoicesCreated", UtilMisc.toMap("invoicesCreated", invoicesCreated), locale));
         result.put("organizationPartyId", organizationPartyId);
         return result;
     }

Modified: ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java?rev=1759056&r1=1759055&r2=1759056&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java Sat Sep  3 08:35:41 2016
@@ -2274,7 +2274,7 @@ public class PaymentGatewayServices {
                 try {
                     invoice = EntityQuery.use(delegator).from("Invoice").where("invoiceId", invoiceId).queryOne();
                 } catch (GenericEntityException e) {
-                    String message = "Failed to process capture result:  Could not find invoice ["+invoiceId+"] due to entity error: " + e.getMessage();
+                    String message = UtilProperties.getMessage(resourceError, "AccountingFailedToProcessCaptureResult", UtilMisc.toMap("invoiceId", invoiceId, "errorString", e.getMessage()), locale);
                     Debug.logError(e, message, module);
                     return ServiceUtil.returnError(message);
                 }
@@ -2393,7 +2393,7 @@ public class PaymentGatewayServices {
             return ServiceUtil.returnError(UtilProperties.getMessage(resource, 
                     "AccountingPaymentRefundError", locale));
         }
-        refundResponse.putAll(ServiceUtil.returnSuccess("Payment #" + refundResponse.get("paymentId") +" is refunded successfully with amount " + refundResponse.get("refundAmount") +" for manual transaction."));
+        refundResponse.putAll(ServiceUtil.returnSuccess(UtilProperties.getMessage(resourceError, "AccountingPaymentRefundedSuccessfully", UtilMisc.toMap("paymentId", refundResponse.get("paymentId"), "refundAmount", refundResponse.get("refundAmount")), locale)));
         return refundResponse;
     }
 

Modified: ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java?rev=1759056&r1=1759055&r2=1759056&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/main/java/org/apache/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java Sat Sep  3 08:35:41 2016
@@ -93,7 +93,7 @@ public class AIMPaymentServices {
         Map<String, Object> validateResults = validateRequest(context, props, request);
         String respMsg = (String)validateResults.get(ModelService.RESPONSE_MESSAGE);
         if (ModelService.RESPOND_ERROR.equals(respMsg)) {
-            results.put(ModelService.ERROR_MESSAGE, "Validation Failed - invalid values");
+            results.put(ModelService.ERROR_MESSAGE, UtilProperties.getMessage(resource, "AccountingValidationFailedInvalidValues", locale));
             return results;
         }
         Map<String, Object> reply = processCard(request, props, locale);
@@ -137,7 +137,7 @@ public class AIMPaymentServices {
         Map<String, Object> validateResults = validateRequest(context, props, request);
         String respMsg = (String)validateResults.get(ModelService.RESPONSE_MESSAGE);
         if (ModelService.RESPOND_ERROR.equals(respMsg)) {
-            results.put(ModelService.ERROR_MESSAGE, "Validation Failed - invalid values");
+            results.put(ModelService.ERROR_MESSAGE, UtilProperties.getMessage(resource, "AccountingValidationFailedInvalidValues", locale));
             return results;
         }
         Map<String, Object> reply = processCard(request, props, locale);
@@ -182,7 +182,7 @@ public class AIMPaymentServices {
         Map<String, Object> validateResults = validateRequest(context, props, request);
         String respMsg = (String)validateResults.get(ModelService.RESPONSE_MESSAGE);
         if (ModelService.RESPOND_ERROR.equals(respMsg)) {
-            results.put(ModelService.ERROR_MESSAGE, "Validation Failed - invalid values");
+            results.put(ModelService.ERROR_MESSAGE, UtilProperties.getMessage(resource, "AccountingValidationFailedInvalidValues", locale));
             return results;
         }
         Map<String, Object> reply = processCard(request, props, locale);
@@ -270,16 +270,17 @@ public class AIMPaymentServices {
         Map<String, Object> validateResults = validateRequest(context, props, request);
         String respMsg = (String)validateResults.get(ModelService.RESPONSE_MESSAGE);
         if (ModelService.RESPOND_ERROR.equals(respMsg)) {
-            results.put(ModelService.ERROR_MESSAGE, "Validation Failed - invalid values");
+            results.put(ModelService.ERROR_MESSAGE, UtilProperties.getMessage(resource, "AccountingValidationFailedInvalidValues", locale));
             return results;
         }
         return processCard(request, props, locale);
     }
 
     public static Map<String, Object> ccCredit(DispatchContext ctx, Map<String, Object> context) {
+    	Locale locale = (Locale) context.get("locale");
         Map<String, Object> results = new HashMap<String, Object>();
         results.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_ERROR);
-        results.put(ModelService.ERROR_MESSAGE, "Authorize.net ccCredit unsupported with version 3.1");
+        results.put(ModelService.ERROR_MESSAGE, UtilProperties.getMessage(resource, "AccountingAuthorizeNetccCreditUnsupported", locale));
         return results;
     }
 
@@ -299,7 +300,7 @@ public class AIMPaymentServices {
         Map<String, Object> validateResults = validateRequest(context, props, request);
         String respMsg = (String)validateResults.get(ModelService.RESPONSE_MESSAGE);
         if (ModelService.RESPOND_ERROR.equals(respMsg)) {
-            results.put(ModelService.ERROR_MESSAGE, "Validation Failed - invalid values");
+            results.put(ModelService.ERROR_MESSAGE, UtilProperties.getMessage(resource, "AccountingValidationFailedInvalidValues", locale));
             return results;
         }
         Map<String, Object> reply = processCard(request, props, locale);