Currently, the sales report shows only a total combined sales that includes one-time and recurring (if any) payments. However, what we need is to see at a glance what we are making each month.
This entails pulling the active recurring orders and totaling those separately from any one-time orders.
Since it's kind of important to know what we're making each month (wink), this is a major priority for us. So we are willing to sponsor development OR do it ourselves with some guidance.
Would the best way be to build a module that hooks in or would it be better to modify the core ubercart sales report functionality? If hook is best, can you point to the hooks we would use? If modifying core is best, can you help pinpoint where that code resides?
Here's the basic queries that would yield the information in our case:
SELECT SUM(`fee_amount`) FROM `uc_recurring_users` WHERE status=0 AND `regular_interval`='1 months'
SELECT SUM(`fee_amount`) FROM `uc_recurring_users` WHERE status=0 AND `regular_interval`='1 years'
Since we offer only monthly or annual, those will suffice. We would add the monthly total to the annual total (divided by 12). Since a custom interval is allowed, it will most likely be necessary to 'explode' the interval value and divide by the arbitrary factor and consider whether the word value is 'months' or 'years'. Just thinking out loud.
If anyone could shed some light on where I would put these queries and how best to integrate, it would be much appreciated!
Thanks,
Brandon
Comments
Comment #1
puravida commentedI just thought about the fact that this part of the report would only be possible if using uc_recurring, so I would imagine that a hook (possibly integrated into uc_recurring) would be ideal. If so, we just need to know what hooks are available and then we can work with the uc_recurring team on integration.
Comment #2
longwaveThere are no hooks to modify any of the reports, unfortunately. Ideally you would be able to build reports with Views which would make them infinitely more flexible, but I'm not sure that's fully achievable at present either.
Closing as a duplicate of #568854: Replace uc_reports with Views, and there is already a uc_recurring issue about this.