From 8976e94a1d697a2a9a8930a3fe9274a0443dc176 Mon Sep 17 00:00:00 2001 From: barredterra <14891507+barredterra@users.noreply.github.com> Date: Thu, 16 Sep 2021 16:38:36 +0200 Subject: [PATCH] feat: rework doctypes --- erpnext/accounts/doctype/dunning/dunning.json | 80 ++++++++++++++----- .../doctype/dunning_type/dunning_type.json | 33 +++----- 2 files changed, 67 insertions(+), 46 deletions(-) diff --git a/erpnext/accounts/doctype/dunning/dunning.json b/erpnext/accounts/doctype/dunning/dunning.json index b609a5ce14..a0e3c150fd 100644 --- a/erpnext/accounts/doctype/dunning/dunning.json +++ b/erpnext/accounts/doctype/dunning/dunning.json @@ -6,7 +6,6 @@ "doctype": "DocType", "engine": "InnoDB", "field_order": [ - "title", "naming_series", "customer", "customer_name", @@ -33,18 +32,24 @@ "section_break_12", "overdue_payments", "section_break_28", - "column_break_17", "total_interest", - "total_outstanding", "dunning_fee", + "column_break_17", + "dunning_amount", + "section_break_32", + "spacer", + "column_break_33", + "total_outstanding", "grand_total", - "income_account", - "printing_setting_section", + "printing_settings_section", "language", "body_text", "column_break_22", "letter_head", "closing_text", + "accounting_details_section", + "cost_center", + "income_account", "amended_from" ], "fields": [ @@ -60,7 +65,8 @@ "fieldname": "naming_series", "fieldtype": "Select", "label": "Series", - "options": "DUNN-.MM.-.YY.-" + "options": "DUNN-.MM.-.YY.-", + "print_hide": 1 }, { "fetch_from": "sales_invoice.customer_name", @@ -91,8 +97,7 @@ "in_list_view": 1, "in_standard_filter": 1, "label": "Dunning Type", - "options": "Dunning Type", - "reqd": 1 + "options": "Dunning Type" }, { "fieldname": "column_break_8", @@ -116,11 +121,6 @@ "fieldname": "column_break_17", "fieldtype": "Column Break" }, - { - "fieldname": "printing_setting_section", - "fieldtype": "Section Break", - "label": "Printing Setting" - }, { "fieldname": "language", "fieldtype": "Link", @@ -155,14 +155,6 @@ "print_hide": 1, "read_only": 1 }, - { - "allow_on_submit": 1, - "default": "{customer_name}", - "fieldname": "title", - "fieldtype": "Data", - "hidden": 1, - "label": "Title" - }, { "fieldname": "body_text", "fieldtype": "Text Editor", @@ -260,10 +252,12 @@ "options": "Draft\nResolved\nUnresolved\nCancelled" }, { + "description": "For dunning fee and interest", "fieldname": "income_account", "fieldtype": "Link", "label": "Income Account", - "options": "Account" + "options": "Account", + "print_hide": 1 }, { "fetch_from": "sales_invoice.conversion_rate", @@ -310,6 +304,48 @@ "fieldtype": "Link", "label": "Contact Person", "options": "Contact" + }, + { + "fieldname": "dunning_amount", + "fieldtype": "Currency", + "label": "Dunning Amount", + "options": "currency", + "read_only": 1 + }, + { + "collapsible": 1, + "fieldname": "accounting_details_section", + "fieldtype": "Section Break", + "label": "Accounting Details" + }, + { + "fieldname": "cost_center", + "fieldtype": "Link", + "label": "Cost Center", + "options": "Cost Center" + }, + { + "collapsible": 1, + "fieldname": "printing_settings_section", + "fieldtype": "Section Break", + "label": "Printing Settings" + }, + { + "fieldname": "section_break_32", + "fieldtype": "Section Break" + }, + { + "fieldname": "column_break_33", + "fieldtype": "Column Break" + }, + { + "fieldname": "spacer", + "fieldtype": "Data", + "hidden": 1, + "label": "Spacer", + "print_hide": 1, + "read_only": 1, + "report_hide": 1 } ], "is_submittable": 1, diff --git a/erpnext/accounts/doctype/dunning_type/dunning_type.json b/erpnext/accounts/doctype/dunning_type/dunning_type.json index da43664472..ca33ce58a9 100644 --- a/erpnext/accounts/doctype/dunning_type/dunning_type.json +++ b/erpnext/accounts/doctype/dunning_type/dunning_type.json @@ -8,10 +8,7 @@ "engine": "InnoDB", "field_order": [ "dunning_type", - "overdue_interval_section", - "start_day", - "column_break_4", - "end_day", + "is_default", "section_break_6", "dunning_fee", "column_break_8", @@ -45,10 +42,6 @@ "fieldtype": "Table", "options": "Dunning Letter Text" }, - { - "fieldname": "column_break_4", - "fieldtype": "Column Break" - }, { "fieldname": "section_break_6", "fieldtype": "Section Break" @@ -57,33 +50,25 @@ "fieldname": "column_break_8", "fieldtype": "Column Break" }, - { - "fieldname": "overdue_interval_section", - "fieldtype": "Section Break", - "label": "Overdue Interval" - }, - { - "fieldname": "start_day", - "fieldtype": "Int", - "label": "Start Day" - }, - { - "fieldname": "end_day", - "fieldtype": "Int", - "label": "End Day" - }, { "fieldname": "rate_of_interest", "fieldtype": "Float", "in_list_view": 1, "label": "Rate of Interest (%) Yearly" + }, + { + "default": "0", + "fieldname": "is_default", + "fieldtype": "Check", + "label": "Is Default" } ], "links": [], - "modified": "2020-07-15 17:14:17.835074", + "modified": "2021-09-16 15:00:02.610605", "modified_by": "Administrator", "module": "Accounts", "name": "Dunning Type", + "naming_rule": "By fieldname", "owner": "Administrator", "permissions": [ {