From 62e344188a2f82f70eca1910081dc6218b1655c0 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Fri, 31 Jul 2020 13:46:50 +0530 Subject: [PATCH] feat: update settings and link filters --- .../membership_settings.js | 10 ++- .../membership_settings.json | 83 ++++++++++++------- 2 files changed, 60 insertions(+), 33 deletions(-) diff --git a/erpnext/non_profit/doctype/membership_settings/membership_settings.js b/erpnext/non_profit/doctype/membership_settings/membership_settings.js index 02ef0292ea..1d894027b0 100644 --- a/erpnext/non_profit/doctype/membership_settings/membership_settings.js +++ b/erpnext/non_profit/doctype/membership_settings/membership_settings.js @@ -11,7 +11,7 @@ frappe.ui.form.on("Membership Settings", { }); } - frm.set_query('print_format', function(doc) { + frm.set_query('inv_print_format', function(doc) { return { filters: { "doc_type": "Sales Invoice" @@ -19,6 +19,14 @@ frappe.ui.form.on("Membership Settings", { }; }); + frm.set_query('membership_print_format', function(doc) { + return { + filters: { + "doc_type": "Membership" + } + }; + }); + frm.set_query('debit_account', function(doc) { return { filters: { diff --git a/erpnext/non_profit/doctype/membership_settings/membership_settings.json b/erpnext/non_profit/doctype/membership_settings/membership_settings.json index 37bea49826..7eeb7fbde2 100644 --- a/erpnext/non_profit/doctype/membership_settings/membership_settings.json +++ b/erpnext/non_profit/doctype/membership_settings/membership_settings.json @@ -11,15 +11,14 @@ "billing_frequency", "webhook_secret", "column_break_6", - "print_format", + "enable_auto_invoicing", "company", "debit_account", "column_break_9", - "enable_auto_invoicing", + "send_email", "send_invoice", - "section_break_10", - "new_member", - "renewal" + "membership_print_format", + "inv_print_format" ], "fields": [ { @@ -61,60 +60,63 @@ "default": "0", "fieldname": "enable_auto_invoicing", "fieldtype": "Check", - "label": "Enable Auto Invoicing" - }, - { - "fieldname": "print_format", - "fieldtype": "Link", - "label": "Print Format", - "options": "Print Format" - }, - { - "fieldname": "new_member", - "fieldtype": "Text Editor", - "label": "Message for New Member", + "label": "Enable Auto Invoicing", "mandatory_depends_on": "eval:doc.send_invoice" }, { - "fieldname": "renewal", - "fieldtype": "Text Editor", - "label": "Message for Renewal", - "mandatory_depends_on": "eval:doc.send_invoice" - }, - { - "depends_on": "eval:doc.company", + "depends_on": "eval:doc.enable_auto_invoicing", "fieldname": "debit_account", "fieldtype": "Link", "label": "Debit Account", + "mandatory_depends_on": "eval:doc.enable_auto_invoicing", "options": "Account" }, - { - "depends_on": "eval:doc.send_invoice", - "fieldname": "section_break_10", - "fieldtype": "Section Break", - "hide_border": 1 - }, { "fieldname": "column_break_9", "fieldtype": "Column Break" }, { + "depends_on": "eval:doc.enable_auto_invoicing", "fieldname": "company", "fieldtype": "Link", "label": "Company", + "mandatory_depends_on": "eval:doc.enable_auto_invoicing", "options": "Company" }, { "default": "0", + "depends_on": "eval:doc.enable_auto_invoicing && doc.send_email", "fieldname": "send_invoice", "fieldtype": "Check", - "label": "Send Email with Invoice" + "label": "Send Invoice with Email" + }, + { + "default": "0", + "fieldname": "send_email", + "fieldtype": "Check", + "label": "Send Acknowledge Email" + }, + { + "depends_on": "eval: doc.send_invoice", + "fieldname": "inv_print_format", + "fieldtype": "Link", + "label": "Invoice Print Format", + "mandatory_depends_on": "eval: doc.send_invoice", + "options": "Print Format" + }, + { + "depends_on": "eval:doc.send_email", + "fieldname": "membership_print_format", + "fieldtype": "Link", + "label": "Membership Print Format", + "mandatory_depends_on": "eval:doc.send_email", + "options": "Print Format" } ], "index_web_pages_for_search": 1, "issingle": 1, "links": [], - "modified": "2020-07-28 12:18:35.289893", + "modified": "2020-07-31 13:45:28.868235", "modified_by": "Administrator", "module": "Non Profit", "name": "Membership Settings", @@ -129,6 +131,23 @@ "role": "System Manager", "share": 1, "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "print": 1, + "read": 1, + "role": "Non Profit Manager", + "share": 1, + "write": 1 + }, + { + "email": 1, + "print": 1, + "read": 1, + "role": "Non Profit Member", + "share": 1 } ], "quick_entry": 1,