gdfwilliams Posted December 13, 2002 Share Posted December 13, 2002 ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ SALES REPORT v1.0 http://www.oscommerce.com/downloads.php/co...ions,800/type,3 12/13/2002 ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ Summary: ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ A sales report utility that includes Daily, Weekly, Monthly and Yearly sales reports, including Total # of Orders, Avg. Order Amount, Total Sales, % Variance from previous hours/days/weeks/months. Daily/Weekly/Hourly reports also include graphs that track total sales. Daily report uses a stacked bar graph to include average order amount. ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ Recent Improvements: ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ v1.0 - Hourly reports, dynamic graphs, improved navigation, minor tweaks v.8 - Minor fix in Install file v.7 - Additions made to language files v.6 - Moved all the logic into class file sales_report.php in admin/includes/classes/ ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ Installation: ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ NEW FILES: >> copy stats_sales_report.php to admin/ >> copy sales_report.php to admin/includes/classes/ >> copy contents of /jsgraph to NEW folder admin/jsgraph >> copy stats_sales_report.php to admin/includes/languages/english/ >> copy contents of /images to admin/images MODIFICATIONS TO EXISTING FILES: 1) CHANGE the following in admin/includes/boxes/reports.php $contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_STATS_PRODUCTS_VIEWED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_PRODUCTS_VIEWED . '</a><br>' . '<a href="' . tep_href_link(FILENAME_STATS_PRODUCTS_PURCHASED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_PRODUCTS_PURCHASED . '</a><br>' . '<a href="' . tep_href_link(FILENAME_STATS_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_ORDERS_TOTAL . '</a><br>'); to $contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_STATS_PRODUCTS_VIEWED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_PRODUCTS_VIEWED . '</a><br>' . '<a href="' . tep_href_link(FILENAME_STATS_PRODUCTS_PURCHASED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_PRODUCTS_PURCHASED . '</a><br>' . '<a href="' . tep_href_link(FILENAME_STATS_CUSTOMERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_ORDERS_TOTAL . '</a><br>' . '<a href="' . tep_href_link(FILENAME_STATS_SALES_REPORT, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_REPORTS_SALES_REPORT . '</a>'); 2) ADD the following line in admin/includes/application_top.php define('FILENAME_SALES_REPORT', 'stats_sales_report.php'); 3) ADD the following line in admin/includes/languages/english.php define('BOX_REPORTS_SALES_REPORT', 'Sales Report'); VIEW YOUR REPORTS: Access reports through Admin Control Panel>Reports>Sales Report. ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ Known Bugs: ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ Some minor layout issues with the graphs: > data ranges > spacing across the X-axis ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ Recent Improvements: ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ v1.0 - Hourly reports, dynamic graphs, improved navigation, minor tweaks v.8 - Minor fix in Install file v.7 - Additions made to language files v.6 - Moved all the logic into class file sales_report.php in admin/includes/classes/ ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ To Do: ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ -> Improve graphing function (PHP, perhaps?) -> Improved export options (CSV and Print) -> User input for date range of reports -> Additional sales data to include categories/subcategories, specials ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ Other Info: ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ Screenshot of Daily report: ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ Development Team: ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ * Charly Wilhelm * Greg Williams Quote Link to comment Share on other sites More sharing options...
cwdmark Posted December 13, 2002 Share Posted December 13, 2002 nice job dude... :P this is great. Quote Link to comment Share on other sites More sharing options...
cwdmark Posted December 13, 2002 Share Posted December 13, 2002 one suggestion.. under weekly reports, have something so that you can choose the month of the weekly reports, not just the current month. same thing goes with all the other categories.......... Quote Link to comment Share on other sites More sharing options...
jasonv Posted December 14, 2002 Share Posted December 14, 2002 This is a fantastic submission. We used to call this the "pulse" report back at another e-commerce company. Anyway, from the installation instructions: 2) ADD the following line in admin/includes/application_top.php define('FILENAME_SALES_REPORT', 'stats_sales_report.php'); ..needs to be changed to: 2) ADD the following line in admin/includes/application_top.php define('FILENAME_STATS_SALES_REPORT', 'stats_sales_report.php'); Then it works just fiiiiiiiiiine. Also, I might add a "bi-weekly" report, to coincide with some of the third-party payment system schedules. Thanks! Quote Link to comment Share on other sites More sharing options...
gdfwilliams Posted December 14, 2002 Author Share Posted December 14, 2002 Thanks for pointing out the Install gaffe. I've resubmitted with correct instructions. (That's the second time I've posted that same error :? ) I really wish the Contribution section allowed for edits... Thanks, too, for the feedback. We're already looking into bi-weekly reporting... sort of. Specifically, Charly is planning to work in a user-defined date range for reports in addition to daily/weekly/monthly. That should allow maximum flexibility for all. More to follow... - Greg Quote Link to comment Share on other sites More sharing options...
gdfwilliams Posted December 14, 2002 Author Share Posted December 14, 2002 For those who don't want to wait until the next version: To fix 2 minor graphing glitches: In admin/stat_sales_report.php: Change: <?php echo 'g.setXScaleValues("'; for ($i = 0; $i < $report->size; $i++) { if ($sales_report_view == 4){ echo substr($report->info[$i]['text'] . $date_text[$i], 0,3); }else{ echo substr($report->info[$i]['text'] . $date_text[$i], 0,5); } if (($i+1) < $report->size) { echo '","'; } } echo '");'; ?> to: <?php echo 'g.setXScaleValues("'; for ($i = 0; $i < $report->size; $i++) { if ($sales_report_view == 4){ echo substr($report->info[$i]['text'] . $date_text[$i], 0,3); }else{ if ($report->size > 5) { echo substr($report->info[$i]['text'] . $date_text[$i], 3,2); } else { echo substr($report->info[$i]['text'] . $date_text[$i], 0,5); } } if (($i+1) < $report->size) { echo '","'; } } echo '");'; ?> Change: $scale_x = ($sum / $report->size) / ($report->size); to: $scale_x = ($sum / $report->size) / 4; Enjoy, GDW Quote Link to comment Share on other sites More sharing options...
gdfwilliams Posted December 14, 2002 Author Share Posted December 14, 2002 Again, a quick between version fix: in admin/includes/classes/sales_report.php: Change: if ($tmpStart > $this->globalStartDate) { to: if ($tmpStart >= $this->globalStartDate) { Thanks, GDW Quote Link to comment Share on other sites More sharing options...
batman Posted December 15, 2002 Share Posted December 15, 2002 Some other stats that might be nice. Number of new customers per day/week/month/year. Number of customer logins per day/week/month/year. Number of orders per customer. (there is a report similar to this with the order totals, but I'm curious to know about my return customers and how many times they have come back.) Thanks for this great contribution!!! Quote Link to comment Share on other sites More sharing options...
jock Posted December 16, 2002 Share Posted December 16, 2002 I had version 0.7 working beautifully and thought it would be nice to upgrade to v1. I also made the additional mods (for those who couldn't wait for next version!) However, I now get a parse error: Parse error: parse error in /home/virtual/site135/fst/var/www/html/catalog/admin/stats_sales_report.php on line 198 Have I screwed up somewhere or has anybody else had this error mesage? Quote Link to comment Share on other sites More sharing options...
Ian-San Posted December 16, 2002 Share Posted December 16, 2002 It means that you have made an error in your code structure. e.g. too many or not enough } " or ' or missing ; or wrong structure of an expression etc. You could try posting the code around line 198 for more help. Quote Ian-san Flawlessnet Link to comment Share on other sites More sharing options...
winterradio Posted December 16, 2002 Share Posted December 16, 2002 Great contribution. Only bug I could find is the month of January missing from monthly analysis since v.08 Quote Link to comment Share on other sites More sharing options...
jock Posted December 16, 2002 Share Posted December 16, 2002 Version 1 now works fine, however I think it's the additional code that seems to be the problem. Everything works OK until I make the amendments to admin/stats_sales_report.php line 196 is where the new code has been added: <?php echo 'g.setXScaleValues("'; ? for ($i = 0; $i < $report->size; $i++) { ? if ($sales_report_view == 4){ echo substr($report->info[$i]['text'] . $date_text[$i], 0,3); ? }else{ ? ?if ($report->size > 5) { echo substr($report->info[$i]['text'] . $date_text[$i], 3,2); } else { echo substr($report->info[$i]['text'] . $date_text[$i], 0,5); } ? } ? ?if (($i+1) < $report->size) { ? echo '","'; ? ?} } echo '");'; ?> Any ideas? Quote Link to comment Share on other sites More sharing options...
crimsontree Posted June 26, 2003 Share Posted June 26, 2003 Where or what is the /jsgraph? NEW FILES: >> copy stats_sales_report.php to admin/ >> copy sales_report.php to admin/includes/classes/ >> copy contents of /jsgraph to NEW folder admin/jsgraph >> copy stats_sales_report.php to admin/includes/languages/english/ >> copy contents of /images to admin/images I have searched the OSCommerce forum, inside the Sales Report contribution folder and my entire store but I found nothing. Can anyone please help? Quote cheers, Crimsontree Link to comment Share on other sites More sharing options...
rhubarb Posted March 28, 2004 Share Posted March 28, 2004 The jsgraph folder and graph.js file appears not to be included in the sales report 1 contribution dated 9 Mar 2003, but it is included in the previous contribution dated 20 Dec 2002. Quote Link to comment Share on other sites More sharing options...
azer Posted October 30, 2005 Share Posted October 30, 2005 i ve installed the last version availaible the Sales Report v1.2 + the patch , but i dont have any errors , and can't see any graph we can se included taht point at tibet collection screenshot ... is this the offcial thread ? Quote MS2 Link to comment Share on other sites More sharing options...
Guest Posted December 19, 2005 Share Posted December 19, 2005 i ve installed the last version availaible the Sales Report v1.2 + the patch , but i dont have any errors , and can't see any graph we can se included taht point at tibet collection screenshot ... is this the offcial thread ? Have we learned why the graph doesn't show up yet? I have the link in the report section but when I click it I am taken to a blank page. I'm puzzled. Quote Link to comment Share on other sites More sharing options...
Guest Posted January 8, 2006 Share Posted January 8, 2006 i ve installed the last version availaible the Sales Report v1.2 + the patch , but i dont have any errors , and can't see any graph we can se included taht point at tibet collection screenshot ... is this the offcial thread ? I'll try it once more... I click on link in admin/reports but I do not see the graph. I get a blank page. What did I miss? Kym Quote Link to comment Share on other sites More sharing options...
maniac101 Posted February 24, 2006 Share Posted February 24, 2006 HI, I installed the last sales report v1.3 and all went well. I have a problem with the previous/next links on the weekly reports (and a few others). Current weekly reports for this year show no previous link although they start at 29/1/2006 - so how do i see weekly reports for the previous weeks ? I can actually go to the data by first showing monthly reports, then clicking through to January - then i see the weekly report for January - so the data is there. Just something to do with the way the 'previous' link is created. Not sure how to fix this yet. Ive tried removing all checks for prev/next links so the links are always there - except now the missing prev link will go daily stats instead of january weekly stats so that hasnt helped much! I have added some extra colums for shipping and tax - but these only work properly when i dont filter based on pending/processing/dispatched - when filtered the shipping and tax show as negative amounts due to the way i am calculating them from the sum. I will work some more on this and hopefully upload a new version of this great contrib. Any help on the previous/next and filtering would be appreciated. thanks Quote Regards Mark Brindle Link to comment Share on other sites More sharing options...
Irvin Posted March 7, 2006 Share Posted March 7, 2006 Hi, does anybody manage to get the labels/measure on the X axis to display? I've just installed this contribution with the latest file v.1.3 from http://www.oscommerce.com/community/contributions,524 But I'm having problem here, the labels on the X axis doesn't show up. The labels on Y axis does show up though. According to http://www.tibetcollection.com/images/sales_report.gif, the labels/measure on the X axis should show up (i.e. 0, 200, 400, 600). Could anybody know what's wrong with that or maybe you don't have any problem with it at all? Please please pleaseee help... Quote Link to comment Share on other sites More sharing options...
Patty Posted July 21, 2006 Share Posted July 21, 2006 Great contribution.Only bug I could find is the month of January missing from monthly analysis since v.08 It's still missing. Is there anyone to help with this contribution? Such a nice one, it deserved a little more attention. I'm also having a problem with a client who has 10 orders status. I really don't know if that has anything to do with that, but since July 12 his report is showing only 0 for the daily sales, when he makes sales every single day. Can somebody help with this nice contribution? :) Quote Patty Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.