Zen Cart Logo
Forums / All Other Contributions/Addons / ZC Inventory Report Module

ZC Inventory Report Module

Views: 20,680

Results 61 to 75 of 75
4 Feb 2016, 5:18 PM
#61
tdkapdc avatar

tdkapdc

New Zenner

Join Date:
Jan 2016
Location:
Perth, Western Australia
Posts:
3
Plugin Contributions:
0

ZC Inventory Report Module

Hi lat9,

Thanks for taking an interest, and I will download and start using myDebug backtrace plugin.

the code preceding, and including line 73 is as follows:

$where_array = array();
if ($cat != '') {
    $where_array[] = " master_categories_id = '".$cat."' ";
}
if ($status != ''){
    $where_array[] = " products_status = '".$status."' ";
}
if ($mfg != ''){
    $where_array[] = " manufacturers_id = '".$mfg."' ";
}
if(count($where_array) > 0){
    $db_category_where = " WHERE ".explode(" AND ", $where_array);
}
else{
    $db_category_where = '';
}

Line 73 is

    $db_category_where = " WHERE ".explode(" AND ", $where_array);

near the bottom.

I can see a reference to manufacturer above, which is what led me to try adding a manufacturer to one of my products, to see if it made a difference.

Appreciate your input / thoughts.

Tim
TDK APDC

4 Feb 2016, 5:42 PM
#62
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

Re: ZC Inventory Report Module

Oh, I see now, it's a coding issue in the original script (I've got no idea how it *ever *ran properly). The 'and' clauses are being built up into an array and then want to be stringified for use in the SQL query.

The correct PHP function to use is implode, like this:

$db_category_where = " WHERE ".[B]implode[/B](" AND ", $where_array);
4 Feb 2016, 5:55 PM
#63
tdkapdc avatar

tdkapdc

New Zenner

Join Date:
Jan 2016
Location:
Perth, Western Australia
Posts:
3
Plugin Contributions:
0

Re: ZC Inventory Report Module

Nice work,

Hit the nail right on the head, and is now working perfectly.

Thank you very much for your assistance.

It has made a useful tool in to an extremely useful tool for me.

Much appreciated.

Tim Bowden
TDK APDC

4 Feb 2016, 7:24 PM
#64
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

Re: ZC Inventory Report Module

Tim, thanks for the follow-up; I'm glad to have helped.

... and ... welcome to the Zen Cart community!

25 May 2020, 5:15 PM
#65
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: ZC Inventory Report Module

2020 Update - Inventory Report drops right into Zen Cart 1.55f and 1.56c if anyone needs it :)

It has also been integrated into the Twitch Base6 public release.

3 Apr 2021, 7:21 AM
#66
shop_suey avatar

shop_suey

Zen Follower

Join Date:
Feb 2014
Location:
Germany
Posts:
375
Plugin Contributions:
0

Re: ZC Inventory Report Module

Hello,
the plugin is exactly what I need.
Is it possible to display only active products?
I have over a thousand of inactive products which I keep for backup only. I don't want them been counted.

11 May 2022, 9:02 PM
#67
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: ZC Inventory Report Module

Submitted to plugins...**

Twitch Inventory Report Advanced**
22a for Zen Cart 1.57c
May 11.2022

Added Twitch Admin Product Thumbnails (TAP Thumb) to Inventory Report Module v1.9.2 with Twitch Base7 image control switches all working together. This printable inventory report can be used to quickly check images, print visual inventory audit lists and more.

Inventory report tested on Zen Cart 1.57c to display or hide images with the newest TAP Thumb image checker - works if you do not have Twitch TAP Thumb installed.

7 Jul 2022, 11:26 AM
#68
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,690
Plugin Contributions:
56

Re: ZC Inventory Report Module

Twitch, could I get you to resubmit your plugin as a brand new plugin? I just realized you've changed the filenames and a bunch of other things, and it would make more sense to have a separate download and support thread for your mod.

7 Jul 2022, 12:08 PM
#69
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: ZC Inventory Report Module

swguy:

Twitch, could I get you to resubmit your plugin as a brand new plugin? I just realized you've changed the filenames and a bunch of other things, and it would make more sense to have a separate download and support thread for your mod.

There is no need to continue branching good modules, this is an improvement on the old module just like any other. The added features can all be turned on/off - as you could easily upgrade and choose to use them or not.

7 Jul 2022, 3:00 PM
#70
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,690
Plugin Contributions:
56

Re: ZC Inventory Report Module

It's not "just an improvement" if you rebrand it completely, which you have done.
You have also changed filenames, (again, to reflect your own branding), which makes it different from a simple bug fix update.

Please resubmit as new so I can submit required fixes to the old module.

20 Sep 2023, 9:38 AM
#71
francois avatar

francois

New Zenner

