Users have been asking for more and better statistical aggregation of transactions, but have been unable to articulate what that would look like, so I decided to concentrate on exposing everything to views, so that use can be made of exposed filters, the new GROUP BY utility, and the theme layer.
I set out to ensure that the following analysis was available to user 1, preferably in views.
After some days of experimentation, I decided to use a mySQL VIEW as virtual table which could be exposed to Drupal's views. Drupal's database API doesn't support this, but I figured it was worth it anyway.
The virtual table contains 2 rows for each transaction, seen from each user's perspective, and it contains columns designed mostly for GROUP BY functions. so the table looks like this:
Transaction ID | User ID | Other ID | Income | Expenditure | Difference | Volume | Currency | Unixtime |
---|---|---|---|---|---|---|---|---|
9999 | 672 | 201 | 49 | 0 | 49 | 49 | hours | 1282873624 |
9999 | 201 | 672 | 0 | 49 | -49 | 49 | hours | 1282873624 |
The table is associated with the field API fields, similar to how the entity table itself is. This design meets all the requirements and some default views are provided which show how to make the most of this presentation of the data.
Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer
Comments
Hi Mat, keep up the good
Hi Mat, keep up the good work!
Let me know if you need some help with those charts & dashboard.
Add new comment