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 441 to 460 of 882
16 Jul 2010, 6:32 PM
#441
beatmaker avatar

beatmaker

New Zenner

Join Date:
May 2007
Posts:
91
Plugin Contributions:
0

Sales report 2.0

BlindSide:

The Sales Report is designed to exactly that, report sales. Reporting based on attributes of a given product is completely different, logically speaking. Without getting into the nitty gritty, what you're looking for would require a complete rewrite to logic at work in building the report.

Gotcha. I understand.

Not sure if anyone knows of another Report add-on to Zencart that might allow for this type of search and reporting function?

16 Jul 2010, 6:32 PM
#442
apsona avatar

apsona

Zen Follower

Join Date:
Jan 2010
Posts:
190
Plugin Contributions:
1

Re: Sales report 2.0

BEatMaKeR:

Please excuse my ignorance if this has already been discussed... but one feature of the Sales Reports that would absolutely be phenomenal would be the option to show 'attributes'.

For example. I run a store that sells apparel items. Often I want to know what is my best selling sizes. I'd love to be able to select a group of item, and see what the best selling size is for those items (i.e. mens tshirts).

Also, one thing that always bugged me was there is no 'forever' option on the sales reports. I can pull a sales overall report by day, week, month, and year... but there is no 'forever' option to show all sales reported for the entire time I started running my store up to today. That would be incredibly useful. Especially given the option above... say I wanted to see how many XL's I've sold since I started the store.

Can someone clue me in? Is this possible? Or can it be?

You might try Apsona ShopAdmin, which includes a reporting facility for creating arbitrary ad-hoc reports. There is a tutorial on the website describing how to create specifically the sales-by-attributes report you mention.

Apsona
Twitter: http://twitter.com/apsona

16 Jul 2010, 6:34 PM
#443
beatmaker avatar

beatmaker

New Zenner

Join Date:
May 2007
Posts:
91
Plugin Contributions:
0

Re: Sales report 2.0

Dumb question... but on the general.ja file the additional lines for the roll over... can you tell me what this does exactly? I added them along with the updates but have not noticed any change? I was assuming this was to roll over the listings in case you wanted to go a level deeper in the reports to make it easier to see as you scroll over the listings?

16 Jul 2010, 6:52 PM
#444
beatmaker avatar

beatmaker

New Zenner

Join Date:
May 2007
Posts:
91
Plugin Contributions:
0

Re: Sales report 2.0

apsona GREAT LOOKING ADD-ON!!! THANKS!!! I have been looking for something like this for a looong time!

17 Jul 2010, 2:00 AM
#445
rweeks avatar

rweeks

New Zenner

Join Date:
Jul 2008
Location:
San Diego, CA
Posts:
45
Plugin Contributions:
0

