Hi Ean,

You may find those threads interesting (using view threaded):

http://www.nabble.com/Users---Decimal-quantity-on-orders-tf1448709.html#a4029250
http://www.nabble.com/Users---Units-of-measure-for-quantities-in-sales-purchase-manufacturing-orders-and-for-inventory-tf941809.html#a2472113

Jacques


----- Original Message ----- 
From: "Ean Schuessler" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, December 22, 2006 3:54 AM
Subject: Fractional quantities?


> Ok, I'm probably missing something really basic here... but... are fractional
> quantities supported? The database is all double, the interfaces on
> ShoppingCart are all double but the ShoppingCart itself just sort of quietly
> casts the double to an int. Whazzap with that?
>
> I commented it out and used some fractional quantities and that all seems cool
> enough. Am I about to descend into some hell of double arithmetic rounding
> errors? The prices are all BigDecimal, right? The Price Is Right, right?!?
>
> A short diff for your amusement:
>
> Index:
> applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java
> ===================================================================
> --- applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java
> (revision 462)
> +++ applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java
> (working copy)
> @@ -673,11 +673,6 @@
>          this.setQuantity(quantity, dispatcher, cart, triggerExternalOps,
> true);
>      }
>
> -    /** Sets the quantity for the item and validates the change in quantity,
> etc */
> -    public void setQuantity(double quantity, LocalDispatcher dispatcher,
> ShoppingCart cart, boolean triggerExternalOps, boolean resetShipGroup) throws
> CartItemModifyException {
> -        this.setQuantity((int) quantity, dispatcher, cart,
> triggerExternalOps, resetShipGroup);
> -    }
> -
>      /** returns "OK" when the product can be booked or returns a string with
> the dates the related fixed Asset is not available */
>      public static String checkAvailability(String productId, double quantity,
> Timestamp reservStart, double reservLength, ShoppingCart cart) {
>          GenericDelegator delegator = cart.getDelegator();
> @@ -767,7 +762,7 @@
>              return "I am sorry, not available at these dates: " +
> resultMessage + "item not added to the shopping cart.....";
>      }
>
> -    protected void setQuantity(int quantity, LocalDispatcher dispatcher,
> ShoppingCart cart, boolean triggerExternalOps, boolean resetShipGroup) throws
> CartItemModifyException {
> +    protected void setQuantity(double quantity, LocalDispatcher dispatcher,
> ShoppingCart cart, boolean triggerExternalOps, boolean resetShipGroup) throws
> CartItemModifyException {
>          if (this.quantity == quantity) {
>              return;
>          }
>
> -- 
> Ean Schuessler, CTO
> [EMAIL PROTECTED]
> 214-720-0700 x 315
> Brainfood, Inc.
> http://www.brainfood.com

Reply via email to