Sales Reports filtered by product are incorrect

  • Posts: 121
  • Thank you received: 7
11 years 6 months ago #73833

Every month, I need to tally up the number of each product sold, as well as the total revenue for each product. This is because I work with other companies and need to calculate their royalties for each sale.

I've tried to use Hikashop's reporting for this and its very frustrating. First, there is a limitation of 50 items which to me makes no sense. I don't care about displaying the report on the dashboard - so I don't see why there should be a limit for reports not published on the dashboard.

Secondly, the bug is related to the way Hikashop calculates sales for a given product.

Say I use a monthly graph to sort gross sales $ by day. And I filter it to a single product. What happens is that it reports the total money brought in by the entire order the product was purchased in. This cannot be correct behaviour.

For instance, say I had two sales of a $69 product on October 23rd. So the total sales for that product for that day should be listed as $138. However, one of the orders included a second unrelated product for $70. So Hikashop reports the total sales as $208 instead of $138.

I literally can't do accounting every month unless I figure this out somehow. Please help!

Please Log in or Create an account to join the conversation.

  • Posts: 81590
  • Thank you received: 13079
  • MODERATOR
11 years 5 months ago #74094

Hi,

In the options of the report, you will find a "limit" option where you can configure how main elements will be displayed.
If you have a limitation of 50 elements, it's probably because you have 50 in that option.
Otherwise, please do a screenshot of your report option screen.

For your second problem could you change the file administrator/components/com_hikashop/classes/widget.php with the one in the archive attached and see if that helps ? If not, please provide a screenshot of the options of your report.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 121
  • Thank you received: 7
11 years 5 months ago #74342

Hi Nicolas,

I have a value of '50' in the limit field already. If I set it any higher, I get an error and this popup dialog that's attached below. So it is not possible to use values higher than 50 as far as I can tell for the limit field. As I said, I don't want to publish this to the dashboard, so its not really relevant if that will break it or not.

I uploaded the new php file and overwrote the old one but it made no difference - incorrect results are still being output. As I said, it seems Hikashop is using the whole orders $ value to calculate gross sales numbers, rather than the individual products (as filtering by product should do).

I've attached my options screenshots as well. Thanks for looking into it.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 121
  • Thank you received: 7
11 years 5 months ago #74343

A few of the options at the top of the screenshot were cut off. Those are:
Display type: Column (though the bug happens with any type)
Date type: created
Group item: days

Please Log in or Create an account to join the conversation.

  • Posts: 81590
  • Thank you received: 13079
  • MODERATOR
11 years 5 months ago #74900

Thank you for the information. The developer in charge of the reports will review that tomorrow and answer you.

Please Log in or Create an account to join the conversation.

  • Posts: 2334
  • Thank you received: 403
11 years 5 months ago #74995

Hi there,

First of all about the limit we just put this message to avoid any problem with the dashboard but you just have let the field blank or set the limit to 0 to avoid this problem.
About your second thing there was indeed a bug, here is a new version of the widget.php file. You have to put it in administrator/component/com_hikashop/class

Let me know if you have any problem :)


File Attachment:

File Name: widget_2012-11-08.zip
File Size:12 KB

Attachments:
Last edit: 11 years 5 months ago by nicolas.

Please Log in or Create an account to join the conversation.

  • Posts: 121
  • Thank you received: 7
11 years 5 months ago #75092

Hi eliot,

Thanks for the update and info. You were right about the limiting - so user error there :)

And with the updated widget.php installed, that fixes the other problem mostly... But there is still an important issue. Now the actual product sales (instead of total order sales) are taken into account when filtering by product - BUT not the actual sales price. For instance, today I sold a product that retails for $59, but it sold for $52.05 because the customer used a coupon. But when I create a report for today's sales of that product, it returns a sales $ value of $59.

That's obviously a big problem if I'm calculating a product's gross sales $ over a month if it does not take discounts into account - since I pay 50% of the gross sales to an associate. The number isn't accurate and thus I'd be seriously overpaying the associate!

Please Log in or Create an account to join the conversation.

  • Posts: 81590
  • Thank you received: 13079
  • MODERATOR
11 years 5 months ago #75099

I see what you're saying but coupons are added to the order in global, and there is no information in the order to know why that coupon was added to the order (because product A was in it ? Because product A and B were in it ? Because 2 products of category C were in it ? Or maybe the coupon was not added because of the products in the order but because the total amount reached a certain limit...), and what amount of the coupon would be for what product in the order.
So I don't see how it would even be possible to take coupons into account for product sales statistics.

Please Log in or Create an account to join the conversation.

  • Posts: 121
  • Thank you received: 7
11 years 5 months ago #75104

Hi Nicolas,

I understand - I never thought of that!

What would you suggest in order to get the actual gross sales $ of a given product? The only way I can think of is to go through it order by order...

Please Log in or Create an account to join the conversation.

  • Posts: 121
  • Thank you received: 7
