You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by sa...@apache.org on 2011/09/20 19:46:24 UTC
svn commit: r1173274 [5/13] - in /ofbiz/branches/jackrabbit20100709: ./
applications/accounting/config/ applications/accounting/entitydef/
applications/accounting/script/org/ofbiz/accounting/invoice/
applications/accounting/script/org/ofbiz/accounting/...
Modified: ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/order/OrderServices.java Tue Sep 20 17:46:13 2011
@@ -558,6 +558,11 @@ public class OrderServices {
orderHeader.set("createdBy", userLogin.getString("userLoginId"));
}
+ String invoicePerShipment = UtilProperties.getPropertyValue("AccountingConfig","create.invoice.per.shipment");
+ if (UtilValidate.isNotEmpty(invoicePerShipment)) {
+ orderHeader.set("invoicePerShipment", invoicePerShipment);
+ }
+
// first try to create the OrderHeader; if this does not fail, continue.
try {
delegator.create(orderHeader);
@@ -1125,8 +1130,64 @@ public class OrderServices {
// store line items, etc so that they will be there for the foreign key checks
delegator.storeAll(toBeStored);
- // START inventory reservation
List<String> resErrorMessages = new LinkedList<String>();
+
+ // add a product service to inventory
+ if (UtilValidate.isNotEmpty(orderItems)) {
+ for (GenericValue orderItem: orderItems) {
+ String productId = (String) orderItem.get("productId");
+ GenericValue product = delegator.getRelatedOne("Product", orderItem);
+
+ if("SERVICE_PRODUCT".equals(product.get("productTypeId"))){
+ String inventoryFacilityId = null;
+ if ("Y".equals(productStore.getString("oneInventoryFacility"))) {
+ inventoryFacilityId = productStore.getString("inventoryFacilityId");
+
+ if (UtilValidate.isEmpty(inventoryFacilityId)) {
+ Debug.logWarning("ProductStore with id " + productStoreId + " has Y for oneInventoryFacility but inventoryFacilityId is empty, returning false for inventory check", module);
+ }
+ } else {
+ List<GenericValue> productFacilities = null;
+ GenericValue productFacility = null;
+
+ try {
+ productFacilities = delegator.getRelatedCache("ProductFacility", product);
+ } catch (GenericEntityException e) {
+ Debug.logWarning(e, "Error invoking getRelatedCache in isCatalogInventoryAvailable", module);
+ }
+
+ if (UtilValidate.isNotEmpty(productFacilities)) {
+ productFacility = EntityUtil.getFirst(productFacilities);
+ inventoryFacilityId = (String) productFacility.get("facilityId");
+ }
+ }
+
+ Map<String, Object> ripCtx = FastMap.newInstance();
+ if (UtilValidate.isNotEmpty(inventoryFacilityId) && UtilValidate.isNotEmpty(productId) && orderItem.getBigDecimal("quantity").compareTo(BigDecimal.ZERO) > 0) {
+ // do something tricky here: run as the "system" user
+ GenericValue permUserLogin = delegator.findByPrimaryKeyCache("UserLogin", UtilMisc.toMap("userLoginId", "system"));
+ ripCtx.put("productId", productId);
+ ripCtx.put("facilityId", inventoryFacilityId);
+ ripCtx.put("inventoryItemTypeId", "SERIALIZED_INV_ITEM");
+ ripCtx.put("statusId","INV_AVAILABLE");
+ ripCtx.put("quantityAccepted", orderItem.getBigDecimal("quantity"));
+ ripCtx.put("quantityRejected", 0.0);
+ ripCtx.put("userLogin", permUserLogin);
+ try {
+ Map<String, Object> ripResult = dispatcher.runSync("receiveInventoryProduct", ripCtx);
+ if (ServiceUtil.isError(ripResult)) {
+ String errMsg = ServiceUtil.getErrorMessage(ripResult);
+ resErrorMessages.addAll((Collection<? extends String>) UtilMisc.<String, String>toMap("reasonCode", "ReceiveInventoryServiceError", "description", errMsg));
+ }
+ } catch (GenericServiceException e) {
+ Debug.logWarning(e, "Error invoking receiveInventoryProduct service in createOrder", module);
+ }
+ }
+ }
+ }
+ }
+
+ // START inventory reservation
try {
reserveInventory(delegator, dispatcher, userLogin, locale, orderItemShipGroupInfo, dropShipGroupIds, itemValuesBySeqId,
orderTypeId, productStoreId, resErrorMessages);
@@ -1286,6 +1347,105 @@ public class OrderServices {
resErrorMessages.add(errMsg);
}
}
+
+ // rent item
+ if (UtilValidate.isNotEmpty(orderItem.getString("productId")) && "RENTAL_ORDER_ITEM".equals(orderItem.getString("orderItemTypeId"))) {
+ try {
+ // get the product of the order item
+ GenericValue product = orderItem.getRelatedOne("Product");
+ if (product == null) {
+ Debug.logError("Error when looking up product in reserveInventory service", module);
+ resErrorMessages.add("Error when looking up product in reserveInventory service");
+ continue;
+ }
+
+ // check product type for rent
+ String productType = (String) product.get("productTypeId");
+ if ("ASSET_USAGE_OUT_IN".equals(productType)) {
+ if (reserveInventory) {
+ // for MARKETING_PKG_PICK reserve the components
+ if (EntityTypeUtil.hasParentType(delegator, "ProductType", "productTypeId", product.getString("productTypeId"), "parentTypeId", "MARKETING_PKG_PICK")) {
+ Map<String, Object> componentsRes = dispatcher.runSync("getAssociatedProducts", UtilMisc.toMap("productId", orderItem.getString("productId"), "type", "PRODUCT_COMPONENT"));
+ if (ServiceUtil.isError(componentsRes)) {
+ resErrorMessages.add((String)componentsRes.get(ModelService.ERROR_MESSAGE));
+ continue;
+ } else {
+ List<GenericValue> assocProducts = UtilGenerics.checkList(componentsRes.get("assocProducts"));
+ Iterator<GenericValue> assocProductsIter = assocProducts.iterator();
+ while (assocProductsIter.hasNext()) {
+ GenericValue productAssoc = assocProductsIter.next();
+ BigDecimal quantityOrd = productAssoc.getBigDecimal("quantity");
+ BigDecimal quantityKit = orderItemShipGroupAssoc.getBigDecimal("quantity");
+ BigDecimal quantity = quantityOrd.multiply(quantityKit);
+ Map<String, Object> reserveInput = new HashMap<String, Object>();
+ reserveInput.put("productStoreId", productStoreId);
+ reserveInput.put("productId", productAssoc.getString("productIdTo"));
+ reserveInput.put("orderId", orderItem.getString("orderId"));
+ reserveInput.put("orderItemSeqId", orderItem.getString("orderItemSeqId"));
+ reserveInput.put("shipGroupSeqId", orderItemShipGroupAssoc.getString("shipGroupSeqId"));
+ reserveInput.put("quantity", quantity);
+ reserveInput.put("userLogin", userLogin);
+ reserveInput.put("facilityId", shipGroupFacilityId);
+ Map<String, Object> reserveResult = dispatcher.runSync("reserveStoreInventory", reserveInput);
+
+ if (ServiceUtil.isError(reserveResult)) {
+ String invErrMsg = "The product ";
+ if (product != null) {
+ invErrMsg += getProductName(product, orderItem);
+ }
+ invErrMsg += " with ID " + orderItem.getString("productId") + " is no longer in stock. Please try reducing the quantity or removing the product from this order.";
+ resErrorMessages.add(invErrMsg);
+ }
+ }
+ }
+ } else {
+ // reserve the product
+ Map<String, Object> reserveInput = new HashMap<String, Object>();
+ reserveInput.put("productStoreId", productStoreId);
+ reserveInput.put("productId", orderItem.getString("productId"));
+ reserveInput.put("orderId", orderItem.getString("orderId"));
+ reserveInput.put("orderItemSeqId", orderItem.getString("orderItemSeqId"));
+ reserveInput.put("shipGroupSeqId", orderItemShipGroupAssoc.getString("shipGroupSeqId"));
+ reserveInput.put("facilityId", shipGroupFacilityId);
+ // use the quantity from the orderItemShipGroupAssoc, NOT the orderItem, these are reserved by item-group assoc
+ reserveInput.put("quantity", orderItemShipGroupAssoc.getBigDecimal("quantity"));
+ reserveInput.put("userLogin", userLogin);
+ Map<String, Object> reserveResult = dispatcher.runSync("reserveStoreInventory", reserveInput);
+
+ if (ServiceUtil.isError(reserveResult)) {
+ String invErrMsg = "The product ";
+ if (product != null) {
+ invErrMsg += getProductName(product, orderItem);
+ }
+ invErrMsg += " with ID " + orderItem.getString("productId") + " is no longer in stock. Please try reducing the quantity or removing the product from this order.";
+ resErrorMessages.add(invErrMsg);
+ }
+ }
+ }
+
+ if (EntityTypeUtil.hasParentType(delegator, "ProductType", "productTypeId", product.getString("productTypeId"), "parentTypeId", "MARKETING_PKG_AUTO")) {
+ GenericValue permUserLogin = delegator.findByPrimaryKeyCache("UserLogin", UtilMisc.toMap("userLoginId", "system"));
+ Map<String, Object> inputMap = new HashMap<String, Object>();
+ if (UtilValidate.isNotEmpty(shipGroupFacilityId)) {
+ inputMap.put("facilityId", shipGroupFacilityId);
+ } else {
+ inputMap.put("facilityId", productStore.getString("inventoryFacilityId"));
+ }
+ inputMap.put("orderId", orderItem.getString("orderId"));
+ inputMap.put("orderItemSeqId", orderItem.getString("orderItemSeqId"));
+ inputMap.put("userLogin", permUserLogin);
+ Map<String, Object> prunResult = dispatcher.runSync("createProductionRunForMktgPkg", inputMap);
+ if (ServiceUtil.isError(prunResult)) {
+ Debug.logError(ServiceUtil.getErrorMessage(prunResult) + " for input:" + inputMap, module);
+ }
+ }
+ }
+ } catch (GenericServiceException e) {
+ String errMsg = "Fatal error calling reserveStoreInventory service: " + e.toString();
+ Debug.logError(e, errMsg, module);
+ resErrorMessages.add(errMsg);
+ }
+ }
}
}
}
Modified: ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/shoppingcart/CheckOutEvents.java Tue Sep 20 17:46:13 2011
@@ -65,14 +65,12 @@ public class CheckOutEvents {
public static final String resource_error = "OrderErrorUiLabels";
public static String cartNotEmpty(HttpServletRequest request, HttpServletResponse response) {
- ShoppingCart cart = (ShoppingCart) request.getSession().getAttribute("shoppingCart");
- //Locale locale = UtilHttp.getLocale(request);
- String errMsg = null;
+ ShoppingCart cart = ShoppingCartEvents.getCartObject(request);
- if (UtilValidate.isNotEmpty(cart)) {
+ if (cart != null && UtilValidate.isNotEmpty(cart.items())) {
return "success";
} else {
- errMsg = UtilProperties.getMessage(resource_error, "checkevents.cart_empty", (cart != null ? cart.getLocale() : Locale.getDefault()));
+ String errMsg = UtilProperties.getMessage(resource_error, "checkevents.cart_empty", (cart != null ? cart.getLocale() : UtilHttp.getLocale(request)));
request.setAttribute("_ERROR_MESSAGE_", errMsg);
return "error";
}
Modified: ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java Tue Sep 20 17:46:13 2011
@@ -2791,7 +2791,7 @@ public class ShoppingCart implements Ite
GenericValue orderTerm = this.getDelegator().makeValue("OrderTerm");
orderTerm.put("termTypeId", termTypeId);
if (UtilValidate.isEmpty(orderItemSeqId)) {
- orderItemSeqId = "_NA_";
+ orderItemSeqId = "_NA_";
}
orderTerm.put("orderItemSeqId", orderItemSeqId);
orderTerm.put("termValue", termValue);
Modified: ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartEvents.java Tue Sep 20 17:46:13 2011
@@ -148,6 +148,7 @@ public class ShoppingCartEvents {
String shipAfterDateStr = null;
Timestamp shipBeforeDate = null;
Timestamp shipAfterDate = null;
+ String numberOfDay = null;
// not used right now: Map attributes = null;
String catalogId = CatalogWorker.getCurrentCatalogId(request);
@@ -299,9 +300,17 @@ public class ShoppingCartEvents {
if (priceStr == null) {
priceStr = "0"; // default price is 0
}
-
+
+ if ("ASSET_USAGE_OUT_IN".equals(ProductWorker.getProductTypeId(delegator, productId))) {
+ if (paramMap.containsKey("numberOfDay")) {
+ numberOfDay = (String) paramMap.remove("numberOfDay");
+ reservStart = UtilDateTime.addDaysToTimestamp(UtilDateTime.nowTimestamp(), 1);
+ reservEnd = UtilDateTime.addDaysToTimestamp(reservStart, Integer.valueOf(numberOfDay));
+ }
+ }
+
// get the renting data
- if ("ASSET_USAGE".equals(ProductWorker.getProductTypeId(delegator, productId))) {
+ if ("ASSET_USAGE".equals(ProductWorker.getProductTypeId(delegator, productId)) || "ASSET_USAGE_OUT_IN".equals(ProductWorker.getProductTypeId(delegator, productId))) {
if (paramMap.containsKey("reservStart")) {
reservStartStr = (String) paramMap.remove("reservStart");
if (reservStartStr.length() == 10) // only date provided, no time string?
Modified: ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java Tue Sep 20 17:46:13 2011
@@ -419,7 +419,7 @@ public class ShoppingCartItem implements
ShoppingCart cart, Boolean triggerExternalOpsBool, Boolean triggerPriceRulesBool, GenericValue parentProduct, Boolean skipInventoryChecks, Boolean skipProductChecks) throws CartItemModifyException {
ShoppingCartItem newItem = new ShoppingCartItem(product, additionalProductFeatureAndAppls, attributes, prodCatalogId, configWrapper, cart.getLocale(), itemType, itemGroup, parentProduct);
-
+
selectedAmount = selectedAmount == null ? BigDecimal.ZERO : selectedAmount;
unitPrice = unitPrice == null ? BigDecimal.ZERO : unitPrice;
reservLength = reservLength == null ? BigDecimal.ZERO : reservLength;
@@ -497,7 +497,7 @@ public class ShoppingCartItem implements
}
// check to see if the product is a rental item
- if ("ASSET_USAGE".equals(product.getString("productTypeId"))) {
+ if ("ASSET_USAGE".equals(product.getString("productTypeId")) || "ASSET_USAGE_OUT_IN".equals(product.getString("productTypeId"))) {
if (reservStart == null) {
String excMsg = UtilProperties.getMessage(resource_error, "item.missing_reservation_starting_date",
cart.getLocale());
@@ -639,57 +639,80 @@ public class ShoppingCartItem implements
/** Clone an item. */
public ShoppingCartItem(ShoppingCartItem item) {
+ this.delegator = item.getDelegator();
try {
this._product = item.getProduct();
} catch (IllegalStateException e) {
this._product = null;
}
- this.delegator = item.getDelegator();
+ try {
+ this._parentProduct = item.getParentProduct();
+ } catch (IllegalStateException e) {
+ this._parentProduct = null;
+ }
this.delegatorName = item.delegatorName;
this.prodCatalogId = item.getProdCatalogId();
this.productId = item.getProductId();
+ this.supplierProductId = item.getSupplierProductId();
+ this.parentProductId = item.getParentProductId();
+ this.externalId = item.getExternalId();
this.itemType = item.getItemType();
this.itemGroup = item.getItemGroup();
this.productCategoryId = item.getProductCategoryId();
- this.quantity = item.getQuantity();
+ this.itemDescription = item.itemDescription;
this.reservStart = item.getReservStart();
this.reservLength = item.getReservLength();
this.reservPersons = item.getReservPersons();
this.accommodationMapId = item.getAccommodationMapId();
this.accommodationSpotId = item.getAccommodationSpotId();
- this.selectedAmount = item.getSelectedAmount();
+ this.quantity = item.getQuantity();
this.setBasePrice(item.getBasePrice());
this.setDisplayPrice(item.getDisplayPrice());
this.setRecurringBasePrice(item.getRecurringBasePrice());
this.setRecurringDisplayPrice(item.getRecurringDisplayPrice());
- this.listPrice = item.getListPrice();
+ this.setSpecialPromoPrice(item.getSpecialPromoPrice());
this.reserv2ndPPPerc = item.getReserv2ndPPPerc();
this.reservNthPPPerc = item.getReservNthPPPerc();
+ this.listPrice = item.getListPrice();
+ this.setIsModifiedPrice(item.getIsModifiedPrice());
+ this.selectedAmount = item.getSelectedAmount();
this.requirementId = item.getRequirementId();
this.quoteId = item.getQuoteId();
this.quoteItemSeqId = item.getQuoteItemSeqId();
this.associatedOrderId = item.getAssociatedOrderId();
this.associatedOrderItemSeqId = item.getAssociatedOrderItemSeqId();
this.orderItemAssocTypeId = item.getOrderItemAssocTypeId();
+ this.setStatusId(item.getStatusId());
+ if (UtilValidate.isEmpty(item.getOrderItemAttributes())) {
+ this.orderItemAttributes = FastMap.<String, String>newInstance();
+ this.orderItemAttributes.putAll(item.getOrderItemAttributes());
+ }
+ this.attributes = item.getAttributes() == null ? new HashMap<String, Object>() : new HashMap<String, Object>(item.getAttributes());
+ this.setOrderItemSeqId(item.getOrderItemSeqId());
+ this.locale = item.locale;
+ this.setShipBeforeDate(item.getShipBeforeDate());
+ this.setShipAfterDate(item.getShipAfterDate());
+ this.setEstimatedShipDate(item.getEstimatedShipDate());
+ this.setCancelBackOrderDate(item.getCancelBackOrderDate());
+ this.contactMechIdsMap = item.getOrderItemContactMechIds() == null ? null : new HashMap<String, String>(item.getOrderItemContactMechIds());
+ this.orderItemPriceInfos = item.getOrderItemPriceInfos() == null ? null : new LinkedList<GenericValue>(item.getOrderItemPriceInfos());
+ this.itemAdjustments.addAll(item.getAdjustments());
this.isPromo = item.getIsPromo();
this.promoQuantityUsed = item.promoQuantityUsed;
- this.locale = item.locale;
this.quantityUsedPerPromoCandidate = new HashMap<GenericPK, BigDecimal>(item.quantityUsedPerPromoCandidate);
this.quantityUsedPerPromoFailed = new HashMap<GenericPK, BigDecimal>(item.quantityUsedPerPromoFailed);
this.quantityUsedPerPromoActual = new HashMap<GenericPK, BigDecimal>(item.quantityUsedPerPromoActual);
- this.orderItemSeqId = item.getOrderItemSeqId();
this.additionalProductFeatureAndAppls = item.getAdditionalProductFeatureAndAppls() == null ?
null : new HashMap<String, GenericValue>(item.getAdditionalProductFeatureAndAppls());
- this.attributes = item.getAttributes() == null ? new HashMap<String, Object>() : new HashMap<String, Object>(item.getAttributes());
- this.contactMechIdsMap = item.getOrderItemContactMechIds() == null ? null : new HashMap<String, String>(item.getOrderItemContactMechIds());
- this.orderItemPriceInfos = item.getOrderItemPriceInfos() == null ? null : new LinkedList<GenericValue>(item.getOrderItemPriceInfos());
- this.itemAdjustments.addAll(item.getAdjustments());
- if (this._product == null) {
- this.itemDescription = item.getName();
+ if (item.getAlternativeOptionProductIds() != null) {
+ List<String> tempAlternativeOptionProductIds = FastList.newInstance();
+ tempAlternativeOptionProductIds.addAll(item.getAlternativeOptionProductIds());
+ this.setAlternativeOptionProductIds(tempAlternativeOptionProductIds);
}
if (item.configWrapper != null) {
this.configWrapper = new ProductConfigWrapper(item.configWrapper);
}
+ this.featuresForSupplier.addAll(item.featuresForSupplier);
}
/** Cannot create shopping cart item with no parameters */
@@ -727,6 +750,8 @@ public class ShoppingCartItem implements
if (UtilValidate.isNotEmpty(_product.getString("productTypeId"))) {
if ("ASSET_USAGE".equals(_product.getString("productTypeId"))) {
this.itemType = "RENTAL_ORDER_ITEM"; // will create additional workeffort/asset usage records
+ } else if ("ASSET_USAGE_OUT_IN".equals(_product.getString("productTypeId"))) {
+ this.itemType = "RENTAL_ORDER_ITEM";
} else {
this.itemType = "PRODUCT_ORDER_ITEM";
}
Modified: ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java Tue Sep 20 17:46:13 2011
@@ -201,7 +201,7 @@ public class ShoppingCartServices {
cart.setOrderName(orderHeader.getString("orderName"));
cart.setOrderStatusId(orderHeader.getString("statusId"));
cart.setOrderStatusString(currentStatusString);
- cart.setFacilityId(orderHeader.getString("originFacilityId"));
+ cart.setFacilityId(orderHeader.getString("originFacilityId"));
try {
cart.setUserLogin(userLogin, dispatcher);
@@ -509,7 +509,7 @@ public class ShoppingCartServices {
try {
orderItemAttributesList = delegator.findByAnd("OrderItemAttribute", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItemSeqId));
if (UtilValidate.isNotEmpty(orderAttributesList)) {
- for(GenericValue orderItemAttr : orderItemAttributesList) {
+ for (GenericValue orderItemAttr : orderItemAttributesList) {
String name = orderItemAttr.getString("attrName");
String value = orderItemAttr.getString("attrValue");
cartItem.setOrderItemAttribute(name, value);
@@ -543,12 +543,7 @@ public class ShoppingCartServices {
List<GenericValue> itemAdjustments = orh.getOrderItemAdjustments(item);
if (itemAdjustments != null) {
for(GenericValue itemAdjustment : itemAdjustments) {
- if ("SALES_TAX".equals(itemAdjustment.get("orderAdjustmentTypeId")) ||
- "VAT_TAX".equals(itemAdjustment.get("orderAdjustmentTypeId")) ||
- "VAT_PRICE_CORRECT".equals(itemAdjustment.get("orderAdjustmentTypeId"))) {
- continue;
- }
- cartItem.addAdjustment(itemAdjustment);
+ if (!isTaxAdjustment(itemAdjustment)) cartItem.addAdjustment(itemAdjustment);
}
}
}
@@ -607,12 +602,7 @@ public class ShoppingCartServices {
} else {
List<GenericValue> itemTaxAdj = cartShipItemInfo.itemTaxAdj;
for (GenericValue shipGroupItemAdjustment : shipGroupItemAdjustments) {
- if ("SALES_TAX".equals(shipGroupItemAdjustment.get("orderAdjustmentTypeId")) ||
- "VAT_TAX".equals(shipGroupItemAdjustment.get("orderAdjustmentTypeId")) ||
- "VAT_PRICE_CORRECT".equals(shipGroupItemAdjustment.get("orderAdjustmentTypeId"))) {
- itemTaxAdj.add(shipGroupItemAdjustment);
- continue;
- }
+ if (isTaxAdjustment(shipGroupItemAdjustment)) itemTaxAdj.add(shipGroupItemAdjustment);
}
}
}
@@ -736,7 +726,7 @@ public class ShoppingCartServices {
if (UtilValidate.isNotEmpty(quoteTerms)) {
// create order term from quote term
for(GenericValue quoteTerm : quoteTerms) {
- BigDecimal termValue = BigDecimal.ZERO;
+ BigDecimal termValue = BigDecimal.ZERO;
if (UtilValidate.isNotEmpty(quoteTerm.getString("termValue"))){
termValue = new BigDecimal(quoteTerm.getString("termValue"));
}
@@ -748,7 +738,7 @@ public class ShoppingCartServices {
cart.addOrderTerm(quoteTerm.getString("termTypeId"), orderItemSeqId,termValue, termDays, quoteTerm.getString("textValue"),quoteTerm.getString("description"));
}
}
-
+
// set the attribute information
if (UtilValidate.isNotEmpty(quoteAttributes)) {
for(GenericValue quoteAttribute : quoteAttributes) {
@@ -892,10 +882,24 @@ public class ShoppingCartServices {
// If applyQuoteAdjustments is set to false then standard cart adjustments are used.
if (applyQuoteAdjustments) {
// The cart adjustments, derived from quote adjustments, are added to the cart
+
+ // Tax adjustments should be added to the shipping group and shipping group item info
+ // Other adjustments like promotional price should be added to the cart independent of
+ // the ship group.
+ // We're creating the cart right now using data from the quote, so there cannot yet be more than one ship group.
+
+ List<GenericValue> cartAdjs = cart.getAdjustments();
+ CartShipInfo shipInfo = cart.getShipInfo(0);
+
List<GenericValue> adjs = orderAdjsMap.get(quoteId);
+
if (adjs != null) {
- cart.getAdjustments().addAll(adjs);
+ for (GenericValue adj : adjs) {
+ if (isTaxAdjustment( adj )) shipInfo.shipTaxAdj.add(adj);
+ else cartAdjs.add(adj);
+ }
}
+
// The cart item adjustments, derived from quote item adjustments, are added to the cart
if (quoteItems != null) {
Iterator<ShoppingCartItem> i = cart.iterator();
@@ -908,11 +912,20 @@ public class ShoppingCartServices {
adjs = null;
}
if (adjs != null) {
- item.getAdjustments().addAll(adjs);
+ for (GenericValue adj : adjs) {
+ if (isTaxAdjustment( adj )) {
+ CartShipItemInfo csii = shipInfo.getShipItemInfo(item);
+
+ if (csii.itemTaxAdj == null) shipInfo.setItemInfo(item, UtilMisc.toList(adj));
+ else csii.itemTaxAdj.add(adj);
+ }
+ else item.addAdjustment(adj);
+ }
}
}
}
}
+
// set the item seq in the cart
if (nextItemSeq > 0) {
try {
@@ -928,6 +941,12 @@ public class ShoppingCartServices {
return result;
}
+ private static boolean isTaxAdjustment(GenericValue cartAdj) {
+ String adjType = cartAdj.getString("orderAdjustmentTypeId");
+
+ return "SALES_TAX".equals(adjType) || "VAT_TAX".equals(adjType) || "VAT_PRICE_CORRECT".equals(adjType);
+ }
+
public static Map<String, Object>loadCartFromShoppingList(DispatchContext dctx, Map<String, Object> context) {
LocalDispatcher dispatcher = dctx.getDispatcher();
Delegator delegator = dctx.getDelegator();
@@ -1034,7 +1053,7 @@ public class ShoppingCartServices {
Debug.logError(e, module);
return ServiceUtil.returnError(e.getMessage());
}
-
+
// set the modified price
if (modifiedPrice != null && modifiedPrice.doubleValue() != 0) {
ShoppingCartItem item = cart.findCartItem(itemIndex);
Modified: ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListEvents.java?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListEvents.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/src/org/ofbiz/order/shoppinglist/ShoppingListEvents.java Tue Sep 20 17:46:13 2011
@@ -377,7 +377,7 @@ public class ShoppingListEvents {
List<GenericValue> existingLists = delegator.findByAnd("ShoppingList", findMap);
Debug.logInfo("Finding existing auto-save shopping list with: \nfindMap: " + findMap + "\nlists: " + existingLists, module);
- if (existingLists != null && !existingLists.isEmpty()) {
+ if (UtilValidate.isNotEmpty(existingLists)) {
list = EntityUtil.getFirst(existingLists);
autoSaveListId = list.getString("shoppingListId");
}
@@ -406,11 +406,21 @@ public class ShoppingListEvents {
autoSaveListId = getAutoSaveListId(delegator, dispatcher, null, userLogin, cart.getProductStoreId());
cart.setAutoSaveListId(autoSaveListId);
}
+ GenericValue shoppingList = delegator.findByPrimaryKey("ShoppingList", UtilMisc.toMap("shoppingListId", autoSaveListId));
+ Integer currentListSize = 0;
+ if (UtilValidate.isNotEmpty(shoppingList)) {
+ List<GenericValue> shoppingListItems = shoppingList.getRelated("ShoppingListItem");
+ if (UtilValidate.isNotEmpty(shoppingListItems)) {
+ currentListSize = shoppingListItems.size();
+ }
+ }
try {
String[] itemsArray = makeCartItemsArray(cart);
if (itemsArray != null && itemsArray.length != 0) {
addBulkFromCart(delegator, dispatcher, cart, userLogin, autoSaveListId, null, itemsArray, false, false);
+ }else if(itemsArray.length == 0 && currentListSize != 0){
+ clearListInfo(delegator, autoSaveListId);
}
} catch (IllegalArgumentException e) {
throw new GeneralException(e.getMessage(), e);
Modified: ofbiz/branches/jackrabbit20100709/applications/order/testdef/ShoppingCartTests.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/testdef/ShoppingCartTests.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/testdef/ShoppingCartTests.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/testdef/ShoppingCartTests.xml Tue Sep 20 17:46:13 2011
@@ -18,11 +18,22 @@ specific language governing permissions
under the License.
-->
-<test-suite suite-name="shopingcarttests"
+<test-suite suite-name="shoppingcarttests"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/test-suite.xsd">
<test-case case-name="shoppingCart-test">
<simple-method-test location="component://order/script/org/ofbiz/order/test/ShoppingCartTests.xml" name="testCreateShoppingCart"/>
</test-case>
+
+ <test-case case-name="productRentalOrder-test">
+ <simple-method-test location="component://order/script/org/ofbiz/order/test/ShoppingCartTests.xml" name="testCreateOrderRentalProduct"/>
+ </test-case>
+
+ <test-case case-name="productServiceOrder-test">
+ <simple-method-test location="component://order/script/org/ofbiz/order/test/ShoppingCartTests.xml" name="testCreateOrderServiceProduct"/>
+ </test-case>
+ <test-case case-name="loadCartFromQuote-test">
+ <simple-method-test location="component://order/script/org/ofbiz/order/test/ShoppingCartTests.xml" name="testLoadCartFromQuote"/>
+ </test-case>
</test-suite>
Modified: ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy Tue Sep 20 17:46:13 2011
@@ -646,4 +646,9 @@ if (product) {
}
context.productImageList = productImageList;
}
+
+ // get reservation start date for rental product
+ if("ASSET_USAGE".equals(productTypeId) || "ASSET_USAGE_OUT_IN".equals(productTypeId)){
+ context.startDate = UtilDateTime.addDaysToTimestamp(UtilDateTime.nowTimestamp(), 1).toString().substring(0,10); // should be tomorrow.
+ }
}
Modified: ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/WEB-INF/controller.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/WEB-INF/controller.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/WEB-INF/controller.xml Tue Sep 20 17:46:13 2011
@@ -1634,6 +1634,33 @@ under the License.
<response name="success" type="view" value="ListQuoteAdjustments"/>
</request-map>
+ <!-- Quote Note Requests -->
+ <request-map uri="createnewquotenote">
+ <security https="true" auth="true"/>
+ <response name="success" type="view" value="createnewquotenote"/>
+ </request-map>
+ <request-map uri="createquotenote">
+ <security https="true" auth="true"/>
+ <event type="service" invoke="createQuoteNote"/>
+ <response name="success" type="view" value="ListQuoteNotes"/>
+ <response name="error" type="view" value="createnewquotenote"/>
+ </request-map>
+ <request-map uri="updateQuoteNote">
+ <security https="true" auth="true"/>
+ <event type="service" invoke="updateNote"/>
+ <response name="success" type="request-redirect" value="ListQuoteNotes"><redirect-parameter name="quoteId"/></response>
+ <response name="error" type="view" value="ListQuoteNotes"/>
+ </request-map>
+ <request-map uri="ListQuoteNotes">
+ <security https="true" auth="true"/>
+ <response name="success" type="view" value="ListQuoteNotes"/>
+ </request-map>
+ <request-map uri="EditQuoteNote">
+ <security https="true" auth="true"/>
+ <response name="success" type="view" value="EditQuoteNote"/>
+ </request-map>
+
+
<!-- WorkEffort Quote request mappings -->
<request-map uri="ListQuoteWorkEfforts">
<security https="true" auth="true"/>
@@ -1736,6 +1763,13 @@ under the License.
<response name="error" type="request" value="json"/>
</request-map>
+ <request-map uri="setInvoicePerShipment">
+ <security https="true" auth="true"/>
+ <event type="service" invoke="updateOrderHeader"/>
+ <response name="success" type="view" value="orderview"/>
+ <response name="error" type="view" value="orderview"/>
+ </request-map>
+
<request-map uri="addShippingAddress">
<security https="true" auth="true"/>
<event type="service" invoke="createUpdateShippingAddress"/>
@@ -2012,6 +2046,9 @@ under the License.
<view-map name="EditQuoteAdjustment" type="screen" page="component://order/widget/ordermgr/QuoteScreens.xml#EditQuoteAdjustment"/>
<view-map name="ViewQuoteProfit" type="screen" page="component://order/widget/ordermgr/QuoteScreens.xml#ViewQuoteProfit"/>
<view-map name="EditQuoteReportMail" type="screen" page="component://order/widget/ordermgr/QuoteScreens.xml#EditQuoteReportMail"/>
+ <view-map name="createnewquotenote" type="screen" page="component://order/widget/ordermgr/QuoteScreens.xml#QuoteNewNote"/>
+ <view-map name="ListQuoteNotes" type="screen" page="component://order/widget/ordermgr/QuoteScreens.xml#ListQuoteNotes"/>
+ <view-map name="EditQuoteNote" type="screen" page="component://order/widget/ordermgr/QuoteScreens.xml#EditQuoteNote"/>
<view-map name="FindRequest" type="screen" page="component://order/widget/ordermgr/CustRequestScreens.xml#FindRequest"/>
<view-map name="ViewRequest" type="screen" page="component://order/widget/ordermgr/CustRequestScreens.xml#ViewRequest"/>
Modified: ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/entry/catalog/compareproducts.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/entry/catalog/compareproducts.ftl?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/entry/catalog/compareproducts.ftl (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/entry/catalog/compareproducts.ftl Tue Sep 20 17:46:13 2011
@@ -21,6 +21,7 @@ under the License.
<tr>
<td> </td>
<#list compareList as product>
+ <#assign tdWidth = 100/compareList?size />
<#assign productData = productDataMap[product.productId]/>
<#assign productContentWrapper = productData.productContentWrapper/>
<#assign price = productData.priceMap/>
@@ -29,7 +30,7 @@ under the License.
<#if smallImageUrl!?length == 0>
<#assign smallImageUrl = "/images/defaultImage.jpg"/>
</#if>
- <td>
+ <td style="width:${tdWidth?c}%;">
<img src="<@o...@ofbizContentUrl>" alt="Small Image"/><br />
${productContentWrapper.get("PRODUCT_NAME")}<br />
<#if totalPrice?exists>
@@ -55,6 +56,8 @@ under the License.
<#-- check to see if it is a rental item; will enter parameters on the detail screen-->
<#elseif product.productTypeId?if_exists == "ASSET_USAGE"/>
<a href="javascript:doGetViaParent('${productUrl}');" class="buttontext">${uiLabelMap.OrderMakeBooking}...</a>
+ <#elseif product.productTypeId?if_exists == "ASSET_USAGE_OUT_IN"/>
+ <a href="javascript:doGetViaParent('${productUrl}');" class="buttontext">${uiLabelMap.OrderRent}...</a>
<#-- check to see if it is an aggregated or configurable product; will enter parameters on the detail screen-->
<#elseif product.productTypeId?if_exists == "AGGREGATED"/>
<a href="javascript:doGetViaParent('${productUrl}');" class="buttontext">${uiLabelMap.OrderConfigure}...</a>
@@ -157,6 +160,8 @@ under the License.
<#-- check to see if it is a rental item; will enter parameters on the detail screen-->
<#elseif product.productTypeId?if_exists == "ASSET_USAGE"/>
<a href="javascript:doGetViaParent('${productUrl}');" class="buttontext">${uiLabelMap.OrderMakeBooking}...</a>
+ <#elseif product.productTypeId?if_exists == "ASSET_USAGE_OUT_IN"/>
+ <a href="javascript:doGetViaParent('${productUrl}');" class="buttontext">${uiLabelMap.OrderRent}...</a>
<#-- check to see if it is an aggregated or configurable product; will enter parameters on the detail screen-->
<#elseif product.productTypeId?if_exists == "AGGREGATED"/>
<a href="javascript:doGetViaParent('${productUrl}');" class="buttontext">${uiLabelMap.OrderConfigure}...</a>
Modified: ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/entry/catalog/productdetail.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/entry/catalog/productdetail.ftl?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/entry/catalog/productdetail.ftl (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/entry/catalog/productdetail.ftl Tue Sep 20 17:46:13 2011
@@ -212,7 +212,7 @@ ${virtualJavaScript?if_exists}
}
function additemSubmit(){
- <#if product.productTypeId?if_exists == "ASSET_USAGE">
+ <#if product.productTypeId?if_exists == "ASSET_USAGE" || product.productTypeId?if_exists == "ASSET_USAGE_OUT_IN">
newdatevalue = validate(document.addform.reservStart.value);
if (newdatevalue == false) {
document.addform.reservStart.focus();
@@ -226,7 +226,7 @@ ${virtualJavaScript?if_exists}
}
function addShoplistSubmit(){
- <#if product.productTypeId?if_exists == "ASSET_USAGE">
+ <#if product.productTypeId?if_exists == "ASSET_USAGE" || product.productTypeId?if_exists == "ASSET_USAGE_OUT_IN">
if (document.addToShoppingList.reservStartStr.value == "") {
document.addToShoppingList.submit();
} else {
@@ -358,7 +358,7 @@ ${virtualJavaScript?if_exists}
<#assign priceStyle = "regularPrice">
</#if>
${uiLabelMap.OrderYourPrice}: <#if "Y" = product.isVirtual?if_exists> ${uiLabelMap.CommonFrom} </#if><span class="${priceStyle}"><@ofbizCurrency amount=price.price isoCode=price.currencyUsed/></span>
- <#if product.productTypeId?if_exists == "ASSET_USAGE">
+ <#if product.productTypeId?if_exists == "ASSET_USAGE" || product.productTypeId?if_exists == "ASSET_USAGE_OUT_IN">
<#if product.reserv2ndPPPerc?exists && product.reserv2ndPPPerc != 0><br /><span class="${priceStyle}">${uiLabelMap.ProductReserv2ndPPPerc}<#if !product.reservNthPPPerc?exists || product.reservNthPPPerc == 0>${uiLabelMap.CommonUntil} ${product.reservMaxPersons}</#if> <@ofbizCurrency amount=product.reserv2ndPPPerc*price.price/100 isoCode=price.currencyUsed/></span></#if>
<#if product.reservNthPPPerc?exists &&product.reservNthPPPerc != 0><br /><span class="${priceStyle}">${uiLabelMap.ProductReservNthPPPerc} <#if !product.reserv2ndPPPerc?exists || product.reserv2ndPPPerc == 0>${uiLabelMap.ProductReservSecond} <#else> ${uiLabelMap.ProductReservThird} </#if> ${uiLabelMap.CommonUntil} ${product.reservMaxPersons}, ${uiLabelMap.ProductEach}: <@ofbizCurrency amount=product.reservNthPPPerc*price.price/100 isoCode=price.currencyUsed/></span></#if>
<#if (!product.reserv2ndPPPerc?exists || product.reserv2ndPPPerc == 0) && (!product.reservNthPPPerc?exists || product.reservNthPPPerc == 0)><br />${uiLabelMap.ProductMaximum} ${product.reservMaxPersons} ${uiLabelMap.ProductPersons}.</#if>
@@ -529,7 +529,7 @@ ${virtualJavaScript?if_exists}
<span style="white-space: nowrap;"><b>${uiLabelMap.CommonAmount}:</b></span>
<input type="text" size="5" name="add_amount" value=""/>
</div>
- <#if product.productTypeId?if_exists == "ASSET_USAGE">
+ <#if product.productTypeId?if_exists == "ASSET_USAGE" || product.productTypeId?if_exists == "ASSET_USAGE_OUT_IN">
<table width="100%"><tr>
<@htmlTemplate.renderDateTimeField name="reservStart" event="" action="" value="" className="" alert="" title="Format: yyyy-MM-dd HH:mm:ss.SSS" size="25" maxlength="30" id="startDate1" dateType="date" shortDateInput=false timeDropdownParamName="" defaultDateTimeString="" localizedIconTitle="" timeDropdown="" timeHourName="" classString="" hour1="" hour2="" timeMinutesName="" minutes="" isTwelveHour="" ampmName="" amSelected="" pmSelected="" compositeType="" formName=""/>
<@htmlTemplate.renderDateTimeField name="reservEnd" event="" action="" value="" className="" alert="" title="Format: yyyy-MM-dd HH:mm:ss.SSS" size="25" maxlength="30" id="endDate1" dateType="date" shortDateInput=false timeDropdownParamName="" defaultDateTimeString="" localizedIconTitle="" timeDropdown="" timeHourName="" classString="" hour1="" hour2="" timeMinutesName="" minutes="" isTwelveHour="" ampmName="" amSelected="" pmSelected="" compositeType="" formName=""/>
@@ -566,7 +566,7 @@ ${virtualJavaScript?if_exists}
<option value="">${uiLabelMap.OrderNewShoppingList}</option>
</select>
- <#if product.productTypeId?if_exists == "ASSET_USAGE">
+ <#if product.productTypeId?if_exists == "ASSET_USAGE" || product.productTypeId?if_exists == "ASSET_USAGE_OUT_IN">
<table><tr><td> </td><td align="right">${uiLabelMap.CommonStartDate} (yyyy-mm-dd)</td><td><input type="text" size="10" name="reservStartStr" /></td><td>Number of days</td><td><input type="text" size="4" name="reservLength" /></td><td> </td><td align="right">Number of persons</td><td><input type="text" size="4" name="reservPersons" value="1" /></td><td align="right">Qty </td><td><input type="text" size="5" name="quantity" value="1" /></td></tr></table>
<#else>
<input type="text" size="5" name="quantity" value="1"/>
Modified: ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/entry/catalog/productsummary.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/entry/catalog/productsummary.ftl?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/entry/catalog/productsummary.ftl (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/entry/catalog/productsummary.ftl Tue Sep 20 17:46:13 2011
@@ -109,6 +109,8 @@ ${virtualJavaScript?if_exists}
<#-- check to see if the product requires an amount -->
<#elseif product.requireAmount?exists && product.requireAmount == "Y">
<a href="${productUrl}" class="buttontext">${uiLabelMap.OrderChooseAmount}...</a>
+ <#elseif product.productTypeId?if_exists == "ASSET_USAGE_OUT_IN">
+ <a href="${productUrl}" class="buttontext">${uiLabelMap.OrderRent}...</a>
<#else>
<form method="post" action="<@o...@ofbizUrl>" name="the${requestAttributes.formNamePrefix?if_exists}${requestAttributes.listIndex?if_exists}form" style="margin: 0;">
<input type="hidden" name="add_product_id" value="${product.productId}"/>
Modified: ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/order/orderinfo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/order/orderinfo.ftl?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/order/orderinfo.ftl (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/order/orderinfo.ftl Tue Sep 20 17:46:13 2011
@@ -252,8 +252,23 @@ under the License.
</form>
</td>
</tr>
- <tr><td colspan="3"><hr /></td></tr>
</#if>
+ <tr><td colspan="3"><hr /></td></tr>
+ <tr>
+ <td align="right" valign="top" width="15%" class="label"> Invoice Per Shipment</td>
+ <td width="5%"> </td>
+ <td valign="top" width="80%">
+ <form name="setInvoicePerShipment" method="post" action="<@o...@ofbizUrl>">
+ <input type = "hidden" name="orderId" value="${orderId}"/>
+ <select name="invoicePerShipment">
+ <option value="Y" <#if (orderHeader.invoicePerShipment)?if_exists == "Y">selected="selected" </#if>>Y</option>
+ <option value="N" <#if (orderHeader.invoicePerShipment)?if_exists == "N">selected="selected" </#if>>N</option>
+ </select>
+ <input type="submit" class="smallSubmit" value="${uiLabelMap.CommonUpdate}"/>
+ </form>
+ </td>
+ </tr>
+ <tr><td colspan="3"><hr /></td></tr>
<#if orderHeader.isViewed?has_content && orderHeader.isViewed == "Y">
<tr>
<td class="label">${uiLabelMap.OrderViewed}</td>
Modified: ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/order/ordershippinginfo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/order/ordershippinginfo.ftl?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/order/ordershippinginfo.ftl (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/order/ordershippinginfo.ftl Tue Sep 20 17:46:13 2011
@@ -246,18 +246,18 @@ under the License.
<td valign="top" width="80%">
<div>
<#if orderHeader?has_content && orderHeader.statusId != "ORDER_CANCELLED" && orderHeader.statusId != "ORDER_COMPLETED" && orderHeader.statusId != "ORDER_REJECTED">
- <#-- passing the shipmentMethod value as the combination of two fields value
- i.e shipmentMethodTypeId & carrierPartyId and this two field values are separated bye
+ <#-- passing the shipmentMethod value as the combination of three fields value
+ i.e shipmentMethodTypeId & carrierPartyId & roleTypeId. Values are separated by
"@" symbol.
-->
<select name="shipmentMethod">
<#if shipGroup.shipmentMethodTypeId?has_content>
- <option value="${shipGroup.shipmentMethodTypeId}@${shipGroup.carrierPartyId?if_exists}"><#if shipGroup.carrierPartyId != "_NA_">${shipGroup.carrierPartyId?if_exists}</#if> ${shipmentMethodType.get("description",locale)?default("")}</option>
+ <option value="${shipGroup.shipmentMethodTypeId}@${shipGroup.carrierPartyId!}@${shipGroup.carrierRoleTypeId!}"><#if shipGroup.carrierPartyId != "_NA_">${shipGroup.carrierPartyId!}</#if> ${shipmentMethodType.get("description",locale)!}</option>
<#else>
<option value=""/>
</#if>
<#list productStoreShipmentMethList as productStoreShipmentMethod>
- <#assign shipmentMethodTypeAndParty = productStoreShipmentMethod.shipmentMethodTypeId + "@" + productStoreShipmentMethod.partyId>
+ <#assign shipmentMethodTypeAndParty = productStoreShipmentMethod.shipmentMethodTypeId + "@" + productStoreShipmentMethod.partyId + "@" + productStoreShipmentMethod.roleTypeId>
<#if productStoreShipmentMethod.partyId?has_content || productStoreShipmentMethod?has_content>
<option value="${shipmentMethodTypeAndParty?if_exists}"><#if productStoreShipmentMethod.partyId != "_NA_">${productStoreShipmentMethod.partyId?if_exists}</#if> ${productStoreShipmentMethod.get("description",locale)?default("")}</option>
</#if>
Modified: ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/return/returnItemInc.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/return/returnItemInc.ftl?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/return/returnItemInc.ftl (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/webapp/ordermgr/return/returnItemInc.ftl Tue Sep 20 17:46:13 2011
@@ -122,7 +122,14 @@ under the License.
<div><@ofbizCurrency amount=orderItem.unitPrice isoCode=orderHeader.currencyUom/></div>
</td>
<td>
- <input type="text" size="8" name="returnPrice_o_${rowCount}" value="${returnableItems.get(orderItem).get("returnablePrice")?string("##0.00")}"/>
+ <#if orderItem.productId?exists>
+ <#assign product = orderItem.getRelatedOne("Product")/>
+ <#if product.productTypeId == "ASSET_USAGE_OUT_IN">
+ <input type="text" size="8" name="returnPrice_o_${rowCount}" value="0.00"/>
+ <#else>
+ <input type="text" size="8" name="returnPrice_o_${rowCount}" value="${returnableItems.get(orderItem).get("returnablePrice")?string("##0.00")}"/>
+ </#if>
+ </#if>
</td>
<td>
<select name="returnReasonId_o_${rowCount}">
Modified: ofbiz/branches/jackrabbit20100709/applications/order/widget/ordermgr/OrderForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/widget/ordermgr/OrderForms.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/widget/ordermgr/OrderForms.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/widget/ordermgr/OrderForms.xml Tue Sep 20 17:46:13 2011
@@ -246,5 +246,17 @@ under the License.
<display-entity entity-name="RoleType" description="${description}"/>
</field>
</form>
-
+
+ <form name="OrderNewNote" target="createordernote" type="single">
+ <field name="orderId"><hidden/></field>
+ <field name="note" title="${uiLabelMap.OrderNote}"><textarea rows="5" cols="70"/></field>
+ <field name="internalNote" title="${uiLabelMap.OrderInternalNote}" tooltip="${uiLabelMap.OrderInternalNoteMessage}">
+ <drop-down allow-empty="true" no-current-selected-key="Y">
+ <option key="Y" description="${uiLabelMap.CommonYes}"/>
+ <option key="N" description="${uiLabelMap.CommonNo}"/>
+ </drop-down>
+ </field>
+ <field name="submitButton" title="${uiLabelMap.CommonSubmit}" widget-style="smallSubmit"><submit button-type="button"/></field>
+ </form>
+
</forms>
Modified: ofbiz/branches/jackrabbit20100709/applications/order/widget/ordermgr/OrderMenus.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/widget/ordermgr/OrderMenus.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/widget/ordermgr/OrderMenus.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/widget/ordermgr/OrderMenus.xml Tue Sep 20 17:46:13 2011
@@ -161,6 +161,15 @@ under the License.
</link>
</menu-item>
+ <menu-item name="ListQuoteNotes" title="${uiLabelMap.OrderOrderQuoteNotes}">
+ <condition>
+ <if-compare operator="equals" value="QUO_CREATED" field="quote.statusId"/>
+ </condition>
+ <link target="ListQuoteNotes">
+ <parameter param-name="quoteId" from-field="quote.quoteId"/>
+ </link>
+ </menu-item>
+
<menu-item name="ListQuoteAttributes" title="${uiLabelMap.OrderOrderQuoteAttributes}">
<condition>
<if-compare operator="equals" value="QUO_CREATED" field="quote.statusId"/>
Modified: ofbiz/branches/jackrabbit20100709/applications/order/widget/ordermgr/OrderViewScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/widget/ordermgr/OrderViewScreens.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/widget/ordermgr/OrderViewScreens.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/widget/ordermgr/OrderViewScreens.xml Tue Sep 20 17:46:13 2011
@@ -262,6 +262,9 @@ under the License.
</screen>
<screen name="OrderNewNote">
<section>
+ <condition>
+ <if-has-permission permission="ORDERMGR" action="_VIEW"/>
+ </condition>
<actions>
<set field="titleProperty" value="OrderAddNote"/>
<set field="headerItem" value="findorders"/>
@@ -270,12 +273,18 @@ under the License.
<widgets>
<decorator-screen name="CommonOrderViewDecorator">
<decorator-section name="body">
- <platform-specific>
- <html><html-template location="component://order/webapp/ordermgr/order/newnote.ftl"/></html>
- </platform-specific>
+ <screenlet title="${uiLabelMap.OrderAddNote}">
+ <container>
+ <link target="orderview?orderId=${orderId}" text="${uiLabelMap.OrderBackToOrder}" style="buttontext"/>
+ </container>
+ <include-form name="OrderNewNote" location="component://order/widget/ordermgr/OrderForms.xml"/>
+ </screenlet>
</decorator-section>
</decorator-screen>
</widgets>
+ <fail-widgets>
+ <label style="h3">${uiLabelMap.OrderViewPermissionError}</label>
+ </fail-widgets>
</section>
</screen>
<screen name="OrderDeliveryScheduleInfo">
Modified: ofbiz/branches/jackrabbit20100709/applications/order/widget/ordermgr/QuoteForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/widget/ordermgr/QuoteForms.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/widget/ordermgr/QuoteForms.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/widget/ordermgr/QuoteForms.xml Tue Sep 20 17:46:13 2011
@@ -545,4 +545,27 @@ under the License.
header-row-style="header-row" default-table-style="basic-table" extends="EditQuoteTerm">
<alt-target use-when="quoteTerm==null" target="createQuoteTermFromItem"/>
</form>
+ <form name="ListQuoteNotes" target="" title="" type="list" list-name="quoteNotes"
+ header-row-style="${headerRowStyle}" odd-row-style="alternate-row" default-table-style="basic-table hover-bar" paginate-target="ListQuoteNotes">
+ <auto-fields-entity entity-name="QuoteNoteView" default-field-type="display"/>
+ <field name="quoteId"><hidden/></field>
+ <field name="noteId"><hidden/></field>
+ <field name="editLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext">
+ <hyperlink target="EditQuoteNote" description="${uiLabelMap.CommonEdit}" also-hidden="false">
+ <parameter param-name="quoteId"/>
+ <parameter param-name="noteId"/>
+ </hyperlink>
+ </field>
+ </form>
+ <form name="ListQuoteNoteInfo" extends="ListQuoteNotes">
+ <field name="editLink"><hidden/></field>
+ <field name="noteInfo"><display size="100"/></field>
+ </form>
+ <form name="AddOrEditQuoteNote" target="${target}" type="single" default-entity-name="QuoteNoteView" default-map-name="quoteNoteData">
+ <field name="quoteId"><hidden/></field>
+ <field name="noteId"><hidden/></field>
+ <field name="noteName"><text/></field>
+ <field name="noteInfo"><textarea rows="5" cols="70"/></field>
+ <field name="submitButton" title="${uiLabelMap.CommonSubmit}" widget-style="smallSubmit"><submit button-type="button"/></field>
+ </form>
</forms>
Modified: ofbiz/branches/jackrabbit20100709/applications/order/widget/ordermgr/QuoteScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/order/widget/ordermgr/QuoteScreens.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/order/widget/ordermgr/QuoteScreens.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/order/widget/ordermgr/QuoteScreens.xml Tue Sep 20 17:46:13 2011
@@ -40,8 +40,8 @@ under the License.
</condition>
<widgets>
<include-menu name="QuoteTabBar" location="component://order/widget/ordermgr/OrderMenus.xml"/>
- <container>
- <label style="h1">[${uiLabelMap.CommonId}:${quote.quoteId}] ${quote.description}</label>
+ <container style="page-title">
+ <label>${uiLabelMap[titleProperty]} [${uiLabelMap.CommonId}:${quote.quoteId}] ${quote.description}</label>
</container>
</widgets>
</section>
@@ -659,6 +659,10 @@ under the License.
<field-map field-name="quoteId" from-field="parameters.quoteId"/>
<field-map field-name="quoteItemSeqId" value="_NA_"/>
</entity-and>
+ <entity-and entity-name="QuoteNoteView" list="quoteNotes">
+ <field-map field-name="quoteId" from-field="parameters.quoteId"/>
+ <order-by field-name="-noteDateTime"/>
+ </entity-and>
</actions>
<widgets>
<container style="lefthalf">
@@ -668,6 +672,7 @@ under the License.
<include-screen name="quoteDate"/>
<include-screen name="quoteRoles"/>
<include-screen name="ListQuoteInfo"/>
+ <include-screen name="ListQuoteNoteInfo"/>
</container>
</widgets>
</section>
@@ -693,6 +698,18 @@ under the License.
</widgets>
</section>
</screen>
+ <screen name="ListQuoteNoteInfo">
+ <section>
+ <condition>
+ <not><if-empty field="quoteNotes"/></not>
+ </condition>
+ <widgets>
+ <screenlet title="${uiLabelMap.OrderOrderQuoteNotes}">
+ <include-form name="ListQuoteNoteInfo" location="component://order/widget/ordermgr/QuoteForms.xml"/>
+ </screenlet>
+ </widgets>
+ </section>
+ </screen>
<screen name="quoteDate">
<section>
<widgets>
@@ -804,4 +821,85 @@ under the License.
</widgets>
</section>
</screen>
+ <screen name="ListQuoteNotes">
+ <section>
+ <actions>
+ <set field="titleProperty" value="OrderOrderQuoteNoteList"/>
+ <set field="tabButtonItem" value="ListQuoteNotes"/>
+ <set field="quoteId" from-field="parameters.quoteId"/>
+ <set field="headerRowStyle" value="header-row-2"/>
+ <entity-one entity-name="Quote" value-field="quote" auto-field-map="true"/>
+ <entity-and entity-name="QuoteNoteView" list="quoteNotes">
+ <field-map field-name="quoteId" from-field="parameters.quoteId"/>
+ <order-by field-name="-noteDateTime"/>
+ </entity-and>
+ </actions>
+ <widgets>
+ <decorator-screen name="CommonQuoteDecorator" location="${parameters.quoteDecoratorLocation}">
+ <decorator-section name="body">
+ <container style="button-bar button-style-1">
+ <link target="createnewquotenote" text="${uiLabelMap.OrderCreateOrderQuoteNote}">
+ <parameter param-name="quoteId" from-field="quote.quoteId"/>
+ </link>
+ </container>
+ <include-form name="ListQuoteNotes" location="component://order/widget/ordermgr/QuoteForms.xml"/>
+ </decorator-section>
+ </decorator-screen>
+ </widgets>
+ </section>
+ </screen>
+ <screen name="QuoteNewNote">
+ <section>
+ <condition>
+ <not><if-empty field="parameters.quoteId"/></not>
+ </condition>
+ <actions>
+ <set field="titleProperty" value="OrderAddNote"/>
+ <set field="tabButtonItem" value="QuoteNotes"/>
+ <set field="target" value="createquotenote"/>
+ <set field="quoteId" from-field="parameters.quoteId"/>
+ <entity-one entity-name="Quote" value-field="quote"/>
+ </actions>
+ <widgets>
+ <decorator-screen name="CommonQuoteDecorator">
+ <decorator-section name="body">
+ <include-form name="AddOrEditQuoteNote" location="component://order/widget/ordermgr/QuoteForms.xml"/>
+ </decorator-section>
+ </decorator-screen>
+ </widgets>
+ <fail-widgets>
+ <label style="h3">${uiLabelMap.OrderViewPermissionError}</label>
+ </fail-widgets>
+ </section>
+ </screen>
+ <screen name="EditQuoteNote">
+ <section>
+ <condition>
+ <and>
+ <not><if-empty field="parameters.noteId"/></not>
+ <not><if-empty field="parameters.quoteId"/></not>
+ </and>
+ </condition>
+ <actions>
+ <set field="titleProperty" value="QuoteEditNote"/>
+ <set field="tabButtonItem" value="QuoteNotes"/>
+ <set field="target" value="updateQuoteNote"/>
+ <set field="quoteId" from-field="parameters.quoteId"/>
+ <set field="noteId" from-field="parameters.noteId"/>
+ <entity-one entity-name="Quote" value-field="quote"/>
+ <entity-one entity-name="QuoteNoteView" value-field="quoteNoteData"/>
+ </actions>
+ <widgets>
+ <decorator-screen name="CommonQuoteDecorator">
+ <decorator-section name="body">
+ <include-form name="AddOrEditQuoteNote" location="component://order/widget/ordermgr/QuoteForms.xml"/>
+ </decorator-section>
+ </decorator-screen>
+ </widgets>
+ <fail-widgets>
+ <label style="h3">${uiLabelMap.OrderViewPermissionError}</label>
+ </fail-widgets>
+ </section>
+ </screen>
+
</screens>
Modified: ofbiz/branches/jackrabbit20100709/applications/party/config/PartyEntityLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/party/config/PartyEntityLabels.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/party/config/PartyEntityLabels.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/party/config/PartyEntityLabels.xml Tue Sep 20 17:46:13 2011
@@ -2268,7 +2268,7 @@
</property>
<property key="RoleType.description.EMAIL_ADMIN">
<value xml:lang="en">Email Administrator</value>
- <value xml:lang="en">Administrateur des emails</value>
+ <value xml:lang="fr">Administrateur des emails</value>
<value xml:lang="hi_IN">à¤à¤®à¥à¤² पà¥à¤°à¤¶à¤¾à¤¸à¤</value>
<value xml:lang="it">Amministratore email</value>
<value xml:lang="pt_BR">Administrador de e-mail</value>
@@ -2327,7 +2327,7 @@
</property>
<property key="RoleType.description.FAM_MANAGER">
<value xml:lang="en">Maintenance Manager or Supervisor</value>
- <value xml:lang="en">Responsable de la maintenance</value>
+ <value xml:lang="fr">Responsable de la maintenance</value>
<value xml:lang="hi_IN">à¤
नà¥à¤°à¤à¥à¤·à¤£ पà¥à¤°à¤¬à¤à¤§à¤ à¤
थवा सà¥à¤ªà¤°à¤µà¤¾à¤à¤à¤°</value>
<value xml:lang="it">Gestione manutenzione o supervisore</value>
<value xml:lang="pt_BR">Gerente ou supervisor de manutenção</value>
@@ -2840,7 +2840,7 @@
<value xml:lang="de">Empfänger der Anfrage</value>
<value xml:lang="en">Request Taker</value>
<value xml:lang="es">Receptor de peticiones</value>
- <value xml:lang="fr">Employé aux recherches</value>
+ <value xml:lang="fr">Preneur de commande</value>
<value xml:lang="hi_IN">à¤
नà¥à¤°à¥à¤§ लà¥à¤¨à¥ वाला</value>
<value xml:lang="it">Acquirente soggetto</value>
<value xml:lang="pt_BR">Receptor de pedidos</value>
@@ -3284,7 +3284,7 @@
</property>
<property key="TermType.description.FAS">
<value xml:lang="en">Incoterm Free Alongside Ship</value>
- <value xml:lang="en">Incoterm : sur le quai du port de départ</value>
+ <value xml:lang="fr">Incoterm : sur le quai du port de départ</value>
<value xml:lang="it">Gratis accanto alla spedizione incoterm</value>
<value xml:lang="pt_BR">Incoterm FAS</value>
<value xml:lang="zh">å½é
è´¸æ(å¯è¿å°)è¹è¾¹äº¤è´§ä»·æ ¼</value>
Modified: ofbiz/branches/jackrabbit20100709/applications/party/data/PartyTypeData.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/party/data/PartyTypeData.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/party/data/PartyTypeData.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/party/data/PartyTypeData.xml Tue Sep 20 17:46:13 2011
@@ -435,7 +435,8 @@ under the License.
<UserPrefGroupType userPrefGroupTypeId="GLOBAL_PREFERENCES" description="Global preferences"/>
<UserPreference userLoginId="_NA_" userPrefTypeId="ORGANIZATION_PARTY" userPrefGroupTypeId="GLOBAL_PREFERENCES" userPrefValue="DEFAULT"/>
- <EnumerationType description="Global preferences" enumTypeId="GLOBAL_PREFERENCES" hasTable="N" parentTypeId=""/>
+ <EnumerationType description="User preference groups" enumTypeId="USER_PREF_GROUPS" hasTable="N" parentTypeId=""/>
+ <EnumerationType description="Global preferences" enumTypeId="GLOBAL_PREFERENCES" hasTable="N" parentTypeId="USER_PREF_GROUPS"/>
<Enumeration description="Organization party" enumCode="" enumId="ORGANIZATION_PARTY" sequenceId="01" enumTypeId="GLOBAL_PREFERENCES"/>
<Enumeration description="Visual Theme" enumCode="" enumId="VISUAL_THEME" sequenceId="02" enumTypeId="GLOBAL_PREFERENCES"/>
Modified: ofbiz/branches/jackrabbit20100709/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/party/script/org/ofbiz/party/communication/CommunicationEventServices.xml Tue Sep 20 17:46:13 2011
@@ -344,8 +344,9 @@ under the License.
<if-empty field="event"><!-- the service can be called multiple times because event can have several recipients-->
<return/><!-- ignore if already deleted -->
</if-empty>
- <!-- remove related links to work effort -->
+ <!-- remove related links to work effort and product -->
<remove-related relation-name="CommunicationEventWorkEff" value-field="event"/>
+ <remove-related relation-name="CommunicationEventProduct" value-field="event"/>
<!-- remove related links to content -->
<get-related value-field="event" relation-name="CommEventContentAssoc" list="contentAssocs"/>
<if-not-empty field="contentAssocs">
@@ -358,6 +359,18 @@ under the License.
<iterate entry="content" list="contents">
<remove-related value-field="content" relation-name="ContentRole"/>
<remove-related value-field="content" relation-name="ContentKeyword"/>
+ <get-related value-field="content" relation-name="FromContentAssoc" list="relatedFromContentassocs"/>
+ <iterate entry="relatedFromContentassoc" list="relatedFromContentassocs">
+ <set field="removeContentAndRelatedInmap.contentId" from-field="relatedFromContentassoc.contentIdTo"/>
+ <call-service service-name="removeContentAndRelated" in-map-name="removeContentAndRelatedInmap"/>
+ </iterate>
+ <remove-related value-field="content" relation-name="FromContentAssoc"/>
+ <get-related value-field="content" relation-name="ToContentAssoc" list="relatedToContentassocs"/>
+ <iterate entry="relatedToContentassoc" list="relatedToContentassocs">
+ <set field="removeContentAndRelatedInmap.contentId" from-field="relatedFromContentassoc.contentIdFrom"/>
+ <call-service service-name="removeContentAndRelated" in-map-name="removeContentAndRelatedInmap"/>
+ </iterate>
+ <remove-related value-field="content" relation-name="ToContentAssoc"/>
<remove-value value-field="content"/>
<!-- check first if the content is used on any other communication event if yes, only delete link-->
<entity-and entity-name="CommEventContentAssoc" list="commEvents">
@@ -365,19 +378,8 @@ under the License.
</entity-and>
<set field="commEventsSize" value="${groovy: return(commEvents.size())}" type="Integer"/>
<if-compare field="commEventsSize" operator="equals" value="1">
- <get-related-one value-field="content" relation-name="DataResource" to-value-field="dataResource"/>
- <if-not-empty field="dataResource">
- <get-related-one value-field="dataResource" relation-name="ImageDataResource" to-value-field="imageDataResource"/>
- <if-not-empty field="imageDataResource">
- <remove-value value-field="imageDataResource"/>
- </if-not-empty>
- <get-related-one value-field="dataResource" relation-name="ElectronicText" to-value-field="electronicText"/>
- <if-not-empty field="electronicText">
- <remove-value value-field="electronicText"/>
- </if-not-empty>
- <remove-related value-field="dataResource" relation-name="DataResourceRole"/>
- <remove-value value-field="dataResource"/>
- </if-not-empty>
+ <set field="removeContentAndRelatedInmap.contentId" from-field="content.contentId"/>
+ <call-service service-name="removeContentAndRelated" in-map-name="removeContentAndRelatedInmap"/>
</if-compare>
</iterate>
</if-not-empty>
Modified: ofbiz/branches/jackrabbit20100709/applications/party/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/party/servicedef/services.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/party/servicedef/services.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/party/servicedef/services.xml Tue Sep 20 17:46:13 2011
@@ -79,9 +79,11 @@ under the License.
<attribute name="description" type="String" mode="IN" optional="true"/>
<attribute name="externalId" type="String" mode="IN" optional="true"/>
<attribute name="statusId" type="String" mode="IN" optional="true"/>
- <override name="firstName" mode="IN" type="String" optional="false"/>
- <override name="lastName" mode="IN" type="String" optional="false"/>
- </service>
+ <!-- First and Last names are here optional. This allows to implement simple create user login screen where user is able create account
+ in system with username and password and then later populate rest of the account information. -->
+<!-- <override name="firstName" optional="false"/>
+ <override name="lastName" optional="false"/>
+--> </service>
<service name="createPersonAndUserLogin" engine="simple" require-new-transaction="true"
location="component://party/script/org/ofbiz/party/party/PartySimpleMethods.xml" invoke="createPersonAndUserLogin" auth="false">
<description>Create a Person and UserLogin</description>
Modified: ofbiz/branches/jackrabbit20100709/applications/party/servicedef/services_view.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/party/servicedef/services_view.xml?rev=1173274&r1=1173273&r2=1173274&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/party/servicedef/services_view.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/party/servicedef/services_view.xml Tue Sep 20 17:46:13 2011
@@ -54,6 +54,7 @@ under the License.
<attribute name="softIdentifier" type="String" mode="IN" optional="true"/> <!-- does a LIKE compare on this -->
<attribute name="partyRelationshipTypeId" type="String" mode="IN" optional="true"/>
<attribute name="ownerPartyIds" type="List" mode="IN" optional="true"/><!-- Lead Owners Parties -->
+ <attribute name="sortField" type="String" mode="IN" optional="true"/>
<attribute name="roleTypes" type="List" mode="OUT" optional="false"/>
<attribute name="partyTypes" type="List" mode="OUT" optional="false"/>
@@ -67,6 +68,7 @@ under the License.
<attribute name="paramList" type="String" mode="OUT" optional="false"/>
<attribute name="highIndex" type="Integer" mode="OUT" optional="false"/>
<attribute name="lowIndex" type="Integer" mode="OUT" optional="false"/>
+ <attribute name="sortField" type="String" mode="OUT" optional="true"/>
</service>
<service name="getPartyContactMechValueMaps" engine="java"