You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's a logic bug in Jethro's attendance report. When people are removed from a group or congregation, they no longer appear as present in past weeks when they did attend.
To test this out:
create a new Group, with attendance marked once a week (here, Mondays):
Add 4 group members.
Go to Attendance -> Record, pick the most recent Monday and record 4 attendances.
The attendances, when viewed, will look like:
Now remove 2 members from the group.
Re-run the report. The attendances have vanished:
The text was updated successfully, but these errors were encountered:
I don't see that this is too complex to fix, at least for group attendance. The attendance_record table hasn't changed. Jethro still 'knows' that 4 people attended that group that day. It's just a matter of fixing the SQL. The current SQL query is:
SELECTperson.id,
person.last_name,
person.first_name,
pgms.labelAS membership_status,
person.status,
ar.date,
ar.present,
IF (pa.idIS NOT NULL,
1,
0) AS planned_absence
FROM _person person
JOIN age_bracket ab ONab.id=person.age_bracketidJOIN family f ONperson.familyid=f.idJOIN person_group_membership pgm ONpgm.personid=person.idANDpgm.groupid=73LEFT JOIN attendance_record ar ON (ar.personid=person.idANDar.date BETWEEN '2024-05-26'AND'2024-05-30'ANDar.groupid=73)
LEFT JOIN person_group_membership_status pgms ONpgms.id=pgm.membership_statusLEFT JOIN planned_absence pa ONpa.personid=person.idANDar.date BETWEEN pa.start_dateANDpa.end_dateWHERE ((person.status<>"archived")
OR (ar.presentIS NOT NULL))
ORDER BY last_name ASC,
person.familyid,
ab.`rank`,
IF (ab.is_adult,
person.gender,
1) DESC, first_name;
It needs to start with attendance_record and LEFT JOIN on other records that may not exist:
SELECTperson.id,
person.last_name,
person.first_name,
pgms.labelAS membership_status,
ar.date,
ar.present,
IF (pa.idIS NOT NULL,
1,
0) AS planned_absence
FROM attendance_record ar
JOIN _person person ONperson.id=ar.personidLEFT JOIN person_group_membership pgm ONpgm.personid=person.idANDpgm.groupid=ar.groupidLEFT JOIN person_group_membership_status pgms ONpgms.id=pgm.membership_statusLEFT JOIN planned_absence pa ONpa.personid=person.idANDar.date BETWEEN pa.start_dateANDpa.end_dateWHEREar.groupid=73ANDar.date BETWEEN '2024-05-26'AND'2024-05-30'
Admittedly we do lose historical members' membership status:
We could LEFT JOIN on person too, to handle the case where a person was deleted.
There's a logic bug in Jethro's attendance report. When people are removed from a group or congregation, they no longer appear as present in past weeks when they did attend.
To test this out:
Add 4 group members.
Go to Attendance -> Record, pick the most recent Monday and record 4 attendances.
The attendances, when viewed, will look like:
Now remove 2 members from the group.
Re-run the report. The attendances have vanished:
The text was updated successfully, but these errors were encountered: