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 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 |
[ https://issues.apache.org/jira/browse/OFBIZ-4257?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gaudin Pierre updated OFBIZ-4257: --------------------------------- Attachment: OFBIZ-4257_add_a_parameter_to_forbid_order_decimal_quantity.patch > 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 > 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 |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4257?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacques Le Roux closed OFBIZ-4257. ---------------------------------- Resolution: Fixed Assignee: Jacques Le Roux Thanks Pierre, Your patch is in trunk at r1094121 Very good description: appreciated > 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 |
In reply to this post by Nicolas Malin (Jira)
[ 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 |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4257?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gaudin Pierre reopened OFBIZ-4257: ---------------------------------- There is an issue on Purchase order because when you try do add a quantity more than one because cart.getProductStoreId() return a null value... Is that normal that cart.getProductStoreId() is null for PO ? Thanks 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 |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13025698#comment-13025698 ] Jacques Le Roux commented on OFBIZ-4257: ---------------------------------------- Hi Pierre, Did you test the same with R10.04 or even R9.04 demo ? (to see if it's not a regression) > 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 |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13025703#comment-13025703 ] Gaudin Pierre commented on OFBIZ-4257: -------------------------------------- No I didn't try but i will. But can we imagine an order without productStore ?? i don't think so. 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 |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13025714#comment-13025714 ] Gaudin Pierre commented on OFBIZ-4257: -------------------------------------- OK i just try to create PO on demo Trunck and demo 9.04 OrderHeader.productStoreId is empty on Trunck OrderHeader.productStoreId is NOT empty on 9.04 So i will create a new JIRA on this regression and close this one if you agree with me. 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 |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13025718#comment-13025718 ] Jacques Le Roux commented on OFBIZ-4257: ---------------------------------------- This has been [recently discussed on user ML|http://markmail.org/message/ew4rpf4ulbg3u3oi]. In Opentaps they created a dummy Product Store for that, but I tend to agree with Paul... > 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 |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13025728#comment-13025728 ] Jacques Le Roux commented on OFBIZ-4257: ---------------------------------------- Pierre, Interesting, our comments crossed on wire. So it was working in R9.04, yes we need to investigate at least. I agree a Jira for that is welcome... > 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 |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4257?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gaudin Pierre resolved OFBIZ-4257. ---------------------------------- Resolution: Fixed > 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 |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4257?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gaudin Pierre reopened OFBIZ-4257: ---------------------------------- I finaly reopen this JIRA and add a patch to fix NPE 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 |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13026943#comment-13026943 ] Gaudin Pierre edited comment on OFBIZ-4257 at 4/29/11 11:59 AM: ---------------------------------------------------------------- I finaly reopen this JIRA and add a patch to fix NPE when shopping cart have no productStoreId Pierre was (Author: gpierre): I finaly reopen this JIRA and add a patch to fix NPE 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 |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4257?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gaudin Pierre updated OFBIZ-4257: --------------------------------- Attachment: OFBIZ-4257_add_a_parameter_to_forbid_order_decimal_quantity_v2.patch > 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, OFBIZ-4257_add_a_parameter_to_forbid_order_decimal_quantity_v2.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 |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4257?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacques Le Roux closed OFBIZ-4257. ---------------------------------- Resolution: Fixed Thanks Pierre, Your patch is in trunk at r1097799 > 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, OFBIZ-4257_add_a_parameter_to_forbid_order_decimal_quantity_v2.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 |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13026966#comment-13026966 ] Gaudin Pierre commented on OFBIZ-4257: -------------------------------------- Thank you Jacques > 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, OFBIZ-4257_add_a_parameter_to_forbid_order_decimal_quantity_v2.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 |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13027004#comment-13027004 ] Erwan de FERRIERES commented on OFBIZ-4257: ------------------------------------------- Hi Pierre, could you secure your modifications with unit tests ? TIA > 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, OFBIZ-4257_add_a_parameter_to_forbid_order_decimal_quantity_v2.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 |
Free forum by Nabble | Edit this page |