Page 73 of 86 FirstFirst ... 2363717273747583 ... LastLast
Results 721 to 730 of 859
  1. #721
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,136
    Plugin Contributions
    11

    Default Re: Sales report 2.0

    Bout the same here. Have thru 2015 version but, the minute I had problems with it computing PHP and XHTML correctly, I dropped it like a hot potato for Ultra-Edit. Doesn't mean it is better than Dreamweaver, JetBeans, etc. It just fits my needs. I would probably not have Dreamweaver were it not in a bundle.

    For those the "just gotta", take a look at http://tinyurl.com/y8a3ngrg for some info that just could make a difference in your outcome. Hopefully, it's current.

    An old thread but maybe helpful at
    http://tinyurl.com/yczpfkzr

  2. #722
    Join Date
    Jul 2013
    Location
    Brisbane, Australia
    Posts
    39
    Plugin Contributions
    0

    Default Re: Sales report 2.0

    This is a great plugin and installation went very smoothly indeed. Thank you to all contributors!

    I was wondering how hard it would be to change the default YTD to Financial YTD (i.e. a date range of 1 July to current date - instead of 1 Jan to current date). I've been searching the various files to try and pinpoint where the relevant constant is allocated the start date without much luck (am not experienced enough to work out where I should be making this change).

    Could anyone please point me in the right direction?

    Thanks...and happy new year to all Zenners!

  3. #723
    Join Date
    Sep 2012
    Posts
    254
    Plugin Contributions
    0

    Default Re: Sales report 2.0

    At first glance it looks like your_admin/stats_sales_report.php line 161 to 205 would be where you could amend the desired dates.

  4. #724
    Join Date
    Jul 2013
    Location
    Brisbane, Australia
    Posts
    39
    Plugin Contributions
    0

    Default Re: Sales report 2.0

    Quote Originally Posted by southshorepizza View Post
    At first glance it looks like your_admin/stats_sales_report.php line 161 to 205 would be where you could amend the desired dates.
    Thanks for responding. I'll see what I can do.

  5. #725
    Join Date
    Jun 2012
    Posts
    412
    Plugin Contributions
    0

    Default Re: Sales report 2.0

    Installed Sales Report v3.2.0 in zc155e. PHP version 5.6.31. I'm getting a PHP warning for a null array argument in in_array. Error message follows:
    PHP Warning: in_array() expects parameter 2 to be array, null given in ...admin/includes/classes/sales_report.php on line 403
    Existing out-of-the-box code is:
    Code:
                // check to see if product is unique in this timeframe
                // add to 'diff_products' array if so
                if (!in_array($pID, $this->timeframe[$id]['total']['diff_products'])) {
                    $this->timeframe[$id]['total']['diff_products'][] = $pID;
                }
    
                if (!in_array($pID, $this->timeframe[$id]['orders'][$oID]['diff_products'])) {
                    $this->timeframe[$id]['orders'][$oID]['diff_products'][] = $pID;
                }
    Should the code be something like this?
    Code:
                // check to see if product is unique in this timeframe
                // add to 'diff_products' array if so
                if (!in_array($pID, $this->timeframe[$id]['total']['diff_products'])) {
                    $this->timeframe[$id]['total']['diff_products'][] = $pID;
                }
    
                if (is_null($this->timeframe[$id]['orders'][$oID]['diff_products']) || !in_array($pID, $this->timeframe[$id]['orders'][$oID]['diff_products'])) {
                    $this->timeframe[$id]['orders'][$oID]['diff_products'][] = $pID;
                }
    Should a similar change be made to the if clause above the modified one?

    Thanks!

  6. #726
    Join Date
    Jun 2012
    Posts
    412
    Plugin Contributions
    0

    Default Re: Sales report 2.0

    Or should the array be initialized somewhere???

  7. #727
    Join Date
    Jun 2012
    Posts
    412
    Plugin Contributions
    0

    Default Re: Sales report 2.0

    The code in function output_csv in admin/includes/classes/sales_report.php sets a filename that includes the report start date and end date, but the variables representing the dates are not set. Original code at line 881:
    Code:
            $filename = CSV_FILENAME_PREFIX . date('Ymd', $startDate) . "-" . date('Ymd', $endDate);
    The following code is one fix for the problem:
    Code:
            $filename = CSV_FILENAME_PREFIX . date('Ymd', $this->sd_raw) . "-" . date('Ymd', $this->ed_raw);

  8. #728
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,684
    Plugin Contributions
    9

    Default Re: Sales report 2.0

    Quote Originally Posted by Dave224 View Post
    Installed Sales Report v3.2.0 in zc155e. PHP version 5.6.31. I'm getting a PHP warning for a null array argument in in_array. Error message follows:

    Existing out-of-the-box code is:
    Code:
                // check to see if product is unique in this timeframe
                // add to 'diff_products' array if so
                if (!in_array($pID, $this->timeframe[$id]['total']['diff_products'])) {
                    $this->timeframe[$id]['total']['diff_products'][] = $pID;
                }
    
                if (!in_array($pID, $this->timeframe[$id]['orders'][$oID]['diff_products'])) {
                    $this->timeframe[$id]['orders'][$oID]['diff_products'][] = $pID;
                }
    Should the code be something like this?
    Code:
                // check to see if product is unique in this timeframe
                // add to 'diff_products' array if so
                if (!in_array($pID, $this->timeframe[$id]['total']['diff_products'])) {
                    $this->timeframe[$id]['total']['diff_products'][] = $pID;
                }
    
                if (is_null($this->timeframe[$id]['orders'][$oID]['diff_products']) || !in_array($pID, $this->timeframe[$id]['orders'][$oID]['diff_products'])) {
                    $this->timeframe[$id]['orders'][$oID]['diff_products'][] = $pID;
                }
    Should a similar change be made to the if clause above the modified one?

    Thanks!
    dave,
    you seem to be a smart enough guy, why don't you try it and let us know if it works? the effort required to post your solution seems greater than the effort involved in trying your own solution to see if it resolves the problem.

    if you wanted to initialize the arrays, you can do it above the while statement on line 348:

    PHP Code:
    $this->timeframe[$id]['orders'][$oID]['diff_products'] = array();
    $this->timeframe[$id]['total']['diff_products'] = array(); 
    i like that idea more than the modified if statement, mostly because i am not sure the if statement would resolve the warning.

    best.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  9. #729
    Join Date
    Jun 2012
    Posts
    412
    Plugin Contributions
    0

    Default Re: Sales report 2.0

    There's a problem in Sales Report version 3.2.0 in file admin/stats_sales_report.php at line 387 where the input date target (purchased date, or status date) and input order status are not output properly. Original code in v3.2.0 is:
    Code:
        $date_target = PRINT_DATE_TARGET;
        if ($date_target == 'purchased') {
            $date_target .= PRINT_DATE_PURCHASED;
        } elseif ($date_target == 'status') {
            $date_target .= (PRINT_DATE_STATUS . ' (' . $status_key[$date_status] . ')');
        }
    The above code sets $date_target to the constant PRINT_DATE_CONSTANT in the first line and the subsequent if and elseif tests will never be satisfied.

    The following is one approach to fix the problem:
    Code:
        $date_target = PRINT_DATE_TARGET;
        if ($_GET['date_target'] == 'purchased') {
            $date_target .= PRINT_DATE_PURCHASED;
        } elseif ($_GET['date_target'] == 'status') {
            $date_target .= (PRINT_DATE_STATUS . ' (' . $status_key[$date_status] . ')');
        }
    In this approach, $_GET['date_target'] is the input date target. Another approach is to revert to the code in a previous version of sales report.

  10. #730
    Join Date
    Jan 2010
    Location
    Northwe't USA
    Posts
    7
    Plugin Contributions
    0

    Default Re: Sales report 2.0

    I'm testing an upgrade from Zen Cart 1.54 to 1.55f and PHP 5.6 to PHP 7.0.27. (and our addons)
    I look at PHP every few years when I feel guilted into doing an upgrade, so I'm definitely not comfortable making changes.

    Thanks, Dave222, for your solution posted in 725 above. That saved me even more grey hair.

    I tried the arrays initialization suggested in 728, sadly that removed the Order and Customer data from the report. I put it (just above the while stmt line 348). Perhaps it would be effective somewhere else. But, unfortunately PHP looks like a bunch of symbols to me, so I'm not quite sure where else to try it. Back in the olden days, I programmed in other languages, so I'm a fan of initializing the arrays, but...as much as I stare at this, senior moments aside, I can't really figure it out.

    When testing the CSV for Product Line Items (In admin/includes/classes/sales_report.php), I was getting this error:
    PHP Warning: Invalid argument supplied for foreach() in ...includes/classes/sales_report.php on line 1043
    AND
    Argument #1 is expected to be an array or a sort flag in .../includes/classes/sales_report.php on line 1050

    Since I don't know what I'm doing, I just copied the if ...null...continue statement from the order level and changed the timeframe to products and that seemed to do the trick. This is about line 1040.

    Code:
    case 'product':
        // sort the products according to requested sort options
        unset($dataset1, $dataset2);
        foreach($timeframe['products'] as $pID => $p_data) {
    
    CHANGED TO
    
    case 'product':
       // sort the products according to requested sort options
       unset($dataset1, $dataset2);
       if (is_null($timeframe['products'])) {
           // Ignore days for which no info exists
    	continue;
       }
       foreach($timeframe['products'] as $pID => $p_data) {

 

 
Page 73 of 86 FirstFirst ... 2363717273747583 ... LastLast

Similar Threads

  1. v139b Sales Report
    By irishshopper in forum General Questions
    Replies: 1
    Last Post: 26 Jan 2014, 01:00 AM
  2. Sales Report
    By jgold723 in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 9 Nov 2011, 05:58 PM
  3. Sales report
    By tlahtine in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 27 Dec 2010, 10:01 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR