ofbiz-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mrisal...@apache.org
Subject svn commit: r1066910 - in /ofbiz/trunk/applications/accounting: config/AccountingErrorUiLabels.xml src/org/ofbiz/accounting/payment/PaymentGatewayServices.java src/org/ofbiz/accounting/tax/TaxAuthorityServices.java
Date Thu, 03 Feb 2011 19:03:25 GMT
Author: mrisaliti
Date: Thu Feb  3 19:03:25 2011
New Revision: 1066910

URL: http://svn.apache.org/viewvc?rev=1066910&view=rev
Log:
Internationalization of return messages of java services of accounting component (OFBIZ-4091)

Modified:
    ofbiz/trunk/applications/accounting/config/AccountingErrorUiLabels.xml
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java

Modified: ofbiz/trunk/applications/accounting/config/AccountingErrorUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/AccountingErrorUiLabels.xml?rev=1066910&r1=1066909&r2=1066910&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/config/AccountingErrorUiLabels.xml (original)
+++ ofbiz/trunk/applications/accounting/config/AccountingErrorUiLabels.xml Thu Feb  3 19:03:25
2011
@@ -367,11 +367,23 @@
         <value xml:lang="it">Non hai il permesso per cancellare il metodo di pagamento
per questo soggetto</value>
         <value xml:lang="pt">Você não tem permissão para excluir este método
de pagamento para partyId</value>
     </property>
+    <property key="AccountingPaymentReauthorizingError">
+        <value xml:lang="en">You do not have permission to delete Payment Method for
this partyId</value>
+        <value xml:lang="it">Non hai il permesso per cancellare il metodo di pagamento
per questo soggetto</value>
+    </property>
+    <property key="AccountingPaymentStatusUpdatingError">
+        <value xml:lang="en">Error updating payment status information: ${errorString}</value>
+        <value xml:lang="it">Errore aggiornando lo stato del pagamento: ${errorString}</value>
+    </property>
     <property key="AccountingTaxIdInvalidFormat">
         <value xml:lang="en">The tax ID ${parameters.partyTaxId} was not in a valid
format for the selected tax authority ${taxAuthority.taxIdFormatPattern}</value>
         <value xml:lang="it">Id tasse ${parameters.partyTaxId} non è nel formato
valido per l'autorità tasse selezionata ${taxAuthority.taxIdFormatPattern}</value>
         <value xml:lang="pt">O número de ID fiscal ${parameters.partyTaxId} não
estava em um formato válido para a autoridade fiscal selecionada ${taxAuthority.taxIdFormatPattern}</value>
     </property>
+    <property key="AccountingTaxSettingError">
+        <value xml:lang="en">Data error getting tax settings: ${errorString}</value>
+        <value xml:lang="it">Errore di lettura impostazioni tasse: ${errorString}</value>
+    </property>
     <property key="payPalEvents.failedToExecuteServiceCreatePaymentFromPreference">
         <value xml:lang="en">Failed to execute service createPaymentFromPreference</value>
         <value xml:lang="fr">Echec à l'exécution du service createPaymentFromPreference</value>

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java?rev=1066910&r1=1066909&r2=1066910&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java
(original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java
Thu Feb  3 19:03:25 2011
@@ -1712,9 +1712,8 @@ public class PaymentGatewayServices {
                 // get the new auth transaction
                 authTrans = getAuthTransaction(paymentPref);
             } catch (GeneralException e) {
-                String errMsg = "Error re-authorizing payment: " + e.toString();
-                Debug.logError(e, errMsg, module);
-                return ServiceUtil.returnError(errMsg);
+                Debug.logError(e, "Error re-authorizing payment: " + e.toString(), module);
+                return ServiceUtil.returnError(UtilProperties.getMessage("AccountingUiLabels",
"AccountingPaymentReauthorizingError", locale));
             }
         }
 
@@ -1893,6 +1892,7 @@ public class PaymentGatewayServices {
         String authType = (String) context.get("serviceTypeEnum");
         String currencyUomId = (String) context.get("currencyUomId");
         Timestamp nowTimestamp = UtilDateTime.nowTimestamp();
+        Locale locale = (Locale) context.get("locale");
 
         // refresh the payment preference
         try {
@@ -2025,9 +2025,8 @@ public class PaymentGatewayServices {
                 }
             }
         } catch (GenericEntityException e) {
-            String errMsg = "Error updating payment status information: " + e.toString();
-            Debug.logError(e, errMsg, module);
-            return ServiceUtil.returnError(errMsg);
+            Debug.logError(e, "Error updating payment status information: " + e.toString(),
module);
+            return ServiceUtil.returnError(UtilProperties.getMessage("AccountingUiLabels",
"AccountingPaymentStatusUpdatingError", UtilMisc.toMap("errorString", e.toString()), locale));
         }
 
         return ServiceUtil.returnSuccess();
