Commerce Reports 4.x is available. It separates the module from the non-maintained Visualization API for the maintained Charts module.

This version also removes the granularity filter we've all come to know and love with using Views Date Format SQL module. This cuts back on module code to maintain for this module and better usage of the SQL query.

The Sales reports (Monthly, Weekly, Yearly) have been broken into their own displays and are secondary menu itmes when on the Sales tab. Sales defaults to monthly, as it always did. The Weekly report has one issue. The granularity defaults on date fields does not include weekly, so the module will have to provide a hook and create one.

I've made date_popup a dependency of the module to provide easier date filtering, similar to Commerce Backoffice Orders.

Addressed in 4.x are:

I also did a quick screencast about the updates: http://www.youtube.com/watch?v=PkX3dns-g4o

Things I can think of to do:

  • Expose a weekly granularity to date sorting See commit 97a2f4b..97f4beb
  • Add CSS to module to clean up date filter (like Backoffice does.)
  • Add CSS to remove Monthly reports highlight when on Weekly or Daily.
  • Test views data export

Comments

haggins’s picture

I did a quick test and it looks good so far.

Just 2 points:
- add views_date_format_sql dependency
- section switching doesn't work

mglaman’s picture

Thanks for pointing that out, haggins.

Just pushed a commit that adds dependency for views_date_format_sql and fixes path to JS/CSS files in "theme/" folder.

haggins’s picture

Thanks for the quick update.

However, to make it work you need to replace '/themes/css/commerce_reports_dashboard.css' with the one from root folder.

There are 2 further minor issues:
- charts don't get resized when switching section
- in your default views I needed to recreate all aggregated fields based on order-total to get any data.

mglaman’s picture

Thanks haggins, I fixed the CSS. I know the Charts do not resize..Charts module doesn't provide way to re-size charts until a patch can be written.

Can you elaborate on "in your default views I needed to recreate all aggregated fields based on order-total to get any data."

  • Is this when you upgraded from 7.x-3.x to 7.x-4.x?
  • Did you have to Revert each View, or were Views caching not flushed to recognize changes?
haggins’s picture

It happend with a fresh module installation and 'drush cc all' did not solve it. Sorry, I haven't more details in mind anymore.

TheoRichel’s picture

Thanks very much for the effort. My experiences with the former version were that it was not accurate (it added some sales to the wrong month).
Do I understand correctly that I can now ditch the Visualization module and replace it with Charts? And there is also a dependency on the Date Popup module. Plus the Views Date Format SQL module. That's it?

I have uninstalled the former version and installed the new one, but even after running Cron and clearing the cache no 'Reports' option appears below store.

TheoRichel’s picture

Well, I have it running now.
1. The fact that the 'Reports' option did not appear below 'Store' had to do with the fact that the Views were still oriented on Visulization, and since that module is now absent the Reports module apparently felt things weren't ready.
2. The problems with 'the wrong month' had to do with the date that order was created. When an order was set on the first of the month, the time rules detracted some hours, which positioned the whole thing in the month before. I just have to remember to postdate my orders on the second of the month instead of on the first (or change that time rule).

mglaman’s picture

@haggins

Could you open a new issue in regards to "in your default views I needed to recreate all aggregated fields based on order-total to get any data." I did a fresh Commerce install and enabled the module and the views were implemented correctly. That way it can be investigated in depth & not get lost in this thread.

@TheoRichel

  • Did you alter the Views previously? That could cause them to stay in database and not disabled when the module was disabled & uninstalled.
  • For the "wrong month" check out this rule Ryan Szrama committed to Commerce: https://drupal.org/node/2044231. Before I became a maintainer I had a discussion with him about the issue of tracking an order for reporting effectively. (Details are also in 4.x readme)
mglaman’s picture

Issue summary: View changes
mglaman’s picture

Issue summary: View changes
haggins’s picture

@mglaman
Sadly our backend opimization process has been postponed to 'undefined'. I will come back to this later.

TheoRichel’s picture

1. I understand your question wrt the recent changing of Views, but I am affraid I cannot definitely answer it.
2. I am currently working away a backlog of orders so I am manually editing the created date to get a better overview what happened in the past months.

Anonymous’s picture

Hi,

Error: Call to undefined function dpm() in /public_html/sites/all/modules/commerce_reports/includes/views/commerce_reports.views.inc, line 29

I found this because I test my code on production. :)

mglaman’s picture

Whoops, mpoplin, thanks. Just made commit to remove that.

haggins, sorry to hear. I've had that happen.

TheoRichel, gotcha, I'll poke around and see if I can still get it to replicate

kvoltz’s picture

Absolutely love this set of tools mglaman!

I've upgraded to the 4.x dev to see what these new features are all about. On a whole, things seem to be working much smoother this go around, which is great.

I am, however, getting a long run of error messages that look like the following:


Notice: Undefined index: thoroughfare in _addressfield_render_address() (line 223 of /home1/jointheu/public_html/profiles/commerce_kickstart/modules/contrib/addressfield/addressfield.module).
Notice: Undefined index: premise in _addressfield_render_address() (line 223 of /home1/jointheu/public_html/profiles/commerce_kickstart/modules/contrib/addressfield/addressfield.module).
Notice: Undefined index: locality in _addressfield_render_address() (line 223 of /home1/jointheu/public_html/profiles/commerce_kickstart/modules/contrib/addressfield/addressfield.module).
Notice: Undefined index: administrative_area in _addressfield_render_address() (line 223 of /home1/jointheu/public_html/profiles/commerce_kickstart/modules/contrib/addressfield/addressfield.module).
Notice: Undefined index: postal_code in _addressfield_render_address() (line 223 of /home1/jointheu/public_html/profiles/commerce_kickstart/modules/contrib/addressfield/addressfield.module).

this repeats over and over.

Hopefully, seeing this error message helps you flush out the bug (or perhaps tell me how and where I've screwed something up).

torgosPizza’s picture

@#15: I don't think that error is related to Commerce Reports.

kvoltz’s picture

it is only displaying on the reports dashboard. My thought is that it is tied to the mapping at the bottom of the reports dashboard.

I could be wrong though...

mglaman’s picture

@kvoltz what version of commerce kick start? Or better, what version of address field.

I'm not sure what could be causing it - refresh your reports dashboad twice to make sure it isn't carrying over from a different page. The customer map uses views, and the two coded blocks do not reference those parts of address field, but it'd still like to check it out

kvoltz’s picture

I'm on 7.x-1.0-beta4

should I install the dev version?

Thanks for the quick response.

mglaman’s picture

@kvoltz, I just found this issue #1997572: Undefined index in _addressfield_render_address() line 223 which looks to be the same problem. Sounds like updating to Address Field 7.x-1.x-dev will resolve the issue.

kvoltz’s picture

Nice find @mglaman, I'm sorry to have hijacked the page. Upgrading to the dev version of address field and clearing the cache solved the problem.

Thanks again.

mglaman’s picture

Status: Needs review » Fixed

alpha1 released.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.