Page 56 of 87 FirstFirst ... 646545556575866 ... LastLast
Results 551 to 560 of 869
  1. #551
    Join Date
    Nov 2003
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: Sales report 2.0

    Quote Originally Posted by sandy86 View Post
    i have installed this mod on 1.3.9h but when ever i try to use it(generate a report) ,it redirects to admin login page.ZenID changes in URL.Please help me out on how to reslove this.I have tried clearing cache,tried on diffrent browsers.
    It's very likely a problem with cookies. Your browsers probably do accept/receive cookies from your admin for some reason. Do your have a zenAdminID in the url on every click?

  2. #552
    Join Date
    Sep 2009
    Posts
    40
    Plugin Contributions
    0

    Default Re: Sales report 2.0

    Quote Originally Posted by rweeks View Post
    Frank - thanks for a great add on.
    It is time to pay sales tax to the state, so it would be nice to have an option to report only sales that were local and have sales tax.

    These are my modifications to do this. If there is a more elegant method, let us know.

    In the language file stats_sales_report.php ~line 207 - added:
    Code:
    // checkboxes
    define('CHECKBOX_SALES_TAX', 'Only Orders with Sales Tax');
    In Classes file sales_report.php near top of file added variable $sales_tax:
    Code:
      class sales_report {
        var $timeframe_group, $sd, $ed, $sd_raw, $ed_raw, $date_target, $date_status;
        var $payment_method, $current_status, $manufacturer, $sales_tax, $detail_level, $output_format;
        var $timeframe, $timeframe_id, $current_date, $product_filter;
    
        function sales_report($timeframe, $sd, $ed, $date_target, $date_status, $payment_method, $current_status, $manufacturer, $sales_tax, $detail_level, $output_format, $order_total_validation) {
          global $db;
    
          // place passed variables into class variables
          $this->timeframe_group = $timeframe;
          $this->date_target = $date_target;
          $this->date_status = $date_status;
          $this->payment_method = $payment_method;
          $this->current_status = $current_status;
          $this->manufacturer = $manufacturer;
          $this->sales_tax = $sales_tax;     
          $this->detail_level = $detail_level;
          $this->output_format = $output_format;
          $this->order_total_validation = $order_total_validation;
    In Classes file sales_report.php near line 165 modify SQL query to include extra if else block. Else statement contains original query.
    Code:
    // build the SQL query of order numbers within the current timeframe
          if ($this->sales_tax =="true"){                 // if else statement added to sort only items that have sales tax. 7/16/10
                          $sql = "SELECT DISTINCT o.orders_id from " . TABLE_ORDERS . " o \n";
                          if ($this->date_target == 'status') {
                            $sql .= "LEFT JOIN " . TABLE_ORDERS_STATUS_HISTORY . " osh ON o.orders_id = osh.orders_id \n";
                            $sql .= "WHERE osh.date_added >= '" . date("Y-m-d H:i:s", $sd) . "' AND osh.date_added < '" . date("Y-m-d H:i:s", $ed) . "' \n";
                            $sql .= "AND order_tax != '$0.00' \n";
                            $sql .= "AND osh.orders_status_id = '" . $this->date_status . "' \n";
                          }
                          else {
                            $sql .= "WHERE o.date_purchased >= '" . date("Y-m-d H:i:s", $sd) . "' AND o.date_purchased < '" . date("Y-m-d H:i:s", $ed) . "' \n";
                            $sql .= "AND order_tax != '$0.00' \n";
                          }
                          if ($this->payment_method) $sql .= "AND o.payment_module_code LIKE '" . $this->payment_method . "' \n";
                          if ($this->current_status) $sql .= "AND o.orders_status = '" . $this->current_status . "' \n";
                          $sql .= "ORDER BY o.orders_id DESC";
          }  
          else {
          // start of original SQL query.
          $sql = "SELECT DISTINCT o.orders_id from " . TABLE_ORDERS . " o \n";
          if ($this->date_target == 'status') {
            $sql .= "LEFT JOIN " . TABLE_ORDERS_STATUS_HISTORY . " osh ON o.orders_id = osh.orders_id \n";
            $sql .= "WHERE osh.date_added >= '" . date("Y-m-d H:i:s", $sd) . "' AND osh.date_added < '" . date("Y-m-d H:i:s", $ed) . "' \n";
            $sql .= "AND osh.orders_status_id = '" . $this->date_status . "' \n";
          }
          else {
            $sql .= "WHERE o.date_purchased >= '" . date("Y-m-d H:i:s", $sd) . "' AND o.date_purchased < '" . date("Y-m-d H:i:s", $ed) . "' \n";
          }
          if ($this->payment_method) $sql .= "AND o.payment_module_code LIKE '" . $this->payment_method . "' \n";
          if ($this->current_status) $sql .= "AND o.orders_status = '" . $this->current_status . "' \n";
          $sql .= "ORDER BY o.orders_id DESC";
           // end of orgiginal SQL query
    Modified stats_sales_report.php to add check box to top section of page

    Add around line 174
    Code:
    $sales_tax= ($_GET['sales_tax'] != '' ? $_GET['sales_tax'] : false);
    Pass new variable to function:
    Code:
          $sr = new sales_report($timeframe,                  //* determines how sales tallies are grouped
                                 $start_date, $end_date,      //* the date range
                                 $date_target, $date_status,  //* what date field to search, and the status (if needed)
                                 $payment_method,             //  payment method used for desired orders
                                 $current_status,             //  currently assigned status to the order
                                 $manufacturer,               //  only include orders with assigned manufacturer
                                 $sales_tax,        //Added to find items with sales tax
                                 $detail_level,               //* what information to output
                                 $output_format,              //* how to display the results
                                 $order_total_validation);
    Check Box added above middle radio buttons around line 449
    Code:
    <td class="smallText">
                  <input type="checkbox"  name="sales_tax" value="true"> <?php echo CHECKBOX_SALES_TAX; ?> <br /> 
                  <input type="radio" name="date_target" value="purchased" onClick="hide('td_date_status', true)"><?php echo RADIO_DATE_TARGET_PURCHASED; ?><br />
                  <input type="radio" name="date_target" value="status" onClick="show('td_date_status')"><?php echo RADIO_DATE_TARGET_STATUS; ?>            </td>
    I think that was all the changes. Seems to work fine.


    After installing these mods, my Sales Reports will ONLY report orders with sales tax, regardless of whether I tick the check box or not.

  3. #553
    Join Date
    Jan 2008
    Location
    Lebanon TN
    Posts
    10
    Plugin Contributions
    0

    Default Re: Sales report 2.0

    Quote Originally Posted by paulm View Post
    Yes, and it appears to work just fine
    (tested very briefly)

    A quick way to register the sales report page is to add a box definition (extra_definitions):

    PHP Code:
    define('BOX_STATS_SALES_REPORT''Sales Report'); 
    Could you be a bit more specific about which .php file this line of code should be inserted in? and where?

    I'm looking at the code in \includes\modules\extra_definitions.php but its not obvious to me where this line of code should go.

  4. #554
    Join Date
    Nov 2003
    Posts
    1,987
    Plugin Contributions
    15

    Default Re: Sales report 2.0

    Quote Originally Posted by rgshearer View Post
    Could you be a bit more specific about which .php file this line of code should be inserted in? and where?

    I'm looking at the code in \includes\modules\extra_definitions.php but its not obvious to me where this line of code should go.
    your_admin/includes/languages/english/extra_definitions/stats_sales_report.php
    (adapt to whatever languages are used)

  5. #555
    Join Date
    May 2008
    Posts
    9
    Plugin Contributions
    0

    Default Re: Sales report 2.0

    Quote Originally Posted by paulm View Post
    your_admin/includes/languages/english/extra_definitions/stats_sales_report.php
    (adapt to whatever languages are used)
    Thanks for that, yay it works!

  6. #556
    Join Date
    May 2006
    Location
    Montana
    Posts
    291
    Plugin Contributions
    20

    Default Re: Sales report 2.0

    FYI - This module has been updated for Zen Cart version 1.5.0 and is now available in the downloads section.

  7. #557
    Join Date
    Feb 2011
    Posts
    665
    Plugin Contributions
    0

    Default Re: Sales report 2.0

    ZC 1.39

    Great add-on!

    I do have a question though....

    I understand "Goods Tax" but I don't know what "Order Rec.Tax" is.

    Can someone clarify this for me please?

  8. #558
    Join Date
    Feb 2011
    Posts
    665
    Plugin Contributions
    0

    Default Re: Sales report 2.0

    okay, I figured it out.

    Goods Tax refers to the tax based on the product cost before discounts are applied.

    Order Rec. Tax
    is the actual tax received after discounts are applied to the cost of the item.

    So....here's my problem.

    The Total shown when I print a report for the entire year is a Total Amount based on the GOODS TAX and GOODS VALUE instead of the ACTUAL SELLING PRICE and the Order Rec.Tax based on that price.

    How do I get a report based on actual sales and actual taxes collected?

  9. #559
    Join Date
    Nov 2009
    Location
    UK
    Posts
    1,090
    Plugin Contributions
    0

    Default Re: Sales report 2.0

    Is there anyway in this addon to show the total orders of the month for example, and a break down of the products within it?

    At the moment, I can either see total products sold, and how many of each, or the order numbers and the total value, but not the orders and the product lines within them.

  10. #560
    Join Date
    Feb 2011
    Posts
    665
    Plugin Contributions
    0

    Default Re: Sales report 2.0

    Anyone able to help with my earlier question?

 

 
Page 56 of 87 FirstFirst ... 646545556575866 ... 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