Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In the original Commerce Reports there was a "Sales" report that allowed viewing the breakdown by daily, weekly, monthly, and yearly. To dogfood the Views integration, this should be recreated.
Comment | File | Size | Author |
---|---|---|---|
#16 | 2976147-16.patch | 48.26 KB | mglaman |
| |||
#12 | 2976147-12.patch | 48.02 KB | mglaman |
#10 | 2976147-10.patch | 47.29 KB | mglaman |
#8 | reports-demo.gif | 510.27 KB | mglaman |
#8 | 2976147-8.patch | 46.82 KB | mglaman |
Comments
Comment #2
mglamanHere is the first go.
Comment #3
mglamanYearly added. Can't get menu links and tabs to cooperate.
Comment #4
lisastreeter CreditAttribution: lisastreeter at Centarro for Impactiv, Inc. commentedMade a little progress. I recently had the same tabs/menu issue while working on another project. Ended up just creating the menu link separately from the view. So I added that to links.menu.yml. I also added a tab for daily but couldn't add weekly:
Drupal\views\Plugin\views\sort\Data.php lacks an option for 'week' granularity. Looks like it would be a pretty simple patch. I just wasn't sure about the format.
Comment #5
mglamanI just looked, in 7.x-4.x I added a custom handler: http://cgit.drupalcode.org/commerce_reports/tree/includes/views/handlers...
And here we make it the default sort handler in a views data alter. So just like I provided a work around for the ReportDateField we'll need a sort version.
Comment #6
mglamanFYI we can make that its own issue, then mark it as a blocker from here. Get that in, then re-roll the patch.
Comment #7
lisastreeter CreditAttribution: lisastreeter at Centarro for Impactiv, Inc. commentedThis issue is currently blocked by Issue #2976401: Create a custom sort handler to provide 'weekly' aggregation option
Comment #8
mglamanHere is the updated view, with weekly thanks to the fix in #2976401: Create a custom sort handler to provide 'weekly' aggregation option. embedded gif goodness.
Comment #10
mglamanTry to fix schema error. Forgot to mark Views in info.yml, too.
Comment #12
mglamanTry to fix the schema issues.
Comment #13
mglamanFor
the `report_id` is an entity field, but COUNT() aggregated. So it’s been flipped to a `numeric` handler. But the handler is overridden at run time, not in a schema level.
Comment #14
mglamanThere's a core bug. I'll just tell the test to not validate schema. See #2976616: Aggregated entity fields cause SchemaIncompleteException
Comment #16
mglamanSkip checking the schema.
Comment #18
mglamanComitted!