Contributions
Daily Product Report
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
Expand All / Collapse All
When I downloaded this package I found that it only displayed the first 10 results and did not show the rest of the products. Now it shows the pages properly and lets you browse through them.
I also added the feature to allow for date ranges instead of just a single day.
This is NOT the full package. This is only just the file I modified.
Added CVS export function is also wokring
The Daily Product Report v0.2 by azer is working completely.
The one thing which was missing in Azer code is
** function mirror_out
So find
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
-------Replace it with
<?php require(DIR_WS_INCLUDES . 'application_bottom.php');
function mirror_out ($field) {
global $csv_accum;
echo $field;
$field = strip_tags($field);
$field = ereg_replace (",","",$field);
if ($csv_accum=='') $csv_accum=$field;
else
{if (strrpos($csv_accum,chr(10)) == (strlen($csv_accum)-1)) $csv_accum .= $field;
else $csv_accum .= "," . $field; };
return;
};
?>
****************************
Still if anyone having trouble .here I added full package of "Daily Product Report" .
All the best
This is a bugfix of the quantity and the total price problem.
The quantity and the total price are now shown correctly
The report is OK.
To enable this, just replace in stats_daily_products_sales_report.php :
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";
with
$products_query_raw = "select ot.value, sum(ot.value) as dailyvalue, count(distinct o.orders_id) as howmany_orders, o.orders_id, sum(op.products_quantity) as howmany_tickets, op.products_name, op.products_model, op.final_price as ticket_price, op.final_price * sum(op.products_quantity) 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";
Hope this helps :)
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 to make all this work :-)
http://forums.oscommerce.com/index.php?showtopic=250993
Add Tchinese languages and move the texts in main file to language file.
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
Note: Contributions are used at own risk.