Author: mor
Date: Mon Apr 26 07:49:58 2010 New Revision: 937953 URL: http://svn.apache.org/viewvc?rev=937953&view=rev Log: Fixed a typo varient -> variant in the comment. Also did minor formatting to the code. if( -> if ( methodDeclaration () -> methodDeclaration() etc. Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/configproductdetail.ftl ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/productdetail.ftl Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java?rev=937953&r1=937952&r2=937953&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java Mon Apr 26 07:49:58 2010 @@ -4950,17 +4950,17 @@ public class ShoppingCart implements Ite public void setOrderStatusString(String orderStatusString) { this.orderStatusString = orderStatusString; } - public static BigDecimal getMinimumOrderQuantity (Delegator delegator, BigDecimal itemBasePrice, String itemProductId) - throws GenericEntityException { + + public static BigDecimal getMinimumOrderQuantity(Delegator delegator, BigDecimal itemBasePrice, String itemProductId) throws GenericEntityException { BigDecimal minQuantity = BigDecimal.ZERO; BigDecimal minimumOrderPrice = BigDecimal.ZERO; - + List<EntityExpr> exprs = FastList.newInstance(); exprs.add(EntityCondition.makeCondition("productId", EntityOperator.EQUALS, itemProductId)); exprs.add(EntityCondition.makeCondition("productPriceTypeId", EntityOperator.EQUALS, "MINIMUM_ORDER_PRICE")); - + List<GenericValue> minimumOrderPriceList = delegator.findList("ProductPrice", EntityCondition.makeCondition(exprs, EntityOperator.AND), null, null, null, false); - if(minimumOrderPriceList != null) { + if (minimumOrderPriceList != null) { minimumOrderPriceList = EntityUtil.filterByDate(minimumOrderPriceList); } if (itemBasePrice == null) { @@ -4981,12 +4981,12 @@ public class ShoppingCart implements Ite itemBasePrice= (BigDecimal) productPriceMap.get("LIST_PRICE"); } } - if(UtilValidate.isNotEmpty(minimumOrderPriceList)) { + if (UtilValidate.isNotEmpty(minimumOrderPriceList)) { minimumOrderPrice = EntityUtil.getFirst(minimumOrderPriceList).getBigDecimal("price"); } - if(itemBasePrice != null && minimumOrderPrice.compareTo(itemBasePrice) > 0) { + if (itemBasePrice != null && minimumOrderPrice.compareTo(itemBasePrice) > 0) { minQuantity = minimumOrderPrice.divide(itemBasePrice, 0, BigDecimal.ROUND_UP); } return minQuantity; } -} +} \ No newline at end of file Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java?rev=937953&r1=937952&r2=937953&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java Mon Apr 26 07:49:58 2010 @@ -777,7 +777,7 @@ public class ShoppingCartHelper { } } else { BigDecimal minQuantity = ShoppingCart.getMinimumOrderQuantity(delegator, item.getBasePrice(), item.getProductId()); - if(quantity.compareTo(minQuantity) < 0) { + if (quantity.compareTo(minQuantity) < 0) { quantity = minQuantity; } item.setQuantity(quantity, dispatcher, this.cart, true, false); Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy?rev=937953&r1=937952&r2=937953&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/entry/catalog/ProductDetail.groovy Mon Apr 26 07:49:58 2010 @@ -387,7 +387,7 @@ if (product) { // sales order: run the "calculateProductPrice" service variantPriceMap = dispatcher.runSync("calculateProductPrice", priceContext); BigDecimal calculatedPrice = (BigDecimal)variantPriceMap.get("price"); - //Get the minimum quantity for varients if MINIMUM_ORDER_PRICE is set for varients. + // Get the minimum quantity for variants if MINIMUM_ORDER_PRICE is set for variants. variantPriceMap.put("minimumQuantity", ShoppingCart.getMinimumOrderQuantity(delegator, calculatedPrice, variant.get("productId"))); Iterator treeMapIter = variantTree.entrySet().iterator(); while (treeMapIter.hasNext()) { Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/configproductdetail.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/configproductdetail.ftl?rev=937953&r1=937952&r2=937953&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/configproductdetail.ftl (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/configproductdetail.ftl Mon Apr 26 07:49:58 2010 @@ -357,7 +357,7 @@ function getConfigDetails(event) { <#else> <a href="javascript:addItem()" class="buttontext"><span style="white-space: nowrap;">${uiLabelMap.OrderAddToCart}</span></a> <input type="text" size="5" name="quantity" value="1" /> - <#if minimumQuantity?exists && minimumQuantity > 0 > + <#if minimumQuantity?exists && minimumQuantity > 0> Minimum order quantity is ${minimumQuantity}. </#if> </#if> Modified: ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/productdetail.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/productdetail.ftl?rev=937953&r1=937952&r2=937953&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/productdetail.ftl (original) +++ ofbiz/trunk/specialpurpose/ecommerce/webapp/ecommerce/catalog/productdetail.ftl Mon Apr 26 07:49:58 2010 @@ -572,11 +572,11 @@ ${virtualJavaScript?if_exists} <#assign secondVariantName = vpricing.get("secondVariantName")?if_exists> <#assign minimumQuantity = vpricing.get("minimumQuantity")> <#if minimumQuantity > 0> - <div>minimum order quantity for ${secondVariantName!} ${variantName!} is ${minimumQuantity!}.</div> + <div>minimum order quantity for ${secondVariantName!} ${variantName!} is ${minimumQuantity!}</div> </#if> </#list> <#elseif minimumQuantity?exists && minimumQuantity?has_content && minimumQuantity > 0> - <div>minimum order quantity for ${productContentWrapper.get("PRODUCT_NAME")?if_exists} is ${minimumQuantity!}.</div> + <div>minimum order quantity for ${productContentWrapper.get("PRODUCT_NAME")?if_exists} is ${minimumQuantity!}</div> </#if> </fieldset> </form> |
Free forum by Nabble | Edit this page |