@@ -3307,8 +3306,7 @@ public class PaymentGatewayServices {
                 }
 
                 if (ServiceUtil.isError(results)) {
-                    String errMsg = UtilProperties.getMessage("AccountingUiLabels", "AccountingCreditCardManualAuthFailedError",
locale);
-                    return ServiceUtil.returnError(errMsg);
+                    return ServiceUtil.returnError(UtilProperties.getMessage("AccountingUiLabels",
"AccountingCreditCardManualAuthFailedError", locale));
                 }
             }
         }

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java?rev=1066910&r1=1066909&r2=1066910&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java
(original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java
Thu Feb  3 19:03:25 2011
@@ -22,6 +22,7 @@ import java.math.BigDecimal;
 import java.sql.Timestamp;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Set;
 
@@ -34,6 +35,7 @@ import org.ofbiz.base.util.UtilDateTime;
 import org.ofbiz.base.util.UtilGenerics;
 import org.ofbiz.base.util.UtilMisc;
 import org.ofbiz.base.util.UtilNumber;
+import org.ofbiz.base.util.UtilProperties;
 import org.ofbiz.base.util.UtilValidate;
 import org.ofbiz.common.geo.GeoWorker;
 import org.ofbiz.entity.Delegator;
@@ -69,6 +71,7 @@ public class TaxAuthorityServices {
         BigDecimal quantity = (BigDecimal) context.get("quantity");
         BigDecimal basePrice = (BigDecimal) context.get("basePrice");
         BigDecimal shippingPrice = (BigDecimal) context.get("shippingPrice");
+        Locale locale = (Locale) context.get("locale");
 
         if (quantity == null) quantity = ONE_BASE;
         BigDecimal amount = basePrice.multiply(quantity);
@@ -119,9 +122,8 @@ public class TaxAuthorityServices {
                 }
             }
         } catch (GenericEntityException e) {
-            String errMsg = "Data error getting tax settings: " + e.toString();
-            Debug.logError(e, errMsg, module);
-            return ServiceUtil.returnError(errMsg);
+            Debug.logError(e, "Data error getting tax settings: " + e.toString(), module);
+            return ServiceUtil.returnError(UtilProperties.getMessage("AccountingUiLabels",
"AccountingTaxSettingError", UtilMisc.toMap("errorString", e.toString()), locale));
         }
 
         // round to 2 decimal places for display/etc
@@ -149,7 +151,7 @@ public class TaxAuthorityServices {
         BigDecimal orderShippingAmount = (BigDecimal) context.get("orderShippingAmount");
         BigDecimal orderPromotionsAmount = (BigDecimal) context.get("orderPromotionsAmount");
         GenericValue shippingAddress = (GenericValue) context.get("shippingAddress");
-        
+        Locale locale = (Locale) context.get("locale");
         GenericValue productStore = null;
         GenericValue facility = null;
         try {
@@ -160,9 +162,8 @@ public class TaxAuthorityServices {
                 facility = delegator.findByPrimaryKey("Facility", UtilMisc.toMap("facilityId",
facilityId));
             }
         } catch (GenericEntityException e) {
-            String errMsg = "Data error getting tax settings: " + e.toString();
-            Debug.logError(e, errMsg, module);
-            return ServiceUtil.returnError(errMsg);
+            Debug.logError(e, "Data error getting tax settings: " + e.toString(), module);
+            return ServiceUtil.returnError(UtilProperties.getMessage("AccountingUiLabels",
"AccountingTaxSettingError", UtilMisc.toMap("errorString", e.toString()), locale));
         }
 
         if (productStore == null && payToPartyId == null) {
@@ -178,9 +179,8 @@ public class TaxAuthorityServices {
                             UtilMisc.toMap("contactMechId", facilityContactMech.getString("contactMechId")));
                 }
             } catch (GenericEntityException e) {
-                String errMsg = "Data error getting tax settings: " + e.toString();
-                Debug.logError(e, errMsg, module);
-                return ServiceUtil.returnError(errMsg);
+                Debug.logError(e, "Data error getting tax settings: " + e.toString(), module);
+                return ServiceUtil.returnError(UtilProperties.getMessage("AccountingUiLabels",
"AccountingTaxSettingError", UtilMisc.toMap("errorString", e.toString()), locale));
             }
         }
         if (shippingAddress == null || (shippingAddress.get("countryGeoId") == null &&
shippingAddress.get("stateProvinceGeoId") == null && shippingAddress.get("postalCodeGeoId")
== null)) {
@@ -197,9 +197,8 @@ public class TaxAuthorityServices {
         try {
             getTaxAuthorities(delegator, shippingAddress, taxAuthoritySet);
         } catch (GenericEntityException e) {
-            String errMsg = "Data error getting tax settings: " + e.toString();
-            Debug.logError(e, errMsg, module);
-            return ServiceUtil.returnError(errMsg);
+            Debug.logError(e, "Data error getting tax settings: " + e.toString(), module);
+            return ServiceUtil.returnError(UtilProperties.getMessage("AccountingUiLabels",
"AccountingTaxSettingError", UtilMisc.toMap("errorString", e.toString()), locale));
         }
 
         // Setup the return lists.



Mime
View raw message