|
Author: mrisaliti
Date: Sun Jan 16 18:50:53 2011 New Revision: 1059632 URL: http://svn.apache.org/viewvc?rev=1059632&view=rev Log: Internationalization of ServiceUtil.returnSuccess, ServiceUtil.returnFailure, ServiceUtil.returnError (OFBIZ-4091) Modified: ofbiz/trunk/applications/accounting/config/AccountingErrorUiLabels.xml ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentMethodServices.java ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/period/PeriodServices.java Modified: ofbiz/trunk/applications/accounting/config/AccountingErrorUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/AccountingErrorUiLabels.xml?rev=1059632&r1=1059631&r2=1059632&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/config/AccountingErrorUiLabels.xml (original) +++ ofbiz/trunk/applications/accounting/config/AccountingErrorUiLabels.xml Sun Jan 16 18:50:53 2011 @@ -23,6 +23,26 @@ <value xml:lang="en">Could not find RateAmount record to be deleted</value> <value xml:lang="it">Non è possibile trovare un record di RateAmount che deve essere cancellato</value> </property> + <property key="AccountingEftAccountCannotBeCreated"> + <value xml:lang="en">ERROR: Could not create payment method Id (id generation failure)</value> + <value xml:lang="it">ERRORE: Non è possibile creare il metodo pagamento (fallimento generazione id)</value> + </property> + <property key="AccountingEftAccountCannotBeCreatedWriteFailure"> + <value xml:lang="en">ERROR: Could not create EFT account (write failure): ${errorString}</value> + <value xml:lang="it">ERRORE: Non è possibile creare il conto EFT (fallita scrittura): ${errorString}</value> + </property> + <property key="AccountingEftAccountCannotBeUpdated"> + <value xml:lang="en">ERROR: Could not update EFT Account (write failure): ${errorString}</value> + <value xml:lang="it">ERRORE: Non è possibile aggiornare il conto EFT (scrittura fallita): ${errorString}</value> + </property> + <property key="AccountingEftAccountCannotBeUpdatedReadFailure"> + <value xml:lang="en">ERROR: Could not update EFT Account (read error): ${errorString}</value> + <value xml:lang="it">ERRORE: Non è possibile aggiornare il conto EFT (fallita lettura): ${errorString}</value> + </property> + <property key="AccountingEftPartyNotAuthorized"> + <value xml:lang="en">Party Id ${partyId} is not the owner of payment method ${paymentMethodId} and does not have permission to change it.</value> + <value xml:lang="it">Il soggetto ${partyId} non è il propretario del metodo di pagamento ${paymentMethodId} non hai il permesso per cambiarlo.</value> + </property> <property key="AccountingFinAccountAuthorizationExpired"> <value xml:lang="en">Authorization transaction ${paymentGatewayResponseId} has expired as of ${authExpiration}</value> <value xml:lang="it">Autorizzazione transazione ${paymentGatewayResponseId} ha una scadenza del ${authExpiration}</value> @@ -135,6 +155,22 @@ <value xml:lang="en">Unknown replenish method found</value> <value xml:lang="it">Metodo rifornimento sconosciuto</value> </property> + <property key="AccountingGiftCardCannotBeCreated"> + <value xml:lang="en">ERROR: Could not create GiftCard (id generation failure)</value> + <value xml:lang="it">ERRORE: Non è possibile creare la carta regalo (fallita generazione id)</value> + </property> + <property key="AccountingGiftCardCannotBeCreatedWriteFailure"> + <value xml:lang="en">ERROR: Could not create GiftCard (write failure): ${errorString}</value> + <value xml:lang="it">ERRORE: Non è possibile creare la carta regalo (fallita scrittura): ${errorString}</value> + </property> + <property key="AccountingGiftCardCannotBeUpdated"> + <value xml:lang="en">ERROR: Could not get GiftCard to update (read error): ${errorString}</value> + <value xml:lang="it">ERRORE: Non è possibile aggiornare la carta regalo (fallita lettura): ${errorString}</value> + </property> + <property key="AccountingGiftCardPartyNotAuthorized"> + <value xml:lang="en">Party Id ${partyId} is not the owner of payment method ${paymentMethodId} and does not have permission to change it.</value> + <value xml:lang="it">Il soggetto ${partyId} non è il propretario del metodo di pagamento ${paymentMethodId} non hai il permesso per cambiarlo.</value> + </property> <property key="AccountingGiftCerticateNumberCannotBeExpired"> <value xml:lang="en">Unable to expire financial account authorization for Gift Certificate: </value> <value xml:lang="it">Non è possibile cancellare l'autorizzazione per il conto finanziario per il certificato regalo: </value> @@ -219,6 +255,18 @@ <value xml:lang="en">Acctg preference not define</value> <value xml:lang="fr">Aucune configuration sur les préférences de gestion encore définie pour votre société</value> </property> + <property key="AccountingPaymentMethodCannotBeDeleted"> + <value xml:lang="en">ERROR: Could not find Payment Method to delete (read failure ${errorString})</value> + <value xml:lang="it">ERRORE: Non è possibile trovare il metodo di pagmento da cancellare (lettura fallita ${errorString})</value> + </property> + <property key="AccountingPaymentMethodCannotBeDeletedWriteFailure"> + <value xml:lang="en">ERROR: Could not find Payment Method to delete (write failure ${errorString})</value> + <value xml:lang="it">ERRORE: Non è possibile trovare il metodo di pagmento da cancellare (scrittura fallita ${errorString})</value> + </property> + <property key="AccountingPaymentMethodNoPermissionToDelete"> + <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="AccountingPayPalCommunicationError"> <value xml:lang="en">A problem occurred while communicating with PayPal, please try again or select a different checkout method</value> <value xml:lang="hi_IN">Paypal सॠसà¤à¤à¤¾à¤° मà¥à¤ समसà¥à¤¯à¤¾, à¤à¥à¤ªà¤¯à¤¾ पà¥à¤¨: पà¥à¤°à¤¯à¤¾à¤¸ à¤à¤°à¥à¤ या à¤à¤ ठलठCheckout पदà¥à¤§à¤¤à¤¿ à¤à¤¾ à¤à¤¯à¤¨ à¤à¤°à¥à¤</value> Modified: ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml?rev=1059632&r1=1059631&r2=1059632&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml (original) +++ ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml Sun Jan 16 18:50:53 2011 @@ -8618,6 +8618,10 @@ <value xml:lang="zh">ä½ æ²¡ææé使ç¨è¿ä¸ªé¡µé¢(éè¦PERIOD_MAINT)</value> <value xml:lang="zh_TW">ä½ æ²ææ¬é使ç¨éåé é¢(éè¦PERIOD_MAINT)</value> </property> + <property key="AccountingPeriodCannotGet"> + <value xml:lang="en">Cannot get a starting date for net income</value> + <value xml:lang="it">Non è possibile ricavare una data d'inizio per l'utile netto</value> + </property> <property key="AccountingPastDueInvoices"> <value xml:lang="en">Past Due Invoices</value> </property> Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentMethodServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentMethodServices.java?rev=1059632&r1=1059631&r2=1059632&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentMethodServices.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentMethodServices.java Sun Jan 16 18:50:53 2011 @@ -50,6 +50,7 @@ public class PaymentMethodServices { public final static String module = PaymentMethodServices.class.getName(); public final static String resource = "AccountingUiLabels"; + public static final String resourceError = "AccountingUiLabels"; /** * Deletes a PaymentMethod entity according to the parameters passed in the context @@ -63,6 +64,7 @@ public class PaymentMethodServices { Delegator delegator = ctx.getDelegator(); Security security = ctx.getSecurity(); GenericValue userLogin = (GenericValue) context.get("userLogin"); + Locale locale = (Locale) context.get("locale"); Timestamp now = UtilDateTime.nowTimestamp(); @@ -74,17 +76,22 @@ public class PaymentMethodServices { paymentMethod = delegator.findByPrimaryKey("PaymentMethod", UtilMisc.toMap("paymentMethodId", paymentMethodId)); } catch (GenericEntityException e) { Debug.logWarning(e.toString(), module); - return ServiceUtil.returnError("ERROR: Could not find Payment Method to delete (read failure: " + e.getMessage() + ")"); + return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, + "AccountingPaymentMethodCannotBeDeleted", + UtilMisc.toMap("errorString", e.getMessage()), locale)); } if (paymentMethod == null) { - return ServiceUtil.returnError("ERROR: Could not find Payment Method to delete (read failure)"); + return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, + "AccountingPaymentMethodCannotBeDeleted", + UtilMisc.toMap("errorString", ""), locale)); } // <b>security check</b>: userLogin partyId must equal paymentMethod partyId, or must have PAY_INFO_DELETE permission if (paymentMethod.get("partyId") == null || !paymentMethod.getString("partyId").equals(userLogin.getString("partyId"))) { if (!security.hasEntityPermission("PAY_INFO", "_DELETE", userLogin)) { - return ServiceUtil.returnError("You do not have permission to delete Payment Method for this partyId"); + return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, + "AccountingPaymentMethodNoPermissionToDelete", locale)); } } @@ -93,7 +100,9 @@ public class PaymentMethodServices { paymentMethod.store(); } catch (GenericEntityException e) { Debug.logWarning(e.toString(), module); - return ServiceUtil.returnError("ERROR: Could not delete Payment Method (write failure): " + e.getMessage()); + return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, + "AccountingPaymentMethodCannotBeDeletedWriteFailure", + UtilMisc.toMap("errorString", e.getMessage()), locale)); } result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS); @@ -170,7 +179,8 @@ public class PaymentMethodServices { try { newPmId = delegator.getNextSeqId("PaymentMethod"); } catch (IllegalArgumentException e) { - return ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingCreditCardCreateIdGenerationFailure", locale)); + return ServiceUtil.returnError(UtilProperties.getMessage(resource, + "AccountingCreditCardCreateIdGenerationFailure", locale)); } } @@ -226,7 +236,8 @@ public class PaymentMethodServices { delegator.storeAll(toBeStored); } catch (GenericEntityException e) { Debug.logWarning(e.getMessage(), module); - return ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingCreditCardCreateWriteFailure", locale) + e.getMessage()); + return ServiceUtil.returnError(UtilProperties.getMessage(resource, + "AccountingCreditCardCreateWriteFailure", locale) + e.getMessage()); } result.put("paymentMethodId", newCc.getString("paymentMethodId")); @@ -268,14 +279,18 @@ public class PaymentMethodServices { paymentMethod = delegator.findByPrimaryKey("PaymentMethod", UtilMisc.toMap("paymentMethodId", paymentMethodId)); } catch (GenericEntityException e) { Debug.logWarning(e.getMessage(), module); - return ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingCreditCardUpdateReadFailure", locale) + e.getMessage()); + return ServiceUtil.returnError(UtilProperties.getMessage(resource, + "AccountingCreditCardUpdateReadFailure", locale) + e.getMessage()); } if (creditCard == null || paymentMethod == null) { - return ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingCreditCardUpdateWithPaymentMethodId", locale) + paymentMethodId); + return ServiceUtil.returnError(UtilProperties.getMessage(resource, + "AccountingCreditCardUpdateWithPaymentMethodId", locale) + paymentMethodId); } if (!paymentMethod.getString("partyId").equals(partyId) && !security.hasEntityPermission("PAY_INFO", "_UPDATE", userLogin)) { - return ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingCreditCardUpdateWithoutPermission", UtilMisc.toMap("partyId", partyId, "paymentMethodId", paymentMethodId), locale)); + return ServiceUtil.returnError(UtilProperties.getMessage(resource, + "AccountingCreditCardUpdateWithoutPermission", UtilMisc.toMap("partyId", partyId, + "paymentMethodId", paymentMethodId), locale)); } // do some more complicated/critical validation... @@ -329,7 +344,8 @@ public class PaymentMethodServices { try { newPmId = delegator.getNextSeqId("PaymentMethod"); } catch (IllegalArgumentException e) { - return ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingCreditCardUpdateIdGenerationFailure", locale)); + return ServiceUtil.returnError(UtilProperties.getMessage(resource, + "AccountingCreditCardUpdateIdGenerationFailure", locale)); } @@ -403,14 +419,16 @@ public class PaymentMethodServices { delegator.storeAll(toBeStored); } catch (GenericEntityException e) { Debug.logWarning(e.getMessage(), module); - return ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingCreditCardUpdateWriteFailure", locale) + e.getMessage()); + return ServiceUtil.returnError(UtilProperties.getMessage(resource, + "AccountingCreditCardUpdateWriteFailure", locale) + e.getMessage()); } } else { result.put("paymentMethodId", paymentMethodId); result.put("oldPaymentMethodId", paymentMethodId); result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS); if (contactMechId == null || !contactMechId.equals("_NEW_")) { - result.put(ModelService.SUCCESS_MESSAGE, UtilProperties.getMessage(resource, "AccountingNoChangesMadeNotUpdatingCreditCard", locale)); + result.put(ModelService.SUCCESS_MESSAGE, UtilProperties.getMessage(resource, + "AccountingNoChangesMadeNotUpdatingCreditCard", locale)); } return result; @@ -470,6 +488,7 @@ public class PaymentMethodServices { Delegator delegator = ctx.getDelegator(); Security security = ctx.getSecurity(); GenericValue userLogin = (GenericValue) context.get("userLogin"); + Locale locale = (Locale) context.get("locale"); Timestamp now = UtilDateTime.nowTimestamp(); @@ -489,7 +508,8 @@ public class PaymentMethodServices { try { newPmId = delegator.getNextSeqId("PaymentMethod"); } catch (IllegalArgumentException e) { - return ServiceUtil.returnError("ERROR: Could not create GiftCard (id generation failure)"); + return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, + "AccountingGiftCardCannotBeCreated", locale)); } } @@ -510,7 +530,9 @@ public class PaymentMethodServices { delegator.storeAll(toBeStored); } catch (GenericEntityException e) { Debug.logWarning(e.getMessage(), module); - return ServiceUtil.returnError("ERROR: Could not create GiftCard (write failure): " + e.getMessage()); + return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, + "AccountingGiftCardCannotBeCreatedWriteFailure", + UtilMisc.toMap("errorString", e.getMessage()), locale)); } result.put("paymentMethodId", newGc.getString("paymentMethodId")); @@ -546,14 +568,20 @@ public class PaymentMethodServices { paymentMethod = delegator.findByPrimaryKey("PaymentMethod", UtilMisc.toMap("paymentMethodId", paymentMethodId)); } catch (GenericEntityException e) { Debug.logWarning(e.getMessage(), module); - return ServiceUtil.returnError("ERROR: Could not get GiftCard to update (read error): " + e.getMessage()); + return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, + "AccountingGiftCardCannotBeUpdated", + UtilMisc.toMap("errorString", e.getMessage()), locale)); } if (giftCard == null || paymentMethod == null) { - return ServiceUtil.returnError("ERROR: Could not find GiftCard to update with id " + paymentMethodId); + return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, + "AccountingGiftCardCannotBeUpdated", + UtilMisc.toMap("errorString", paymentMethodId), locale)); } if (!paymentMethod.getString("partyId").equals(partyId) && !security.hasEntityPermission("PAY_INFO", "_UPDATE", userLogin)) { - return ServiceUtil.returnError("Party Id [" + partyId + "] is not the owner of payment method [" + paymentMethodId + "] and does not have permission to change it."); + return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, + "AccountingGiftCardPartyNotAuthorized", + UtilMisc.toMap("partyId", partyId, "paymentMethodId", paymentMethodId), locale)); } @@ -590,7 +618,8 @@ public class PaymentMethodServices { try { newPmId = delegator.getNextSeqId("PaymentMethod"); } catch (IllegalArgumentException e) { - return ServiceUtil.returnError("ERROR: Could not update GiftCard info (id generation failure)"); + return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, + "AccountingGiftCardCannotBeCreated", locale)); } newPm.set("partyId", partyId); @@ -619,8 +648,9 @@ public class PaymentMethodServices { delegator.storeAll(toBeStored); } catch (GenericEntityException e) { Debug.logWarning(e.getMessage(), module); - return ServiceUtil.returnError( - "ERROR: Could not update EFT Account (write failure): " + e.getMessage()); + return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, + "AccountingEftAccountCannotBeUpdated", + UtilMisc.toMap("errorString", e.getMessage()), locale)); } } else { result.put("paymentMethodId", paymentMethodId); @@ -650,6 +680,7 @@ public class PaymentMethodServices { Delegator delegator = ctx.getDelegator(); Security security = ctx.getSecurity(); GenericValue userLogin = (GenericValue) context.get("userLogin"); + Locale locale = (Locale) context.get("locale"); Timestamp now = UtilDateTime.nowTimestamp(); @@ -670,7 +701,8 @@ public class PaymentMethodServices { try { newPmId = delegator.getNextSeqId("PaymentMethod"); } catch (IllegalArgumentException e) { - return ServiceUtil.returnError("ERROR: Could not create payment method Id (id generation failure)"); + return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, + "AccountingEftAccountCannotBeCreated", locale)); } } @@ -712,7 +744,8 @@ public class PaymentMethodServices { if (tempVal == null) { // no value found, create a new one newPartyContactMechPurpose = delegator.makeValue("PartyContactMechPurpose", - UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId, "contactMechPurposeTypeId", contactMechPurposeTypeId, "fromDate", now)); + UtilMisc.toMap("partyId", partyId, "contactMechId", contactMechId, + "contactMechPurposeTypeId", contactMechPurposeTypeId, "fromDate", now)); } } @@ -723,7 +756,9 @@ public class PaymentMethodServices { delegator.storeAll(toBeStored); } catch (GenericEntityException e) { Debug.logWarning(e.getMessage(), module); - return ServiceUtil.returnError("ERROR: Could not create credit card (write failure): " + e.getMessage()); + return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, + "AccountingEftAccountCannotBeCreatedWriteFailure", + UtilMisc.toMap("errorString", e.getMessage()), locale)); } result.put("paymentMethodId", newEa.getString("paymentMethodId")); @@ -766,15 +801,20 @@ public class PaymentMethodServices { delegator.findByPrimaryKey("PaymentMethod", UtilMisc.toMap("paymentMethodId", paymentMethodId)); } catch (GenericEntityException e) { Debug.logWarning(e.getMessage(), module); - return ServiceUtil.returnError( - "ERROR: Could not get EFT Account to update (read error): " + e.getMessage()); + return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, + "AccountingEftAccountCannotBeUpdatedReadFailure", + UtilMisc.toMap("errorString", e.getMessage()), locale)); } if (eftAccount == null || paymentMethod == null) { - return ServiceUtil.returnError("ERROR: Could not find EFT Account to update with id " + paymentMethodId); + return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, + "AccountingEftAccountCannotBeUpdated", + UtilMisc.toMap("errorString", paymentMethodId), locale)); } if (!paymentMethod.getString("partyId").equals(partyId) && !security.hasEntityPermission("PAY_INFO", "_UPDATE", userLogin)) { - return ServiceUtil.returnError("Party Id [" + partyId + "] is not the owner of payment method [" + paymentMethodId + "] and does not have permission to change it."); + return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, + "AccountingEftAccountCannotBeUpdated", + UtilMisc.toMap("partyId", partyId, "paymentMethodId", paymentMethodId), locale)); } newPm = GenericValue.create(paymentMethod); @@ -786,7 +826,8 @@ public class PaymentMethodServices { try { newPmId = delegator.getNextSeqId("PaymentMethod"); } catch (IllegalArgumentException e) { - return ServiceUtil.returnError("ERROR: Could not update EFT Account info (id generation failure)"); + return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, + "AccountingEftAccountCannotBeCreated", locale)); } newPm.set("partyId", partyId); @@ -848,8 +889,9 @@ public class PaymentMethodServices { delegator.storeAll(toBeStored); } catch (GenericEntityException e) { Debug.logWarning(e.getMessage(), module); - return ServiceUtil.returnError( - "ERROR: Could not update EFT Account (write failure): " + e.getMessage()); + return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, + "AccountingEftAccountCannotBeUpdated", + UtilMisc.toMap("errorString", e.getMessage()), locale)); } } else { result.put("paymentMethodId", paymentMethodId); Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/period/PeriodServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/period/PeriodServices.java?rev=1059632&r1=1059631&r2=1059632&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/period/PeriodServices.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/period/PeriodServices.java Sun Jan 16 18:50:53 2011 @@ -22,10 +22,12 @@ package org.ofbiz.accounting.period; import java.sql.Date; import java.sql.Timestamp; import java.util.List; +import java.util.Locale; import java.util.Map; import org.ofbiz.base.util.UtilDateTime; import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.base.util.UtilProperties; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; @@ -35,7 +37,9 @@ import org.ofbiz.service.DispatchContext import org.ofbiz.service.ServiceUtil; public class PeriodServices { + public static String module = PeriodServices.class.getName(); + public static final String resource = "AccountingUiLabels"; /* find the date of the last closed CustomTimePeriod, or, if none available, the earliest date available of any * CustomTimePeriod @@ -45,6 +49,7 @@ public class PeriodServices { String organizationPartyId = (String) context.get("organizationPartyId"); // input parameters String periodTypeId = (String) context.get("periodTypeId"); Date findDate = (Date) context.get("findDate"); + Locale locale = (Locale) context.get("locale"); // default findDate to now if (findDate == null) { @@ -82,7 +87,8 @@ public class PeriodServices { if ((timePeriods != null) && (timePeriods.size() > 0) && (timePeriods.get(0).get("fromDate") != null)) { lastClosedDate = UtilDateTime.toTimestamp(timePeriods.get(0).getDate("fromDate")); } else { - return ServiceUtil.returnError("Cannot get a starting date for net income"); + return ServiceUtil.returnError(UtilProperties.getMessage(resource, + "AccountingPeriodCannotGet", locale)); } } |
| Free forum by Nabble | Edit this page |
