Forums / All Other Contributions/Addons / Stock vs. Sales Report Thread

Stock vs. Sales Report Thread

Results 1 to 18 of 18
18 Mar 2012, 13:24
#1
ts232 avatar

ts232

Zen Follower

Join Date:
May 2006
Posts:
167
Plugin Contributions:
0

Stock vs. Sales Report Thread

I am happy to give back to the ZC community with this report that I have found very useful for managing my own store. :clap:

https://www.zen-cart.com/downloads.php?do=file&id=1371

Stock vs. Sales Report
--------------------------

- For each product sold in a given period (specified in the stats_stock.php file), determines total sales for the product, current stock level, and how many days until the product is projected to be out of stock.

- This is very useful for catalogs where the rate of sales between different products varies significantly. For a low selling item you might be fine having only 3 items in stock compared to a high selling item that you need 100 in stock.

- If the product is projected to be out of stock within a number of days that you specify, it highlights the product and shows you an estimate of how many units need to be reordered to remove the alert status.

- Sort by stock projection, current stock, or current sales.

- This contribution tested and working on my Zen-Carts 1.3.9.h. & 1.5.0. I hope it helps you keep track of stock ordering issues as much as it helps me!
12 Apr 2012, 02:04
#2
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: Stock vs. Sales Report Thread

Hi! Thanks for putting this together for everyone!! One question, does this take attributes into account? If not, do you think it can be added without too much reworking of the code?
13 Apr 2012, 14:19
#3
ts232 avatar

ts232

Zen Follower

Join Date:
May 2006
Posts:
167
Plugin Contributions:
0

Re: Stock vs. Sales Report Thread

lankeeyankee:

Hi! Thanks for putting this together for everyone!! One question, does this take attributes into account? If not, do you think it can be added without too much reworking of the code?


That's definitely something that I want to do. I am planning to install the stock by attributes contribution to my 1.3.9h cart soon, and would like the report to work with that.

In the mean time, as a halfway measure, it might be useful to at least break down the sales figures by attributes.
17 Apr 2012, 05:30
#4
ozetrade avatar

ozetrade

Zen Follower

Join Date:
Dec 2004
Posts:
171
Plugin Contributions:
0

Re: Stock vs. Sales Report Thread

Hi. I've just installed this mod but I've got a problem - I get an error - I believe it has to do with the fact that I'm supposed to edit the stats_stock.php file. Problem is your instructions aren't clear on how to edit this file.

I'm getting the following error:
Error!

Unable to determine the page link!

Function used:

zen_href_link('', '&product_type=&cPath=&pID=&action=new_product', 'NONSSL')


Can you provide an example of what needs to changed in the stats_stock.php file.

Thanks.
17 Apr 2012, 14:45
#5
ts232 avatar

ts232

Zen Follower

Join Date:
May 2006
Posts:
167
Plugin Contributions:
0

Re: Stock vs. Sales Report Thread

ozetrade:

Hi. I've just installed this mod but I've got a problem - I get an error - I believe it has to do with the fact that I'm supposed to edit the stats_stock.php file. Problem is your instructions aren't clear on how to edit this file.

I'm getting the following error:


Can you provide an example of what needs to changed in the stats_stock.php file.

Thanks.


The defaults should work fine in the php file. No edits required. What version of ZC are you running?

Just saw your signature, that all sites are running 1.3.9h, which is the same as mine. There must be something different between our installs: are you running any SEO or URL rewrites? Perhaps you have something other than the standard product categories?
10 May 2012, 03:29
#6
mrrocketman avatar

mrrocketman

New Zenner

Join Date:
May 2012
Posts:
1
Plugin Contributions:
0

Re: Stock vs. Sales Report Thread

ozetrade:

Hi. I've just installed this mod but I've got a problem - I get an error - I believe it has to do with the fact that I'm supposed to edit the stats_stock.php file. Problem is your instructions aren't clear on how to edit this file.

I'm getting the following error:


Can you provide an example of what needs to changed in the stats_stock.php file.

Thanks.


Hmm, anybody ever figure this one out? Just did a clean install of zen-cart 1.5. Added a new product category and a product to test everything and I’m getting the above error as well.
14 Oct 2012, 20:43
#7
ts232 avatar

