refactor: make health check configurable for companies
diff --git a/erpnext/accounts/doctype/ledger_health_monitor/ledger_health_monitor.json b/erpnext/accounts/doctype/ledger_health_monitor/ledger_health_monitor.json
index 9a91648..4c1c8f8 100644
--- a/erpnext/accounts/doctype/ledger_health_monitor/ledger_health_monitor.json
+++ b/erpnext/accounts/doctype/ledger_health_monitor/ledger_health_monitor.json
@@ -9,7 +9,9 @@
"monitor_section",
"monitor_for_last_x_days",
"debit_credit_mismatch",
- "general_and_payment_ledger_mismatch"
+ "general_and_payment_ledger_mismatch",
+ "section_break_xdsp",
+ "companies"
],
"fields": [
{
@@ -21,7 +23,7 @@
{
"fieldname": "monitor_section",
"fieldtype": "Section Break",
- "label": "Monitor"
+ "label": "Configuration"
},
{
"default": "0",
@@ -42,12 +44,22 @@
"in_list_view": 1,
"label": "Monitor for Last 'X' days",
"reqd": 1
+ },
+ {
+ "fieldname": "section_break_xdsp",
+ "fieldtype": "Section Break",
+ "label": "Companies"
+ },
+ {
+ "fieldname": "companies",
+ "fieldtype": "Table",
+ "options": "Ledger Health Monitor Company"
}
],
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
- "modified": "2024-03-27 09:53:00.674708",
+ "modified": "2024-03-27 10:07:28.601546",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Ledger Health Monitor",
diff --git a/erpnext/accounts/doctype/ledger_health_monitor/ledger_health_monitor.py b/erpnext/accounts/doctype/ledger_health_monitor/ledger_health_monitor.py
index c6a3379..9f7c569 100644
--- a/erpnext/accounts/doctype/ledger_health_monitor/ledger_health_monitor.py
+++ b/erpnext/accounts/doctype/ledger_health_monitor/ledger_health_monitor.py
@@ -14,6 +14,11 @@
if TYPE_CHECKING:
from frappe.types import DF
+ from erpnext.accounts.doctype.ledger_health_monitor_company.ledger_health_monitor_company import (
+ LedgerHealthMonitorCompany,
+ )
+
+ companies: DF.Table[LedgerHealthMonitorCompany]
debit_credit_mismatch: DF.Check
enable_health_monitor: DF.Check
general_and_payment_ledger_mismatch: DF.Check
diff --git a/erpnext/accounts/doctype/ledger_health_monitor_company/__init__.py b/erpnext/accounts/doctype/ledger_health_monitor_company/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/accounts/doctype/ledger_health_monitor_company/__init__.py
diff --git a/erpnext/accounts/doctype/ledger_health_monitor_company/ledger_health_monitor_company.json b/erpnext/accounts/doctype/ledger_health_monitor_company/ledger_health_monitor_company.json
new file mode 100644
index 0000000..87fa3e3
--- /dev/null
+++ b/erpnext/accounts/doctype/ledger_health_monitor_company/ledger_health_monitor_company.json
@@ -0,0 +1,32 @@
+{
+ "actions": [],
+ "allow_rename": 1,
+ "creation": "2024-03-27 10:04:45.727054",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+ "company"
+ ],
+ "fields": [
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "in_list_view": 1,
+ "label": "Company",
+ "options": "Company"
+ }
+ ],
+ "index_web_pages_for_search": 1,
+ "istable": 1,
+ "links": [],
+ "modified": "2024-03-27 10:06:22.806155",
+ "modified_by": "Administrator",
+ "module": "Accounts",
+ "name": "Ledger Health Monitor Company",
+ "owner": "Administrator",
+ "permissions": [],
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "states": []
+}
\ No newline at end of file
diff --git a/erpnext/accounts/doctype/ledger_health_monitor_company/ledger_health_monitor_company.py b/erpnext/accounts/doctype/ledger_health_monitor_company/ledger_health_monitor_company.py
new file mode 100644
index 0000000..5890410
--- /dev/null
+++ b/erpnext/accounts/doctype/ledger_health_monitor_company/ledger_health_monitor_company.py
@@ -0,0 +1,23 @@
+# Copyright (c) 2024, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+# import frappe
+from frappe.model.document import Document
+
+
+class LedgerHealthMonitorCompany(Document):
+ # begin: auto-generated types
+ # This code is auto-generated. Do not modify anything in this block.
+
+ from typing import TYPE_CHECKING
+
+ if TYPE_CHECKING:
+ from frappe.types import DF
+
+ company: DF.Link | None
+ parent: DF.Data
+ parentfield: DF.Data
+ parenttype: DF.Data
+ # end: auto-generated types
+
+ pass