Re: Sales report 2.0

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'); 
```In Classes file sales_report.php near top of file added variable $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;

// 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


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.
19 Jul 2010, 1:02 PM
#446
blindside avatar

blindside

Totally Zenned

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

Re: Sales report 2.0

Glancing over your code, I don't see any glaring issues. Thanks for sharing your mod!

Frank Koehl
"Cleverly Disguised as a Responsible Adult"

frankkoehl.com

20 Aug 2010, 11:07 PM
#447
rony avatar

rony

New Zenner

Join Date:
Aug 2010
Posts:
77
Plugin Contributions:
0

Re: Sales report 2.0

I don't know why its not working for me. I installed it without any problems. But when I click the link from Reports > Sales Report it redirect me to Control Panel Login Page. Not sure what is going on..! I am using ZenCart version 1.3.9e

:(

21 Aug 2010, 12:02 AM
#448
rony avatar

rony

New Zenner

Join Date:
Aug 2010
Posts:
77
Plugin Contributions:
0

Re: Sales report 2.0

Rony:

I don't know why its not working for me. I installed it without any problems. But when I click the link from Reports > Sales Report it redirect me to Control Panel Login Page. Not sure what is going on..! I am using ZenCart version 1.3.9e

:(

I have found the bug. It doesn't work in Chrome. When I tried it in Firefox it worked.

21 Aug 2010, 6:26 PM
#449
carlvt88 avatar

carlvt88

Zen Follower

Join Date:
Aug 2007
Location:
Williston, Vermont
Posts:
180
Plugin Contributions:
0

Re: Sales report 2.0

I use chrome with no problem. You might need to dump your internet cache.

24 Aug 2010, 6:40 PM
#450
rony avatar

rony

New Zenner

Join Date:
Aug 2010
Posts:
77
Plugin Contributions:
0

Re: Sales report 2.0

Same problem now in Firefox. Redirects to the Login Page.

25 Aug 2010, 2:59 AM
#451
soxophoneplayer avatar

soxophoneplayer

Totally Zenned

Join Date:
Feb 2008
Posts:
534
Plugin Contributions:
0

Re: Sales report 2.0

Same problem now in Firefox. Redirects to the Login Page.

I get redirected to login page in Firefox IF I check the 'open in new window' box.

If I don't check that box, the report appears at the bottom of the page (if on screen is the selected output.)

And.... if I check the 'open in new window' box, then try again after unchecking the box, but without first exiting admin I will also get redirected to the login page.

But if I exit admin, login again and click the report button without checking the 'open in new window' everything is fine again.

Not sure if that's what was intended, but that's what happens for me, and its fine ;o)

zc 1.3.8a

25 Aug 2010, 12:22 PM
#452
blindside avatar

blindside

Totally Zenned

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

Re: Sales report 2.0

You guys with the login redirect issue, are you using the Admin Profiles plugin, or similar access control system on your admins?

Frank Koehl
"Cleverly Disguised as a Responsible Adult"

frankkoehl.com

25 Aug 2010, 3:49 PM
#453
soxophoneplayer avatar

soxophoneplayer

Totally Zenned

Join Date:
Feb 2008
Posts:
534
Plugin Contributions:
0

Re: Sales report 2.0

You guys with the login redirect issue, are you using the Admin Profiles plugin, or similar access control system on your admins?

I'm not.

zc 1.3.8a on Firefox. (testsite on localhost zc 1.3.9f on FF behaves the same)

It's not a big deal for me. I just don't click the 'open in new window' box and everything seems to work fine. (I like and use the mod :smile: )

15 Sep 2010, 3:57 AM
#454
flobaby avatar

flobaby

New Zenner

Join Date:
Aug 2010
Posts:
3
Plugin Contributions:
0

Re: Sales report 2.0

I'm sure this is easy but I'm stymied. How do I make Today's date the default for the reports. I'd love to use it as a punch list for what items I have to make that day.

16 Sep 2010, 2:19 AM
#455
carlvt88 avatar

carlvt88

Zen Follower

Join Date:
Aug 2007
Location:
Williston, Vermont
Posts:
180
Plugin Contributions:
0

Re: Sales report 2.0

in admin/stats_sales_report.php, you could change the definition of yesterday to point to today, just to see if this is what you want (remove the '-1' in each line)

        case 'yesterday':
          $start_date = date(DATE_FORMAT, mktime(0, 0, 0, date("m"), date("d") [B]- 1[/B], date("Y")));
          $end_date = date(DATE_FORMAT, mktime(0, 0, 0, date("m"), date("d") [B]- 1[/B], date("Y")));

If that looks good, add a 'today' option. You can set the defaults in admin/includes/languages/english/stats_sales_report.php.

7 Oct 2010, 12:17 AM
#456
kavlito avatar

kavlito

New Zenner

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

Re: Sales report 2.0

Woodymon:

Hi Frank-

Easy install as you stated.

Regarding setting defaults for timeframe reports, is there a method available to disable displaying a period when no orders are processed? That is, rather than displaying "-- NO ORDERS IN TIMEFRAME --", instead just display the periods where an order was processed? Hopefully not many shopkeepers will have days like that, but would be useful feature for some mom & pops (especially for weekends or vacations).

Of course if reports are to be used as any kind of an "audit" instrument then showing zero order days is indeed a good idea.

Thanks,
Woody
in /admin/includes/languages/english, edit stats_sales_report.php and set (line 67) define('DISPLAY_EMPTY_TIMEFRAMES', true)

7 Oct 2010, 3:11 PM
#457
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Location:
Longs, SC
Posts:
635
Plugin Contributions:
0

Re: Sales report 2.0

BlindSide:

You guys with the login redirect issue, are you using the Admin Profiles plugin, or similar access control system on your admins?

I just installed this mod and I'm getting the login redirect problem also. It works fine in Chrome, redirects in FF, and gets the following error just loading the report menu in IE:
Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; GTB6.5; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729; OfficeLiveConnector.1.5; OfficeLivePatch.1.3; .NET4.0C)
Timestamp: Thu, 7 Oct 2010 15:08:32 UTC

Message: Object required
Line: 344
Char: 24
Code: 0
URI: http://www.mysite.com/admin/stats_sales_report.php

7 Oct 2010, 8:09 PM
#458
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Location:
Longs, SC
Posts:
635
Plugin Contributions:
0

Re: Sales report 2.0

Firefox > Tools > Clear Recent History > clear everything fixed the problem.

7 Oct 2010, 10:49 PM
#459
kavlito avatar

kavlito

New Zenner

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

Re: Sales report 2.0

Hi. I installed Sales Report 2.3.0 by carlvt88. There is a new feature for reporting on Product IDs. However, when I enter my product id's and run the report, I get the following error:

1054 Unknown column 'ARTEKZ1' in 'where clause'
in:
[select distinct pd.products_name from zen_products_description pd where products_id = ARTEKZ1]

I found the code in /admin/stats_sales_report.php on line 643. However, I am not a PHP programmer so I cannot troubleshoot the code.

Any thoughts?

Thanks in advance.

7 Oct 2010, 11:05 PM
#460
kavlito avatar

kavlito

New Zenner

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

Re: Sales report 2.0

kavlito:

hi. I installed sales report 2.3.0 by carlvt88. There is a new feature for reporting on product ids. However, when i enter my product id's and run the report, i get the following error:

1054 unknown column 'artekz1' in 'where clause'
in:
[select distinct pd.products_name from zen_products_description pd where products_id = artekz1]

i found the code in /admin/stats_sales_report.php on line 643. However, i am not a php programmer so i cannot troubleshoot the code.

Any thoughts?

Thanks in advance.

silly me! I was using sku's instead of product id's...