From 05eec4752811ec3e3019b5ee84319f8b3b821160 Mon Sep 17 00:00:00 2001 From: justin Date: Mon, 4 May 2026 11:26:45 -0500 Subject: [PATCH] Add Compliance Deadline + Compliance Calendar DocTypes for ERPNext MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Compliance Deadline: created by job_server after filing completion, tracks annual filing deadlines (RMD, CPNI, 499-A, BDC). Compliance Calendar: used by renewal_worker for billing cycle, tracks due dates, invoices, and recurring renewal entries. Both were referenced in code but never created — caused 417 errors. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../doctype/compliance_calendar/__init__.py | 0 .../compliance_calendar.json | 198 ++++++++++++++++++ .../compliance_calendar.py | 5 + .../doctype/compliance_deadline/__init__.py | 0 .../compliance_deadline.json | 138 ++++++++++++ .../compliance_deadline.py | 5 + 6 files changed, 346 insertions(+) create mode 100644 performancewest_erpnext/performancewest_erpnext/compliance/doctype/compliance_calendar/__init__.py create mode 100644 performancewest_erpnext/performancewest_erpnext/compliance/doctype/compliance_calendar/compliance_calendar.json create mode 100644 performancewest_erpnext/performancewest_erpnext/compliance/doctype/compliance_calendar/compliance_calendar.py create mode 100644 performancewest_erpnext/performancewest_erpnext/compliance/doctype/compliance_deadline/__init__.py create mode 100644 performancewest_erpnext/performancewest_erpnext/compliance/doctype/compliance_deadline/compliance_deadline.json create mode 100644 performancewest_erpnext/performancewest_erpnext/compliance/doctype/compliance_deadline/compliance_deadline.py diff --git a/performancewest_erpnext/performancewest_erpnext/compliance/doctype/compliance_calendar/__init__.py b/performancewest_erpnext/performancewest_erpnext/compliance/doctype/compliance_calendar/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/performancewest_erpnext/performancewest_erpnext/compliance/doctype/compliance_calendar/compliance_calendar.json b/performancewest_erpnext/performancewest_erpnext/compliance/doctype/compliance_calendar/compliance_calendar.json new file mode 100644 index 0000000..ac9c1c6 --- /dev/null +++ b/performancewest_erpnext/performancewest_erpnext/compliance/doctype/compliance_calendar/compliance_calendar.json @@ -0,0 +1,198 @@ +{ + "actions": [], + "autoname": "hash", + "creation": "2026-05-04 00:00:00.000000", + "doctype": "DocType", + "editable_grid": 0, + "engine": "InnoDB", + "field_order": [ + "title", + "compliance_type", + "category", + "status", + "dates_section", + "due_date", + "reminder_date", + "entity_section", + "entity_name", + "customer", + "order_reference", + "state_code", + "details_section", + "description", + "amount_usd", + "amount_cad", + "billing_section", + "invoice", + "recurring", + "recurrence_period", + "renewal_of" + ], + "fields": [ + { + "fieldname": "title", + "fieldtype": "Data", + "label": "Title", + "reqd": 1, + "in_list_view": 1 + }, + { + "fieldname": "compliance_type", + "fieldtype": "Data", + "label": "Compliance Type", + "in_list_view": 1, + "description": "e.g. FCC RMD, FCC CPNI, State PUC, CRTC" + }, + { + "fieldname": "category", + "fieldtype": "Select", + "label": "Category", + "options": "Federal\nState\nCanada\nOther", + "default": "Other" + }, + { + "fieldname": "status", + "fieldtype": "Select", + "label": "Status", + "options": "Upcoming\nDue Soon\nInvoice Sent\nPaid\nOverdue\nCompleted\nCancelled", + "default": "Upcoming", + "in_list_view": 1 + }, + { + "fieldname": "dates_section", + "fieldtype": "Section Break", + "label": "Dates" + }, + { + "fieldname": "due_date", + "fieldtype": "Date", + "label": "Due Date", + "reqd": 1, + "in_list_view": 1 + }, + { + "fieldname": "reminder_date", + "fieldtype": "Date", + "label": "Reminder Date", + "description": "Date to start sending reminders (typically 30 days before due)" + }, + { + "fieldname": "entity_section", + "fieldtype": "Section Break", + "label": "Entity" + }, + { + "fieldname": "entity_name", + "fieldtype": "Data", + "label": "Entity Name" + }, + { + "fieldname": "customer", + "fieldtype": "Link", + "label": "Customer", + "options": "Customer" + }, + { + "fieldname": "order_reference", + "fieldtype": "Data", + "label": "Order Reference", + "description": "Original compliance order number" + }, + { + "fieldname": "state_code", + "fieldtype": "Data", + "label": "State Code", + "description": "US state code for state-specific filings (e.g. CA, TX)" + }, + { + "fieldname": "details_section", + "fieldtype": "Section Break", + "label": "Details" + }, + { + "fieldname": "description", + "fieldtype": "Small Text", + "label": "Description" + }, + { + "fieldname": "amount_usd", + "fieldtype": "Currency", + "label": "Amount (USD)", + "default": "0", + "options": "USD" + }, + { + "fieldname": "amount_cad", + "fieldtype": "Currency", + "label": "Amount (CAD)", + "default": "0", + "options": "CAD" + }, + { + "fieldname": "billing_section", + "fieldtype": "Section Break", + "label": "Billing" + }, + { + "fieldname": "invoice", + "fieldtype": "Link", + "label": "Invoice", + "options": "Sales Invoice" + }, + { + "fieldname": "recurring", + "fieldtype": "Check", + "label": "Recurring", + "default": "0" + }, + { + "fieldname": "recurrence_period", + "fieldtype": "Select", + "label": "Recurrence Period", + "options": "\nAnnual\nQuarterly\nMonthly", + "depends_on": "recurring" + }, + { + "fieldname": "renewal_of", + "fieldtype": "Link", + "label": "Renewal Of", + "options": "Compliance Calendar", + "description": "Previous calendar entry this renews" + } + ], + "index_web_pages_for_search": 0, + "issingle": 0, + "istable": 0, + "links": [], + "modified": "2026-05-04 00:00:00.000000", + "modified_by": "Administrator", + "module": "Compliance", + "name": "Compliance Calendar", + "naming_rule": "Random", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + }, + { + "create": 1, + "read": 1, + "report": 1, + "role": "Accounting Advisor", + "write": 1 + } + ], + "sort_field": "due_date", + "sort_order": "ASC", + "title_field": "title", + "track_changes": 1 +} diff --git a/performancewest_erpnext/performancewest_erpnext/compliance/doctype/compliance_calendar/compliance_calendar.py b/performancewest_erpnext/performancewest_erpnext/compliance/doctype/compliance_calendar/compliance_calendar.py new file mode 100644 index 0000000..1bff659 --- /dev/null +++ b/performancewest_erpnext/performancewest_erpnext/compliance/doctype/compliance_calendar/compliance_calendar.py @@ -0,0 +1,5 @@ +import frappe +from frappe.model.document import Document + +class ComplianceCalendar(Document): + pass diff --git a/performancewest_erpnext/performancewest_erpnext/compliance/doctype/compliance_deadline/__init__.py b/performancewest_erpnext/performancewest_erpnext/compliance/doctype/compliance_deadline/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/performancewest_erpnext/performancewest_erpnext/compliance/doctype/compliance_deadline/compliance_deadline.json b/performancewest_erpnext/performancewest_erpnext/compliance/doctype/compliance_deadline/compliance_deadline.json new file mode 100644 index 0000000..1da2536 --- /dev/null +++ b/performancewest_erpnext/performancewest_erpnext/compliance/doctype/compliance_deadline/compliance_deadline.json @@ -0,0 +1,138 @@ +{ + "actions": [], + "autoname": "hash", + "creation": "2026-05-04 00:00:00.000000", + "doctype": "DocType", + "editable_grid": 0, + "engine": "InnoDB", + "field_order": [ + "title", + "filing_type", + "deadline_date", + "status", + "entity_section", + "entity_name", + "frn", + "customer", + "details_section", + "notes", + "linked_order", + "published", + "route" + ], + "fields": [ + { + "fieldname": "title", + "fieldtype": "Data", + "label": "Title", + "reqd": 1, + "in_list_view": 1 + }, + { + "fieldname": "filing_type", + "fieldtype": "Data", + "label": "Filing Type", + "in_list_view": 1, + "description": "e.g. RMD Recertification, CPNI Annual Certification, 499-A Filing" + }, + { + "fieldname": "deadline_date", + "fieldtype": "Date", + "label": "Deadline Date", + "reqd": 1, + "in_list_view": 1 + }, + { + "fieldname": "status", + "fieldtype": "Select", + "label": "Status", + "options": "Upcoming\nDue Soon\nFiled\nOverdue\nWaived", + "default": "Upcoming", + "in_list_view": 1 + }, + { + "fieldname": "entity_section", + "fieldtype": "Section Break", + "label": "Entity" + }, + { + "fieldname": "entity_name", + "fieldtype": "Data", + "label": "Entity Name" + }, + { + "fieldname": "frn", + "fieldtype": "Data", + "label": "FRN" + }, + { + "fieldname": "customer", + "fieldtype": "Link", + "label": "Customer", + "options": "Customer" + }, + { + "fieldname": "details_section", + "fieldtype": "Section Break", + "label": "Details" + }, + { + "fieldname": "notes", + "fieldtype": "Small Text", + "label": "Notes" + }, + { + "fieldname": "linked_order", + "fieldtype": "Data", + "label": "Linked Order", + "description": "Compliance order number (CO-XXXXXXXX)" + }, + { + "fieldname": "published", + "fieldtype": "Check", + "label": "Published", + "default": "1" + }, + { + "fieldname": "route", + "fieldtype": "Data", + "label": "Route", + "hidden": 1 + } + ], + "index_web_pages_for_search": 0, + "issingle": 0, + "istable": 0, + "links": [], + "modified": "2026-05-04 00:00:00.000000", + "modified_by": "Administrator", + "module": "Compliance", + "name": "Compliance Deadline", + "naming_rule": "Random", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + }, + { + "create": 1, + "read": 1, + "report": 1, + "role": "Accounting Advisor", + "write": 1 + } + ], + "sort_field": "deadline_date", + "sort_order": "ASC", + "title_field": "title", + "track_changes": 1 +} diff --git a/performancewest_erpnext/performancewest_erpnext/compliance/doctype/compliance_deadline/compliance_deadline.py b/performancewest_erpnext/performancewest_erpnext/compliance/doctype/compliance_deadline/compliance_deadline.py new file mode 100644 index 0000000..4bee3f5 --- /dev/null +++ b/performancewest_erpnext/performancewest_erpnext/compliance/doctype/compliance_deadline/compliance_deadline.py @@ -0,0 +1,5 @@ +import frappe +from frappe.model.document import Document + +class ComplianceDeadline(Document): + pass