Page MenuHomePhabricator

Create a report for non-credit card donations by user
Closed, ResolvedPublic

Description

donations input by user for MGFE volumes (non-credit card)
Time period:
July - Dec.
Oct - Dec.
The goal is to assess team member productivity

Event Timeline

@RLewis Could you check if the list of MGFE staff in this group in CiviCRM is up to date? Looks like it needs updating and we'd like to use it for reporting.

@Lars - yes this definitely needs updating, whats the best way for me to do that, remove them from the group?

@RLewis Yes, just remove any contacts who are not current and add any staff members who are missing. This group also controls who sees the DR view of the contact summary page, so good to keep it updated so new staff have the same view as the rest of you. You can ignore any fr-tech folks who are in there.

Turns out we are actually looking for counts for the donation processing team, which has now been done. This is by date entered rather than by donation date. Here is the SQL for future use.

SELECT
  CONCAT(ct.first_name, " ", ct.last_name) as Name,
  COUNT(c.id) AS Count,
  SUM(c.total_amount) AS Total
FROM civicrm_contribution c
INNER JOIN log_civicrm_contribution log
  ON c.id = log.id
  AND log.log_action = "Insert"
  AND log.log_date BETWEEN "20251001000000" AND "20251231235959"
INNER JOIN civicrm_contact ct
  ON ct.id = log.log_user_id
  AND ct.id IN (56534495, 14795889, 34448858, 47095239, 63777943)
WHERE c.contribution_status_id = 1
  AND c. is_test = 0
  AND c.is_template = 0
  AND c.payment_instrument_id NOT IN (1, 16)
GROUP BY log.log_user_id
ORDER BY count(c.id) DESC;

We may need to check the payment_instrument_ids by adding the following as the list excluded is just Credit Card and Credit Card: Mastercard, which were the only relevant ones.

GROUP_CONCAT(DISTINCT ov.label SEPARATOR ", ") AS paymentmethods

and

LEFT JOIN civicrm_option_value ov
  ON ov.value = c.payment_instrument_id
  AND ov.option_group_id = 10
XenoRyet set Final Story Points to 2.