ts232

Zen Follower

Join Date:
May 2006
Posts:
167
Plugin Contributions:
0

Re: Stock vs. Sales Report Thread

lankeeyankee:

Hi! Thanks for putting this together for everyone!! One question, does this take attributes into account? If not, do you think it can be added without too much reworking of the code?


Version 2.0 now has partial support for stock with attributes. I am doing a new version that provides fuller support.
14 Oct 2012, 20:45
#8
ts232 avatar

ts232

Zen Follower

Join Date:
May 2006
Posts:
167
Plugin Contributions:
0

Re: Stock vs. Sales Report Thread

mrrocketman:

Hmm, anybody ever figure this one out? Just did a clean install of zen-cart 1.5. Added a new product category and a product to test everything and I’m getting the above error as well.


Does the error occur when loading the initial report page, or when trying to click on one of the product links?

I am working on a new feature version and would like to correct this error, but I am not seeing any of these errors on my cart. An example of the product links generated by the report is:

http://<DOMAIN>/<ADMIN>/product.php?&product_type=1&cPath=6_282_779&pID=106&action=new_product

Are all of the problems happening in 1.5? Anyone having problems in 1.3.x?
01 Dec 2012, 10:14
#9
macbos avatar

macbos

New Zenner

Join Date:
Jul 2006
Posts:
27
Plugin Contributions:
0

Re: Stock vs. Sales Report Thread

Anyone having problems in 1.3.x?

Getting this error

1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND zo.date_purchased > DATE_ADD(CURRENT_DATE(), INTERVAL -365 DAY) GROUP BY w' at line 9
in:
[SELECT COUNT(*) as total_orders, SUM(op.products_quantity) AS total_units, CONCAT('[ ', opa.products_options, ': ', opa.products_options_values,' ]') AS products_options_values_pair, SUBSTRING(opa.products_options_values, 1, 999) AS width FROM orders_products_attributes opa INNER JOIN orders_products op USING(orders_products_id) INNER JOIN orders zo ON zo.orders_id = op.orders_id WHERE products_options_values LIKE '%%' AND products_id = AND zo.date_purchased > DATE_ADD(CURRENT_DATE(), INTERVAL -365 DAY) GROUP BY width ORDER BY total_orders DESC;]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.


Any idea ?

Tnx
14 Mar 2013, 06:10
#10
petsupplies4u avatar

petsupplies4u

New Zenner

Join Date:
Feb 2013
Posts:
3
Plugin Contributions:
0

Re: Stock vs. Sales Report Thread

Hello Everyone,

Just wondering if anyone has seen the following error: "WARNING: An Error occurred, please refresh the page and try again."

I've installed the latest Sales vs Stock Plugin on a fresh 1.5.1 Zen Cart build.

I've had the same error on the test & live sight.

Cheers
07 Sep 2013, 05:22
#11
ashely avatar

ashely

New Zenner

Join Date:
Apr 2010
Posts:
43
Plugin Contributions:
0

Re: Stock vs. Sales Report Thread

petsupplies4u:

Hello Everyone,

Just wondering if anyone has seen the following error: "WARNING: An Error occurred, please refresh the page and try again."

I've installed the latest Sales vs Stock Plugin on a fresh 1.5.1 Zen Cart build.

I've had the same error on the test & live sight.

Cheers


I'm having this problem too. Any solution yet?

Also, considering we have over 50,000 products online, can we have an export option in this module?

Many thanks,
Ashely
07 Sep 2013, 12:26
#12
ts232 avatar

ts232

Zen Follower

Join Date:
May 2006
Posts:
167
Plugin Contributions:
0

Re: Stock vs. Sales Report Thread

Ashely:

I'm having this problem too. Any solution yet?

Also, considering we have over 50,000 products online, can we have an export option in this module?

Many thanks,
Ashely


Do you have the stock with attributes plugin also installed?
02 Oct 2013, 04:09
#13
bobbibop avatar

bobbibop

New Zenner

Join Date:
Jul 2004
Posts:
53
Plugin Contributions:
0

Re: Stock vs. Sales Report Thread

