update readme

This commit is contained in:
meichthys 2025-09-09 05:51:09 +00:00
parent b1eea7e3eb
commit 974ac76083
4 changed files with 59 additions and 12 deletions

View File

@ -42,10 +42,9 @@ After the above installation and a WebUI reload, you should see the `Church` app
Hopefully this roadmap will help avoid too much scope creep and provide a sense of where this project is headed. The items below are listed in order of current priority.
- Collection Improvements
- Make collections submittable(?)
- Add Onboarding Tours
- Add 'Tutorial' button to each doctype form
- Ministry tracking
- Fund Tracking
- Update fund balance after collection submission
- Add standard church website pages:
@ -55,12 +54,12 @@ Hopefully this roadmap will help avoid too much scope creep and provide a sense
- Beliefs/Statement of Faith
- Calendar
- Contact Us
- Collection Improvements
- Make collections submittable(?)
- Add portal for `Church Person`s
- Show tracked giving
- Show tracked attendance
- Allow updating attendance status(?)
- Ministry tracking
- Auto add spouse to `Church Person`s relationships
- Event templating/recurrence
- Templating via `Church Event Type` default values table(?)
- Add table to `Church Family` form to show current members

View File

@ -15,6 +15,8 @@ frappe.ui.form.on("Church Person", {
before_save(frm) {
// Call ensure_single_head_of_household
frm.call("ensure_single_head_of_household");
// Call add_spouse_to_relationships
frm.call("add_spouse_to_relationships");
},
after_save(frm) {
frm.call("update_is_current_role")

View File

@ -12,6 +12,7 @@
"first_name",
"last_name",
"full_name",
"gender",
"column_break_agva",
"photo",
"birthday",
@ -254,13 +255,20 @@
"fieldtype": "Table",
"label": "Notable Relationships",
"options": "Church Person Relation"
},
{
"fieldname": "gender",
"fieldtype": "Link",
"label": "Gender",
"options": "Gender",
"reqd": 1
}
],
"grid_page_length": 50,
"image_field": "photo",
"index_web_pages_for_search": 1,
"links": [],
"modified": "2025-09-08 23:12:28.638350",
"modified": "2025-09-08 23:37:58.374411",
"modified_by": "Administrator",
"module": "Church",
"name": "Church Person",

View File

@ -14,14 +14,42 @@ class ChurchPerson(Document):
self.full_name = f"{self.first_name} {self.last_name}"
@frappe.whitelist()
def new_family_from_person(self):
doc = frappe.new_doc("Church Family")
doc.family_name = self.last_name
doc.save()
self.set("family", doc)
def add_spouse_to_relationships(self):
if not self.spouse:
return
self.spouse_doc = frappe.get_doc("Church Person", self.spouse, for_update=True)
# Determine relationship type based on gender
if self.spouse_doc.gender == "Male":
spouse_relationship_type = "Wife"
relationship_type = "Husband"
elif self.spouse_doc.gender == "Female":
spouse_relationship_type = "Husband"
relationship_type = "Wife"
else:
frappe.throw(__(f"Invalid spouse gender: {self.spouse_doc.gender}"))
spouse_doc = frappe.get_doc("Church Person", self.spouse)
spouse_doc.db_set("is_married", True)
spouse_doc.db_set("spouse", self.name)
already_exists = False
if spouse_doc.relationships:
for spouse_relationship in spouse_doc.relationships:
if spouse_relationship.relation_type == spouse_relationship_type and spouse_relationship.church_person == self.name:
already_exists = True
if not already_exists:
spouse_doc.append("relationships", {"church_person": self.name, "relation_type": spouse_relationship_type})
spouse_doc.save()
already_exists = False
if self.relationships:
for self_relationship in self.relationships:
if self_relationship.relation_type == relationship_type and self_relationship.church_person == spouse_doc.name:
already_exists = True
if not already_exists:
self.append("relationships", {"church_person": spouse_doc.name, "relation_type": relationship_type})
self.save()
self.reload()
frappe.msgprint(f"New family created: {doc.family_name}")
frappe.msgprint("✅ Spousal relationships have been synced between spouses.")
@frappe.whitelist()
def ensure_single_head_of_household(self):
@ -47,6 +75,16 @@ class ChurchPerson(Document):
head_doc.is_head_of_household = False
head_doc.save()
@frappe.whitelist()
def new_family_from_person(self):
doc = frappe.new_doc("Church Family")
doc.family_name = self.last_name
doc.save()
self.set("family", doc)
self.save()
self.reload()
frappe.msgprint(f"New family created: {doc.family_name}")
@frappe.whitelist()
def update_is_current_role(self):
for role in self.church_roles: