Author: jonesde
Date: Mon Jan 5 23:44:59 2009 New Revision: 731858 URL: http://svn.apache.org/viewvc?rev=731858&view=rev Log: A few fixes for things I missed while progressively compiling during the typecheckcleanup200810 branch merge Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartHelper.java ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryWorker.java Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java?rev=731858&r1=731857&r2=731858&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java Mon Jan 5 23:44:59 2009 @@ -778,7 +778,7 @@ Iterator cpi = currentPayments.iterator(); while (cpi.hasNext()) { GenericValue payment = (GenericValue) cpi.next(); - BigDecimal notApplied = PaymentWorker.getPaymentNotAppliedBd(payment); + BigDecimal notApplied = PaymentWorker.getPaymentNotApplied(payment); if (notApplied.signum() > 0) { Map appl = new HashMap(); appl.put("paymentId", payment.get("paymentId")); 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=731858&r1=731857&r2=731858&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 Jan 5 23:44:59 2009 @@ -713,8 +713,8 @@ } } else if (parameterName.startsWith("amount")) { if (item != null && quantString.length() > 0) { - double amount = nf.parse(quantString).doubleValue(); - if (amount <= 0 ) { + BigDecimal amount = new BigDecimal(quantString); + if (amount.compareTo(BigDecimal.ZERO) <= 0) { String errMsg = UtilProperties.getMessage(resource, "cart.amount_not_positive_number", this.cart.getLocale()); errorMsgs.add(errMsg); result = ServiceUtil.returnError(errorMsgs); Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryWorker.java?rev=731858&r1=731857&r2=731858&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryWorker.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/product/inventory/InventoryWorker.java Mon Jan 5 23:44:59 2009 @@ -105,7 +105,7 @@ * @param delegator The delegator to use * @return Map of productIds to quantities outstanding. */ - public static Map<String, Double> getOutstandingProductQuantities(Collection<String> productIds, String orderTypeId, GenericDelegator delegator) { + public static Map<String, BigDecimal> getOutstandingProductQuantities(Collection<String> productIds, String orderTypeId, GenericDelegator delegator) { Set<String> fieldsToSelect = UtilMisc.toSet("productId", "quantityOpen"); List<EntityCondition> condList = UtilMisc.<EntityCondition>toList( EntityCondition.makeCondition("orderTypeId", EntityOperator.EQUALS, orderTypeId), @@ -121,7 +121,7 @@ condList.add(EntityCondition.makeCondition("orderItemStatusId", EntityOperator.NOT_EQUAL, "ITEM_CANCELLED")); EntityConditionList conditions = EntityCondition.makeCondition(condList, EntityOperator.AND); - Map<String, Double> results = FastMap.newInstance(); + Map<String, BigDecimal> results = FastMap.newInstance(); try { List<GenericValue> orderedProducts = delegator.findList("OrderItemQuantityReportGroupByProduct", conditions, fieldsToSelect, null, null, false); for (GenericValue value: orderedProducts) { @@ -134,12 +134,12 @@ } /** As above, but for sales orders */ - public static Map<String, Double> getOutstandingProductQuantitiesForSalesOrders(Collection<String> productIds, GenericDelegator delegator) { + public static Map<String, BigDecimal> getOutstandingProductQuantitiesForSalesOrders(Collection<String> productIds, GenericDelegator delegator) { return getOutstandingProductQuantities(productIds, "SALES_ORDER", delegator); } - /** As above, but for purhcase orders */ - public static Map<String, Double> getOutstandingProductQuantitiesForPurchaseOrders(Collection<String> productIds, GenericDelegator delegator) { + /** As above, but for purchase orders */ + public static Map<String, BigDecimal> getOutstandingProductQuantitiesForPurchaseOrders(Collection<String> productIds, GenericDelegator delegator) { return getOutstandingProductQuantities(productIds, "PURCHASE_ORDER", delegator); } } |
Free forum by Nabble | Edit this page |