feat: update settings and link filters

This commit is contained in:
Shivam Mishra 2020-07-31 13:46:50 +05:30
parent 15340e0c7f
commit 62e344188a
2 changed files with 60 additions and 33 deletions

View File

@ -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 { return {
filters: { filters: {
"doc_type": "Sales Invoice" "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) { frm.set_query('debit_account', function(doc) {
return { return {
filters: { filters: {

View File

@ -11,15 +11,14 @@
"billing_frequency", "billing_frequency",
"webhook_secret", "webhook_secret",
"column_break_6", "column_break_6",
"print_format", "enable_auto_invoicing",
"company", "company",
"debit_account", "debit_account",
"column_break_9", "column_break_9",
"enable_auto_invoicing", "send_email",
"send_invoice", "send_invoice",
"section_break_10", "membership_print_format",
"new_member", "inv_print_format"
"renewal"
], ],
"fields": [ "fields": [
{ {
@ -61,60 +60,63 @@
"default": "0", "default": "0",
"fieldname": "enable_auto_invoicing", "fieldname": "enable_auto_invoicing",
"fieldtype": "Check", "fieldtype": "Check",
"label": "Enable Auto Invoicing" "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",
"mandatory_depends_on": "eval:doc.send_invoice" "mandatory_depends_on": "eval:doc.send_invoice"
}, },
{ {
"fieldname": "renewal", "depends_on": "eval:doc.enable_auto_invoicing",
"fieldtype": "Text Editor",
"label": "Message for Renewal",
"mandatory_depends_on": "eval:doc.send_invoice"
},
{
"depends_on": "eval:doc.company",
"fieldname": "debit_account", "fieldname": "debit_account",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Debit Account", "label": "Debit Account",
"mandatory_depends_on": "eval:doc.enable_auto_invoicing",
"options": "Account" "options": "Account"
}, },
{
"depends_on": "eval:doc.send_invoice",
"fieldname": "section_break_10",
"fieldtype": "Section Break",
"hide_border": 1
},
{ {
"fieldname": "column_break_9", "fieldname": "column_break_9",
"fieldtype": "Column Break" "fieldtype": "Column Break"
}, },
{ {
"depends_on": "eval:doc.enable_auto_invoicing",
"fieldname": "company", "fieldname": "company",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Company", "label": "Company",
"mandatory_depends_on": "eval:doc.enable_auto_invoicing",
"options": "Company" "options": "Company"
}, },
{ {
"default": "0", "default": "0",
"depends_on": "eval:doc.enable_auto_invoicing && doc.send_email",
"fieldname": "send_invoice", "fieldname": "send_invoice",
"fieldtype": "Check", "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, "index_web_pages_for_search": 1,
"issingle": 1, "issingle": 1,
"links": [], "links": [],
"modified": "2020-07-28 12:18:35.289893", "modified": "2020-07-31 13:45:28.868235",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Non Profit", "module": "Non Profit",
"name": "Membership Settings", "name": "Membership Settings",
@ -129,6 +131,23 @@
"role": "System Manager", "role": "System Manager",
"share": 1, "share": 1,
"write": 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, "quick_entry": 1,