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);