This patch from Marco Risaliti fully localise ShoppingCartItem.java. Thanks to him and Tarlika Elisabeth Schmitz who reported this in http://jira.undersunconsulting.com/browse/OFBIZ-485.
This close http://jira.undersunconsulting.com/browse/OFBIZ-485 and https://issues.apache.org/jira/browse/OFBIZ-200 git-svn-id: https://svn.apache.org/repos/asf/incubator/ofbiz/trunk@439953 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -541,6 +541,20 @@ checkhelper_sales_order_lines_lookup_failed = ERROR: Sales Order Lines lookup fa
|
||||
checkhelpertotalsdonotmatchordertotal = Totals do not match order total.
|
||||
help_also_interested_in = You might also be interested in :
|
||||
item.product_not_found = Product not found, not adding to cart. [productId: ${productId}]
|
||||
item.cannot_add_product_virtual=Tried to add the Virtual Product ${productName} (productId: ${productId}) to the cart, not adding.
|
||||
item.cannot_add_product_not_configured_correctly=Tried to add the Product ${productName} (productId: ${productId}) to the cart, not adding: the product is not configured correctly.
|
||||
item.cannot_add_product_not_yet_available=Tried to add the Product ${productName} (productId: ${productId}) to the cart. This product has not yet been made available for sale, so not adding.
|
||||
item.cannot_add_product_no_longer_available=Tried to add the Product ${productName} (productId: ${productId}) to the cart. This product is no longer available for sale, so not adding.
|
||||
item.missing_reservation_starting_date=The starting date of the reservation is missing....
|
||||
item.reservation_from_tomorrow=You can only make reservation starting tomorrow....
|
||||
item.number_of_days=Please enter a number of days, 1, or more....
|
||||
item.maximum_number_of_person_renting=The maximum number of persons renting this object is ${reservMaxPersons} however you have requested: ${reservPersons} !
|
||||
item.product_not_available=Product not available, ProductId: ${productId} message: ${availableMessage}
|
||||
item.cannot_find_Fixed_Asset=Could not find a related Fixed Asset for the product: ${productId}
|
||||
item.fixed_Asset_not_found=fixed_Asset_not_found. Fixed AssetId: ${fixedAssetId}
|
||||
item.availableOk=OK
|
||||
item.availableQnt=Quantity requested: ${quantityReq} Quantity available: ${quantityAvail}
|
||||
item.notAvailable=I am sorry, not available at these dates: ${resultMessage} item not added to the shopping cart.....
|
||||
shoppinglistevents.added_product_to_cart = Added product ${productId} to cart.
|
||||
shoppinglistevents.cannot_create_new_shopping_list = Cannot create new shopping list.
|
||||
shoppinglistevents.choose_shopping_list = Please choose a shopping list.
|
||||
|
||||
@@ -534,7 +534,21 @@ checkhelper.totals_do_not_match_order_total = Totali non corrispondono al totale
|
||||
checkhelper_sales_order_lines_lookup_failed = ERRORE: Righe Ordine Vendita ricerca fallita.
|
||||
checkhelpertotalsdonotmatchordertotal = Totali non corrispondono al totale ordine.
|
||||
help_also_interested_in = Tu potresti essere interessato anche a :
|
||||
item.product_not_found = Produtto non trovato, non aggiungerelo al carrello. [productId: ${productId}]
|
||||
item.product_not_found = Prodotto non trovato, non verr\u00e0 aggiunto al carrello. [prodotto: ${productId}]
|
||||
item.cannot_add_product_virtual=Tentativo di aggiungere il Prodotto Virtuale ${productName} (prodotto: ${productId}) al carrello, non verr\u00e0 aggiunto.
|
||||
item.cannot_add_product_not_configured_correctly=Tentativo di aggiungere il Prodotto ${productName} (prodotto: ${productId}) al carrello, non verr\u00e0 aggiunto: il prodotto non \u00e8 configurato correttamente.
|
||||
item.cannot_add_product_not_yet_available=Tentativo di aggiungere il Prodotto ${productName} (prodotto: ${productId}) al carrello. Questo prodotto non \u00e8 stato ancora reso disponibile per la vendita, cos\u00ec non sar\u00e0 possibile aggiungerlo.
|
||||
item.cannot_add_product_no_longer_available=Tentativo di aggiungere il Prodotto ${productName} (prodotto: ${productId}) al carrello. Questo prodotto non \u00e8 pi\u00f9 disponibile per la vendita, cos\u00ec non sar\u00e0 possibile aggiungerlo.
|
||||
item.missing_reservation_starting_date=La data di inizio prenotazione \u00e8 mancante....
|
||||
item.reservation_from_tomorrow=Tu potrai effettuare la prenotazione solo da domani....
|
||||
item.number_of_days=Perfavore inserire un numero di giorni, 1, o pi\u00f9....
|
||||
item.maximum_number_of_person_renting=Il numero massimo di persone che affittano questo oggetto \u00e8 ${reservMaxPersons} comunque tu hai richiesto: ${reservPersons} !
|
||||
item.product_not_available=Prodotto non disponibile, Prodotto: ${productId} messaggio: ${availableMessage}
|
||||
item.cannot_find_Fixed_Asset=Non \u00e8 possibile trovare un Cespite per il prodotto: ${productId}
|
||||
item.fixed_Asset_not_found=Cespite non trovato. Cespite: ${fixedAssetId}
|
||||
item.availableOk=OK
|
||||
item.availableQnt=Quantit\u00e0 richiesta: ${quantityReq} Quantit\u00e0 disponibile: ${quantityAvail}
|
||||
item.notAvailable=Sono spiacente, nessuna disponibilit\u00e0 a queste date: ${resultMessage} prodotto non aggiunto al carrello.....
|
||||
shoppinglistevents.added_product_to_cart = Aggiunto ${productId} prodotto al carrello.
|
||||
shoppinglistevents.cannot_create_new_shopping_list = Non \u00e8 possibile creare una nuova lista di acquisto.
|
||||
shoppinglistevents.choose_shopping_list = Perfavore scegliere una lista di acquisto.
|
||||
|
||||
@@ -179,9 +179,12 @@ public class ShoppingCartItem implements java.io.Serializable {
|
||||
|
||||
// check to see if product is virtual
|
||||
if ("Y".equals(product.getString("isVirtual"))) {
|
||||
String excMsg = "Tried to add the Virtual Product " + product.getString("productName") +
|
||||
" (productId: " + product.getString("productId") + ") to the cart, not adding.";
|
||||
Map messageMap = UtilMisc.toMap("productName", product.getString("productName"),
|
||||
"productId", product.getString("productId"));
|
||||
|
||||
String excMsg = UtilProperties.getMessage(resource, "item.cannot_add_product_virtual",
|
||||
messageMap , cart.getLocale() );
|
||||
|
||||
Debug.logWarning(excMsg, module);
|
||||
throw new CartItemModifyException(excMsg);
|
||||
}
|
||||
@@ -191,9 +194,12 @@ public class ShoppingCartItem implements java.io.Serializable {
|
||||
// check to see if the product is fully configured
|
||||
if ("AGGREGATED".equals(product.getString("productTypeId"))) {
|
||||
if (configWrapper == null || !configWrapper.isCompleted()) {
|
||||
String excMsg = "Tried to add the Product " + product.getString("productName") +
|
||||
" (productId: " + product.getString("productId") + ") to the cart, not adding: the product is not configured correctly.";
|
||||
Map messageMap = UtilMisc.toMap("productName", product.getString("productName"),
|
||||
"productId", product.getString("productId"));
|
||||
|
||||
String excMsg = UtilProperties.getMessage(resource, "item.cannot_add_product_not_configured_correctly",
|
||||
messageMap , cart.getLocale() );
|
||||
|
||||
Debug.logWarning(excMsg, module);
|
||||
throw new CartItemModifyException(excMsg);
|
||||
}
|
||||
@@ -347,9 +353,12 @@ public class ShoppingCartItem implements java.io.Serializable {
|
||||
boolean triggerExternalOps = triggerExternalOpsBool == null ? true : triggerExternalOpsBool.booleanValue();
|
||||
|
||||
// check to see if product is virtual
|
||||
if ("Y".equals(product.getString("isVirtual"))) {
|
||||
String excMsg = "Tried to add the Virtual Product " + product.getString("productName") +
|
||||
" (productId: " + product.getString("productId") + ") to the cart, not adding.";
|
||||
if ("Y".equals(product.getString("isVirtual"))) {
|
||||
Map messageMap = UtilMisc.toMap("productName", product.getString("productName"),
|
||||
"productId", product.getString("productId"));
|
||||
|
||||
String excMsg = UtilProperties.getMessage(resource, "item.cannot_add_product_virtual",
|
||||
messageMap , cart.getLocale() );
|
||||
|
||||
Debug.logWarning(excMsg, module);
|
||||
throw new CartItemModifyException(excMsg);
|
||||
@@ -359,45 +368,58 @@ public class ShoppingCartItem implements java.io.Serializable {
|
||||
|
||||
// check to see if introductionDate hasn't passed yet
|
||||
if (product.get("introductionDate") != null && nowTimestamp.before(product.getTimestamp("introductionDate"))) {
|
||||
String excMsg = "Tried to add the Product " + product.getString("productName") +
|
||||
" (productId: " + product.getString("productId") + ") to the cart. This product has not yet been made available for sale, so not adding.";
|
||||
Map messageMap = UtilMisc.toMap("productName", product.getString("productName"),
|
||||
"productId", product.getString("productId"));
|
||||
|
||||
String excMsg = UtilProperties.getMessage(resource, "item.cannot_add_product_not_yet_available",
|
||||
messageMap , cart.getLocale() );
|
||||
|
||||
Debug.logWarning(excMsg, module);
|
||||
throw new CartItemModifyException(excMsg);
|
||||
}
|
||||
|
||||
// check to see if salesDiscontinuationDate has passed
|
||||
if (product.get("salesDiscontinuationDate") != null && nowTimestamp.after(product.getTimestamp("salesDiscontinuationDate"))) {
|
||||
String excMsg = "Tried to add the Product " + product.getString("productName") +
|
||||
" (productId: " + product.getString("productId") + ") to the cart. This product is no longer available for sale, so not adding.";
|
||||
Map messageMap = UtilMisc.toMap("productName", product.getString("productName"),
|
||||
"productId", product.getString("productId"));
|
||||
|
||||
String excMsg = UtilProperties.getMessage(resource, "item.cannot_add_product_no_longer_available",
|
||||
messageMap , cart.getLocale() );
|
||||
|
||||
Debug.logWarning(excMsg, module);
|
||||
throw new CartItemModifyException(excMsg);
|
||||
}
|
||||
|
||||
|
||||
// check to see if the product is a rental item
|
||||
if ("ASSET_USAGE".equals(product.getString("productTypeId"))) {
|
||||
if (reservStart == null) {
|
||||
String excMsg = "The starting date of the reservation is missing....";
|
||||
String excMsg = UtilProperties.getMessage(resource, "item.missing_reservation_starting_date",
|
||||
cart.getLocale() );
|
||||
throw new CartItemModifyException(excMsg);
|
||||
}
|
||||
|
||||
if (reservStart.before(UtilDateTime.nowTimestamp())) {
|
||||
String excMsg = "You can only make reservation starting tomorrow....";
|
||||
String excMsg = UtilProperties.getMessage(resource, "item.reservation_from_tomorrow",
|
||||
cart.getLocale() );
|
||||
throw new CartItemModifyException(excMsg);
|
||||
}
|
||||
newItem.setReservStart(reservStart);
|
||||
|
||||
if (reservLength < 1) {
|
||||
String excMsg = "Please enter a number of days, 1, or more....";
|
||||
String excMsg = UtilProperties.getMessage(resource, "item.number_of_days",
|
||||
cart.getLocale() );
|
||||
throw new CartItemModifyException(excMsg);
|
||||
}
|
||||
newItem.setReservLength(reservLength);
|
||||
|
||||
|
||||
if (product.get("reservMaxPersons") != null) {
|
||||
double reservMaxPersons = product.getDouble("reservMaxPersons").doubleValue();
|
||||
if (reservMaxPersons < reservPersons) {
|
||||
String excMsg = "The maximum number of persons renting this object is " + product.getString("reservMaxPersons") + " however you have requested: " + reservPersons + " !";
|
||||
Map messageMap = UtilMisc.toMap("reservMaxPersons", product.getString("reservMaxPersons"),
|
||||
"reservPersons", (new Double(reservPersons)).toString());
|
||||
String excMsg = UtilProperties.getMessage(resource, "item.maximum_number_of_person_renting",
|
||||
messageMap, cart.getLocale() );
|
||||
|
||||
Debug.logInfo(excMsg,module);
|
||||
throw new CartItemModifyException(excMsg);
|
||||
}
|
||||
@@ -413,7 +435,10 @@ public class ShoppingCartItem implements java.io.Serializable {
|
||||
// check to see if the related fixed asset is available for rent
|
||||
String isAvailable = checkAvailability(product.getString("productId"), quantity, reservStart, reservLength, cart);
|
||||
if(isAvailable.compareTo("OK") != 0) {
|
||||
String excMsg = "Product not available, ProductId:" + product.getString("productId") + " message:" + isAvailable.toString();
|
||||
Map messageMap = UtilMisc.toMap("productId", product.getString("productId"),
|
||||
"availableMessage", isAvailable.toString());
|
||||
String excMsg = UtilProperties.getMessage(resource, "item.product_not_available",
|
||||
messageMap, cart.getLocale() );
|
||||
Debug.logInfo(excMsg, module);
|
||||
throw new CartItemModifyException(isAvailable);
|
||||
}
|
||||
@@ -421,10 +446,11 @@ public class ShoppingCartItem implements java.io.Serializable {
|
||||
|
||||
// check to see if the product is fully configured
|
||||
if ("AGGREGATED".equals(product.getString("productTypeId"))) {
|
||||
if (configWrapper == null || !configWrapper.isCompleted()) {
|
||||
String excMsg = "Tried to add the Product " + product.getString("productName") +
|
||||
" (productId: " + product.getString("productId") + ") to the cart, not adding: the product is not configured correctly.";
|
||||
|
||||
if (configWrapper == null || !configWrapper.isCompleted()) {
|
||||
Map messageMap = UtilMisc.toMap("productName", product.getString("productName"),
|
||||
"productId", product.getString("productId"));
|
||||
String excMsg = UtilProperties.getMessage(resource, "item.cannot_add_product_not_configured_correctly",
|
||||
messageMap , cart.getLocale() );
|
||||
Debug.logWarning(excMsg, module);
|
||||
throw new CartItemModifyException(excMsg);
|
||||
}
|
||||
@@ -712,13 +738,17 @@ public class ShoppingCartItem implements java.io.Serializable {
|
||||
List allFixedAssetProduct = delegator.findByAnd("FixedAssetProduct", UtilMisc.toMap("productId", productId, "fixedAssetProductTypeId", "FAPT_USE"));
|
||||
selFixedAssetProduct = EntityUtil.filterByDate(allFixedAssetProduct, UtilDateTime.nowTimestamp(), "fromDate", "thruDate", true);
|
||||
} catch (GenericEntityException e) {
|
||||
return "Could not find a related Fixed Asset for the product: " + productId;
|
||||
Map messageMap = UtilMisc.toMap("productId", productId);
|
||||
String msg = UtilProperties.getMessage(resource, "item.cannot_find_Fixed_Asset", messageMap , cart.getLocale());
|
||||
return msg;
|
||||
}
|
||||
if (selFixedAssetProduct != null && selFixedAssetProduct.size() > 0) {
|
||||
Iterator firstOne = selFixedAssetProduct.iterator();
|
||||
fixedAssetProduct = (GenericValue) firstOne.next();
|
||||
} else {
|
||||
return "Could not find a related Fixed Asset for the product: " + productId;
|
||||
Map messageMap = UtilMisc.toMap("productId", productId);
|
||||
String msg = UtilProperties.getMessage(resource, "item.cannot_find_Fixed_Asset", messageMap , cart.getLocale());
|
||||
return msg;
|
||||
}
|
||||
|
||||
// find the fixed asset itself
|
||||
@@ -726,10 +756,14 @@ public class ShoppingCartItem implements java.io.Serializable {
|
||||
try {
|
||||
fixedAsset = fixedAssetProduct.getRelatedOne("FixedAsset");
|
||||
} catch (GenericEntityException e) {
|
||||
return "fixed_Asset_not_found. Fixed AssetId: " + fixedAssetProduct.getString("fixedAssetId");
|
||||
Map messageMap = UtilMisc.toMap("fixedAssetId", fixedAssetProduct.getString("fixedAssetId"));
|
||||
String msg = UtilProperties.getMessage(resource, "item.fixed_Asset_not_found", messageMap , cart.getLocale());
|
||||
return msg;
|
||||
}
|
||||
if (fixedAsset == null) {
|
||||
return "fixed_Asset_not_found. Fixed AssetId: " + fixedAssetProduct.getString("fixedAssetId");
|
||||
Map messageMap = UtilMisc.toMap("fixedAssetId", fixedAssetProduct.getString("fixedAssetId"));
|
||||
String msg = UtilProperties.getMessage(resource, "item.fixed_Asset_not_found", messageMap , cart.getLocale());
|
||||
return msg;
|
||||
}
|
||||
//Debug.logInfo("Checking availability for product: " + productId.toString() + " and related FixedAsset: " + fixedAssetProduct.getString("fixedAssetId"),module);
|
||||
|
||||
@@ -740,9 +774,13 @@ public class ShoppingCartItem implements java.io.Serializable {
|
||||
} catch (GenericEntityException e) {
|
||||
// no calendar ok, when not more that total capacity
|
||||
if (fixedAsset.getDouble("productionCapacity").doubleValue() >= quantity) {
|
||||
return "OK";
|
||||
String msg = UtilProperties.getMessage(resource, "item.availableOk", cart.getLocale());
|
||||
return msg;
|
||||
} else {
|
||||
return "Quantity requested: " + quantity + " Quantity available: " + fixedAsset.getString("productionCapacity");
|
||||
Map messageMap = UtilMisc.toMap("quantityReq", (new Double(quantity)).toString(),
|
||||
"quantityAvail", fixedAsset.getString("productionCapacity"));
|
||||
String msg = UtilProperties.getMessage(resource, "item.availableQnt", messageMap , cart.getLocale());
|
||||
return msg;
|
||||
}
|
||||
}
|
||||
// now find all the dates and check the availabilty for each date
|
||||
@@ -785,10 +823,15 @@ public class ShoppingCartItem implements java.io.Serializable {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (resultMessage.compareTo("") == 0)
|
||||
return "OK";
|
||||
else
|
||||
return "I am sorry, not available at these dates: " + resultMessage + "item not added to the shopping cart.....";
|
||||
if (resultMessage.compareTo("") == 0) {
|
||||
String msg = UtilProperties.getMessage(resource, "item.availableOk", cart.getLocale());
|
||||
return msg;
|
||||
}
|
||||
else {
|
||||
Map messageMap = UtilMisc.toMap("resultMessage", resultMessage);
|
||||
String msg = UtilProperties.getMessage(resource, "item.notAvailable", messageMap, cart.getLocale());
|
||||
return msg;
|
||||
}
|
||||
}
|
||||
|
||||
protected void setQuantity(int quantity, LocalDispatcher dispatcher, ShoppingCart cart, boolean triggerExternalOps, boolean resetShipGroup, boolean updateProductPrice) throws CartItemModifyException {
|
||||
|
||||
Reference in New Issue
Block a user