I just installed this Mod. I have Zen v 1.5.0.

When I execute stats_stock.php, I receive the same error -

"WARNING: An Error occurred, please refresh the page and try again."

Only one item appears in the results. We have 500 products, no Attributes to worry about.

There is no indication what the error is. There is no apparent log to check.

What could the error be and how do I fix it?

Regards,
John L
04 Oct 2013, 01:53
#14
ashely avatar

ashely

New Zenner

Join Date:
Apr 2010
Posts:
43
Plugin Contributions:
0

Re: Stock vs. Sales Report Thread

ts232:

Do you have the stock with attributes plugin also installed?

No, I don't have the stock with attributes plugin installed. I also only have one item showing up on the screen.

Thanks,
Ashely
03 Sep 2014, 21:54
#15
ts232 avatar

ts232

Zen Follower

Join Date:
May 2006
Posts:
167
Plugin Contributions:
0

Re: Stock vs. Sales Report Thread

Hi Folks. I have finally gotten around to upgrading my site from 1.3.9h to 1.5.3 and am able to reproduce some of the problems that you have been having on 1.5.x installs.

Unfortunately, there does not quite yet seem to be a reliable Stock by Attributes solution for 1.5.3. When there is one, I will likely update this report to work with it. In the mean time, I will take a look at creating a simplified version of this report that will at least report the sales by attribute, even if it is not able to track the actual stock counts. Until then, this report will *only* work on sites that have the Stock with Attributes plug-in installed.
25 Feb 2015, 03:56
#16
ts232 avatar

ts232

Zen Follower

Join Date:
May 2006
Posts:
167
Plugin Contributions:
0

Re: Stock vs. Sales Report Thread

ts232:

Unfortunately, there does not quite yet seem to be a reliable Stock by Attributes solution for 1.5.3. When there is one, I will likely update this report to work with it. In the mean time, I will take a look at creating a simplified version of this report that will at least report the sales by attribute, even if it is not able to track the actual stock counts. Until then, this report will *only* work on sites that have the Stock with Attributes plug-in installed.


So I got tired of waiting for a non-beta version of stock by attributes to be released, and rewrote this report to work with the commercial Products Options Stock Manager (http://vinosdefrutastropicales.com/index.php?main_page=product_info&cPath=2_7&products_id=46), which is what I am now using for my stock by attributes needs. If you do not have this plugin installed the report should still work, but it will not break down sales and stock by attributes.

I have submitted the new version to the moderators and will let you know here when it is approved.
23 Sep 2015, 02:48
#17
patclay avatar

patclay

New Zenner

Join Date:
Dec 2008
Posts:
88
Plugin Contributions:
0

Re: Stock vs. Sales Report Thread

Hi TS232

I want to say thanks for a great mod. I use it as the base for all of my ordering. I can't understand why it is not included in ZC by default.

Of course it was as good as it could be :D, so I added a couple of things:
1/ A dropdown so I could run the report by category
2/ Added the sales value so I can get a better look at where the $ are coming from
3/ Tidied the currency formatting

The changes were pretty minor, so if you think that they would be useful additions to others, I can fire them over to you (LMK how is best)

I also have a report mod in the approval process I used your format/methods as the basis for - just a report which shows all inactive products - I suspected I would catch a couple of products which shouldn't have been inactive. I was right, so I thought it would be a useful report for others.

Cheers & thanks for your contribution.

Pat
30 Aug 2016, 01:35
#18
carmen avatar

carmen

New Zenner

Join Date:
Aug 2016
Posts:
3
Plugin Contributions:
0

Re: Stock vs. Sales Report Thread

Hello All!

I downloaded and implemented this addon; "Sales VS Stock Report"
but I don't know if it is working the way it should.

Basically when I run a report it's only showing some of the information. It seems as if there should be several pages but there is no button or link to go to another page. For example when I sort by stock alphabetically ascending it only shows the stock from A-M but there is no other page or button to click to display the rest i.e. N-Z. Likewise if I sort alphabetically descending it only shows from Z-W.

I have tried sorting in different ways like "qty in stock" but it's always the same, only one page of information is displayed and I know that there should be more.

Any advice or help would be very much appreciated :)