Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-4257

add a parameter to forbid order decimal quantity

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Trunk
    • Trunk
    • ecommerce, order
    • None

    Description

      This is a patch to add a parameter to forbid order decimal quantity

      Behavior before the patch :

      • you can add decimal quantity on shopping cart item (front office and back office) even if the product is a unit
      • there is no rounding on quantity on shopping cart item thus you get amount with a large number of decimal
      • reorder widget display quantity to reorder with a large number of decimal

      What does this patch :

      • a new field "orderDecimalQuantity" is added into ProducStore entity. The value of this field can be set from EditProducStore form (into shopping cart section). Value can be "Y", "N" or empty.
      • a new field "orderDecimalQuantity" is added into Product entity. The value of this field can be set from EditProduc form (into shopping cart section). Value can be "Y", "N" or empty.
      • a new method "isDecimalQuantityOrderAllowed" have been add into productWorker class. This method test if order decimal quantity is allow for a product and a productStore. Product is superior on producStore. Here is the table of value :
      • ProductStore.orderDecimalQuantity = "Y" && Product.orderDecimalQuantity = "Y" => return True
      • ProductStore.orderDecimalQuantity = "N" && Product.orderDecimalQuantity = "Y" => return True
      • ProductStore.orderDecimalQuantity = empty && Product.orderDecimalQuantity = "Y" => return True
      • ProductStore.orderDecimalQuantity = "Y" && Product.orderDecimalQuantity = "N" => return False
      • ProductStore.orderDecimalQuantity = "N" && Product.orderDecimalQuantity = "N" => return False
      • ProductStore.orderDecimalQuantity = empty && Product.orderDecimalQuantity = "N" => return False
      • ProductStore.orderDecimalQuantity = "Y" && Product.orderDecimalQuantity = empty => return True
      • ProductStore.orderDecimalQuantity = "N" && Product.orderDecimalQuantity = empty => return False
      • ProductStore.orderDecimalQuantity = empty && Product.orderDecimalQuantity = empty => return True
      • addToCat and modifyCart car method have been modify to call isDecimalQuantityOrderAllowed. If result is true then quantity is rounding with order config value. If result is false then quantity is rounding to 0. No message is return.
      • to fix reorder quantity, then getQuickReorderProducts method have been modify to call isDecimalQuantityOrderAllowed. If result is true then quantity is rounding with order config value. If result is false then quantity is rounding to 0.

      What the result :

      • You can forbid or accept to manage order decimal quantity for all product
      • You can forbid or accept to manage order decimal quantity for one product
      • Decimal quantity are now rounded with order config value.
      • reorder quantity is rounded with order config value or rounding to 0

      Attachments

        Issue Links

          Activity

            People

              jleroux Jacques Le Roux
              gpierre Gaudin Pierre
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: