Forums / Addon Admin Tools / Sales report 2.0

Sales report 2.0

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

Results 541 to 560 of 882
30 Jan 2012, 1:58 PM
#541
rgshearer avatar

rgshearer

New Zenner

Join Date:
Jan 2008
Location:
Lebanon TN
Posts:
10
Plugin Contributions:
0

Sales report 2.0

I see from the header info in stats_sales_report.php that Conor and Blindside are both listed as @author.

Any chance either of these two authors has updated Sales Report to be compliant with v1.5?

Or are working on it?

If you're working on it, any ideas when it might be ready?

I have several clients who depend heavily on the report for sales info and management decisions.

Thanks,

RGShearer

30 Jan 2012, 2:22 PM
#542
rgshearer avatar

rgshearer

New Zenner

Join Date:
Jan 2008
Location:
Lebanon TN
Posts:
10
Plugin Contributions:
0

Re: Sales report 2.0

Or, alternatively, could someone provide the values for the Admin Page Registration that would allow stats_sales_report.php to be added to the admin page?

30 Jan 2012, 10:01 PM
#543
darkangel avatar

darkangel

Totally Zenned

Join Date:
Oct 2007
Location:
Emporia, Kansas
Posts:
1,729
Plugin Contributions:
0

Re: Sales report 2.0

rgshearer:

Or, alternatively, could someone provide the values for the Admin Page Registration that would allow stats_sales_report.php to be added to the admin page?

with the removal of the admin/boxes folder (or includes/boxes) can't remember which one for sure...anyway with its removal and the change in coding it will take the creators of the mods a time to fix them.

they are volunteers too

it is not a matter of "insert code here" type of thing for that will show you "something" but not the controls in admin.

This link is showing all mods that have been converted....up to now anyways. Keep watching it to see when it is added. I could have sworn I saw it was working but that would mean going back a few pages or reading the entire thread to be certain.

Just Click Here!

OFF TOPIC ---> but if one does not use CC for payment is it equally important to upgrade to 1.5 of zencart? I have been asked this several times from my clients and I am not sure

30 Jan 2012, 10:11 PM
#544
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Sales report 2.0

DarkAngel:

with the removal of the admin/boxes folder (or includes/boxes) can't remember which one for sure...anyway with its removal and the change in coding it will take the creators of the mods a time to fix them.

they are volunteers too

it is not a matter of "insert code here" type of thing for that will show you "something" but not the controls in admin.

This link is showing all mods that have been converted....up to now anyways. Keep watching it to see when it is added. I could have sworn I saw it was working but that would mean going back a few pages or reading the entire thread to be certain.

Just Click Here!It's not a simple matter of add this here click this.. At the VERY LEAST, there's gonna be a database change or two, a few new files that will need to be created and finally the original code will have to be examined and modified if necessary to work within the new security parameters.. It may be a quick fix, it may require a little more time.. One thing is for certain.. To post EVERYTHING that would need to be done in a support thread is a waste off time as the perons writing this step by step could just as soon bundle up ALL the changes and submit it...
DarkAngel:

OFF TOPIC ---> but if one does not use CC for payment is it equally important to upgrade to 1.5 of zencart? I have been asked this several times from my clients and I am not sureYou know where you need to ask this question..:smile:

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

30 Jan 2012, 11:10 PM
#545
darkangel avatar

darkangel

Totally Zenned

Join Date:
Oct 2007
Location:
Emporia, Kansas
Posts:
1,729
Plugin Contributions:
0

Re: Sales report 2.0

DivaVocals:

I
You know where you need to ask this question..:smile:

LOL darn it all thought I could sneak it in ...oh well hangs head will go do it soon...they are in no hurry anyway since their mods still need updating...hah

have a great Tuesday...monday was yucky.

15 Feb 2012, 11:06 PM
#546
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Sales report 2.0

mike-1981:

Has anyone tried installing this mod for Zencart 1.5?
Yes, and it appears to work just fine :clap:
(tested very briefly)

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

define('BOX_STATS_SALES_REPORT', 'Sales Report');

And install the following sql (using the admin sql patch tool):

INSERT INTO admin_pages (page_key,language_key,main_page,page_params,menu_key,display_on_menu,sort_order)
VALUES ('salesReport','BOX_STATS_SALES_REPORT','FILENAME_STATS_SALES_REPORT','','reports','Y','999');
21 Feb 2012, 3:10 AM
#547
sandy86 avatar

sandy86

New Zenner

Join Date:
Jan 2012
Posts:
4
Plugin Contributions:
0

Re: Sales report 2.0

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.but could not solve.

21 Feb 2012, 3:17 AM
#548
jeking avatar

jeking

Totally Zenned

Join Date:
Oct 2005
Location:
Chicago, IL USA
Posts:
1,592
Plugin Contributions:
0

Re: Sales report 2.0

sandy86:

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.but could not solve.

I had this problem awhile back. The bookmark I was using to log into the admin contained the session id. When I removed that from the url, my problem went away.

Jim
Wheaton Website Services

21 Feb 2012, 4:08 AM
#549
sandy86 avatar

sandy86

New Zenner

Join Date:
Jan 2012
Posts:
4
Plugin Contributions:
0

Re: Sales report 2.0

no that didnt help.:(:(:(

22 Feb 2012, 11:43 AM
#550
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Sales report 2.0

sandy86:

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?

22 Feb 2012, 7:57 PM
#551
kavlito avatar

kavlito

New Zenner

Join Date:
Sep 2009
Posts:
40
Plugin Contributions:
0

Re: Sales report 2.0

rweeks:

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:

// checkboxes
define('CHECKBOX_SALES_TAX', 'Only Orders with Sales Tax');

> ```
  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.
> ```
// 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
> ```
$sales_tax= ($_GET['sales_tax'] != '' ? $_GET['sales_tax'] : false);

Pass new variable to function:

  $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
> ```
<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.
23 Feb 2012, 10:16 PM
#552
rgshearer avatar

rgshearer

New Zenner

Join Date:
Jan 2008
Location:
Lebanon TN
Posts:
10
Plugin Contributions:
0

Re: Sales report 2.0

paulm:

Yes, and it appears to work just fine :clap:
(tested very briefly)

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

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.
24 Feb 2012, 11:27 AM
#553
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Sales report 2.0

rgshearer:

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)

26 Feb 2012, 9:23 AM
#554
wild0ne avatar

wild0ne

New Zenner

Join Date:
May 2008
Posts:
10
Plugin Contributions:
0

Re: Sales report 2.0

paulm:

your_admin/includes/languages/english/extra_definitions/stats_sales_report.php
(adapt to whatever languages are used)

Thanks for that, yay it works! :clap:

1 Mar 2012, 4:22 AM
#555
stellarweb avatar

stellarweb

Zen Follower

Join Date:
May 2006
Location:
Montana
Posts:
293
Plugin Contributions:
8

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.

4 Mar 2012, 7:52 PM
#556
serious avatar

serious

Totally Zenned

Join Date:
Feb 2011
Posts:
686
Plugin Contributions:
0

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?

4 Mar 2012, 9:18 PM
#557
serious avatar

serious

Totally Zenned

Join Date:
Feb 2011
Posts:
686
Plugin Contributions:
0

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?

5 Mar 2012, 1:55 PM
#558
dgent avatar

dgent

Totally Zenned

Join Date:
Nov 2009
Location:
UK
Posts:
1,117
Plugin Contributions:
0

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.

6 Mar 2012, 1:18 PM
#559
serious avatar

serious

Totally Zenned

Join Date:
Feb 2011
Posts:
686
Plugin Contributions:
0

Re: Sales report 2.0

Anyone able to help with my earlier question?

9 Mar 2012, 3:47 PM
#560
sharc316 avatar

sharc316

Zen Follower

Join Date:
Mar 2011
Posts:
160
Plugin Contributions:
0

Re: Sales report 2.0

Hi,

I've installed this sales report mod but I'm not seeing it in admin under reports.

I've triple checked that I uploaded the file structure correctly. Dont know what to do at this point. Please help...

Thanks