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

ZC Inventory Report Module

Views: 20,680

Results 41 to 60 of 75
14 Sep 2015, 6:48 AM
#41
muteyaar avatar

muteyaar

Zen Follower

Join Date:
Oct 2007
Posts:
134
Plugin Contributions:
0

ZC Inventory Report Module

dbltoe:

The original file established the $csv on line 50. What to do if $csv ==1 took place at line 95 and continues in lines 110-119 creates $filename for the .csv file.
Line 171 is probably related to the button as it is part of the form.
None of those are found in the file Ajeh submitted.
Wish I had a simple way to reinsert them but, there's a lot going on between old and new. My comparison software is not helping much. AND... Never will my skills match Ajeh.
Hopefully, this info can speed up a solution.

Thanks for your reply dbltoe, I am waiting for a reply from Ajeh also.......

14 Sep 2015, 1:17 PM
#42
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: ZC Inventory Report Module

I think this is what you are wanting ... you might ask the author to add this field to future releases ...

This is updated based on v1.8.1

15 Sep 2015, 10:43 AM
#43
muteyaar avatar

muteyaar

Zen Follower

Join Date:
Oct 2007
Posts:
134
Plugin Contributions:
0

Re: ZC Inventory Report Module

Ajeh:

I think this is what you are wanting ... you might ask the author to add this field to future releases ...

This is updated based on v1.8.1

That's Perfect !!
Thank you very much.

There is one more thing that I want in this mod. I do not know if this is possible or not.

I want the CSV file with only the ACTIVE products inventory. This Module is presently showing the whole inventory. there are many INACTIVE PRODUCTS in my store with NON ZERO quantity, and it is very difficult to select these manually.
Is there any method, that I get the desired results with only the ACTIVE products inventory?

Or at least there should be the ACTIVE /INACTIVE status column in the report.

thanks in advance.

15 Sep 2015, 1:27 PM
#44
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: ZC Inventory Report Module

Adding a bit more customization should be able to offer you either/or on the CSV file ...

15 Sep 2015, 1:38 PM
#45
muteyaar avatar

muteyaar

Zen Follower

Join Date:
Oct 2007
Posts:
134
Plugin Contributions:
0

Re: ZC Inventory Report Module

Ajeh:

Adding a bit more customization should be able to offer you either/or on the CSV file ...

Thank You Very much Ajeh !!

You are a genius....... I just wanted this exactly same style.

Thanks a lot.

15 Sep 2015, 1:43 PM
#46
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: ZC Inventory Report Module

You are most welcome ... remember the Zen Cart Team when you are rich and famous! :cool:

24 Sep 2015, 3:43 PM
#47
muteyaar avatar

muteyaar

Zen Follower

Join Date:
Oct 2007
Posts:
134
Plugin Contributions:
0

Re: ZC Inventory Report Module

Ajeh:

You are most welcome ... remember the Zen Cart Team when you are rich and famous! :cool:

Hi,
I have one more question about this mod.

is it possible to receive a column with URL link of main image of each product in the report?
If it is is possible, then kindly help me in this regard.

thanks.

24 Sep 2015, 7:04 PM
#48
bislewl avatar

bislewl

Totally Zenned

Join Date:
Dec 2011
Location:
Wisconsin, USA
Posts:
674
Plugin Contributions:
12

Re: ZC Inventory Report Module

muteyaar:

Hi,
I have one more question about this mod.

is it possible to receive a column with URL link of main image of each product in the report?
If it is is possible, then kindly help me in this regard.

thanks.

You would need to add a column, and then use the product_image field to get the image name, then you could create a <a href>, to the images url.

So yes, simple kinda...

25 Sep 2015, 1:14 AM
#49
muteyaar avatar

muteyaar

Zen Follower

Join Date:
Oct 2007
Posts:
134
Plugin Contributions:
0

Re: ZC Inventory Report Module

bislewl:

You would need to add a column, and then use the product_image field to get the image name, then you could create a <a href>, to the images url.

So yes, simple kinda...

Thanks for the quick reply bislewl, i am a layman and do not have much knowledge about this. Can you please give me a step by step process of doing this?

or can you please upload the file with required modification.
I will be very thankful to you.

  • muteyaar
25 Sep 2015, 1:28 AM
#50
bislewl avatar

bislewl

Totally Zenned

Join Date:
Dec 2011
Location:
Wisconsin, USA
Posts:
674
Plugin Contributions:
12

Re: ZC Inventory Report Module

muteyaar:

Thanks for the quick reply bislewl, i am a layman and do not have much knowledge about this. Can you please give me a step by step process of doing this?

or can you please upload the file with required modification.
I will be very thankful to you.

  • muteyaar

Ok, Here is a rough idea. If you don't feel comfortable you may need to hire someone.
Using file-set for version 1.9.0
Line 114: you will need to add p.products_image into the sql select statment

