|
Author: mrisaliti
Date: Thu Jan 13 22:57:44 2011 New Revision: 1058781 URL: http://svn.apache.org/viewvc?rev=1058781&view=rev Log: Reverted revision 1058311 for buildbot failure Modified: ofbiz/trunk/applications/accounting/config/AccountingErrorUiLabels.xml ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountPaymentServices.java ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountProductServices.java ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java ofbiz/trunk/applications/content/config/ContentUiLabels.xml ofbiz/trunk/applications/content/src/org/ofbiz/content/compdoc/CompDocServices.java Modified: ofbiz/trunk/applications/accounting/config/AccountingErrorUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/AccountingErrorUiLabels.xml?rev=1058781&r1=1058780&r2=1058781&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/config/AccountingErrorUiLabels.xml (original) +++ ofbiz/trunk/applications/accounting/config/AccountingErrorUiLabels.xml Thu Jan 13 22:57:44 2011 @@ -23,114 +23,18 @@ <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="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> - </property> - <property key="AccountingFinAccountCancelled"> - <value xml:lang="en">Account has been cancelled</value> - <value xml:lang="it">Il conto è stato cancellato</value> - </property> - <property key="AccountingFinAccountCannotBeAuthorized"> - <value xml:lang="en">Cannot authorize financial account due to: ${errorString}</value> - <value xml:lang="it">Non è possibile autorizzare il conto finanziario per: ${errorString}</value> - </property> - <property key="AccountingFinAccountCannotBeExpired"> - <value xml:lang="en">Unable to expire financial account authorization: </value> - <value xml:lang="it">Non è possibile cancellare l'autorizzazione per il conto finanziario: </value> - </property> - <property key="AccountingFinAccountCannotBeRefunded"> - <value xml:lang="en">Available balance does not match the actual balance; pending authorizations; cannot refund FinAccount at this time.</value> - <value xml:lang="it">Bilancio disponibilie non corrisponde all'attuale bilancio; autorizzazioni in attesa; non è possibile rimborsare il conto finanziario in questo momento.</value> - </property> - <property key="AccountingFinAccountCannotBeReplenish"> - <value xml:lang="en">Cannot locate product store from previous deposits; product store cannot be empty</value> - <value xml:lang="it">Non è possibile localizzare il negozio dei precedenti depositi; il negozio non può essere vuoto</value> - </property> - <property key="AccountingFinAccountCannotCapture"> - <value xml:lang="en">No authorization transaction found for the OrderPaymentPreference; cannot capture</value> - <value xml:lang="it">Nessuna transazione di autorizzazione trovata per le preferenze pagamento ordine; non è possibile catturare</value> - </property> - <property key="AccountingFinAccountCannotCreate"> - <value xml:lang="en">Unable to create financial accout; no productStoreId on OrderHeader: ${orderId}</value> - <value xml:lang="it">Non è possibile creare conto finanziario; nessun negozio impostato sulla testata ordine: ${orderId}</value> - </property> - <property key="AccountingFinAccountCannotCreditAccount"> - <value xml:lang="en">Could not find or create a service credit account</value> - <value xml:lang="it">Non è possibile trovare o creare un servizio di accredito conto</value> - </property> - <property key="AccountingFinAccountCannotFindAuthorization"> - <value xml:lang="en"> Could not find authorization transaction.</value> - <value xml:lang="it"> Non è possibile trovare la transazione di autorizzazione.</value> - </property> - <property key="AccountingFinAccountCannotLocateItFromAccountCode"> - <value xml:lang="en">Unable to locate financial account from account code</value> - <value xml:lang="it">Non è possibile localizzare il conto finanziario dal codice conto</value> - </property> <property key="AccountingFinAccountCannotPost"> <value xml:lang="en">Cannot post FinAccountTrans with ID ${parameters.finAccountTransId} to GL, could not find ${creditDebit} ${requiredField}</value> <value xml:lang="it">Non post FinAccountTrans con ID ${parameters.finAccountTransId} in GL, could not find ${creditDebit} ${requiredField}</value> </property> - <property key="AccountingFinAccountExpired"> - <value xml:lang="en">Account has expired as of ${thruDate}</value> - <value xml:lang="it">Conto scaduto dal ${thruDate}</value> - </property> - <property key="AccountingFinAccountFrozen"> - <value xml:lang="en">Account is currently frozen</value> - <value xml:lang="it">Il conto è attualmente congelato</value> - </property> - <property key="AccountingFinAccountIdAndFinAccountCodeAreNull"> - <value xml:lang="en">Both finAccountId and finAccountCode cannot be null; at least one is required</value> - <value xml:lang="it">Entrambi finAccountId e finAccountCode non possono essere nulli; al minimo uno è richiesto</value> - </property> - <property key="AccountingFinAccountIdInvalid"> - <value xml:lang="en">Invalid financial account; cannot locate account</value> - <value xml:lang="it">Conto finanziario invalido; non è possibile localizzare il conto</value> - </property> <property key="AccountingFinAccountInactiveStatusError"> <value xml:lang="en">FinAccount must be in active status</value> <value xml:lang="fr">Le compte financier doit être dans un état actif</value> </property> - <property key="AccountingFinAccountIsNotRefundable"> - <value xml:lang="en">Account is not refunable</value> - <value xml:lang="it">Il conto non è rimborsabile</value> - </property> - <property key="AccountingFinAccountNegative"> - <value xml:lang="en">Account is currently negative and pending replenishment</value> - <value xml:lang="it">Il conto è attualmente negativo e in attesa di rifornimento</value> - </property> - <property key="AccountingFinAccountNoPaymentMethodAssociatedWithReplenishAccount"> - <value xml:lang="en">No payment method associated with replenish account</value> - <value xml:lang="it">Nessun metodo pagamento associtao con il conto di rifornimento</value> - </property> - <property key="AccountingFinAccountNotFound"> - <value xml:lang="en">No finAccountId found ${finAccountId}</value> - <value xml:lang="it">Conto finanziario non trovato ${finAccountId}</value> - </property> - <property key="AccountingFinAccountPartiallyRefunded"> - <value xml:lang="en">FinAccount partially refunded; not enough replenish deposits to refund!</value> - <value xml:lang="it">Conto finanziario parzialmente rimborsato; non ci sono abbastanza depositi per il rifornimento da rimborsare!</value> - </property> - <property key="AccountingFinAccountPinCodeCombinatorNotFound"> - <value xml:lang="en">Financial account PIN/CODE combination not found</value> - <value xml:lang="it">Conto finanziario combinazione PIN/CODE non trovata</value> - </property> - <property key="AccountingFinAccountMustBePositive"> - <value xml:lang="en">Amount should be a positive number.</value> - <value xml:lang="it">L'importo dovrebbe essere un numero positivo.</value> - </property> - <property key="AccountingFinAccountSetting"> - <value xml:lang="en">No settings found for store ${productStoreId} for fin account type ${finAccountTypeId}</value> - <value xml:lang="it">Nessuna configurazione trovata per il negozio ${productStoreId} per il tipo conto finanziario ${finAccountTypeId}</value> - </property> <property key="AccountingFinAccountStatusNotValidError"> <value xml:lang="en">FinAccount not in valid status</value> <value xml:lang="fr">Le compte financier n'est pas dans un état valide</value> </property> - <property key="AccountingFinAccountUnknownReplenishMethod"> - <value xml:lang="en">Unknown replenish method found</value> - <value xml:lang="it">Metodo rifornimento sconosciuto</value> - </property> <property key="AccountingPartyAcctgPreferenceNotDefine"> <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> Modified: ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml?rev=1058781&r1=1058780&r2=1058781&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml (original) +++ ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml Thu Jan 13 22:57:44 2011 @@ -2133,10 +2133,6 @@ <value xml:lang="fr">Montant Commission</value> <value xml:lang="hi_IN">दलालॠराशà¥</value> </property> - <property key="AccountingCommissionInvoicesCreated"> - <value xml:lang="en">Created Commission invoices for each commission receiving parties ${invoicesCreated}</value> - <value xml:lang="it">Create fatture provvigioni per ogni provvigione ricevuta dai soggetti ${invoicesCreated}</value> - </property> <property key="AccountingCommissionRun"> <value xml:lang="de">Provisionslauf</value> <value xml:lang="en">Commission Run</value> Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountPaymentServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountPaymentServices.java?rev=1058781&r1=1058780&r2=1058781&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountPaymentServices.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountPaymentServices.java Thu Jan 13 22:57:44 2011 @@ -22,7 +22,6 @@ package org.ofbiz.accounting.finaccount; import java.math.BigDecimal; import java.sql.Timestamp; import java.util.List; -import java.util.Locale; import java.util.Map; import javolution.util.FastList; @@ -57,14 +56,13 @@ import org.ofbiz.service.ServiceUtil; public class FinAccountPaymentServices { public static final String module = FinAccountPaymentServices.class.getName(); - public static final String resourceError = "AccountingErrorUiLabels"; // base payment integration services public static Map<String, Object> finAccountPreAuth(DispatchContext dctx, Map<String, Object> context) { LocalDispatcher dispatcher = dctx.getDispatcher(); Delegator delegator = dctx.getDelegator(); GenericValue userLogin = (GenericValue) context.get("userLogin"); - Locale locale = (Locale) context.get("locale"); + GenericValue paymentPref = (GenericValue) context.get("orderPaymentPreference"); String finAccountCode = (String) context.get("finAccountCode"); String finAccountPin = (String) context.get("finAccountPin"); @@ -112,17 +110,14 @@ public class FinAccountPaymentServices { finAccount = FinAccountHelper.getFinAccountFromCode(finAccountCode, delegator); } catch (GenericEntityException e) { Debug.logError(e, module); - return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, - "AccountingFinAccountCannotLocateItFromAccountCode", locale)); + return ServiceUtil.returnError("Unable to locate financial account from account code"); } } else { - return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, - "AccountingFinAccountIdAndFinAccountCodeAreNull", locale)); + return ServiceUtil.returnError("Both finAccountId and finAccountCode cannot be null; at least one is required"); } } if (finAccount == null) { - return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, - "AccountingFinAccountIdInvalid", locale)); + return ServiceUtil.returnError("Invalid financial account; cannot locate account"); } String finAccountTypeId = finAccount.getString("finAccountTypeId"); @@ -153,8 +148,7 @@ public class FinAccountPaymentServices { if ("Y".equals(finAccountSettings.getString("requirePinCode"))) { if (!FinAccountHelper.validatePin(delegator, finAccountCode, finAccountPin)) { Map<String, Object> result = ServiceUtil.returnSuccess(); - result.put("authMessage", UtilProperties.getMessage(resourceError, - "AccountingFinAccountPinCodeCombinatorNotFound", locale)); + result.put("authMessage", "Financial account PIN/CODE combination not found"); result.put("authResult", Boolean.FALSE); result.put("processAmount", amount); result.put("authFlag", "0"); @@ -169,9 +163,7 @@ public class FinAccountPaymentServices { // check for expiration date if ((finAccount.getTimestamp("thruDate") != null) && (finAccount.getTimestamp("thruDate").before(UtilDateTime.nowTimestamp()))) { Map<String, Object> result = ServiceUtil.returnSuccess(); - result.put("authMessage", UtilProperties.getMessage(resourceError, - "AccountingFinAccountExpired", - UtilMisc.toMap("thruDate", finAccount.getTimestamp("thruDate")), locale)); + result.put("authMessage", "Account has expired as of " + finAccount.getTimestamp("thruDate")); result.put("authResult", Boolean.FALSE); result.put("processAmount", amount); result.put("authFlag", "0"); @@ -190,14 +182,11 @@ public class FinAccountPaymentServices { if ("FNACT_NEGPENDREPL".equals(statusId) || "FNACT_MANFROZEN".equals(statusId) || "FNACT_CANCELLED".equals(statusId)) { Map<String, Object> result = ServiceUtil.returnSuccess(); if ("FNACT_NEGPENDREPL".equals(statusId)) { - result.put("authMessage", UtilProperties.getMessage(resourceError, - "AccountingFinAccountNegative", locale)); + result.put("authMessage", "Account is currently negative and pending replenishment"); } else if ("FNACT_MANFROZEN".equals(statusId)) { - result.put("authMessage", UtilProperties.getMessage(resourceError, - "AccountingFinAccountFrozen", locale)); + result.put("authMessage", "Account is currently frozen"); } else if ("FNACT_CANCELLED".equals(statusId)) { - result.put("authMessage", UtilProperties.getMessage(resourceError, - "AccountingFinAccountCancelled", locale)); + result.put("authMessage", "Account has been cancelled"); } result.put("authResult", Boolean.FALSE); result.put("processAmount", amount); @@ -272,31 +261,26 @@ public class FinAccountPaymentServices { return result; } catch (GenericEntityException ex) { Debug.logError(ex, "Cannot authorize financial account", module); - return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, - "AccountingFinAccountCannotBeAuthorized", - UtilMisc.toMap("errorString", ex.getMessage()), locale)); + return ServiceUtil.returnError("Cannot authorize financial account due to " + ex.getMessage()); } catch (GenericServiceException ex) { - Debug.logError(ex, "Cannot authorize financial account", module); - return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, - "AccountingFinAccountCannotBeAuthorized", - UtilMisc.toMap("errorString", ex.getMessage()), locale)); + Debug.logError(ex, "Cannot authorize gift certificate", module); + return ServiceUtil.returnError("Cannot authorize financial account due to " + ex.getMessage()); } } public static Map<String, Object> finAccountReleaseAuth(DispatchContext dctx, Map<String, Object> context) { LocalDispatcher dispatcher = dctx.getDispatcher(); GenericValue userLogin = (GenericValue) context.get("userLogin"); + GenericValue paymentPref = (GenericValue) context.get("orderPaymentPreference"); - Locale locale = (Locale) context.get("locale"); - String err = UtilProperties.getMessage(resourceError, "AccountingFinAccountCannotBeExpired", locale); + String err = "Unable to expire financial account authorization: "; try { // expire the related financial authorization transaction GenericValue authTransaction = PaymentGatewayServices.getAuthTransaction(paymentPref); if (authTransaction == null) { - return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, - "AccountingFinAccountCannotFindAuthorization", locale)); + return ServiceUtil.returnError(err + " Could not find authorization transaction."); } Map<String, Object> input = UtilMisc.toMap("userLogin", userLogin, "finAccountAuthId", authTransaction.get("referenceNum")); @@ -322,7 +306,6 @@ public class FinAccountPaymentServices { public static Map<String, Object> finAccountCapture(DispatchContext dctx, Map<String, Object> context) { LocalDispatcher dispatcher = dctx.getDispatcher(); Delegator delegator = dctx.getDelegator(); - Locale locale = (Locale) context.get("locale"); GenericValue orderPaymentPreference = (GenericValue) context.get("orderPaymentPreference"); GenericValue userLogin = (GenericValue) context.get("userLogin"); @@ -335,8 +318,7 @@ public class FinAccountPaymentServices { authTrans = PaymentGatewayServices.getAuthTransaction(orderPaymentPreference); } if (authTrans == null) { - return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, - "AccountingFinAccountCannotCapture", locale)); + return ServiceUtil.returnError("No authorization transaction found for the OrderPaymentPreference; cannot capture"); } // get the auth record @@ -363,17 +345,12 @@ public class FinAccountPaymentServices { // make sure authorization has not expired Timestamp authExpiration = finAccountAuth.getTimestamp("thruDate"); if ((authExpiration != null) && (authExpiration.before(UtilDateTime.nowTimestamp()))) { - return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, - "AccountingFinAccountAuthorizationExpired", - UtilMisc.toMap("paymentGatewayResponseId", authTrans.getString("paymentGatewayResponseId"), - "authExpiration", authExpiration), locale)); + return ServiceUtil.returnError("Authorization transaction [" + authTrans.getString("paymentGatewayResponseId") + "] has expired as of " + authExpiration); } // make sure the fin account itself has not expired if ((finAccount.getTimestamp("thruDate") != null) && (finAccount.getTimestamp("thruDate").before(UtilDateTime.nowTimestamp()))) { - return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, - "AccountingFinAccountExpired", - UtilMisc.toMap("thruDate", finAccount.getTimestamp("thruDate")), locale)); + return ServiceUtil.returnError("Financial account has expired as of " + finAccount.getTimestamp("thruDate")); } String finAccountId = finAccount.getString("finAccountId"); @@ -447,7 +424,6 @@ public class FinAccountPaymentServices { public static Map<String, Object> finAccountRefund(DispatchContext dctx, Map<String, Object> context) { LocalDispatcher dispatcher = dctx.getDispatcher(); Delegator delegator = dctx.getDelegator(); - Locale locale = (Locale) context.get("locale"); GenericValue orderPaymentPreference = (GenericValue) context.get("orderPaymentPreference"); GenericValue userLogin = (GenericValue) context.get("userLogin"); @@ -476,8 +452,7 @@ public class FinAccountPaymentServices { } if (finAccountId == null) { - return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, - "AccountingFinAccountNotFound", UtilMisc.toMap("finAccountId", ""), locale)); + return ServiceUtil.returnError("No finAccountId found"); } // call the deposit service @@ -521,7 +496,6 @@ public class FinAccountPaymentServices { public static Map<String, Object> finAccountWithdraw(DispatchContext dctx, Map<String, Object> context) { LocalDispatcher dispatcher = dctx.getDispatcher(); Delegator delegator = dctx.getDelegator(); - Locale locale = (Locale) context.get("locale"); GenericValue userLogin = (GenericValue) context.get("userLogin"); String productStoreId = (String) context.get("productStoreId"); @@ -546,8 +520,7 @@ public class FinAccountPaymentServices { // validate the amount if (amount.compareTo(BigDecimal.ZERO) < 0) { - return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, - "AccountingFinAccountMustBePositive", locale)); + return ServiceUtil.returnError("Amount should be a positive number."); } GenericValue finAccount; @@ -560,15 +533,12 @@ public class FinAccountPaymentServices { // verify we have a financial account if (finAccount == null) { - return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, - "AccountingFinAccountNotFound", UtilMisc.toMap("finAccountId", ""), locale)); + return ServiceUtil.returnError("Unable to find Financial account for this transaction"); } // make sure the fin account itself has not expired if ((finAccount.getTimestamp("thruDate") != null) && (finAccount.getTimestamp("thruDate").before(UtilDateTime.nowTimestamp()))) { - return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, - "AccountingFinAccountExpired", - UtilMisc.toMap("thruDate", finAccount.getTimestamp("thruDate")), locale)); + return ServiceUtil.returnError("Financial account has expired as of " + finAccount.getTimestamp("thruDate")); } // check the actual balance (excluding authorized amounts) and create the transaction if it is sufficient @@ -615,7 +585,6 @@ public class FinAccountPaymentServices { public static Map<String, Object> finAccountDeposit(DispatchContext dctx, Map<String, Object> context) { LocalDispatcher dispatcher = dctx.getDispatcher(); Delegator delegator = dctx.getDelegator(); - Locale locale = (Locale) context.get("locale"); GenericValue userLogin = (GenericValue) context.get("userLogin"); String productStoreId = (String) context.get("productStoreId"); @@ -642,21 +611,17 @@ public class FinAccountPaymentServices { finAccount = delegator.findByPrimaryKey("FinAccount", UtilMisc.toMap("finAccountId", finAccountId)); } catch (GenericEntityException e) { Debug.logError(e, module); - return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, - "AccountingFinAccountNotFound", UtilMisc.toMap("finAccountId", finAccountId), locale)); + return ServiceUtil.returnError(e.getMessage()); } // verify we have a financial account if (finAccount == null) { - return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, - "AccountingFinAccountNotFound", UtilMisc.toMap("finAccountId", ""), locale)); + return ServiceUtil.returnError("Unable to find Financial account for this transaction"); } // make sure the fin account itself has not expired if ((finAccount.getTimestamp("thruDate") != null) && (finAccount.getTimestamp("thruDate").before(UtilDateTime.nowTimestamp()))) { - return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, - "AccountingFinAccountExpired", - UtilMisc.toMap("thruDate", finAccount.getTimestamp("thruDate")), locale)); + return ServiceUtil.returnError("Financial account has expired as of " + finAccount.getTimestamp("thruDate")); } Debug.log("Deposit into financial account #" + finAccountId + " [" + amount + "]", module); @@ -708,7 +673,6 @@ public class FinAccountPaymentServices { public static Map<String, Object> finAccountReplenish(DispatchContext dctx, Map<String, Object> context) { LocalDispatcher dispatcher = dctx.getDispatcher(); Delegator delegator = dctx.getDelegator(); - Locale locale = (Locale) context.get("locale"); GenericValue userLogin = (GenericValue) context.get("userLogin"); String productStoreId = (String) context.get("productStoreId"); @@ -723,8 +687,7 @@ public class FinAccountPaymentServices { return ServiceUtil.returnError(e.getMessage()); } if (finAccount == null) { - return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, - "AccountingFinAccountNotFound", UtilMisc.toMap("finAccountId", finAccountId), locale)); + return ServiceUtil.returnError("Invalid financial account [" + finAccountId + "]"); } String currency = finAccount.getString("currencyUomId"); String statusId = finAccount.getString("statusId"); @@ -747,8 +710,7 @@ public class FinAccountPaymentServices { if (productStoreId == null) { productStoreId = getLastProductStoreId(delegator, finAccountId); if (productStoreId == null) { - return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, - "AccountingFinAccountCannotBeReplenish", locale)); + return ServiceUtil.returnError("Cannot locate product store from previous deposits; product store cannot be empty"); } } @@ -810,8 +772,7 @@ public class FinAccountPaymentServices { //the deposit is replenish-level itself depositAmount = replenishLevel; } else { - return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, - "AccountingFinAccountUnknownReplenishMethod", locale)); + return ServiceUtil.returnError("Unknown replenish method found"); } // get the owner party @@ -826,8 +787,7 @@ public class FinAccountPaymentServices { String paymentMethodId = finAccount.getString("replenishPaymentId"); if (paymentMethodId == null) { Debug.logWarning("finAccountReplenish Warning: No payment method (replenishPaymentId) attached to financial account [" + finAccountId + "] cannot auto-replenish", module); - return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, - "AccountingFinAccountNoPaymentMethodAssociatedWithReplenishAccount", locale)); + return ServiceUtil.returnError("No payment method associated with replenish account"); } GenericValue paymentMethod; @@ -840,8 +800,7 @@ public class FinAccountPaymentServices { if (paymentMethod == null) { // no payment methods on file; cannot replenish Debug.logWarning("finAccountReplenish Warning: No payment method found for ID [" + paymentMethodId + "] for party [" + ownerPartyId + "] cannot auto-replenish", module); - return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, - "AccountingFinAccountNoPaymentMethodAssociatedWithReplenishAccount", locale)); + return ServiceUtil.returnError("Cannot locate payment method ID [" + paymentMethodId + "]"); } // hit the payment method for the amount to replenish Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountProductServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountProductServices.java?rev=1058781&r1=1058780&r2=1058781&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountProductServices.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountProductServices.java Thu Jan 13 22:57:44 2011 @@ -43,14 +43,12 @@ import javolution.util.FastMap; public class FinAccountProductServices { public static final String module = FinAccountProductServices.class.getName(); - public static final String resourceOrderError = "OrderErrorUiLabels"; - public static final String resourceError = "AccountingErrorUiLabels"; - + public static Map<String, Object> createPartyFinAccountFromPurchase(DispatchContext dctx, Map<String, Object> context) { // this service should always be called via FULFILLMENT_EXTASYNC LocalDispatcher dispatcher = dctx.getDispatcher(); Delegator delegator = dctx.getDelegator(); - Locale locale = (Locale) context.get("locale"); + GenericValue orderItem = (GenericValue) context.get("orderItem"); GenericValue userLogin = (GenericValue) context.get("userLogin"); @@ -64,8 +62,7 @@ public class FinAccountProductServices { orderHeader = orderItem.getRelatedOne("OrderHeader"); } catch (GenericEntityException e) { Debug.logError(e, "Unable to get OrderHeader from OrderItem", module); - return ServiceUtil.returnError(UtilProperties.getMessage(resourceOrderError, - "OrderCannotGetOrderHeader", UtilMisc.toMap("orderId", orderId), locale)); + return ServiceUtil.returnError("Unable to get OrderHeader from OrderItem"); } String productId = orderItem.getString("productId"); @@ -119,10 +116,9 @@ public class FinAccountProductServices { productStoreId = orh.getProductStoreId(); } if (productStoreId == null) { - Debug.logFatal("Unable to create financial accout; no productStoreId on OrderHeader : " + orderId, module); - return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, - "AccountingFinAccountCannotCreate", - UtilMisc.toMap("orderId", orderId), locale)); + String errMsg = "Unable to create financial accout; no productStoreId on OrderHeader : " + orderId; + Debug.logFatal(errMsg, module); + return ServiceUtil.returnError(errMsg); } // party ID (owner) Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java?rev=1058781&r1=1058780&r2=1058781&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java Thu Jan 13 22:57:44 2011 @@ -22,7 +22,6 @@ package org.ofbiz.accounting.finaccount; import java.math.BigDecimal; import java.sql.Timestamp; import java.util.List; -import java.util.Locale; import java.util.Map; import javolution.util.FastMap; @@ -31,7 +30,6 @@ import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.GeneralException; import org.ofbiz.base.util.UtilDateTime; import org.ofbiz.base.util.UtilMisc; -import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; @@ -52,7 +50,6 @@ import org.ofbiz.service.ServiceUtil; public class FinAccountServices { public static final String module = FinAccountServices.class.getName(); - public static final String resourceError = "AccountingErrorUiLabels"; public static Map<String, Object> createAccountAndCredit(DispatchContext dctx, Map<String, Object> context) { Delegator delegator = dctx.getDelegator(); @@ -60,7 +57,6 @@ public class FinAccountServices { String finAccountTypeId = (String) context.get("finAccountTypeId"); String accountName = (String) context.get("accountName"); String finAccountId = (String) context.get("finAccountId"); - Locale locale = (Locale) context.get("locale"); // check the type if (finAccountTypeId == null) { @@ -148,8 +144,7 @@ public class FinAccountServices { } } if (creditAccount == null) { - return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, - "AccountingFinAccountCannotCreditAccount", locale)); + return ServiceUtil.returnError("Could not find or create a service credit account"); } } @@ -184,15 +179,12 @@ public class FinAccountServices { GenericValue userLogin = (GenericValue) context.get("userLogin"); String productStoreId = (String) context.get("productStoreId"); String finAccountTypeId = (String) context.get("finAccountTypeId"); - Locale locale = (Locale) context.get("locale"); try { // get the product store id and use it to generate a unique fin account code GenericValue productStoreFinAccountSetting = delegator.findByPrimaryKeyCache("ProductStoreFinActSetting", UtilMisc.toMap("productStoreId", productStoreId, "finAccountTypeId", finAccountTypeId)); if (productStoreFinAccountSetting == null) { - return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, - "AccountingFinAccountSetting", - UtilMisc.toMap("productStoreId", productStoreId, "finAccountTypeId", finAccountTypeId), locale)); + return ServiceUtil.returnError("No settings found for store [" + productStoreId + "] for fin account type [" + finAccountTypeId + "]"); } Long accountCodeLength = productStoreFinAccountSetting.getLong("accountCodeLength"); @@ -246,7 +238,6 @@ public class FinAccountServices { Delegator delegator = dctx.getDelegator(); String finAccountId = (String) context.get("finAccountId"); String finAccountCode = (String) context.get("finAccountCode"); - Locale locale = (Locale) context.get("locale"); GenericValue finAccount; if (finAccountId == null) { @@ -265,8 +256,7 @@ public class FinAccountServices { } } if (finAccount == null) { - return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, - "AccountingFinAccountNotFound", UtilMisc.toMap("finAccountId", finAccountId), locale)); + return ServiceUtil.returnError("Unable to locate financial account"); } // get the balance @@ -292,11 +282,9 @@ public class FinAccountServices { public static Map<String, Object> checkFinAccountStatus(DispatchContext dctx, Map<String, Object> context) { Delegator delegator = dctx.getDelegator(); String finAccountId = (String) context.get("finAccountId"); - Locale locale = (Locale) context.get("locale"); if (finAccountId == null) { - return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, - "AccountingFinAccountNotFound", UtilMisc.toMap("finAccountId", ""), locale)); + return ServiceUtil.returnError("Financial account ID is required for this service!"); } GenericValue finAccount; @@ -337,7 +325,7 @@ public class FinAccountServices { public static Map<String, Object> refundFinAccount(DispatchContext dctx, Map<String, Object> context) { LocalDispatcher dispatcher = dctx.getDispatcher(); Delegator delegator = dctx.getDelegator(); - Locale locale = (Locale) context.get("locale"); + GenericValue userLogin = (GenericValue) context.get("userLogin"); String finAccountId = (String) context.get("finAccountId"); Map<String, Object> result = null; @@ -352,8 +340,7 @@ public class FinAccountServices { if (finAccount != null) { // check to make sure the account is refundable if (!"Y".equals(finAccount.getString("isRefundable"))) { - return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, - "AccountingFinAccountIsNotRefundable", locale)); + return ServiceUtil.returnError("Account is not refunable"); } // get the actual and available balance @@ -362,8 +349,7 @@ public class FinAccountServices { // if they do not match, then there are outstanding authorizations which need to be settled first if (actualBalance.compareTo(availableBalance) != 0) { - return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, - "AccountingFinAccountCannotBeRefunded", locale)); + return ServiceUtil.returnError("Available balance does not match the actual balance; pending authorizations; cannot refund FinAccount at this time."); } // now we make sure there is something to refund @@ -487,8 +473,7 @@ public class FinAccountServices { // check to make sure we balanced out if (remainingBalance.compareTo(FinAccountHelper.ZERO) == 1) { - result = ServiceUtil.returnError(UtilProperties.getMessage(resourceError, - "AccountingFinAccountPartiallyRefunded", locale)); + result = ServiceUtil.returnSuccess("FinAccount partially refunded; not enough replenish deposits to refund!"); } } } |
| Free forum by Nabble | Edit this page |
