Hi Ashish

Thanks for taking another look at this, I haven't tried it but you
could try making the code look like this:
percentMarkup = ((retailPrice - costPrice)/costPrice)*100;
percentMarkup = Double.NaN != percentMarkup ? percentMarkup : "";

Regards
Scott

2008/8/5  <[EMAIL PROTECTED]>:
> Author: ashish
> Date: Tue Aug  5 04:02:08 2008
> New Revision: 682667
>
> URL: http://svn.apache.org/viewvc?rev=682667&view=rev
> Log:
> As per Scott Gray comment on my previous commit on JIRA issue OFBIZ-1905.
> Thanks Scott for your valuable comment.
> Scott, Please let us know your thoughts on this whenever you get a chance.
>
> Modified:
>    
> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/OpenOrderItemsReport.groovy
>
> Modified: 
> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/OpenOrderItemsReport.groovy
> URL: 
> http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/OpenOrderItemsReport.groovy?rev=682667&r1=682666&r2=682667&view=diff
> ==============================================================================
> --- 
> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/OpenOrderItemsReport.groovy
>  (original)
> +++ 
> ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/OpenOrderItemsReport.groovy
>  Tue Aug  5 04:02:08 2008
> @@ -121,7 +121,13 @@
>     totalRetailPrice += retailPrice;
>     totalCostPrice += costPrice;
>     totalquantityOrdered += quantityOrdered;
> -    totalquantityOpen += quantityOpen;
> +    totalquantityOpen += quantityOpen;
> +    costPriceDividendValue = costPrice;
> +    if(costPriceDividendValue){
> +        percentMarkup = ((retailPrice - costPrice)/costPrice)*100;
> +    }else{
> +        percentMarkup = "";
> +    }
>     orderItemMap = [orderDate : orderDate,
>                     orderId : orderId,
>                     productId : productId,
> @@ -136,13 +142,19 @@
>                     listPrice : listPrice,
>                     discount : listPrice - retailPrice,
>                     calculatedMarkup : retailPrice - costPrice,
> -                    percentMarkup : ((retailPrice - 
> costPrice)/costPrice?:1)*100];
> +                    percentMarkup : percentMarkup];
>     orderItemList.add(orderItemMap);
>  }
>
>  listIt.close();
>  totalAmountList = [];
>  if (orderItemList) {
> +    totalCostPriceDividendValue = totalCostPrice;
> +    if(totalCostPriceDividendValue){
> +        totalPercentMarkup = ((totalRetailPrice - 
> totalCostPrice)/totalCostPrice)*100 ;
> +    }else{
> +        totalPercentMarkup = "";
> +    }
>     totalAmountMap = [totalCostPrice : totalCostPrice,
>                       totalListPrice : totalListPrice,
>                       totalRetailPrice : totalRetailPrice,
> @@ -151,7 +163,7 @@
>                       totalquantityOpen : totalquantityOpen,
>                       totalDiscount : totalListPrice - totalRetailPrice,
>                       totalMarkup : totalRetailPrice - totalCostPrice,
> -                      totalPercentMarkup : ((totalRetailPrice - 
> totalCostPrice)/totalCostPrice)*100];
> +                      totalPercentMarkup : totalPercentMarkup];
>     totalAmountList.add(totalAmountMap);
>  }
>  context.orderItemList = orderItemList;
>
>
>

Reply via email to