somewhere between 200-210
your's need to add a table header perhaps ```html

<td class="dataTableHeadingContent" align="center">Image Link</td> ```

between 235-245 as position as above
you will want to add something like:

<td class="dataTableContent" align="center"><a href="<?php echo DIR_WS_IMAGES.$products->fields['products_image']; ?>" target="_blank">Link</a></td>

I haven't verified if that works, but that should get you pretty close.

25 Sep 2015, 6:36 AM
#51
muteyaar avatar

muteyaar

Zen Follower

Join Date:
Oct 2007
Posts:
134
Plugin Contributions:
0

Re: ZC Inventory Report Module

bislewl:

Ok, Here is a rough idea. If you don't feel comfortable you may need to hire someone.
Using file-set for version 1.9.0
Line 114: you will need to add p.products_image into the sql select statment

somewhere between 200-210
your's need to add a table header perhaps ```html

<td class="dataTableHeadingContent" align="center">Image Link</td> ``` > > between 235-245 as position as above > you will want to add something like: > ```php <td class="dataTableContent" align="center"><a href="<?php echo DIR_WS_IMAGES.$products->fields['products_image']; ?>" target="_blank">Link</a></td> ``` > > I haven't verified if that works, but that should get you pretty close.

Hi,
I did just as suggested by you.
Now, I am able to see a column in the report with Product image heading and LINK for all the images, but on clicking on the LINK, it shows the XXXXX.com/admin/images page for all the links

Moreover, on downloading the ACTIVE products report, the products image column in present, but it does not show any link. it has blank values.

25 Sep 2015, 1:24 PM
#52
bislewl avatar

bislewl

Totally Zenned

Join Date:
Dec 2011
Location:
Wisconsin, USA
Posts:
674
Plugin Contributions:
12

Re: ZC Inventory Report Module

muteyaar:

Hi,
I did just as suggested by you.
Now, I am able to see a column in the report with Product image heading and LINK for all the images, but on clicking on the LINK, it shows the XXXXX.com/admin/images page for all the links

Moreover, on downloading the ACTIVE products report, the products image column in present, but it does not show any link. it has blank values.

is it pulling in the product_images? If not is the product images in the select statement?
it should look like:

$products_query_raw = "select p.products_id, products_quantity, pd.products_name, p.products_model, p.products_price, (products_quantity * p.products_price) as total, categories_name, p.products_quantity_order_min, m.manufacturers_name, p.products_image from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd using(products_id) LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON(cd.categories_id = p.master_categories_id AND cd.language_id = '" . $lang_id . "') left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id) " . $db_category_where . " group by p.products_id order by " . $sort . " " . $dir;

try using this line instead

<td class="dataTableContent" align="center"><a href="<?php echo DIR_WS_CATALOG_IMAGES.$products->fields['products_image']; ?>" target="_blank">Link</a></td>

That should resolve the /admin issue

25 Sep 2015, 1:46 PM
#53
muteyaar avatar

muteyaar

Zen Follower

Join Date:
Oct 2007
Posts:
134
Plugin Contributions:
0

Re: ZC Inventory Report Module

bislewl:

is it pulling in the product_images? If not is the product images in the select statement?
it should look like:

$products_query_raw = "select p.products_id, products_quantity, pd.products_name, p.products_model, p.products_price, (products_quantity * p.products_price) as total, categories_name, p.products_quantity_order_min, m.manufacturers_name, p.products_image from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd using(products_id) LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON(cd.categories_id = p.master_categories_id AND cd.language_id = '" . $lang_id . "') left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id) " . $db_category_where . " group by p.products_id order by " . $sort . " " . $dir;

> 
> try using this line instead
> ```php
<td class="dataTableContent" align="center"><a href="<?php echo DIR_WS_CATALOG_IMAGES.$products->fields['products_image']; ?>" target="_blank">Link</a></td>

That should resolve the /admin issue

Hi, thanks for the quick reply.
I added the code given by you .
It is now showing the links for product images in the ADMIN panel. But when I down load the ACTIVE products report, the product images column has BLANK values.. Nothing shows there.

25 Sep 2015, 2:08 PM
#54
bislewl avatar

bislewl

Totally Zenned

Join Date:
Dec 2011
Location:
Wisconsin, USA
Posts:
674
Plugin Contributions:
12

Re: ZC Inventory Report Module

muteyaar:

Hi, thanks for the quick reply.
I added the code given by you .
It is now showing the links for product images in the ADMIN panel. But when I down load the ACTIVE products report, the product images column has BLANK values.. Nothing shows there.

ok, if you want it in the CSV as well try changing this around line 118

