From d9956e4f310f0a9798b64b7c1aaee847940491cd Mon Sep 17 00:00:00 2001 From: muruthigitau Date: Thu, 17 Oct 2024 07:32:29 +0300 Subject: [PATCH 1/2] fix: meter reading tariffs and price list loading --- .../item_price_tariff/item_price_tariff.json | 6 +++++- .../doctype/meter_reading/meter_reading.json | 3 +-- .../doctype/meter_reading/meter_reading.py | 1 + .../meter_reading_rate.json | 19 +++---------------- .../utils/create_meter_reading_rates.py | 1 + 5 files changed, 11 insertions(+), 19 deletions(-) diff --git a/utility_billing/utility_billing/doctype/item_price_tariff/item_price_tariff.json b/utility_billing/utility_billing/doctype/item_price_tariff/item_price_tariff.json index b3dfa22..a600833 100644 --- a/utility_billing/utility_billing/doctype/item_price_tariff/item_price_tariff.json +++ b/utility_billing/utility_billing/doctype/item_price_tariff/item_price_tariff.json @@ -42,6 +42,10 @@ { "fieldname": "block", "fieldtype": "Data", + "in_filter": 1, + "in_list_view": 1, + "in_preview": 1, + "in_standard_filter": 1, "label": "Block", "reqd": 1 } @@ -49,7 +53,7 @@ "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2024-10-16 14:44:47.681695", + "modified": "2024-10-17 06:20:57.592318", "modified_by": "Administrator", "module": "Utility Billing", "name": "Item Price Tariff", diff --git a/utility_billing/utility_billing/doctype/meter_reading/meter_reading.json b/utility_billing/utility_billing/doctype/meter_reading/meter_reading.json index 0b156f2..c3950fa 100644 --- a/utility_billing/utility_billing/doctype/meter_reading/meter_reading.json +++ b/utility_billing/utility_billing/doctype/meter_reading/meter_reading.json @@ -87,7 +87,6 @@ "default": "MR-.YYYY.MM.-", "fieldname": "naming_series", "fieldtype": "Select", - "hidden": 1, "in_list_view": 1, "label": "Series", "options": "MR-.YYYY.MM.-", @@ -132,7 +131,7 @@ "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], - "modified": "2024-10-15 13:20:50.730593", + "modified": "2024-10-17 06:30:56.344965", "modified_by": "Administrator", "module": "Utility Billing", "name": "Meter Reading", diff --git a/utility_billing/utility_billing/doctype/meter_reading/meter_reading.py b/utility_billing/utility_billing/doctype/meter_reading/meter_reading.py index a5bd4b9..0505619 100644 --- a/utility_billing/utility_billing/doctype/meter_reading/meter_reading.py +++ b/utility_billing/utility_billing/doctype/meter_reading/meter_reading.py @@ -41,6 +41,7 @@ def create_sales_order(meter_reading): "qty": round(rate.qty), "rate": rate.rate, "amount": rate.amount, + "block": rate.block, "delivery_date": nowdate(), }, ) diff --git a/utility_billing/utility_billing/doctype/meter_reading_rate/meter_reading_rate.json b/utility_billing/utility_billing/doctype/meter_reading_rate/meter_reading_rate.json index 294f73f..652b794 100644 --- a/utility_billing/utility_billing/doctype/meter_reading_rate/meter_reading_rate.json +++ b/utility_billing/utility_billing/doctype/meter_reading_rate/meter_reading_rate.json @@ -18,7 +18,6 @@ "fieldname": "meter_reading_item", "fieldtype": "Link", "in_filter": 1, - "in_list_view": 1, "in_preview": 1, "in_standard_filter": 1, "label": "Meter Reading Item", @@ -85,26 +84,14 @@ } ], "index_web_pages_for_search": 1, + "istable": 1, "links": [], - "modified": "2024-10-17 05:34:18.084480", + "modified": "2024-10-17 06:25:22.454232", "modified_by": "Administrator", "module": "Utility Billing", "name": "Meter Reading Rate", "owner": "Administrator", - "permissions": [ - { - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "System Manager", - "share": 1, - "write": 1 - } - ], + "permissions": [], "sort_field": "creation", "sort_order": "DESC", "states": [] diff --git a/utility_billing/utility_billing/utils/create_meter_reading_rates.py b/utility_billing/utility_billing/utils/create_meter_reading_rates.py index 3376810..cfad7b6 100644 --- a/utility_billing/utility_billing/utils/create_meter_reading_rates.py +++ b/utility_billing/utility_billing/utils/create_meter_reading_rates.py @@ -46,6 +46,7 @@ def create_meter_reading_rates(meter_reading, price_list, reading_date): { "meter_reading_item": item.name, "item_code": item.item_code, + "block": tariff.block, "qty": slab_quantity, "amount": amount, "rate": rate, From 4bf26b1fd73a124dbe9456534d281d61033c0a19 Mon Sep 17 00:00:00 2001 From: muruthigitau Date: Thu, 17 Oct 2024 07:40:35 +0300 Subject: [PATCH 2/2] chore: workspace fixture - utility billing linking to selling --- utility_billing/fixtures/custom_field.json | 56 +++++++++++++++++++ utility_billing/fixtures/doctype_link.json | 34 +++++++++++ utility_billing/fixtures/workspace.json | 54 ++++++++++++++++++ .../utility_billing/utility_billing.json | 46 +++++++++++++++ 4 files changed, 190 insertions(+) create mode 100644 utility_billing/utility_billing/workspace/utility_billing/utility_billing.json diff --git a/utility_billing/fixtures/custom_field.json b/utility_billing/fixtures/custom_field.json index 015ae23..23b0d75 100644 --- a/utility_billing/fixtures/custom_field.json +++ b/utility_billing/fixtures/custom_field.json @@ -279,6 +279,62 @@ "unique": 0, "width": null }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "doctype": "Custom Field", + "dt": "Sales Order Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "block", + "fieldtype": "Data", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "meter_number", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Block", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-10-17 06:28:22.017747", + "module": "Utility Billing", + "name": "Sales Order Item-custom_block", + "no_copy": 0, + "non_negative": 0, + "options": null, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, { "allow_in_quick_entry": 0, "allow_on_submit": 0, diff --git a/utility_billing/fixtures/doctype_link.json b/utility_billing/fixtures/doctype_link.json index 3626140..3de99b8 100644 --- a/utility_billing/fixtures/doctype_link.json +++ b/utility_billing/fixtures/doctype_link.json @@ -66,5 +66,39 @@ "parentfield": "links", "parenttype": "DocType", "table_fieldname": "sales_order" + }, + { + "custom": 0, + "docstatus": 0, + "doctype": "DocType Link", + "group": "Utility Billing", + "hidden": 0, + "is_child_table": 0, + "link_doctype": "Utility Service Request", + "link_fieldname": "sales_order", + "modified": "2024-10-16 15:05:45.346765", + "name": "qhct5747de", + "parent": "Sales Order", + "parent_doctype": null, + "parentfield": "links", + "parenttype": "DocType", + "table_fieldname": null + }, + { + "custom": 0, + "docstatus": 0, + "doctype": "DocType Link", + "group": "Utility Billing", + "hidden": 0, + "is_child_table": 0, + "link_doctype": "Meter Reading", + "link_fieldname": "sales_order", + "modified": "2024-10-16 15:05:45.346765", + "name": "qhct5cue67", + "parent": "Sales Order", + "parent_doctype": null, + "parentfield": "links", + "parenttype": "DocType", + "table_fieldname": "sales_order" } ] \ No newline at end of file diff --git a/utility_billing/fixtures/workspace.json b/utility_billing/fixtures/workspace.json index b4eb446..9a5654b 100644 --- a/utility_billing/fixtures/workspace.json +++ b/utility_billing/fixtures/workspace.json @@ -1,4 +1,58 @@ [ + { + "app": null, + "charts": [], + "content": "[{\"id\":\"fqWR1Nv2hU\",\"type\":\"header\",\"data\":{\"text\":\"Utility Billing Shortcuts
\",\"col\":12}},{\"id\":\"_3e05httN7\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Meter Reading\",\"col\":3}},{\"id\":\"1acTaFDYDY\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Utility Service Request\",\"col\":4}}]", + "custom_blocks": [], + "docstatus": 0, + "doctype": "Workspace", + "for_user": "", + "hide_custom": 0, + "icon": "milestone", + "indicator_color": "green", + "is_hidden": 0, + "label": "Utility Billing", + "links": [], + "modified": "2024-10-17 06:39:06.370295", + "module": "Utility Billing", + "name": "Utility Billing", + "number_cards": [], + "parent_page": "Selling", + "public": 1, + "quick_lists": [], + "restrict_to_domain": null, + "roles": [], + "sequence_id": 48.0, + "shortcuts": [ + { + "color": "Grey", + "doc_view": "List", + "format": null, + "icon": null, + "kanban_board": null, + "label": "Meter Reading", + "link_to": "Meter Reading", + "restrict_to_domain": null, + "stats_filter": "[]", + "type": "DocType", + "url": null + }, + { + "color": "Grey", + "doc_view": "List", + "format": null, + "icon": null, + "kanban_board": null, + "label": "Utility Service Request", + "link_to": "Utility Service Request", + "restrict_to_domain": null, + "stats_filter": "[]", + "type": "DocType", + "url": null + } + ], + "title": "Utility Billing" + }, { "app": null, "charts": [ diff --git a/utility_billing/utility_billing/workspace/utility_billing/utility_billing.json b/utility_billing/utility_billing/workspace/utility_billing/utility_billing.json new file mode 100644 index 0000000..2b78d0f --- /dev/null +++ b/utility_billing/utility_billing/workspace/utility_billing/utility_billing.json @@ -0,0 +1,46 @@ +{ + "charts": [], + "content": "[{\"id\":\"fqWR1Nv2hU\",\"type\":\"header\",\"data\":{\"text\":\"Utility Billing Shortcuts
\",\"col\":12}},{\"id\":\"_3e05httN7\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Meter Reading\",\"col\":3}},{\"id\":\"1acTaFDYDY\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Utility Service Request\",\"col\":4}}]", + "creation": "2024-10-15 09:19:30.540834", + "custom_blocks": [], + "docstatus": 0, + "doctype": "Workspace", + "for_user": "", + "hide_custom": 0, + "icon": "milestone", + "idx": 0, + "indicator_color": "green", + "is_hidden": 0, + "label": "Utility Billing", + "links": [], + "modified": "2024-10-17 06:39:06.370295", + "modified_by": "Administrator", + "module": "Utility Billing", + "name": "Utility Billing", + "number_cards": [], + "owner": "Administrator", + "parent_page": "Selling", + "public": 1, + "quick_lists": [], + "roles": [], + "sequence_id": 48.0, + "shortcuts": [ + { + "color": "Grey", + "doc_view": "List", + "label": "Meter Reading", + "link_to": "Meter Reading", + "stats_filter": "[]", + "type": "DocType" + }, + { + "color": "Grey", + "doc_view": "List", + "label": "Utility Service Request", + "link_to": "Utility Service Request", + "stats_filter": "[]", + "type": "DocType" + } + ], + "title": "Utility Billing" +} \ No newline at end of file