Re: svn commit: r682667 - /ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/OpenOrderItemsReport.groovy

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r682667 - /ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/OpenOrderItemsReport.groovy

Scott Gray
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  <[hidden email]>:

> 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 | Threaded
Open this post in threaded view
|

Re: svn commit: r682667 - /ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/reports/OpenOrderItemsReport.groovy

Ashish Vijaywargiya
Scott,

Thanks once again for looking at this and giving a helpful comment.
I tried changes suggested by you.

Although instead of showing "blank" it is showing "infinity".
Please let me know what to do next.


On Tue, Aug 5, 2008 at 5:24 PM, Scott Gray <[hidden email]> wrote:

> 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  <[hidden email]>:
> > 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;
> >
> >
> >
>



--
Ashish Vijaywargiya
Indore (M.P), India
http://en.wikipedia.org/wiki/Indore