$products[] = array(
            'products_id' => $current_inventory->fields['products_id'],
            'products_model' => $current_inventory->fields['products_model'],
            'products_name' => $current_inventory->fields['products_name'],
            'categories_name' => $current_inventory->fields['categories_name'],
            'manufacturers_name' => $current_inventory->fields['manufacturers_name'],
            'products_quantity' => $current_inventory->fields['products_quantity'],
            'products_quantity_order_min' => $current_inventory->fields['products_quantity_order_min'],
            'products_price' => $currencies->format($current_inventory->fields['products_price']),
            'total' => $currencies->format($current_inventory->fields['total']),
        );

to:

$products[] = array(
            'products_id' => $current_inventory->fields['products_id'],
            'products_model' => $current_inventory->fields['products_model'],
            'products_name' => $current_inventory->fields['products_name'],
            'products_image' => DIR_WS_CATALOG_IMAGES.$current_inventory->fields['products_image'],
            'categories_name' => $current_inventory->fields['categories_name'],
            'manufacturers_name' => $current_inventory->fields['manufacturers_name'],
            'products_quantity' => $current_inventory->fields['products_quantity'],
            'products_quantity_order_min' => $current_inventory->fields['products_quantity_order_min'],
            'products_price' => $currencies->format($current_inventory->fields['products_price']),
            'total' => $currencies->format($current_inventory->fields['total']),
        );
25 Sep 2015, 2:14 PM
#55
muteyaar avatar

muteyaar

Zen Follower

Join Date:
Oct 2007
Posts:
134
Plugin Contributions:
0

Re: ZC Inventory Report Module

bislewl:

ok, if you want it in the CSV as well try changing this around line 118

$products[] = array(
'products_id' => $current_inventory->fields['products_id'],
'products_model' => $current_inventory->fields['products_model'],
'products_name' => $current_inventory->fields['products_name'],
'categories_name' => $current_inventory->fields['categories_name'],
'manufacturers_name' => $current_inventory->fields['manufacturers_name'],
'products_quantity' => $current_inventory->fields['products_quantity'],
'products_quantity_order_min' => $current_inventory->fields['products_quantity_order_min'],
'products_price' => $currencies->format($current_inventory->fields['products_price']),
'total' => $currencies->format($current_inventory->fields['total']),
);

