Add Compliance Deadline + Compliance Calendar DocTypes for ERPNext

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) <noreply@anthropic.com>
This commit is contained in:
justin 2026-05-04 11:26:45 -05:00
parent d6da7f4d7b
commit 05eec47528
6 changed files with 346 additions and 0 deletions

View file

@ -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
}

View file

@ -0,0 +1,5 @@
import frappe
from frappe.model.document import Document
class ComplianceCalendar(Document):
pass

View file

@ -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
}

View file

@ -0,0 +1,5 @@
import frappe
from frappe.model.document import Document
class ComplianceDeadline(Document):
pass