[ https://issues.apache.org/jira/browse/OFBIZ-4257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13020858#comment-13020858 ]
Gaudin Pierre commented on OFBIZ-4257: -------------------------------------- Thank you Jacques for the quick commite !! Pierre > add a parameter to forbid order decimal quantity > ------------------------------------------------ > > Key: OFBIZ-4257 > URL: https://issues.apache.org/jira/browse/OFBIZ-4257 > Project: OFBiz > Issue Type: Improvement > Components: order, specialpurpose/ecommerce > Affects Versions: SVN trunk > Reporter: Gaudin Pierre > Assignee: Jacques Le Roux > Fix For: SVN trunk > > Attachments: > OFBIZ-4257_add_a_parameter_to_forbid_order_decimal_quantity.patch > > > 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 -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira