Forums / Addon Admin Tools / Sales report 2.0

Sales report 2.0

Started by blindside on 29 Aug 2006, 2:41 AM · Views: 248,184

Results 181 to 200 of 882
2 Apr 2007, 10:04 PM
#181
moktar avatar

moktar

New Zenner

Join Date:
Jan 2007
Posts:
17
Plugin Contributions:
0

Sales report 2.0

Hello,

davestrand:

And I keep getting this error every few Rows..

<b>Warning</b>: Invalid argument supplied for foreach() in <b>/home/.cara/davestra/strandland.com/digitalstore/admin/includes/classes/sales_report.php</b> on line <b>908</b><br />

or this one...

<b>Warning</b>: array_multisort() [<a href='function.array-multisort?zenAdminID=4baf46482870f18dcf2411f16f568494'>function.array-multisort</a>]: Argument #1 is expected to be an array or a sort flag in <b>/home/.cara/davestra/strandland.com/digitalstore/admin/includes/classes/sales_report.php</b> on line <b>915</b><br />

or this one...

<b>Warning</b>: Invalid argument supplied for foreach() in <b>/home/.cara/davestra/strandland.com/digitalstore/admin/includes/classes/sales_report.php</b> on line <b>908</b><br />

I had the same warnings and found a fix that works on my install. I submit it here in case it is usefull to Dave or others. BlindSide, please review the fix and include it in next release if appropriate.

In admin\includes\classes\sales_report.php around line 857, find :

unset($dataset1, $dataset2);
foreach($timeframe['orders'] as $oID => $o_data) {

Add this line after the unset line:

 
if (!is_array($timeframe['orders']) ) continue;

In the CSV output, I also had blank lines between different days with daily timeframe. Here is the fix:

In admin\includes\classes\sales_report.php around line 903, find:

 
echo CSV_NEWLINE;

and comment it (or remove):

 
//echo CSV_NEWLINE;
4 Apr 2007, 6:15 PM
#182
agamic avatar

agamic

New Zenner

Join Date:
Apr 2007
Posts:
24
Plugin Contributions:
0

Re: Sales report 2.0

wapnoj:

I notice that when I use +order line Items that the tax is correct and shipping is also included, but using that method I can not sort by product as I can using the +product line Items. My point is that Im hoping that the answer to the miscalculated tax and lack of shipping lies in the +order line item as it seems to be fine.

I was wondering whether there was a fix for this as I have just loaded the latest report mod running on 1.3.7 and the tax shows as $1 which is incorrect under the product line items filter but correctly at $2.97 under the orders filter.
Thanks Blindside for a great mod nevertheless.

6 Apr 2007, 4:07 PM
#183
mountain_mama avatar

mountain_mama

New Zenner

Join Date:
Nov 2006
Location:
8,600 ft in the Rocky Montains of Colorado
Posts:
23
Plugin Contributions:
0

Re: Sales report 2.0

Hello 'Blindside',

I am running the latest version of zen cart and have downloaded and installed your mod into the top level, as usual. When I go into the admin, I find sales report. When I click on it, I get a blank page. I have downloaded your mod twice and reinstalled it. Everything seems in order.

I am running a local apache webserver on my laptop.

Any ideas? Thank you!

6 Apr 2007, 4:13 PM
#184
stevietheman avatar

stevietheman

New Zenner

Join Date:
Mar 2007
Location:
Louisville, Kentucky, USA
Posts:
34
Plugin Contributions:
0

Re: Sales report 2.0

Mountain Mama:

Hello 'Blindside',

I am running the latest version of zen cart and have downloaded and installed your mod into the top level, as usual. When I go into the admin, I find sales report. When I click on it, I get a blank page. I have downloaded your mod twice and reinstalled it. Everything seems in order.

I am running a local apache webserver on my laptop.

Any ideas? Thank you!

Check out my recent previous posts where I describe fixes you can apply. Maybe doing these fixes will work for you.

Steve Magruder, Freelance Web Programmer
WebCommons :: Web Programming Services

6 Apr 2007, 4:50 PM
#185
mountain_mama avatar

mountain_mama

New Zenner

Join Date:
Nov 2006
Location:
8,600 ft in the Rocky Montains of Colorado
Posts:
23
Plugin Contributions:
0

Re: Sales report 2.0

Hello Steve,

I tried them all, but still a blank page!

7 Apr 2007, 8:49 AM
#186
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: Sales report 2.0

Hi,

Just tried this module out this morning and it's pretty handy - thanks! :clap:

Being from Ireland, the date formatting issues were a little irritating, but they were extremely simple to fix.

For anyone from the UK/Ireland, this is all you need to change:

In admin/includes/classes/sales_report.php change lines 58 and 59 from:

      $this->sd_raw = mktime(0, 0, 0, substr($sd, 0, 2), substr($sd, 3, 2), substr($sd, 6, 4) );
      $this->ed_raw = mktime(0, 0, 0, substr($ed, 0, 2), substr($ed, 3, 2), substr($ed, 6, 4) );

to:

      if (strtolower(DATE_FORMAT) == 'm/d/y') {
        // Use US date format (m/d/Y)
        $this->sd_raw = mktime(0, 0, 0, substr($sd, 0, 2), substr($sd, 3, 2), substr($sd, 6, 4) );
        $this->ed_raw = mktime(0, 0, 0, substr($ed, 0, 2), substr($ed, 3, 2), substr($ed, 6, 4) );
      } else if (strtolower(DATE_FORMAT) == 'd/m/y') {
        // Use UK date format (d/m/Y)
        $this->sd_raw = mktime(0, 0, 0, substr($sd, 3, 2), substr($sd, 0, 2), substr($sd, 6, 4) );
        $this->ed_raw = mktime(0, 0, 0, substr($ed, 3, 2), substr($ed, 0, 2), substr($ed, 6, 4) );
      }

And in admin/includes/english/stats_sales_report.php change lines 114-118 from:

define('TIME_DISPLAY_DAY', 'n-j-Y');
define('TIME_DISPLAY_WEEK', 'n-j-Y');
define('TIME_DISPLAY_MONTH', 'n-j-Y');
define('TIME_DISPLAY_YEAR', 'n-j-Y');
define('DATE_SPACER', ' thru<br/>   ');

to:

if (strtolower(DATE_FORMAT) == 'm/d/y') {
  // Use US date format (m/d/Y)
  define('TIME_DISPLAY_DAY', 'n-j-Y');
  define('TIME_DISPLAY_WEEK', 'n-j-Y');
  define('TIME_DISPLAY_MONTH', 'n-j-Y');
  define('TIME_DISPLAY_YEAR', 'n-j-Y');
  define('DATE_SPACER', ' thru<br/>   ');
} else if (strtolower(DATE_FORMAT) == 'd/m/y') {
  // Use UK date format (d/m/Y)
  define('TIME_DISPLAY_DAY', 'jS-M-y');
  define('TIME_DISPLAY_WEEK', 'jS-M-y');
  define('TIME_DISPLAY_MONTH', 'jS-M-y');
  define('TIME_DISPLAY_YEAR', 'jS-M-y');
  define('DATE_SPACER', ' to<br/>   ');
}

Of course, the above is assuming that you have changed your admin/includes/language/english.php file to use:

define('DATE_FORMAT', 'd/m/Y');
define('DATE_FORMAT_SPIFFYCAL', 'dd/MM/yyyy');

Also, I've used jS-M-y as my preferred date output format... this affects the CSV output as well.

Some of you may prefer to use j-n-Y for more numerical formatting.. it's up to you (check PHP's date function documentation for more formatting options!).

Hope that is of help! :yes:

A note to blindside while I'm here...

First off, a great big thanks! :)

Secondly, the lines 693 and 1029 in the main stats_sales_report.php really need changing from <? to <?php - it seems silly to leave these as they are forcing users to have to make modifications. :blink:

Lastly, the comments in the Javascript should have the <?php and ?> tags removed from being around them, they result in parse errors here which causes the javascript to fail. Which is a pity because it makes it look as if the module doesn't work out of the box.

Thanks once again!

All the best...

Conor
ceon

NOTE: We are sorry that Conor is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

8 Apr 2007, 5:24 PM
#187
conor avatar

conor

Passed

Join Date:
Aug 2004
Location:
Belfast, Northern Ireland
Posts:
2,480
Plugin Contributions:
4

Re: Sales report 2.0

Hi,

Sorry, hadn't tested the above with a day of the month after the 12th so missed out on noticing that the javascript has to be updated also.

Again it's quite a simple change... if you've done the above, just change the following file as well in the manner described below:

admin/includes/javascript/sales_report.js.php

