[ 
https://issues.apache.org/jira/browse/OFBIZ-12649?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nicolas Malin updated OFBIZ-12649:
----------------------------------
    Affects Version/s:     (was: 18.12.06)

> Function ProductWorker.shippingApplies failed if chargeShipping is empty
> ------------------------------------------------------------------------
>
>                 Key: OFBIZ-12649
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-12649
>             Project: OFBiz
>          Issue Type: Bug
>          Components: product
>    Affects Versions: 22.01.01
>            Reporter: Nicolas Malin
>            Assignee: Nicolas Malin
>            Priority: Trivial
>
> When you compute the estimated shipping cost, you compute the quantity of 
> product to ship.
> This use the ProductWorker.shippingApplies for each product to know if it 
> need to be ship or not.
> On this function the code 
>  
> {code:java}
> Boolean chargeShipping = product.getBoolean("chargeShipping");
> if (chargeShipping == null) {
>     return true;
> }
> return chargeShipping;
> {code}
> is wrong if the field chargeShipping is empty on a product.
> The reason is simple, GenericValue.getBoolean return false if the field is 
> empty
> GenericEntity.java:738
>  
> {code:java}
>     public Boolean getBoolean(String name) {
>         Object obj = get(name);
>         if (obj == null) {
>             return false;
>         }
> {code}
> So in this case the function ProductWorker.shippingApplies return always 
> false instead true.
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to