Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1

    bug Time Change and Sales Report??

    Tonight is when the time advances 1 hour for most people in North America, and I just ran into something which I think is related to this change.

    I am running Zen Cart 1.3.0.1, with Database Patch Level: 1.3.0.1

    and Sales Report 2.0

    I just switched my screen from running a Daily Report for March 8, 2008 to run a Daily Report for March 9, 2008 ... and the report is now displaying March 9, and March 10 in the single day report. Nothing about the report was changed in any way except for the date, and I use this screen to do a running total all day, every day. I don't recall whether this happened in prior years, as this is the first day that I have actually been sitting here at or around midnight Server Time (my server is in Dallas, central time).

    I hope this is enough info

    John

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    link problem Re: Time Change and Sales Report??

    1. Are you talking about a report built-in to Zen Cart? or an addon?

    2. Isn't this the same as what happens when the clock hits midnight each day, and the "date" "changes"?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3

    bug Re: Time Change and Sales Report??

    Quote Originally Posted by DrByte View Post
    1. Are you talking about a report built-in to Zen Cart? or an addon?

    2. Isn't this the same as what happens when the clock hits midnight each day, and the "date" "changes"?
    1 - It is Blindsides Sales Report 2.0

    2 - It is NOT the same. As I've stated before I have run this report as a daily running total, so that I know at a moments; notice how things are going. This is the first time I've ever seen this happen, and as of right now (6:12am Central time) it is still displaying both March 9 and March 10. It is as if it is confused as to which day it is. Nothing else on the server is showing the slightest blip other than this one thing, and I'm thinking that it might have something to do with the time change today. If it was just a date change, I think it would be showing yesterday and today ... not today and tomorrow.

    I don't know if it is something in BlindSide's Sales Report 2.0 or in ZenCart, but I figured this was the best place to mention this. I think it happened like this last year as well, but I'm not certain as I wasn't awake when the clock rolled over like I was this time, so when I noticed it later in the day, I think I ended up passing it off as a glitch, because the next day the problem disappeared!

    BTW, when I stated earlier that I wasn't around when it rolled over before ... I only meant on the day that the clocks changed. I have been at my computer most nights when the server rolls through midnight, and have never seen this happen on any normal night, but it did happen tonight. It's as if Zencart, or the Sales Report thinks it is one day while the other thinks it is the other one, so they end up displaying both?????


    John
    Last edited by jrafuse; 9 Mar 2008 at 12:23 PM.

  4. #4
    Join Date
    Aug 2005
    Location
    Vic, Oz
    Posts
    1,905
    Plugin Contributions
    5

    Default Re: Time Change and Sales Report??

    Quote Originally Posted by jrafuse View Post
    Tonight is when the time advances 1 hour for most people in North America, and I just ran into something which I think is related to this change.

    I am running Zen Cart 1.3.0.1, with Database Patch Level: 1.3.0.1

    and Sales Report 2.0

    I just switched my screen from running a Daily Report for March 8, 2008 to run a Daily Report for March 9, 2008 ... and the report is now displaying March 9, and March 10 in the single day report. Nothing about the report was changed in any way except for the date, and I use this screen to do a running total all day, every day. I don't recall whether this happened in prior years, as this is the first day that I have actually been sitting here at or around midnight Server Time (my server is in Dallas, central time).

    I hope this is enough info

    John
    Check Admin -> Tools -> server info
    See if Server time and database time are the same??

  5. #5

    Default Re: Time Change and Sales Report??

    Nope ... Server and Database time are exactly the same

    On this same note ... I also run a Month-to-Date report, which today is set for March 01,2008 through March 10, 2008. The report shows all ten days, but the day count at the bottom show "9" instead of "10" .

    I just checked my records ... and the same thing happened LAST March ... The month-to-date report was set for all 31 days, but the count at the bottom shows only 30 days. All with version 1.3.0.1 of Zencart. Different Server platforms from last year to now. Change was made in November 2007. The reports for 2004, 2005, and 2006 all show things correctly for March, but they show the 1 day difference for April (should be showing 30 days, but total says 29 days).

    The difference here is that Daylight Savings Time changed in the US in 2007 from April to March ... from my side of things, this has to be significant, as the count inaccuracy seems to be entirely related to spring-time change to DST. Prior to 2007 the in-accurate count happens in April coinciding with the time change in April. Now, since March 2007 , that inaccuracy occurs in March ... again coinciding with DST.

    As I stated earlier ... maybe it is a problem with Sales Report 2.0 and Zencart arguing about the change to DST, or maybe it is something else, but I think it is significant that it only occurs around that event.

    Maybe someone else has a better idea???

    John

  6. #6
    Join Date
    Sep 2004
    Posts
    1,388
    Plugin Contributions
    4

    Default Re: Time Change and Sales Report??

    My SR doesn't do anything at all with DST, so I don't think SR would be responsible directly.

    You've got examples from March, what about Jan and Feb in 2007 and 2008. Same results?

    Any recent server switches or major upgrades? If so, you might want to compare your reports with the known server change.
    Frank Koehl
    "Cleverly Disguised as a Responsible Adult"

    frankkoehl.com

  7. #7

    Default Re: Time Change and Sales Report??

    Quote Originally Posted by BlindSide View Post
    My SR doesn't do anything at all with DST, so I don't think SR would be responsible directly.

    You've got examples from March, what about Jan and Feb in 2007 and 2008. Same results?

    Any recent server switches or major upgrades? If so, you might want to compare your reports with the known server change.
    As stated previously ... it ONLY happens during the month that the time changes forward. January, and February as well as April last year show accurately the number of days, etc. Only March shows the problem. Same thing this year, now that we are in April. April is showing the right number of days, same as Jan, and Feb ... but March is still off by one day less. Prior to the change from April to March in the U.S., this glitch was happening in April, now it is March. There definitely seems to be a correlation here. I have changed Servers twice during this period where this happens, as well as going from ZenCart 1.2.7 to 1.3.0.1 to 1.3.8a. The only thing which is consistent across all of these changes is Sales Report 2. That is why I mentioned it.

    I hope this helps ...

    John

  8. #8
    Join Date
    Sep 2004
    Posts
    1,388
    Plugin Contributions
    4

    Default Re: Time Change and Sales Report??

    I agree that that is a very strange behavior, but again all of the time functionality in the report comes from PHP and MySQL, which in turn take their orders from the server.

    You can see it for yourself from lines 60 to 71 in admin/includes/classes/sales_report.php ...
    Code:
          // all our calculations are done using a "raw" timestamp format, which are
          // pulled from entered date strings using the substr function (similar to zen_date_raw)
          $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) );
    
          // run a few checks on the dates
          // avoid dates before the first order
          $first = $db->Execute("select UNIX_TIMESTAMP(min(date_purchased)) as date FROM " . TABLE_ORDERS);
          $first_order = $first->fields['date'];
          $this->global_sd = mktime(0, 0, 0, date("m", $first_order), date("d", $first_order), date("Y", $first_order));
          if ($this->sd_raw < $this->global_sd) $this->sd_raw = $this->global_sd;
          if ($this->ed_raw < $this->global_sd) $this->ed_raw = $this->global_sd;
    The code certainly isn't doing anything different within the month of March, and I've never heard a report of an error like this. Based on this and my experience as a server admin, I think you really need to look at your server configuration. Start with the kernel's time keeping and DST settings, then look at Apache, MySQL, and PHP, in that order. A server swap would identify the source immediately, but that's obviously a little more involved.

    I wish I could offer a better solution, but I will keep an eye out for similar issues.
    Frank Koehl
    "Cleverly Disguised as a Responsible Adult"

    frankkoehl.com

  9. #9

    Default Re: Time Change and Sales Report??

    The reason I even brought it up this year is that I just DID a Server swap in December. Went from Redhat Enterprise 3 to 5, from PHP 4 to 5, Zencart 1.2.7 to Zencart 1.3.8a, and everything else is brand new, except for some templates ... yet the same thing. So I thought I'd ask ... it is not like it is screwing up the sales numbers or anything ... just a bit of an annoyance more than anything else, but I have no explanation for it.

    John

  10. #10
    Join Date
    Sep 2004
    Posts
    1,388
    Plugin Contributions
    4

    Default Re: Time Change and Sales Report??

    You were seeing the same behavior before the server change?

    ...alright, I got nothing...
    Frank Koehl
    "Cleverly Disguised as a Responsible Adult"

    frankkoehl.com

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v139h Refunds/Returns and Sales Report
    By CabinetGuy in forum Managing Customers and Orders
    Replies: 1
    Last Post: 12 Aug 2012, 02:14 PM
  2. Sales Report change timframe
    By avf in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 25 Nov 2009, 10:34 AM
  3. Currencies and sales report question
    By camay123 in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 7
    Last Post: 25 Nov 2008, 09:04 PM
  4. Mulitple Vendors and Sales Report
    By tbjsjd in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 20 May 2008, 06:10 PM
  5. Sales Report 1.4 and Gift Certificates/Coupons
    By Picci in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 29 Aug 2006, 03:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg