Initialize fork and rebrand app to event_manager
CI / Server (push) Has been cancelled
Linters / Frappe Linter (push) Has been cancelled
Linters / Vulnerable Dependency Check (push) Has been cancelled
UI Tests / Playwright E2E Tests (push) Has been cancelled

This commit is contained in:
2026-05-11 09:56:57 +02:00
parent f82bb803ac
commit 786cbc724f
500 changed files with 41152 additions and 2 deletions
@@ -0,0 +1,25 @@
// Copyright (c) 2025, BWH Studios and contributors
// For license information, please see license.txt
frappe.query_reports["Event Add-Ons Overview"] = {
filters: [
{
fieldname: "event",
label: __("Event"),
fieldtype: "Link",
options: "Pohodex Event Manager Event",
reqd: 1,
},
{
fieldname: "add_on_type",
label: __("Add-On Type"),
fieldtype: "Link",
options: "Ticket Add-on",
},
{
fieldname: "add_on_value",
label: __("Add-On Value"),
fieldtype: "Data",
},
],
};
@@ -0,0 +1,34 @@
{
"add_total_row": 0,
"add_translate_data": 0,
"columns": [],
"creation": "2025-11-06 10:58:02.520355",
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"filters": [],
"idx": 0,
"is_standard": "Yes",
"letterhead": null,
"modified": "2025-11-06 10:58:02.520355",
"modified_by": "Administrator",
"module": "Ticketing",
"name": "Event Add-Ons Overview",
"owner": "Administrator",
"prepared_report": 0,
"ref_doctype": "Event Ticket",
"report_name": "Event Add-Ons Overview",
"report_type": "Script Report",
"roles": [
{
"role": "System Manager"
},
{
"role": "Event Manager"
},
{
"role": "Pohodex Event Manager User"
}
],
"timeout": 0
}
@@ -0,0 +1,81 @@
# Copyright (c) 2025, BWH Studios and contributors
# For license information, please see license.txt
import frappe
from frappe import _
def execute(filters: dict | None = None):
"""Return columns and data for the report.
This is the main entry point for the report. It accepts the filters as a
dictionary and should return columns and data. It is called by the framework
every time the report is refreshed or a filter is updated.
"""
columns = get_columns()
data = get_data(filters)
return columns, data
def get_columns() -> list[dict]:
"""Return columns for the report.
One field definition per column, just like a DocType field definition.
"""
return [
{
"label": _("Attendee Name"),
"fieldname": "attendee_name",
"fieldtype": "Data",
},
{"label": _("Attendee Email"), "fieldname": "attendee_email", "fieldtype": "Data", "width": 200},
{"label": _("Add-On"), "fieldname": "add_on", "fieldtype": "Data", "width": 150},
{"label": _("Value"), "fieldname": "value", "fieldtype": "Data", "width": 150},
{
"label": _("Ticket"),
"fieldname": "ticket",
"fieldtype": "Link",
"options": "Event Ticket",
"width": 150,
},
]
def get_data(filters=None) -> list[dict]:
"""Return data for the report.
The report data is a list of rows, with each row being a list of cell values.
"""
tav = frappe.qb.DocType("Ticket Add-on Value")
ticket = frappe.qb.DocType("Event Ticket")
ticket_add_on = frappe.qb.DocType("Ticket Add-on")
if not filters:
filters = {}
query = (
frappe.qb.from_(tav)
.join(ticket)
.on(tav.parent == ticket.name)
.join(ticket_add_on)
.on(tav.add_on == ticket_add_on.name)
.select(
ticket.attendee_name,
ticket.attendee_email,
ticket.name.as_("ticket"),
ticket_add_on.title.as_("add_on"),
tav.value,
)
.where(ticket.event == filters.get("event"))
.where(ticket.docstatus == 1)
)
if filters.get("add_on_type"):
query = query.where(ticket_add_on.name == filters.get("add_on_type"))
if filters.get("add_on_value"):
# like operator for partial matching
query = query.where(tav.value.like(f"%{filters.get('add_on_value')}%"))
return query.run(as_dict=True)