> 
> to:
> 
> ```php
$products[] = array(
            'products_id' => $current_inventory->fields['products_id'],
            'products_model' => $current_inventory->fields['products_model'],
            'products_name' => $current_inventory->fields['products_name'],
            'products_image' => DIR_WS_CATALOG_IMAGES.$current_inventory->fields['products_image'],
            'categories_name' => $current_inventory->fields['categories_name'],
            'manufacturers_name' => $current_inventory->fields['manufacturers_name'],
            'products_quantity' => $current_inventory->fields['products_quantity'],
            'products_quantity_order_min' => $current_inventory->fields['products_quantity_order_min'],
            'products_price' => $currencies->format($current_inventory->fields['products_price']),
            'total' => $currencies->format($current_inventory->fields['total']),
        );

It is now showing only one URL in all the fields on the products images column in the CSV file
http://XXXXXX.com/images

it is still not showing proper URLs of each products

25 Sep 2015, 2:40 PM
#56
bislewl avatar

bislewl

Totally Zenned

Join Date:
Dec 2011
Location:
Wisconsin, USA
Posts:
674
Plugin Contributions:
12

Re: ZC Inventory Report Module

muteyaar:

It is now showing only one URL in all the fields on the products images column in the CSV file
http://XXXXXX.com/images

it is still not showing proper URLs of each products

I should be showing the complete url, as long as the product has an image.
Is your spreadsheet software hiding the rest? It's the only thing I can think of right now

25 Sep 2015, 5:00 PM
#57
muteyaar avatar

muteyaar

Zen Follower

Join Date:
Oct 2007
Posts:
134
Plugin Contributions:
0

Re: ZC Inventory Report Module

bislewl:

I should be showing the complete url, as long as the product has an image.
Is your spreadsheet software hiding the rest? It's the only thing I can think of right now

Here are the screenshots of what I am getting:

admin panel: http://i140.photobucket.com/albums/r20/muteyaar/invrepadmin.png

CSV file: http://i140.photobucket.com/albums/r20/muteyaar/activerep.png

The links are fine in admin panel, but the URLs are incomplete in the CSV file.

26 Sep 2015, 4:39 AM
#58
muteyaar avatar

muteyaar

Zen Follower

Join Date:
Oct 2007
Posts:
134
Plugin Contributions:
0

Re: ZC Inventory Report Module

muteyaar:

Here are the screenshots of what I am getting:

admin panel: http://i140.photobucket.com/albums/r20/muteyaar/invrepadmin.png

CSV file: http://i140.photobucket.com/albums/r20/muteyaar/activerep.png

The links are fine in admin panel, but the URLs are incomplete in the CSV file.

Hi,
Thanks for your help Zencart team,
I managed to get the desired report by changing

$lang_id = $_SESSION['languages_id'] != '' ? intval($_SESSION['languages_id']) : 1;
$products_query_raw = "select p.products_id, products_quantity, pd.products_name, p.products_model, p.products_price, (products_quantity * p.products_price) as total, categories_name, p.products_quantity_order_min, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd using(products_id) LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON(cd.categories_id = p.master_categories_id AND cd.language_id = '" . $lang_id . "') left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id) " . $db_category_where . " group by p.products_id order by " . $sort . " " . $dir;
//echo 'sql: ' . $products_query_raw . '<br>';
if ($csv == '1') {

to this:

$lang_id = $_SESSION['languages_id'] != '' ? intval($_SESSION['languages_id']) : 1;
$products_query_raw = "select p.products_id, products_quantity, pd.products_name, p.products_model, p.products_image, p.products_price, (products_quantity * p.products_price) as total, categories_name, p.products_quantity_order_min, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd using(products_id) LEFT JOIN " . TABLE_CATEGORIES_DESCRIPTION . " cd ON(cd.categories_id = p.master_categories_id AND cd.language_id = '" . $lang_id . "') left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id) " . $db_category_where . " group by p.products_id order by " . $sort . " " . $dir;
//echo 'sql: ' . $products_query_raw . '<br>';
if ($csv == '1') {

CSV file is now giving correct reporting.
Thanks !!

4 Feb 2016, 3:36 PM
#59
tdkapdc avatar

tdkapdc

New Zenner

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

Re: ZC Inventory Report Module

Hi,

I am brand new to zen cart, and a 'pigeon' programmer, so please understand that I while I can understand concepts, I have to nut it out with the programming by turning each cog in my brain individually ......

Having scoured the forums and net for answers, I don't think this has been covered, relating to this module (please correct me if I'm wrong)

I am almost entirely happy withe my store, and am populating, however have a little bug with this particular add-on relating to 'report by category' from the drop down menu:

When running this report from 'top' category, everything works well (very, very well .... Exactly what I was after - thank you to author).

However, when I select a category or subcategory, I receive the 'warning, an error occurred, please refresh, etc', and the list does not populate.

I have looked at the myAdminDebug files, with the following result: (nb: ****** in place of store and admin names)

[04-Feb-2016 14:52:43 UTC] PHP Warning: explode() expects parameter 2 to be string, array given in /home//public_html/store//stats_inventory_report.php on line 73
[04-Feb-2016 14:52:43 UTC] PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 :: select count() as total from zc_products p left join zc_products_description pd using(products_id) LEFT JOIN zc_categories_description cd ON(cd.categories_id = p.master_categories_id AND cd.language_id = '1') left join zc_manufacturers m using(manufacturers_id) WHERE ==> (as called by) /home//public_html/store//includes/classes/split_page_results.php on line 39 <== in /home/*****/public_html/store/includes/classes/db/mysql/query_factory.php on line 155

From what I can conclude, it appears that I have two errors occurring, however the second is possibly related to / resulting from the first.

My 'pigeon' interprets the first as a problem with the variable being returned: the request is asking for a string, but receiving an array .... sound right?

Any ideas on how I might resolve this? Either way, this add-on is going to be very useful, however I have around 2,000 items to manage. It would be much more handy if I could break this report down by category.

Thank you for taking the time to read - I hope someone will be able to assist, however it isn't a 'show stopper' for me, by any means.

Using: ZC 1.5.4, downloaded plug-in about a week ago.
PHP Version: 5.3.29 (Zend: 2.3.0) PHP Memory Limit: 128M
Database: MySQL 10.0.20-MariaDB-cll-lve

I do have quite a few other add-ons in place - this was one of the earlier installs, and has given the same result since installation.

NB. I do not have any manufacturers specified, however did test adding a manufacturer to a product, with the same result. Don't think this should affect category level reporting, but perhaps?

Regards,

Tim Bowden
TDK APDC

4 Feb 2016, 4:02 PM
#60
lat9 avatar

lat9

Administrator

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

Re: ZC Inventory Report Module

I believe that your 'pigeon' interpretation of the issue is close. The problem appears to be that the script is calling the PHP function *explode *and supplying an array for the 2nd argument instead of a string. Fix that issue and the sQL error will resolve itself.

What is the block of code around line 73 of the stats_inventory_report script? You can use the "CODE" tags (the **# **in the toolbar you see when you're creating a post) to wrap the code-block.

Although it's not going to shed additional light on this error, you might want to install the ***myDEBUG Backtrace ***(https://www.zen-cart.com/downloads.php?do=file&id=1879) plugin to help in solving future issues.