Join Date:
Sep 2012
Posts:
42
Plugin Contributions:
0

Re: ZC Inventory Report Module

I have been using this plugin for a few years and it used to work very well for my needs.
Some time ago I upgraded Zencart to 1.5.7d (due to the fact that my hosting provider forced pHp 8.0 on me).
I also upgraded to the latest version of this plugin 1.9.3.

At the time I noticed an error: It was no longer possible to select a category from the drop-down list (the plugin just returns to the admin home page). I could still download the CSV for all products (but had to split the categories in Excel). Now I would really like to see if it can be fixed.

It will be much appreciated if anyone can maybe help me here! Is this perhaps a pHp 8.0 issues?

The error log shows the following:
[20-Sep-2023 09:15:42 UTC] PHP Notice: Undefined index: cat in /Admin/stats_inventory_report.php on line 46
[20-Sep-2023 09:15:42 UTC] PHP Notice: Undefined index: dir in /Admin/stats_inventory_report.php on line 47
[20-Sep-2023 09:15:42 UTC] PHP Notice: Undefined index: sort in /Admin/stats_inventory_report.php on line 48
[20-Sep-2023 09:15:42 UTC] PHP Notice: Undefined index: page in /Admin/stats_inventory_report.php on line 49
[20-Sep-2023 09:15:42 UTC] PHP Notice: Undefined index: mfg in /Admin/stats_inventory_report.php on line 50
[20-Sep-2023 09:15:42 UTC] PHP Notice: Undefined index: status in /Admin/stats_inventory_report.php on line 51
[20-Sep-2023 09:15:42 UTC] PHP Notice: Undefined index: csv in /Admin/stats_inventory_report.php on line 52
[20-Sep-2023 09:15:42 UTC] PHP Notice: Undefined variable: replace_dir in /Admin/stats_inventory_report.php on line 187
[20-Sep-2023 09:15:42 UTC] PHP Notice: Undefined variable: dir_model in /Admin/stats_inventory_report.php on line 200
[20-Sep-2023 09:15:42 UTC] PHP Notice: Undefined variable: total in /Admin/stats_inventory_report.php on line 231

21 Sep 2023, 8:16 AM
#72
francois avatar

francois

New Zenner

Join Date:
Sep 2012
Posts:
42
Plugin Contributions:
0

Re: ZC Inventory Report Module

Update on the above problem. I managed to get rid of the above errors by applying the isset function on all these variables.
However, the same thing happens: when I try to select a category, the page just returns to ZenCart home page.
Strangely, no new error are logged...

Any ideas anyone?

8 May 2024, 7:33 PM
#73
nishajh avatar

nishajh

Zen Follower

Join Date:
May 2009
Posts:
105
Plugin Contributions:
0

Re: ZC Inventory Report Module

Hello
Is it possible to filter the data on category? Rather than displaying the filtered results, clicking on a category redirects me to the admin home page

9 May 2024, 2:18 AM
#74
nishajh avatar

nishajh

Zen Follower

Join Date:
May 2009
Posts:
105
Plugin Contributions:
0

Re: ZC Inventory Report Module

just updating the correct code for this

Replace

<form method="get" action="<?php echo zen_href_link(FILENAME_STATS_INVENTORY_REPORT, 'page='.$get_page.'&dir='.$replace_dir.'&sort=replace_sort', 'SSL'); ?>"><?php echo zen_draw_pull_down_menu('cat', zen_get_category_tree(), $cat, 'onChange="this.form.submit();"'); ?></form>

with

<form method="get" action="stats_inventory_report.php"><?php echo zen_draw_pull_down_menu('cat', zen_get_category_tree(), $cat, 'onChange="this.form.submit();"'); ?></form> </form>

Also to show only the enabled products change code to

$products_query_raw = "SELECT p.products_id, p.products_quantity, pd.products_name, p.products_model, p.products_price, (p.products_quantity * p.products_price) AS total, cd.categories_name, p.products_cost, m.manufacturers_name
FROM " . TABLE_PRODUCTS . " p
LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON p.products_id = pd.products_id
LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON p.master_categories_id = cd.categories_id AND cd.language_id = '" . $lang_id . "'
LEFT JOIN " . TABLE_MANUFACTURERS . " m ON p.manufacturers_id = m.manufacturers_id
" . $db_category_where . "
GROUP BY p.products_id, pd.products_name
HAVING p.products_status = '1'
ORDER BY " . $sort . " " . $dir;

thanks

15 Feb 2026, 4:34 PM
#75
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Location:
Croatia
Posts:
1,782
Plugin Contributions:
21

Re: ZC Inventory Report Module

I've refactored this plugin to support Zen Cart 2.x and it is now an Encapsulated Plugin. Updated version is available on Github: https://github.com/zenexpert/inventory-report