I'm stuck with something I'd like to achieve using Drupal 10, Views and the Group module.
The point is to have a website allowing parents (Users) to create a family (Group), add children (Nodes), then add expenses (Nodes) linked to a specific child.
To achieve this, here's what I've got:
- I've got a Group type called "family"
- the Group Membership plugin for this Group type is installed and has a field of type Number called "percentage" (which allows parents to specify which part of the expenses they'll take in charge)
- Drupal users who are members of a "family" group are "parents"
- I have a content type called "child"
- and I have a second content type called "expense" with a reference field pointing at the "child" entities and an "amount" field
Now I created a View listing all expenses for a specific family, grouped by author (parent). This works quite fine.
What I can't figure out is how I can get the "percentage" field (which is in the Group Membership plugin) in order to display which part of the expense's amount the current logged in parent should take in charge (for each expense listed).
So instead of having a listing such as:
Expense : title, child, amount
I'd like to have:
Expense : title, child, amount, your percentage, your part (calculated)