Jump to content
Sign in to follow this  
azer

Daily Product Report

Recommended Posts

here is the support thread for this report contribution

 

http://www.oscommerce.com/community/contributions,2791

 

This is a Daily Product Report contribution binspired by the the contribution 2619, "Monthly Sales Report", early version.

A customer wanted to get more details with a report showing how many products and which one are sold for a given date.

Using a "Spiffy Calendar", the administrator can select a day/date, and the report will show a table with the following tables:

No. Order Quantity Product Name Product Model Unit Price Product Quantity Total Purchased


MS2

Share this post


Link to post
Share on other sites

Changes :

----------

0.2 by azer

 

Added CVS export

Removed useless point

Added a currency format ( no more hardcoded)

Change a little bit the layout

Added some language define for hard coded terms

 

still remaining to do !!!:

- the quantity are not shown correctly

- so the sum and the report is FALSE

- when you click on a product it doesnt show the customer that have purchased the product

 

Need help !

Edited by azer

MS2

Share this post


Link to post
Share on other sites

I think adding a way of checking which customers have bought the products would be good. Otherwise this report would seem to be just a specific case of the reports that can be requested with Sales Report 2.

Share this post


Link to post
Share on other sites

Hi there, I am getting the following error ...

Fatal error: Call to undefined function: mirror_out() in /home/mickdieg/public_html/admin/stats_daily_products_sales_report.php on line 110

 

How do I define the mirror_out function?

Share this post


Link to post
Share on other sites
Hi there, I am getting the following error ...

Fatal error: Call to undefined function: mirror_out() in /home/mickdieg/public_html/admin/stats_daily_products_sales_report.php on line 110

 

How do I define the mirror_out function?

 

I removed them and it all worked. The other thing is that the csv outputs nothing as the variable $csv_accum never gets updated. I have it set to:

 

$csv_accum.=$csv_date.",".$products['products_model'].",".number_format($products['howmany_tickets'],0).",".number_format($products['ticket_price'],2);

 

But you could have it set to any of the variables held in the previous table:

 

$rows;

$date;

number_format($products['howmany_orders'],0);

$products['products_name'];

$products['products_model'];

number_format($products['ticket_price'],2);

number_format($products['howmany_tickets'],0);

number_format($products['howmuch'],2);

Share this post


Link to post
Share on other sites

Oh a side line for the author:

 

still remaining to do !!!:

- the quantity are not shown correctly

I HAVE TESTED THEM AND THEY SEEM TO SHOW CORRECTLY...

- so the sum and the report is FALSE

MEBE NOT!

- when you click on a product it doesnt show the customer that have purchased the product.

THIS WOULD BE IMPOSSIBLE AS MANY DIFFERENT PEOPLE CAN BUY A PRODUCT SO THIS LINK IS UNABLE TO BE USED USEFULLY.

 

I have made some additions for discount coupons in this addition. Message me here and i'll post them if anyone needs them.

 

l8rz

Share this post


Link to post
Share on other sites

Hello !!

 

This contribution is not working !

 

Could someone help to fix it ??

 

Regards,

 

Nathali


Best Regards,

Nathali

Share this post


Link to post
Share on other sites
Hi there, I am getting the following error ...

Fatal error: Call to undefined function: mirror_out() in /home/mickdieg/public_html/admin/stats_daily_products_sales_report.php on line 110

 

How do I define the mirror_out function?

 

I get this exact same problem can anyone help me? I've taken the latest fix - I get the following error - this is a problem with the format of the date - if I fix this I'm back to the undefined function error

 

Thanks

 

Lotti

Share this post


Link to post
Share on other sites
I get this exact same problem can anyone help me? I've taken the latest fix - I get the following error - this is a problem with the format of the date - if I fix this I'm back to the undefined function error

 

Thanks

 

Lotti

 

Sorry this is the error I get with the fix:

 

Parse error: syntax error, unexpected T_VARIABLE in /home/src/public_html/shop/admin/stats_daily_products_sales_report.php on line 124

Share this post


Link to post
Share on other sites
Sorry this is the error I get with the fix:

 

Parse error: syntax error, unexpected T_VARIABLE in /home/src/public_html/shop/admin/stats_daily_products_sales_report.php on line 124

 

 

Anyone?

Share this post


Link to post
Share on other sites
Anyone?

 

You need to swap out the statement for this:

 

$products_query_raw = "select ot.value, sum(ot.value) as dailyvalue, count(distinct o.orders_id) as howmany_orders, o.orders_id, count(distinct op.orders_products_id) as howmany_tickets, op.products_name, op.products_model, op.final_price as ticket_price, op.final_price * count(distinct op.orders_products_id) as howmuch from orders_total ot, orders o, orders_products op where o.date_purchased like \"$date%\" and o.orders_id = op.orders_id and ot.orders_id = op.orders_id and ot.class='ot_total' group by op.products_name";

 

 

It was just a matter of escaping the characters around the $date%.

 

On another not the spiffy cal day selector doesn't work in ie's, any ideas??

 

All the best....

Share this post


Link to post
Share on other sites

I have installed Daily Product Report v0.3 by adidmamah

 

still remaining to do !!!:

- the quantity are not shown correctly

I HAVE TESTED THEM AND THEY SEEM TO SHOW CORRECTLY...

- so the sum and the report is FALSE

MEBE NOT!

- when you click on a product it doesnt show the customer that have purchased the product.

THIS WOULD BE IMPOSSIBLE AS MANY DIFFERENT PEOPLE CAN BUY A PRODUCT SO THIS LINK IS UNABLE TO BE USED USEFULLY.

 

 

still remaining to do !!!:

- the quantity are not shown correctly - true for the product quantity so the report total seems false what is strange is that the final total is right !

 

- when you click on a product it doesnt show the customer that have purchased the product.

THIS WOULD BE IMPOSSIBLE AS MANY DIFFERENT PEOPLE CAN BUY A PRODUCT SO THIS LINK IS UNABLE TO BE USED USEFULLY.

what is the purpose then to have a link to a blank table page ?

 

i had this code to preview the article but doesnt seems to work either :

<tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href='<?php echo tep_href_link(FILENAME_CATEGORIES, 'action=new_product_preview&read=only&pID=' . $products['products_id'] . '?page=' . $HTTP_GET_VARS['page'], 'NONSSL'); ?>'">

 

nice feature would be to to have a cron job to send this report daily by email


MS2

Share this post


Link to post
Share on other sites

one other difference in the new contrib i dont understand if it s a mistake or the effect is the missing : document. on document.dailyreportform.reportdate.value

 

 

old version :

<script language="javascript">cal1.writeControl(); cal1.dateFormat="yyyy-MM-dd"; document.dailyreportform.reportdate.value="<?php echo $date; ?>"</script></td>

 

new version

<script language="javascript">cal1.writeControl(); cal1.dateFormat="yyyy-MM-dd"; dailyreportform.reportdate.value="<?php echo $date; ?>"</script></td>


MS2

Share this post


Link to post
Share on other sites

I have this contribution working well with the date range, except the page links at the bottom of the page have never worked, so the total number of products do not show.

 

Here's what I have at the bottom of my page:

 

"Displaying 1 to 1 (of 1 products) Page 1 of 1"

 

And here is the code I have to display this:

 

                      <td class="smallText" valign="top"><?php echo $customers_split->display_count($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td>
               <td class="smallText" align="right"><?php echo $customers_split->display_links($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], "date1={$_REQUEST['date1']}&date2={$_REQUEST['date2']}"); ?> </td>

 

Any help would be greatly appreciated.

 

Thanks,

 

Grant

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×