11 years 5 months ago #75105

I generally never create coupons that are more complex than a discount on a single product. Would it be possible to have the reports include just the coupons that apply to single products in their respective products' sales numbers? I just checked and that is the way that my previous reporting system worked (through e-junkie.com). If the coupons have more complex qualifications than that, then they could be ignored.

Please Log in or Create an account to join the conversation.

  • Posts: 81590
  • Thank you received: 13079
  • MODERATOR
11 years 5 months ago #75389

Well, it's always possible with a hack in hikaShop but we can't add a half done feature like that by default.

I'm not the developer behind the reporting system so I can't guarantee it but you can try to change the line:
$selectAdd='(prod.order_product_price+prod.order_product_tax)*prod.order_product_quantity';

to:

$selectAdd='(prod.order_product_price+prod.order_product_tax)*prod.order_product_quantity*(100-disc.discount_percent_amount)/100';
$leftjoin = ' LEFT JOIN '.hikashop_table('discount').' AS disc ON prod.product_id = disc.discount_product_id ';

in the widget.php that you already updated.

Please Log in or Create an account to join the conversation.

  • Posts: 121
  • Thank you received: 7
11 years 5 months ago #75419

Thanks Nicolas. I'll try that. I understand, its half-done... How about this though as a more complete solution?

1. Single product coupons are reported as linked to that products sales $.
2. All other types of coupons are reported as divided up between the order products. So if there are 4 products in an order all worth $50, and a $10 discount coupon is used that isn't linked to a single product, then the value of the products is each reduced by $2.50 in the reports?

For instance, AUP coupons are obviously applied to the entire order, so it makes sense to calculate that discount as averaged across all the orders products.

Please Log in or Create an account to join the conversation.

  • Posts: 81590
  • Thank you received: 13079
  • MODERATOR
11 years 5 months ago #75448

We won't do it. First, it's still doesn't take into account some cases, and there are already lot of options in the reports.
We'll see, but I don't see much need for that anyway.
You just have to change a bit the code as I explained.

Please Log in or Create an account to join the conversation.

  • Posts: 3
  • Thank you received: 0
11 years 5 months ago #75487

Is it possible to add product or Sale Qty's to these reports as well as total Value ?

Please Log in or Create an account to join the conversation.

  • Posts: 2334
  • Thank you received: 403
11 years 5 months ago #75816

Hi SB,

Could you more precise about what you want to add and to which report?

Please Log in or Create an account to join the conversation.

  • Posts: 3
  • Thank you received: 0
11 years 5 months ago #75882

The sales reports (listings or tables) show the Value of products sold for a particular, week, month, period.

I would like to see the quantity of each product sold.

SB

Please Log in or Create an account to join the conversation.

  • Posts: 2334
  • Thank you received: 403
11 years 5 months ago #76088

Try with the type "orders" instead of "sales", it should do what you want :)

Please Log in or Create an account to join the conversation.

  • Posts: 121
  • Thank you received: 7
11 years 5 months ago #76237

Hi Nicolas,

I just tried that and got this warning when opening the dashboard

Warning: implode() [function.implode]: Invalid arguments passed in /home/floyd/public_html/new-nucleus-soundlab/administrator/components/com_hikashop/classes/widget.php on line 1126

Warning: Invalid argument supplied for foreach() in /home/floyd/public_html/new-nucleus-soundlab/administrator/components/com_hikashop/classes/widget.php on line 1257

nicolas wrote: Well, it's always possible with a hack in hikaShop but we can't add a half done feature like that by default.

I'm not the developer behind the reporting system so I can't guarantee it but you can try to change the line:
$selectAdd='(prod.order_product_price+prod.order_product_tax)*prod.order_product_quantity';

to:

$selectAdd='(prod.order_product_price+prod.order_product_tax)*prod.order_product_quantity*(100-disc.discount_percent_amount)/100';
$leftjoin = ' LEFT JOIN '.hikashop_table('discount').' AS disc ON prod.product_id = disc.discount_product_id ';

in the widget.php that you already updated.

Please Log in or Create an account to join the conversation.

  • Posts: 3
  • Thank you received: 0
11 years 5 months ago #76508

eliot wrote: Try with the type "orders" instead of "sales", it should do what you want :)


Thanks for that. I can now see Qtys in the summary reports.

Unfortunately it looks like the Qty's are being multiplied by themselves (squared).

A qty of 1 is OK as 1*1=1 but anyhting more than 1 gives incorrect results in the summary.

Qtys of 1,2,2 & 2 gives a total of 13 :S

Please Log in or Create an account to join the conversation.

  • Posts: 2334
  • Thank you received: 403
11 years 5 months ago #76606

Do you have the last version of Hikashop?
Try to update and if it doesn't solve the problem PM an access to your backend :)

Please Log in or Create an account to join the conversation.

Time to create page: 0.093 seconds
Powered by Kunena Forum