Change lines 427-429 from:

      if (isDate(sd_array[1], sd_array[0], sd_array[2]) &&
          isDate(ed_array[1], ed_array[0], ed_array[2]) ) {
          // the array is in mm-dd-yyyy format, but isDate needs it in dd-mm-yyyy

to:

<?php
if (strtolower(DATE_FORMAT) == 'm/d/y') {
  // Use US date format (m/d/Y)
?>
      if (isDate(sd_array[1], sd_array[0], sd_array[2]) &&
          isDate(ed_array[1], ed_array[0], ed_array[2]) ) {
<?php
} else if (strtolower(DATE_FORMAT) == 'd/m/y') {
  // Use UK date format (d/m/Y)
?>
      if (isDate(sd_array[0], sd_array[1], sd_array[2]) &&
          isDate(ed_array[0], ed_array[1], ed_array[2]) ) {
<?php
}
?>

Wee buns!

Happy Easter Everyone! :clap:

Conor
ceon

NOTE: We are sorry that Conor is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

10 Apr 2007, 9:12 PM
#188
airtime avatar

airtime

New Zenner

Join Date:
Mar 2007
Posts:
51
Plugin Contributions:
0

Re: Sales report 2.0

I just installed Sales Report 2.0 on zc1.3.7. First on my test server. It went smooth and appeared to function perfectly. Then on my live server. It installed smooth, but the page is different with mission functionality. The 'sort product by' and 'then sort product by' are missing.
I've attached the two different screen shots.
Thanks,
Airtime.

10 Apr 2007, 11:45 PM
#189
blindside avatar

blindside

Totally Zenned

Join Date:
Sep 2004
Posts:
1,237
Plugin Contributions:
1

Re: Sales report 2.0

airtime:

I just installed Sales Report 2.0 on zc1.3.7. First on my test server. It went smooth and appeared to function perfectly. Then on my live server. It installed smooth, but the page is different with mission functionality. The 'sort product by' and 'then sort product by' are missing.
I've attached the two different screen shots.
Just change the "Displayed Information" dropdown; the additional options appear/disappear based on your selection in that box.

Frank Koehl
"Cleverly Disguised as a Responsible Adult"

frankkoehl.com

25 Apr 2007, 2:42 PM
#190
ces avatar

ces

Zen Follower

Join Date:
Nov 2004
Location:
West Mids, England
Posts:
199
Plugin Contributions:
0

Re: Sales report 2.0

Thanks Conor for updating Frank's "super" sales report!!

Just reporting back everything is great now!!

Thanks again you two.

Craig

9 May 2007, 11:53 AM
#191
poosk avatar

poosk

Totally Zenned

Join Date:
Mar 2005
Location:
Helsinki
Posts:
477
Plugin Contributions:
0

Re: Sales report 2.0

why I get always an error with dates if I try to select custom timeline?

9 May 2007, 11:57 AM
#192
ces avatar

ces

Zen Follower

Join Date:
Nov 2004
Location:
West Mids, England
Posts:
199
Plugin Contributions:
0

Re: Sales report 2.0

poosk:

why I get always an error with dates if I try to select custom timeline?

Have you tried the adjustments Conor suggests on the previous page.

I'm in the UK and use the day/month/year format and Conor's solution works fine for me.

Craig

17 May 2007, 9:48 PM
#193
jamie2k avatar

jamie2k

New Zenner

Join Date:
Oct 2006
Location:
Suffolk UK
Posts:
55
Plugin Contributions:
1

Re: Sales report 2.0

Hi Blindside,

I have installed this mod on my test site and i get the following error after pressing "show me the money":-

1406 Data too long for column 'page_parameters' at row 1
in:
[insert into admin_activity_log (access_date, admin_id, page_accessed, page_parameters, ip_address) values (now(), '3', 'stats_sales_report.php', 'date_preset=yesterday&start_date=&end_date=&date_target=status&date_status=1&payment_method=¤t_status=&timeframe=day&timeframe_sort=asc&detail_level=timeframe&li_sort_order_a=asc&li_sort_order_b=asc&output_format=display&new_window=1&', '62.105.176.92')]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

Can you help Please?

17 May 2007, 10:06 PM
#194
stevietheman avatar

stevietheman

New Zenner

Join Date:
Mar 2007
Location:
Louisville, Kentucky, USA
Posts:
34
Plugin Contributions:
0

Re: Sales report 2.0

jamie2k:

Hi Blindside,

I have installed this mod on my test site and i get the following error after pressing "show me the money":-

1406 Data too long for column 'page_parameters' at row 1
in:
[insert into admin_activity_log (access_date, admin_id, page_accessed, page_parameters, ip_address) values (now(), '3', 'stats_sales_report.php', 'date_preset=yesterday&start_date=&end_date=&date_target=status&date_status=1&payment_method=¤t_status=&timeframe=day&timeframe_sort=asc&detail_level=timeframe&li_sort_order_a=asc&li_sort_order_b=asc&output_format=display&new_window=1&', '62.105.176.92')]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

Can you help Please?

Run this SQL on your Zen Cart database:

ALTER TABLE admin_activity_log CHANGE page_parameters page_parameters TEXT NULL DEFAULT NULL;

Steve Magruder, Freelance Web Programmer
WebCommons :: Web Programming Services

17 May 2007, 11:08 PM
#195
jamie2k avatar

jamie2k

New Zenner

Join Date:
Oct 2006
Location:
Suffolk UK
Posts:
55
Plugin Contributions:
1

Re: Sales report 2.0

Stevietheman:

Run this SQL on your Zen Cart database:

ALTER TABLE admin_activity_log CHANGE page_parameters page_parameters TEXT NULL DEFAULT NULL;

 
:) Big smiles... thanks for such a quick reply... worked like a dream.
17 May 2007, 11:19 PM
#196
stevietheman avatar

stevietheman

New Zenner

Join Date:
Mar 2007
Location:
Louisville, Kentucky, USA
Posts:
34
Plugin Contributions:
0

Re: Sales report 2.0

jamie2k:

:) Big smiles... thanks for such a quick reply... worked like a dream.

My pleasure. This one was easy, as it's already been answered before. :clap:

Steve Magruder, Freelance Web Programmer
WebCommons :: Web Programming Services

17 May 2007, 11:27 PM
#197
jamie2k avatar

jamie2k

New Zenner

Join Date:
Oct 2006
Location:
Suffolk UK
Posts:
55
Plugin Contributions:
1

Re: Sales report 2.0

Stevie,

I am sure if you have done as much of this as i have you'll agree; once you have looked at the zen forum for longer than an hour, after a full days work, at 11pm; your eyes decieve you and even though you know how to find the answers, they seem to evade you.

I really need another pair of hands and eyes for this time of day... I'm shattered, been hard at it for time... so should think about bed now.

Many thanks again,

kind regards

Jamie

PS. R U UK Based ?

18 May 2007, 2:07 AM
#198
stevietheman avatar

stevietheman

New Zenner

Join Date:
Mar 2007
Location:
Louisville, Kentucky, USA
Posts:
34
Plugin Contributions:
0

Re: Sales report 2.0

Jamie, I understand how that goes. I've been there many times myself. I've even already asked a question in these forums that I smacked my head about afterwards.

I'm based in Louisville, KY, home of the Queen's recent visit. :cool: It's only about five hours behind here (and I speak a version of English), so I theoretically could work on UK projects.

Steve Magruder, Freelance Web Programmer
WebCommons :: Web Programming Services

19 May 2007, 4:24 AM
#199
ronlee67 avatar

ronlee67

Totally Zenned

Join Date:
Sep 2006
Location:
Colorado Springs CO USA
Posts:
519
Plugin Contributions:
0

Re: Sales report 2.0

BlindSide:

Well it's been a long time in the making, but hopefully the wait was worth it! Sales Report 2.0 is here, so go get it!

http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=83

You can drop the files right into the admin and right over top of the existing files. Still no overwrites. :thumbsup:

Take it for a spin, and let me know what you think, and if you find any problems. I've been using it for the past few months as I built and tweaked it, so there should be no major issues.

Enjoy, and thanks for your patience.

I'm confused about the version of this contribution. If I follow the link it takes me to the download section where this contribution is listed as:
Zen Cart™ Version: v1.3.6
Version: rev 104
**Last Updated: **Nov 11 2006
Author: BlindSide
There is no mention of Sales Report 2.0 (just Sales Report). I installed it anyway and it looks good!

My two questions are:

Is the above rev 104 the latest version of Sales Report 2.0?
Is there a way to display the State where the order is shipped (for completing sales tax reports)?
I installed on ZenCart Ver. 1.3.7 and haven't had any problems.

Ron


www.aspenshopsonline.com - ZenCart 1.3.9h
www.wilkssupply.com - ZenCart 1.3.9h
www.un-du.net - ZenCart 1.3.8a

20 May 2007, 8:28 PM
#200
hudda avatar

hudda

New Zenner

Join Date:
Nov 2006
Posts:
39
Plugin Contributions:
0

Re: Sales report 2.0

Hi,

Sorry to bother you.

I have installed and can see 'sales report' in reports, however when i click on it, it gives me a HTTP 404 not found.

Any help would be greatly appreciated.

Thanks,

N.Hudda