diff --git a/utility_billing/utility_billing/doctype/utility_category/__init__.py b/utility_billing/utility_billing/doctype/utility_category/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/utility_billing/utility_billing/doctype/utility_category/test_utility_category.py b/utility_billing/utility_billing/doctype/utility_category/test_utility_category.py new file mode 100644 index 0000000..cfaa466 --- /dev/null +++ b/utility_billing/utility_billing/doctype/utility_category/test_utility_category.py @@ -0,0 +1,9 @@ +# Copyright (c) 2024, Navari and Contributors +# See license.txt + +# import frappe +from frappe.tests.utils import FrappeTestCase + + +class TestUtilityCategory(FrappeTestCase): + pass diff --git a/utility_billing/utility_billing/doctype/utility_category/utility_category.js b/utility_billing/utility_billing/doctype/utility_category/utility_category.js new file mode 100644 index 0000000..87a9270 --- /dev/null +++ b/utility_billing/utility_billing/doctype/utility_category/utility_category.js @@ -0,0 +1,8 @@ +// Copyright (c) 2024, Navari and contributors +// For license information, please see license.txt + +// frappe.ui.form.on("Utility Category", { +// refresh(frm) { + +// }, +// }); diff --git a/utility_billing/utility_billing/doctype/utility_category/utility_category.json b/utility_billing/utility_billing/doctype/utility_category/utility_category.json new file mode 100644 index 0000000..5c1330a --- /dev/null +++ b/utility_billing/utility_billing/doctype/utility_category/utility_category.json @@ -0,0 +1,44 @@ +{ + "actions": [], + "allow_rename": 1, + "autoname": "field:title", + "creation": "2024-11-06 16:06:42.742911", + "doctype": "DocType", + "engine": "InnoDB", + "field_order": [ + "title" + ], + "fields": [ + { + "fieldname": "title", + "fieldtype": "Data", + "label": "Title", + "unique": 1 + } + ], + "index_web_pages_for_search": 1, + "links": [], + "modified": "2024-11-06 16:06:42.742911", + "modified_by": "Administrator", + "module": "Utility Billing", + "name": "Utility Category", + "naming_rule": "By fieldname", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], + "sort_field": "creation", + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/utility_billing/utility_billing/doctype/utility_category/utility_category.py b/utility_billing/utility_billing/doctype/utility_category/utility_category.py new file mode 100644 index 0000000..0f5ec6b --- /dev/null +++ b/utility_billing/utility_billing/doctype/utility_category/utility_category.py @@ -0,0 +1,9 @@ +# Copyright (c) 2024, Navari and contributors +# For license information, please see license.txt + +# import frappe +from frappe.model.document import Document + + +class UtilityCategory(Document): + pass diff --git a/utility_billing/utility_billing/doctype/utility_property/__init__.py b/utility_billing/utility_billing/doctype/utility_property/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/utility_billing/utility_billing/doctype/utility_property/test_utility_property.py b/utility_billing/utility_billing/doctype/utility_property/test_utility_property.py new file mode 100644 index 0000000..0f4bb9e --- /dev/null +++ b/utility_billing/utility_billing/doctype/utility_property/test_utility_property.py @@ -0,0 +1,9 @@ +# Copyright (c) 2024, Navari and Contributors +# See license.txt + +# import frappe +from frappe.tests.utils import FrappeTestCase + + +class TestUtilityProperty(FrappeTestCase): + pass diff --git a/utility_billing/utility_billing/doctype/utility_property/utility_property.js b/utility_billing/utility_billing/doctype/utility_property/utility_property.js new file mode 100644 index 0000000..84a004e --- /dev/null +++ b/utility_billing/utility_billing/doctype/utility_property/utility_property.js @@ -0,0 +1,12 @@ +// Copyright (c) 2024, Navari and contributors +// For license information, please see license.txt + +frappe.ui.form.on("Utility Property", { + refresh(frm) { + frm.toggle_display("address_html", !frm.is_new()); + frm.toggle_display("contact_html", !frm.is_new()); + if (!frm.is_new()) { + frappe.contacts.render_address_and_contact(frm); + } + }, +}); diff --git a/utility_billing/utility_billing/doctype/utility_property/utility_property.json b/utility_billing/utility_billing/doctype/utility_property/utility_property.json new file mode 100644 index 0000000..ac82769 --- /dev/null +++ b/utility_billing/utility_billing/doctype/utility_property/utility_property.json @@ -0,0 +1,154 @@ +{ + "actions": [], + "allow_rename": 1, + "autoname": "field:property_name", + "creation": "2024-11-06 15:58:52.896790", + "doctype": "DocType", + "engine": "InnoDB", + "field_order": [ + "section_break_uwso", + "property_name", + "territory", + "utility_category", + "location", + "parent_utility_property", + "is_group", + "column_break_dhhw", + "lft", + "plot_no", + "house_no", + "rgt", + "old_parent", + "address_contacts_tab", + "address_html", + "column_break_txlm", + "contact_html" + ], + "fields": [ + { + "fieldname": "section_break_uwso", + "fieldtype": "Section Break" + }, + { + "fieldname": "lft", + "fieldtype": "Int", + "hidden": 1, + "label": "Left", + "no_copy": 1, + "read_only": 1 + }, + { + "fieldname": "rgt", + "fieldtype": "Int", + "hidden": 1, + "label": "Right", + "no_copy": 1, + "read_only": 1 + }, + { + "default": "0", + "fieldname": "is_group", + "fieldtype": "Check", + "label": "Is Group" + }, + { + "fieldname": "old_parent", + "fieldtype": "Link", + "label": "Old Parent", + "options": "Utility Property" + }, + { + "fieldname": "parent_utility_property", + "fieldtype": "Link", + "ignore_user_permissions": 1, + "label": "Parent Utility Property", + "options": "Utility Property" + }, + { + "fieldname": "property_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Name", + "reqd": 1, + "unique": 1 + }, + { + "fieldname": "column_break_dhhw", + "fieldtype": "Column Break" + }, + { + "fieldname": "territory", + "fieldtype": "Link", + "label": "Territory", + "options": "Territory" + }, + { + "fieldname": "utility_category", + "fieldtype": "Link", + "label": "Utility Category", + "options": "Utility Category" + }, + { + "fieldname": "location", + "fieldtype": "Link", + "label": "Location", + "options": "Location" + }, + { + "fieldname": "plot_no", + "fieldtype": "Data", + "label": "Plot No" + }, + { + "fieldname": "house_no", + "fieldtype": "Data", + "label": "House No" + }, + { + "fieldname": "address_contacts_tab", + "fieldtype": "Tab Break", + "label": "Address & Contacts" + }, + { + "fieldname": "address_html", + "fieldtype": "HTML", + "label": "Address HTML" + }, + { + "fieldname": "column_break_txlm", + "fieldtype": "Column Break" + }, + { + "fieldname": "contact_html", + "fieldtype": "HTML", + "label": "Contact HTML" + } + ], + "index_web_pages_for_search": 1, + "is_tree": 1, + "links": [], + "modified": "2024-11-06 16:19:19.100357", + "modified_by": "Administrator", + "module": "Utility Billing", + "name": "Utility Property", + "naming_rule": "By fieldname", + "nsm_parent_field": "parent_utility_property", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/utility_billing/utility_billing/doctype/utility_property/utility_property.py b/utility_billing/utility_billing/doctype/utility_property/utility_property.py new file mode 100644 index 0000000..c063eb6 --- /dev/null +++ b/utility_billing/utility_billing/doctype/utility_property/utility_property.py @@ -0,0 +1,11 @@ +# Copyright (c) 2024, Navari and contributors +# For license information, please see license.txt + +# import frappe +from frappe.utils.nestedset import NestedSet +from frappe.contacts.address_and_contact import load_address_and_contact + + +class UtilityProperty(NestedSet): + def onload(self): + load_address_and_contact(self) diff --git a/utility_billing/utility_billing/doctype/utility_service_request/utility_service_request.py b/utility_billing/utility_billing/doctype/utility_service_request/utility_service_request.py index fe1443b..b64ffba 100644 --- a/utility_billing/utility_billing/doctype/utility_service_request/utility_service_request.py +++ b/utility_billing/utility_billing/doctype/utility_service_request/utility_service_request.py @@ -12,7 +12,7 @@ class UtilityServiceRequest(Document): def onload(self): load_address_and_contact(self) - + @frappe.whitelist() def create_customer_and_sales_order(docname):