refactor: Remove non-profit domain from ERPNext
This commit is contained in:
parent
ac816f4fed
commit
0c0a9ed96d
@ -1,22 +0,0 @@
|
||||
data = {
|
||||
'desktop_icons': [
|
||||
'Non Profit',
|
||||
'Member',
|
||||
'Donor',
|
||||
'Volunteer',
|
||||
'Grant Application',
|
||||
'Accounts',
|
||||
'Buying',
|
||||
'HR',
|
||||
'ToDo'
|
||||
],
|
||||
'restricted_roles': [
|
||||
'Non Profit Manager',
|
||||
'Non Profit Member',
|
||||
'Non Profit Portal User'
|
||||
],
|
||||
'modules': [
|
||||
'Non Profit'
|
||||
],
|
||||
'default_portal_role': 'Non Profit Manager'
|
||||
}
|
@ -69,7 +69,6 @@ domains = {
|
||||
'Education': 'erpnext.domains.education',
|
||||
'Hospitality': 'erpnext.domains.hospitality',
|
||||
'Manufacturing': 'erpnext.domains.manufacturing',
|
||||
'Non Profit': 'erpnext.domains.non_profit',
|
||||
'Retail': 'erpnext.domains.retail',
|
||||
'Services': 'erpnext.domains.services',
|
||||
}
|
||||
@ -176,7 +175,6 @@ standard_portal_menu_items = [
|
||||
{"title": _("Fees"), "route": "/fees", "reference_doctype": "Fees", "role":"Student"},
|
||||
{"title": _("Newsletter"), "route": "/newsletters", "reference_doctype": "Newsletter"},
|
||||
{"title": _("Admission"), "route": "/admissions", "reference_doctype": "Student Admission", "role": "Student"},
|
||||
{"title": _("Certification"), "route": "/certification", "reference_doctype": "Certification Application", "role": "Non Profit Portal User"},
|
||||
{"title": _("Material Request"), "route": "/material-requests", "reference_doctype": "Material Request", "role": "Customer"},
|
||||
{"title": _("Appointment Booking"), "route": "/book_appointment"},
|
||||
]
|
||||
@ -373,7 +371,6 @@ scheduler_events = {
|
||||
"erpnext.selling.doctype.quotation.quotation.set_expired_status",
|
||||
"erpnext.buying.doctype.supplier_quotation.supplier_quotation.set_expired_status",
|
||||
"erpnext.accounts.doctype.process_statement_of_accounts.process_statement_of_accounts.send_auto_email",
|
||||
"erpnext.non_profit.doctype.membership.membership.set_expired_status",
|
||||
"erpnext.hr.doctype.interview.interview.send_daily_feedback_reminder"
|
||||
],
|
||||
"daily_long": [
|
||||
@ -566,19 +563,6 @@ global_search_doctypes = {
|
||||
{'doctype': 'Assessment Code', 'index': 39},
|
||||
{'doctype': 'Discussion', 'index': 40},
|
||||
],
|
||||
"Non Profit": [
|
||||
{'doctype': 'Certified Consultant', 'index': 1},
|
||||
{'doctype': 'Certification Application', 'index': 2},
|
||||
{'doctype': 'Volunteer', 'index': 3},
|
||||
{'doctype': 'Membership', 'index': 4},
|
||||
{'doctype': 'Member', 'index': 5},
|
||||
{'doctype': 'Donor', 'index': 6},
|
||||
{'doctype': 'Chapter', 'index': 7},
|
||||
{'doctype': 'Grant Application', 'index': 8},
|
||||
{'doctype': 'Volunteer Type', 'index': 9},
|
||||
{'doctype': 'Donor Type', 'index': 10},
|
||||
{'doctype': 'Membership Type', 'index': 11}
|
||||
],
|
||||
"Hospitality": [
|
||||
{'doctype': 'Hotel Room', 'index': 0},
|
||||
{'doctype': 'Hotel Room Reservation', 'index': 1},
|
||||
|
@ -17,7 +17,6 @@ Education
|
||||
Regional
|
||||
Restaurant
|
||||
ERPNext Integrations
|
||||
Non Profit
|
||||
Hotels
|
||||
Quality Management
|
||||
Communication
|
||||
|
@ -1,8 +0,0 @@
|
||||
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Certification Application', {
|
||||
refresh: function(frm) {
|
||||
|
||||
}
|
||||
});
|
@ -1,323 +0,0 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_events_in_timeline": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
"autoname": "NPO-CAPP-.YYYY.-.#####",
|
||||
"beta": 0,
|
||||
"creation": "2018-06-08 16:12:42.091729",
|
||||
"custom": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "DocType",
|
||||
"document_type": "",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"fields": [
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "name_of_applicant",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Name of Applicant",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "email",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Email",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "User",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "column_break_1",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "certification_status",
|
||||
"fieldtype": "Select",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Certification Status",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Yet to appear\nCertified\nNot Certified",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "payment_details",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Payment Details",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "paid",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Paid",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "currency",
|
||||
"fieldtype": "Select",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Currency",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "USD\nINR",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "amount",
|
||||
"fieldtype": "Float",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
}
|
||||
],
|
||||
"has_web_view": 0,
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 0,
|
||||
"idx": 0,
|
||||
"image_view": 0,
|
||||
"in_create": 0,
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2018-11-04 03:36:35.337403",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Non Profit",
|
||||
"name": "Certification Application",
|
||||
"name_case": "",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"amend": 0,
|
||||
"cancel": 0,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "System Manager",
|
||||
"set_user_permissions": 0,
|
||||
"share": 1,
|
||||
"submit": 0,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"quick_entry": 0,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"restrict_to_domain": "Non Profit",
|
||||
"show_name_in_global_search": 0,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1,
|
||||
"track_seen": 0,
|
||||
"track_views": 0
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class CertificationApplication(Document):
|
||||
pass
|
@ -1,8 +0,0 @@
|
||||
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestCertificationApplication(unittest.TestCase):
|
||||
pass
|
@ -1,8 +0,0 @@
|
||||
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Certified Consultant', {
|
||||
refresh: function(frm) {
|
||||
|
||||
}
|
||||
});
|
@ -1,724 +0,0 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_events_in_timeline": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
"autoname": "NPO-CONS-.YYYY.-.#####",
|
||||
"beta": 0,
|
||||
"creation": "2018-06-13 17:27:19.838334",
|
||||
"custom": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "DocType",
|
||||
"document_type": "",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"fields": [
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "name_of_consultant",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Name of Consultant",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "country",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Country",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Country",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "email",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Email",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "User",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "phone",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Phone",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "website_url",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Website",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "address",
|
||||
"fieldtype": "Small Text",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Address",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "column_break1",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "image",
|
||||
"fieldtype": "Attach Image",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Image",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "certification_application",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Certification Application",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Certification Application",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "section_break1",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Certification Validity",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "from_date",
|
||||
"fieldtype": "Date",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "From",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "column_beak2",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "to_date",
|
||||
"fieldtype": "Date",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "To",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "section_break2",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "introduction",
|
||||
"fieldtype": "Small Text",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Introduction",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "details",
|
||||
"fieldtype": "Text Editor",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Details",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "section_break3",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "discuss_id",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Discuss ID",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "github_id",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "GitHub ID",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_in_quick_entry": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "show_in_website",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Show in Website",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
}
|
||||
],
|
||||
"has_web_view": 0,
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 0,
|
||||
"idx": 0,
|
||||
"image_view": 0,
|
||||
"in_create": 0,
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2018-11-04 03:36:47.386618",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Non Profit",
|
||||
"name": "Certified Consultant",
|
||||
"name_case": "",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"amend": 0,
|
||||
"cancel": 0,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "System Manager",
|
||||
"set_user_permissions": 0,
|
||||
"share": 1,
|
||||
"submit": 0,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"cancel": 0,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Non Profit Manager",
|
||||
"set_user_permissions": 0,
|
||||
"share": 1,
|
||||
"submit": 0,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"quick_entry": 0,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"restrict_to_domain": "Non Profit",
|
||||
"show_name_in_global_search": 0,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1,
|
||||
"track_seen": 0,
|
||||
"track_views": 0
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class CertifiedConsultant(Document):
|
||||
pass
|
@ -1,8 +0,0 @@
|
||||
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestCertifiedConsultant(unittest.TestCase):
|
||||
pass
|
@ -1,8 +0,0 @@
|
||||
// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Chapter', {
|
||||
refresh: function() {
|
||||
|
||||
}
|
||||
});
|
@ -1,397 +0,0 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_guest_to_view": 1,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 1,
|
||||
"autoname": "prompt",
|
||||
"beta": 0,
|
||||
"creation": "2017-09-14 13:36:03.904702",
|
||||
"custom": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "DocType",
|
||||
"document_type": "",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"fields": [
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "chapter_head",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Chapter Head",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Member",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "column_break_3",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "region",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Region",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "section_break_5",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "introduction",
|
||||
"fieldtype": "Text Editor",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Introduction",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "meetup_embed_html",
|
||||
"fieldtype": "Code",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Meetup Embed HTML",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "address",
|
||||
"fieldtype": "Text",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Address",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"description": "chapters/chapter_name\nleave blank automatically set after saving chapter.",
|
||||
"fieldname": "route",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Route",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "published",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Published",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 1,
|
||||
"columns": 0,
|
||||
"fieldname": "chapter_members",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Chapter Members",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "members",
|
||||
"fieldtype": "Table",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Members",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Chapter Member",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
}
|
||||
],
|
||||
"has_web_view": 1,
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 0,
|
||||
"idx": 0,
|
||||
"image_view": 0,
|
||||
"in_create": 0,
|
||||
"is_published_field": "published",
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2017-12-14 12:59:31.424240",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Non Profit",
|
||||
"name": "Chapter",
|
||||
"name_case": "Title Case",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"amend": 0,
|
||||
"apply_user_permissions": 0,
|
||||
"cancel": 0,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Non Profit Manager",
|
||||
"set_user_permissions": 0,
|
||||
"share": 1,
|
||||
"submit": 0,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"restrict_to_domain": "Non Profit",
|
||||
"route": "chapters",
|
||||
"show_name_in_global_search": 0,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1,
|
||||
"track_seen": 0
|
||||
}
|
@ -1,49 +0,0 @@
|
||||
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
|
||||
import frappe
|
||||
from frappe.website.website_generator import WebsiteGenerator
|
||||
|
||||
|
||||
class Chapter(WebsiteGenerator):
|
||||
_website = frappe._dict(
|
||||
condition_field = "published",
|
||||
)
|
||||
|
||||
def get_context(self, context):
|
||||
context.no_cache = True
|
||||
context.show_sidebar = True
|
||||
context.parents = [dict(label='View All Chapters',
|
||||
route='chapters', title='View Chapters')]
|
||||
|
||||
def validate(self):
|
||||
if not self.route: #pylint: disable=E0203
|
||||
self.route = 'chapters/' + self.scrub(self.name)
|
||||
|
||||
def enable(self):
|
||||
chapter = frappe.get_doc('Chapter', frappe.form_dict.name)
|
||||
chapter.append('members', dict(enable=self.value))
|
||||
chapter.save(ignore_permissions=1)
|
||||
frappe.db.commit()
|
||||
|
||||
|
||||
def get_list_context(context):
|
||||
context.allow_guest = True
|
||||
context.no_cache = True
|
||||
context.show_sidebar = True
|
||||
context.title = 'All Chapters'
|
||||
context.no_breadcrumbs = True
|
||||
context.order_by = 'creation desc'
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
def leave(title, user_id, leave_reason):
|
||||
chapter = frappe.get_doc("Chapter", title)
|
||||
for member in chapter.members:
|
||||
if member.user == user_id:
|
||||
member.enabled = 0
|
||||
member.leave_reason = leave_reason
|
||||
chapter.save(ignore_permissions=1)
|
||||
frappe.db.commit()
|
||||
return "Thank you for Feedback"
|
@ -1,79 +0,0 @@
|
||||
{% extends "templates/web.html" %}
|
||||
|
||||
{% block page_content %}
|
||||
<h1>{{ title }}</h1>
|
||||
<p>{{ introduction }}</p>
|
||||
{% if meetup_embed_html %}
|
||||
{{ meetup_embed_html }}
|
||||
{% endif %}
|
||||
<h3>Member Details</h3>
|
||||
|
||||
{% if members %}
|
||||
<table class="table" style="max-width: 600px;">
|
||||
{% set index = [1] %}
|
||||
{% for user in members %}
|
||||
{% if user.enabled == 1 %}
|
||||
<tr>
|
||||
<td>
|
||||
<div style="margin-bottom: 30px; max-width: 600px" class="with-border">
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<div class="pull-left">
|
||||
<b>{{ index|length }}. {{ frappe.db.get_value('User', user.user, 'full_name') }}</b></div>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
{% if user.website_url %}
|
||||
<a href="{{ user.website_url }}">{{ user.website_url | truncate (50) or '' }}</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<br><br>
|
||||
<div class="col-lg-12">
|
||||
{% if user.introduction %}
|
||||
{{ user.introduction }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% set __ = index.append(1) %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% else %}
|
||||
<p>No member yet.</p>
|
||||
{% endif %}
|
||||
|
||||
<h3>Chapter Head</h3>
|
||||
<div style="margin-bottom: 30px; max-width: 600px" class="with-border">
|
||||
|
||||
<table class="table table-bordered small" style="max-width: 600px;">
|
||||
{% set doc = frappe.get_doc('Member',chapter_head) %}
|
||||
<tr>
|
||||
<td style='width: 15%'>Name</td>
|
||||
<td><b>{{ doc.member_name }}<b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Email</td>
|
||||
<td>{{ frappe.db.get_value('User', doc.email, 'email') or '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Phone</td>
|
||||
<td>{{ frappe.db.get_value('User', doc.email, 'phone') or '' }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{% if address %}
|
||||
<h3>Address</h3>
|
||||
<div style="margin-bottom: 30px; max-width: 600px" class="with-border">
|
||||
<p>{{ address or ''}}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<p style="margin: 20px 0 30px;"><a href="/non_profit/join-chapter?name={{ name }}" class='btn btn-primary'>Join this Chapter</a></p>
|
||||
<p style="margin: 20px 0 30px;"><a href="/non_profit/leave-chapter?name={{ name }}" class=''>Leave this Chapter</a></p>
|
||||
|
||||
{% endblock %}
|
@ -1,25 +0,0 @@
|
||||
{% if doc.published %}
|
||||
<div style="margin-bottom: 30px; max-width: 600px" class="with-border clickable">
|
||||
<a href={{ doc.route }}>
|
||||
<h3>{{ doc.name }}</h3>
|
||||
<p>
|
||||
<span class="label"> Chapter Head : {{ frappe.db.get_value('User', chapter_head, 'full_name') }} </span>
|
||||
<span class="label">
|
||||
{% if members %}
|
||||
{% set index = [] %}
|
||||
{% for user in members %}
|
||||
{% if user.enabled == 1 %}
|
||||
{% set __ = index.append(1) %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
Members: {{ index|length }}
|
||||
{% else %}
|
||||
Members: 0
|
||||
{% endif %}
|
||||
</span>
|
||||
<!-- Assignment of value to global variable not working in jinja -->
|
||||
</p>
|
||||
<p>{{ html2text(doc.introduction) | truncate (200) }}</p>
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
@ -1,8 +0,0 @@
|
||||
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestChapter(unittest.TestCase):
|
||||
pass
|
@ -1,199 +0,0 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
"beta": 0,
|
||||
"creation": "2017-09-14 13:38:04.296375",
|
||||
"custom": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "DocType",
|
||||
"document_type": "",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"fields": [
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "user",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "User",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "User",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "introduction",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Introduction",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "website_url",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Website URL",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 2,
|
||||
"default": "1",
|
||||
"fieldname": "enabled",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Enabled",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "leave_reason",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Leave Reason",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"translatable": 0,
|
||||
"unique": 0
|
||||
}
|
||||
],
|
||||
"has_web_view": 0,
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 0,
|
||||
"idx": 0,
|
||||
"image_view": 0,
|
||||
"in_create": 0,
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"modified": "2018-03-07 05:36:51.664816",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Non Profit",
|
||||
"name": "Chapter Member",
|
||||
"name_case": "",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
"quick_entry": 1,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"restrict_to_domain": "Non Profit",
|
||||
"show_name_in_global_search": 0,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1,
|
||||
"track_seen": 0
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class ChapterMember(Document):
|
||||
pass
|
@ -1,26 +0,0 @@
|
||||
// Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Donation', {
|
||||
refresh: function(frm) {
|
||||
if (frm.doc.docstatus === 1 && !frm.doc.paid) {
|
||||
frm.add_custom_button(__('Create Payment Entry'), function() {
|
||||
frm.events.make_payment_entry(frm);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
make_payment_entry: function(frm) {
|
||||
return frappe.call({
|
||||
method: 'erpnext.accounts.doctype.payment_entry.payment_entry.get_payment_entry',
|
||||
args: {
|
||||
'dt': frm.doc.doctype,
|
||||
'dn': frm.doc.name
|
||||
},
|
||||
callback: function(r) {
|
||||
var doc = frappe.model.sync(r.message);
|
||||
frappe.set_route('Form', doc[0].doctype, doc[0].name);
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
@ -1,156 +0,0 @@
|
||||
{
|
||||
"actions": [],
|
||||
"autoname": "naming_series:",
|
||||
"creation": "2021-02-17 10:28:52.645731",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"naming_series",
|
||||
"donor",
|
||||
"donor_name",
|
||||
"email",
|
||||
"column_break_4",
|
||||
"company",
|
||||
"date",
|
||||
"payment_details_section",
|
||||
"paid",
|
||||
"amount",
|
||||
"mode_of_payment",
|
||||
"razorpay_payment_id",
|
||||
"amended_from"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "donor",
|
||||
"fieldtype": "Link",
|
||||
"label": "Donor",
|
||||
"options": "Donor",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fetch_from": "donor.donor_name",
|
||||
"fieldname": "donor_name",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Donor Name",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fetch_from": "donor.email",
|
||||
"fieldname": "email",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Email",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_4",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "date",
|
||||
"fieldtype": "Date",
|
||||
"label": "Date",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "payment_details_section",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Payment Details"
|
||||
},
|
||||
{
|
||||
"fieldname": "amount",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Amount",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "mode_of_payment",
|
||||
"fieldtype": "Link",
|
||||
"label": "Mode of Payment",
|
||||
"options": "Mode of Payment"
|
||||
},
|
||||
{
|
||||
"fieldname": "razorpay_payment_id",
|
||||
"fieldtype": "Data",
|
||||
"label": "Razorpay Payment ID",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "naming_series",
|
||||
"fieldtype": "Select",
|
||||
"label": "Naming Series",
|
||||
"options": "NPO-DTN-.YYYY.-"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "paid",
|
||||
"fieldtype": "Check",
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Paid"
|
||||
},
|
||||
{
|
||||
"fieldname": "company",
|
||||
"fieldtype": "Link",
|
||||
"label": "Company",
|
||||
"options": "Company",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "amended_from",
|
||||
"fieldtype": "Link",
|
||||
"label": "Amended From",
|
||||
"no_copy": 1,
|
||||
"options": "Donation",
|
||||
"print_hide": 1,
|
||||
"read_only": 1
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"is_submittable": 1,
|
||||
"links": [],
|
||||
"modified": "2021-03-11 10:53:11.269005",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Non Profit",
|
||||
"name": "Donation",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "System Manager",
|
||||
"select": 1,
|
||||
"share": 1,
|
||||
"submit": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Non Profit Manager",
|
||||
"select": 1,
|
||||
"share": 1,
|
||||
"submit": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"search_fields": "donor_name, email",
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"title_field": "donor_name",
|
||||
"track_changes": 1
|
||||
}
|
@ -1,220 +0,0 @@
|
||||
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
|
||||
import json
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.email import sendmail_to_system_managers
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import flt, get_link_to_form, getdate
|
||||
|
||||
from erpnext.non_profit.doctype.membership.membership import verify_signature
|
||||
|
||||
|
||||
class Donation(Document):
|
||||
def validate(self):
|
||||
if not self.donor or not frappe.db.exists('Donor', self.donor):
|
||||
# for web forms
|
||||
user_type = frappe.db.get_value('User', frappe.session.user, 'user_type')
|
||||
if user_type == 'Website User':
|
||||
self.create_donor_for_website_user()
|
||||
else:
|
||||
frappe.throw(_('Please select a Member'))
|
||||
|
||||
def create_donor_for_website_user(self):
|
||||
donor_name = frappe.get_value('Donor', dict(email=frappe.session.user))
|
||||
|
||||
if not donor_name:
|
||||
user = frappe.get_doc('User', frappe.session.user)
|
||||
donor = frappe.get_doc(dict(
|
||||
doctype='Donor',
|
||||
donor_type=self.get('donor_type'),
|
||||
email=frappe.session.user,
|
||||
member_name=user.get_fullname()
|
||||
)).insert(ignore_permissions=True)
|
||||
donor_name = donor.name
|
||||
|
||||
if self.get('__islocal'):
|
||||
self.donor = donor_name
|
||||
|
||||
def on_payment_authorized(self, *args, **kwargs):
|
||||
self.load_from_db()
|
||||
self.create_payment_entry()
|
||||
|
||||
def create_payment_entry(self, date=None):
|
||||
settings = frappe.get_doc('Non Profit Settings')
|
||||
if not settings.automate_donation_payment_entries:
|
||||
return
|
||||
|
||||
if not settings.donation_payment_account:
|
||||
frappe.throw(_('You need to set <b>Payment Account</b> for Donation in {0}').format(
|
||||
get_link_to_form('Non Profit Settings', 'Non Profit Settings')))
|
||||
|
||||
from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry
|
||||
|
||||
frappe.flags.ignore_account_permission = True
|
||||
pe = get_payment_entry(dt=self.doctype, dn=self.name)
|
||||
frappe.flags.ignore_account_permission = False
|
||||
pe.paid_from = settings.donation_debit_account
|
||||
pe.paid_to = settings.donation_payment_account
|
||||
pe.posting_date = date or getdate()
|
||||
pe.reference_no = self.name
|
||||
pe.reference_date = date or getdate()
|
||||
pe.flags.ignore_mandatory = True
|
||||
pe.insert()
|
||||
pe.submit()
|
||||
|
||||
|
||||
@frappe.whitelist(allow_guest=True)
|
||||
def capture_razorpay_donations(*args, **kwargs):
|
||||
"""
|
||||
Creates Donation from Razorpay Webhook Request Data on payment.captured event
|
||||
Creates Donor from email if not found
|
||||
"""
|
||||
data = frappe.request.get_data(as_text=True)
|
||||
|
||||
try:
|
||||
verify_signature(data, endpoint='Donation')
|
||||
except Exception as e:
|
||||
log = frappe.log_error(e, 'Donation Webhook Verification Error')
|
||||
notify_failure(log)
|
||||
return { 'status': 'Failed', 'reason': e }
|
||||
|
||||
if isinstance(data, str):
|
||||
data = json.loads(data)
|
||||
data = frappe._dict(data)
|
||||
|
||||
payment = data.payload.get('payment', {}).get('entity', {})
|
||||
payment = frappe._dict(payment)
|
||||
|
||||
try:
|
||||
if not data.event == 'payment.captured':
|
||||
return
|
||||
|
||||
# to avoid capturing subscription payments as donations
|
||||
if payment.description and 'subscription' in str(payment.description).lower():
|
||||
return
|
||||
|
||||
donor = get_donor(payment.email)
|
||||
if not donor:
|
||||
donor = create_donor(payment)
|
||||
|
||||
donation = create_donation(donor, payment)
|
||||
donation.run_method('create_payment_entry')
|
||||
|
||||
except Exception as e:
|
||||
message = '{0}\n\n{1}\n\n{2}: {3}'.format(e, frappe.get_traceback(), _('Payment ID'), payment.id)
|
||||
log = frappe.log_error(message, _('Error creating donation entry for {0}').format(donor.name))
|
||||
notify_failure(log)
|
||||
return { 'status': 'Failed', 'reason': e }
|
||||
|
||||
return { 'status': 'Success' }
|
||||
|
||||
|
||||
def create_donation(donor, payment):
|
||||
if not frappe.db.exists('Mode of Payment', payment.method):
|
||||
create_mode_of_payment(payment.method)
|
||||
|
||||
company = get_company_for_donations()
|
||||
donation = frappe.get_doc({
|
||||
'doctype': 'Donation',
|
||||
'company': company,
|
||||
'donor': donor.name,
|
||||
'donor_name': donor.donor_name,
|
||||
'email': donor.email,
|
||||
'date': getdate(),
|
||||
'amount': flt(payment.amount) / 100, # Convert to rupees from paise
|
||||
'mode_of_payment': payment.method,
|
||||
'razorpay_payment_id': payment.id
|
||||
}).insert(ignore_mandatory=True)
|
||||
|
||||
donation.submit()
|
||||
return donation
|
||||
|
||||
|
||||
def get_donor(email):
|
||||
donors = frappe.get_all('Donor',
|
||||
filters={'email': email},
|
||||
order_by='creation desc')
|
||||
|
||||
try:
|
||||
return frappe.get_doc('Donor', donors[0]['name'])
|
||||
except Exception:
|
||||
return None
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
def create_donor(payment):
|
||||
donor_details = frappe._dict(payment)
|
||||
donor_type = frappe.db.get_single_value('Non Profit Settings', 'default_donor_type')
|
||||
|
||||
donor = frappe.new_doc('Donor')
|
||||
donor.update({
|
||||
'donor_name': donor_details.email,
|
||||
'donor_type': donor_type,
|
||||
'email': donor_details.email,
|
||||
'contact': donor_details.contact
|
||||
})
|
||||
|
||||
if donor_details.get('notes'):
|
||||
donor = get_additional_notes(donor, donor_details)
|
||||
|
||||
donor.insert(ignore_mandatory=True)
|
||||
return donor
|
||||
|
||||
|
||||
def get_company_for_donations():
|
||||
company = frappe.db.get_single_value('Non Profit Settings', 'donation_company')
|
||||
if not company:
|
||||
from erpnext.non_profit.utils import get_company
|
||||
company = get_company()
|
||||
return company
|
||||
|
||||
|
||||
def get_additional_notes(donor, donor_details):
|
||||
if type(donor_details.notes) == dict:
|
||||
for k, v in donor_details.notes.items():
|
||||
notes = '\n'.join('{}: {}'.format(k, v))
|
||||
|
||||
# extract donor name from notes
|
||||
if 'name' in k.lower():
|
||||
donor.update({
|
||||
'donor_name': donor_details.notes.get(k)
|
||||
})
|
||||
|
||||
# extract pan from notes
|
||||
if 'pan' in k.lower():
|
||||
donor.update({
|
||||
'pan_number': donor_details.notes.get(k)
|
||||
})
|
||||
|
||||
donor.add_comment('Comment', notes)
|
||||
|
||||
elif type(donor_details.notes) == str:
|
||||
donor.add_comment('Comment', donor_details.notes)
|
||||
|
||||
return donor
|
||||
|
||||
|
||||
def create_mode_of_payment(method):
|
||||
frappe.get_doc({
|
||||
'doctype': 'Mode of Payment',
|
||||
'mode_of_payment': method
|
||||
}).insert(ignore_mandatory=True)
|
||||
|
||||
|
||||
def notify_failure(log):
|
||||
try:
|
||||
content = '''
|
||||
Dear System Manager,
|
||||
Razorpay webhook for creating donation failed due to some reason.
|
||||
Please check the error log linked below
|
||||
Error Log: {0}
|
||||
Regards, Administrator
|
||||
'''.format(get_link_to_form('Error Log', log.name))
|
||||
|
||||
sendmail_to_system_managers(_('[Important] [ERPNext] Razorpay donation webhook failed, please check.'), content)
|
||||
except Exception:
|
||||
pass
|
@ -1,16 +0,0 @@
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'donation',
|
||||
'non_standard_fieldnames': {
|
||||
'Payment Entry': 'reference_name'
|
||||
},
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Payment'),
|
||||
'items': ['Payment Entry']
|
||||
}
|
||||
]
|
||||
}
|
@ -1,77 +0,0 @@
|
||||
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
|
||||
from erpnext.non_profit.doctype.donation.donation import create_donation
|
||||
|
||||
|
||||
class TestDonation(unittest.TestCase):
|
||||
def setUp(self):
|
||||
create_donor_type()
|
||||
settings = frappe.get_doc('Non Profit Settings')
|
||||
settings.company = '_Test Company'
|
||||
settings.donation_company = '_Test Company'
|
||||
settings.default_donor_type = '_Test Donor'
|
||||
settings.automate_donation_payment_entries = 1
|
||||
settings.donation_debit_account = 'Debtors - _TC'
|
||||
settings.donation_payment_account = 'Cash - _TC'
|
||||
settings.creation_user = 'Administrator'
|
||||
settings.flags.ignore_permissions = True
|
||||
settings.save()
|
||||
|
||||
def test_payment_entry_for_donations(self):
|
||||
donor = create_donor()
|
||||
create_mode_of_payment()
|
||||
payment = frappe._dict({
|
||||
'amount': 100,
|
||||
'method': 'Debit Card',
|
||||
'id': 'pay_MeXAmsgeKOhq7O'
|
||||
})
|
||||
donation = create_donation(donor, payment)
|
||||
|
||||
self.assertTrue(donation.name)
|
||||
|
||||
# Naive test to check if at all payment entry is generated
|
||||
# This method is actually triggered from Payment Gateway
|
||||
# In any case if details were missing, this would throw an error
|
||||
donation.on_payment_authorized()
|
||||
donation.reload()
|
||||
|
||||
self.assertEqual(donation.paid, 1)
|
||||
self.assertTrue(frappe.db.exists('Payment Entry', {'reference_no': donation.name}))
|
||||
|
||||
|
||||
def create_donor_type():
|
||||
if not frappe.db.exists('Donor Type', '_Test Donor'):
|
||||
frappe.get_doc({
|
||||
'doctype': 'Donor Type',
|
||||
'donor_type': '_Test Donor'
|
||||
}).insert()
|
||||
|
||||
|
||||
def create_donor():
|
||||
donor = frappe.db.exists('Donor', 'donor@test.com')
|
||||
if donor:
|
||||
return frappe.get_doc('Donor', 'donor@test.com')
|
||||
else:
|
||||
return frappe.get_doc({
|
||||
'doctype': 'Donor',
|
||||
'donor_name': '_Test Donor',
|
||||
'donor_type': '_Test Donor',
|
||||
'email': 'donor@test.com'
|
||||
}).insert()
|
||||
|
||||
|
||||
def create_mode_of_payment():
|
||||
if not frappe.db.exists('Mode of Payment', 'Debit Card'):
|
||||
frappe.get_doc({
|
||||
'doctype': 'Mode of Payment',
|
||||
'mode_of_payment': 'Debit Card',
|
||||
'accounts': [{
|
||||
'company': '_Test Company',
|
||||
'default_account': 'Cash - _TC'
|
||||
}]
|
||||
}).insert()
|
@ -1,17 +0,0 @@
|
||||
// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Donor', {
|
||||
refresh: function(frm) {
|
||||
frappe.dynamic_link = {doc: frm.doc, fieldname: 'name', doctype: 'Donor'};
|
||||
|
||||
frm.toggle_display(['address_html','contact_html'], !frm.doc.__islocal);
|
||||
|
||||
if(!frm.doc.__islocal) {
|
||||
frappe.contacts.render_address_and_contact(frm);
|
||||
} else {
|
||||
frappe.contacts.clear_address_and_contact(frm);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
@ -1,110 +0,0 @@
|
||||
{
|
||||
"actions": [],
|
||||
"allow_rename": 1,
|
||||
"autoname": "field:email",
|
||||
"creation": "2017-09-19 16:20:27.510196",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"donor_name",
|
||||
"column_break_5",
|
||||
"donor_type",
|
||||
"email",
|
||||
"image",
|
||||
"address_contacts",
|
||||
"address_html",
|
||||
"column_break_9",
|
||||
"contact_html"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "donor_name",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Donor Name",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_5",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "donor_type",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Donor Type",
|
||||
"options": "Donor Type",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "email",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Email",
|
||||
"reqd": 1,
|
||||
"unique": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "image",
|
||||
"fieldtype": "Attach Image",
|
||||
"hidden": 1,
|
||||
"label": "Image",
|
||||
"no_copy": 1,
|
||||
"print_hide": 1
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:!doc.__islocal;",
|
||||
"fieldname": "address_contacts",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Address and Contact",
|
||||
"options": "fa fa-map-marker"
|
||||
},
|
||||
{
|
||||
"fieldname": "address_html",
|
||||
"fieldtype": "HTML",
|
||||
"label": "Address HTML"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_9",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "contact_html",
|
||||
"fieldtype": "HTML",
|
||||
"label": "Contact HTML"
|
||||
}
|
||||
],
|
||||
"image_field": "image",
|
||||
"links": [
|
||||
{
|
||||
"link_doctype": "Donation",
|
||||
"link_fieldname": "donor"
|
||||
}
|
||||
],
|
||||
"modified": "2021-02-17 16:36:33.470731",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Non Profit",
|
||||
"name": "Donor",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Non Profit Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
"restrict_to_domain": "Non Profit",
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"title_field": "donor_name",
|
||||
"track_changes": 1
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
|
||||
from frappe.contacts.address_and_contact import load_address_and_contact
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class Donor(Document):
|
||||
def onload(self):
|
||||
"""Load address and contacts in `__onload`"""
|
||||
load_address_and_contact(self)
|
||||
|
||||
def validate(self):
|
||||
from frappe.utils import validate_email_address
|
||||
if self.email:
|
||||
validate_email_address(self.email.strip(), True)
|
@ -1,3 +0,0 @@
|
||||
frappe.listview_settings['Donor'] = {
|
||||
add_fields: ["donor_name", "donor_type", "image"],
|
||||
};
|
@ -1,8 +0,0 @@
|
||||
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestDonor(unittest.TestCase):
|
||||
pass
|
@ -1,8 +0,0 @@
|
||||
// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Donor Type', {
|
||||
refresh: function() {
|
||||
|
||||
}
|
||||
});
|
@ -1,94 +0,0 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
"autoname": "field:donor_type",
|
||||
"beta": 0,
|
||||
"creation": "2017-09-19 16:19:16.639635",
|
||||
"custom": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "DocType",
|
||||
"document_type": "",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"fields": [
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "donor_type",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Donor Type",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
}
|
||||
],
|
||||
"has_web_view": 0,
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 0,
|
||||
"idx": 0,
|
||||
"image_view": 0,
|
||||
"in_create": 0,
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2017-12-05 07:04:36.757595",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Non Profit",
|
||||
"name": "Donor Type",
|
||||
"name_case": "",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"amend": 0,
|
||||
"apply_user_permissions": 0,
|
||||
"cancel": 0,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Non Profit Manager",
|
||||
"set_user_permissions": 0,
|
||||
"share": 1,
|
||||
"submit": 0,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"restrict_to_domain": "Non Profit",
|
||||
"show_name_in_global_search": 0,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1,
|
||||
"track_seen": 0
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class DonorType(Document):
|
||||
pass
|
@ -1,8 +0,0 @@
|
||||
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestDonorType(unittest.TestCase):
|
||||
pass
|
@ -1,27 +0,0 @@
|
||||
// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Grant Application', {
|
||||
refresh: function(frm) {
|
||||
frappe.dynamic_link = {doc: frm.doc, fieldname: 'name', doctype: 'Grant Application'};
|
||||
|
||||
frm.toggle_display(['address_html','contact_html'], !frm.doc.__islocal);
|
||||
|
||||
if(!frm.doc.__islocal) {
|
||||
frappe.contacts.render_address_and_contact(frm);
|
||||
} else {
|
||||
frappe.contacts.clear_address_and_contact(frm);
|
||||
}
|
||||
|
||||
if(frm.doc.status == 'Received' && !frm.doc.email_notification_sent){
|
||||
frm.add_custom_button(__("Send Grant Review Email"), function() {
|
||||
frappe.call({
|
||||
method: "erpnext.non_profit.doctype.grant_application.grant_application.send_grant_review_emails",
|
||||
args: {
|
||||
grant_application: frm.doc.name
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
@ -1,851 +0,0 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_guest_to_view": 1,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
"autoname": "",
|
||||
"beta": 0,
|
||||
"creation": "2017-09-21 12:02:01.206913",
|
||||
"custom": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "DocType",
|
||||
"document_type": "",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"fields": [
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "applicant_type",
|
||||
"fieldtype": "Select",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Applicant Type",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Individual\nOrganization",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "applicant_name",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Name",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"depends_on": "eval:doc.applicant_type=='Organization'",
|
||||
"fieldname": "contact_person",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Contact Person",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "email",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Email",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "column_break_5",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "Open",
|
||||
"fieldname": "status",
|
||||
"fieldtype": "Select",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Status",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Open\nReceived\nIn Progress\nApproved\nRejected\nExpired\nWithdrawn",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "website_url",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Website URL",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "company",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Company",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "Company",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "address_contacts",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Address and Contact",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "fa fa-map-marker",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "address_html",
|
||||
"fieldtype": "HTML",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Address HTML",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "column_break_9",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "contact_html",
|
||||
"fieldtype": "HTML",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Contact HTML",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "grant_application_details",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Grant Application Details ",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "grant_description",
|
||||
"fieldtype": "Long Text",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Grant Description",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "section_break_15",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "amount",
|
||||
"fieldtype": "Currency",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Requested Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "has_any_past_grant_record",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Has any past Grant Record",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "column_break_17",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "route",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Route",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "published",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Show on Website",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "assessment_result",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Assessment Result",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "assessment_mark",
|
||||
"fieldtype": "Float",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Assessment Mark (Out of 10)",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "note",
|
||||
"fieldtype": "Small Text",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Note",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "column_break_24",
|
||||
"fieldtype": "Column Break",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "assessment_manager",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Assessment Manager",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "User",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "email_notification_sent",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Email Notification Sent",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 1,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
}
|
||||
],
|
||||
"has_web_view": 1,
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 0,
|
||||
"idx": 0,
|
||||
"image_field": "",
|
||||
"image_view": 0,
|
||||
"in_create": 0,
|
||||
"is_published_field": "published",
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2017-12-06 12:39:57.677899",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Non Profit",
|
||||
"name": "Grant Application",
|
||||
"name_case": "",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"amend": 0,
|
||||
"apply_user_permissions": 0,
|
||||
"cancel": 0,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Non Profit Manager",
|
||||
"set_user_permissions": 0,
|
||||
"share": 1,
|
||||
"submit": 0,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"quick_entry": 0,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"restrict_to_domain": "Non Profit",
|
||||
"route": "grant-application",
|
||||
"show_name_in_global_search": 0,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"title_field": "applicant_name",
|
||||
"track_changes": 1,
|
||||
"track_seen": 0
|
||||
}
|
@ -1,58 +0,0 @@
|
||||
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.contacts.address_and_contact import load_address_and_contact
|
||||
from frappe.utils import get_url
|
||||
from frappe.website.website_generator import WebsiteGenerator
|
||||
|
||||
|
||||
class GrantApplication(WebsiteGenerator):
|
||||
_website = frappe._dict(
|
||||
condition_field = "published",
|
||||
)
|
||||
|
||||
def validate(self):
|
||||
if not self.route: #pylint: disable=E0203
|
||||
self.route = 'grant-application/' + self.scrub(self.name)
|
||||
|
||||
def onload(self):
|
||||
"""Load address and contacts in `__onload`"""
|
||||
load_address_and_contact(self)
|
||||
|
||||
def get_context(self, context):
|
||||
context.no_cache = True
|
||||
context.show_sidebar = True
|
||||
context.parents = [dict(label='View All Grant Applications',
|
||||
route='grant-application', title='View Grants')]
|
||||
|
||||
def get_list_context(context):
|
||||
context.allow_guest = True
|
||||
context.no_cache = True
|
||||
context.no_breadcrumbs = True
|
||||
context.show_sidebar = True
|
||||
context.order_by = 'creation desc'
|
||||
context.introduction ='''<a class="btn btn-primary" href="/my-grant?new=1">
|
||||
Apply for new Grant Application</a>'''
|
||||
|
||||
@frappe.whitelist()
|
||||
def send_grant_review_emails(grant_application):
|
||||
grant = frappe.get_doc("Grant Application", grant_application)
|
||||
url = get_url('grant-application/{0}'.format(grant_application))
|
||||
frappe.sendmail(
|
||||
recipients= grant.assessment_manager,
|
||||
sender=frappe.session.user,
|
||||
subject='Grant Application for {0}'.format(grant.applicant_name),
|
||||
message='<p> Please Review this grant application</p><br>' + url,
|
||||
reference_doctype=grant.doctype,
|
||||
reference_name=grant.name
|
||||
)
|
||||
|
||||
grant.status = 'In Progress'
|
||||
grant.email_notification_sent = 1
|
||||
grant.save()
|
||||
frappe.db.commit()
|
||||
|
||||
frappe.msgprint(_("Review Invitation Sent"))
|
@ -1,68 +0,0 @@
|
||||
{% extends "templates/web.html" %}
|
||||
|
||||
{% block page_content %}
|
||||
<h1>{{ applicant_name }}</h1>
|
||||
{% if frappe.user == owner %}
|
||||
<p><a class='btn btn-primary btn-sm' href="/my-grant?name={{ name }}">Edit Grant</a></p>
|
||||
{% endif %}
|
||||
<br>
|
||||
<table class='table table-bordered small' style='max-width: 400px; margin-bottom: 0px;'>
|
||||
<tr>
|
||||
<td style='width: 38.2%'>Organization/Indvidual</td>
|
||||
<td>{{ applicant_type }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Grant Applicant Name</td>
|
||||
<td>{{ applicant_name}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Date</td>
|
||||
<td>{{ frappe.format_date(creation) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Status</td>
|
||||
<td>{{ status }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Email</td>
|
||||
<td>{{ email }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<h2>Q. Please outline your current situation and why you are applying for a grant?</h2>
|
||||
<p> {{ grant_description }}</p>
|
||||
<h2>Q. Requested grant amount</h2>
|
||||
<p>{{ amount }}</p>
|
||||
<h2>Q. Have you recevied grant from us before?</h2>
|
||||
<p>{{ has_any_past_grant_record }}</p>
|
||||
<h3>Contact</h3>
|
||||
{% if frappe.user != 'Guest' %}
|
||||
<table class='table table-bordered small' style='max-width: 400px; margin-bottom: 0px;'>
|
||||
{% if contact_person %}
|
||||
<tr>
|
||||
<td style='width: 38.2%'>Contact Person</td>
|
||||
<td>{{ contact_person }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td style='width: 38.2%'>Email</td>
|
||||
<td>{{ email }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
{% else %}
|
||||
<p><a href="/login">You must register and login to view contact details</a></p>
|
||||
{% endif %}
|
||||
<br>
|
||||
{% if frappe.session.user == assessment_manager %}
|
||||
{% if assessment_scale %}
|
||||
<p> Assessment Review done </p>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<p><br><a href="/my-grant?new=1" class='btn btn-primary'>Post a New Grant</a></p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block style %}
|
||||
<link type="text/css" rel="stylesheet" href="/assets/css/non-profits.css">
|
||||
<style>
|
||||
{% if style is defined %}{{ style }}{% endif %}
|
||||
</style>
|
||||
{% endblock %}
|
@ -1,11 +0,0 @@
|
||||
{% if doc.published %}
|
||||
<div style='margin-bottom: 30px; max-width: 600px;'
|
||||
class='with-border clickable'>
|
||||
<a href="/{{ doc.route }}">
|
||||
<h3 style='margin-top: 0px;'>{{ doc.name }}</h3>
|
||||
<p>
|
||||
<span class='label'>{{ frappe.format_date(doc.creation) }}</span>
|
||||
</p>
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
@ -1,8 +0,0 @@
|
||||
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestGrantApplication(unittest.TestCase):
|
||||
pass
|
@ -1,64 +0,0 @@
|
||||
// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Member', {
|
||||
setup: function(frm) {
|
||||
frappe.db.get_single_value('Non Profit Settings', 'enable_razorpay_for_memberships').then(val => {
|
||||
if (val && (frm.doc.subscription_id || frm.doc.customer_id)) {
|
||||
frm.set_df_property('razorpay_details_section', 'hidden', false);
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
refresh: function(frm) {
|
||||
|
||||
frappe.dynamic_link = {doc: frm.doc, fieldname: 'name', doctype: 'Member'};
|
||||
|
||||
frm.toggle_display(['address_html','contact_html'], !frm.doc.__islocal);
|
||||
|
||||
if(!frm.doc.__islocal) {
|
||||
frappe.contacts.render_address_and_contact(frm);
|
||||
|
||||
// custom buttons
|
||||
frm.add_custom_button(__('Accounting Ledger'), function() {
|
||||
frappe.set_route('query-report', 'General Ledger',
|
||||
{party_type:'Member', party:frm.doc.name});
|
||||
});
|
||||
|
||||
frm.add_custom_button(__('Accounts Receivable'), function() {
|
||||
frappe.set_route('query-report', 'Accounts Receivable', {member:frm.doc.name});
|
||||
});
|
||||
|
||||
if (!frm.doc.customer) {
|
||||
frm.add_custom_button(__('Create Customer'), () => {
|
||||
frm.call('make_customer_and_link').then(() => {
|
||||
frm.reload_doc();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// indicator
|
||||
erpnext.utils.set_party_dashboard_indicators(frm);
|
||||
|
||||
} else {
|
||||
frappe.contacts.clear_address_and_contact(frm);
|
||||
}
|
||||
|
||||
frappe.call({
|
||||
method:"frappe.client.get_value",
|
||||
args:{
|
||||
'doctype':"Membership",
|
||||
'filters':{'member': frm.doc.name},
|
||||
'fieldname':[
|
||||
'to_date'
|
||||
]
|
||||
},
|
||||
callback: function (data) {
|
||||
if(data.message) {
|
||||
frappe.model.set_value(frm.doctype,frm.docname,
|
||||
"membership_expiry_date", data.message.to_date);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
@ -1,210 +0,0 @@
|
||||
{
|
||||
"actions": [],
|
||||
"allow_rename": 1,
|
||||
"autoname": "naming_series:",
|
||||
"creation": "2017-09-11 09:24:52.898356",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"naming_series",
|
||||
"member_name",
|
||||
"membership_expiry_date",
|
||||
"column_break_5",
|
||||
"membership_type",
|
||||
"email_id",
|
||||
"image",
|
||||
"customer_section",
|
||||
"customer",
|
||||
"customer_name",
|
||||
"supplier_section",
|
||||
"supplier",
|
||||
"address_contacts",
|
||||
"address_html",
|
||||
"column_break_9",
|
||||
"contact_html",
|
||||
"razorpay_details_section",
|
||||
"subscription_id",
|
||||
"customer_id",
|
||||
"subscription_status",
|
||||
"column_break_21",
|
||||
"subscription_start",
|
||||
"subscription_end"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "naming_series",
|
||||
"fieldtype": "Select",
|
||||
"label": "Series",
|
||||
"options": "NPO-MEM-.YYYY.-",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "member_name",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Member Name",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "membership_expiry_date",
|
||||
"fieldtype": "Date",
|
||||
"label": "Membership Expiry Date"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_5",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "membership_type",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Membership Type",
|
||||
"options": "Membership Type",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "image",
|
||||
"fieldtype": "Attach Image",
|
||||
"hidden": 1,
|
||||
"label": "Image",
|
||||
"no_copy": 1,
|
||||
"print_hide": 1
|
||||
},
|
||||
{
|
||||
"collapsible": 1,
|
||||
"fieldname": "customer_section",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Customer"
|
||||
},
|
||||
{
|
||||
"fieldname": "customer",
|
||||
"fieldtype": "Link",
|
||||
"label": "Customer",
|
||||
"options": "Customer"
|
||||
},
|
||||
{
|
||||
"fetch_from": "customer.customer_name",
|
||||
"fieldname": "customer_name",
|
||||
"fieldtype": "Data",
|
||||
"label": "Customer Name",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"collapsible": 1,
|
||||
"fieldname": "supplier_section",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Supplier"
|
||||
},
|
||||
{
|
||||
"fieldname": "supplier",
|
||||
"fieldtype": "Link",
|
||||
"label": "Supplier",
|
||||
"options": "Supplier"
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:!doc.__islocal;",
|
||||
"fieldname": "address_contacts",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Address and Contact",
|
||||
"options": "fa fa-map-marker"
|
||||
},
|
||||
{
|
||||
"fieldname": "address_html",
|
||||
"fieldtype": "HTML",
|
||||
"label": "Address HTML"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_9",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "contact_html",
|
||||
"fieldtype": "HTML",
|
||||
"label": "Contact HTML"
|
||||
},
|
||||
{
|
||||
"fieldname": "email_id",
|
||||
"fieldtype": "Data",
|
||||
"label": "Email Address",
|
||||
"options": "Email"
|
||||
},
|
||||
{
|
||||
"fieldname": "subscription_id",
|
||||
"fieldtype": "Data",
|
||||
"label": "Subscription ID",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "customer_id",
|
||||
"fieldtype": "Data",
|
||||
"label": "Customer ID",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "razorpay_details_section",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 1,
|
||||
"label": "Razorpay Details"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_21",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "subscription_start",
|
||||
"fieldtype": "Date",
|
||||
"label": "Subscription Start "
|
||||
},
|
||||
{
|
||||
"fieldname": "subscription_end",
|
||||
"fieldtype": "Date",
|
||||
"label": "Subscription End"
|
||||
},
|
||||
{
|
||||
"fieldname": "subscription_status",
|
||||
"fieldtype": "Select",
|
||||
"label": "Subscription Status",
|
||||
"options": "\nActive\nHalted"
|
||||
}
|
||||
],
|
||||
"image_field": "image",
|
||||
"links": [],
|
||||
"modified": "2021-07-11 14:27:26.368039",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Non Profit",
|
||||
"name": "Member",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Non Profit Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Non Profit Member",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
"restrict_to_domain": "Non Profit",
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"title_field": "member_name",
|
||||
"track_changes": 1
|
||||
}
|
@ -1,185 +0,0 @@
|
||||
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.contacts.address_and_contact import load_address_and_contact
|
||||
from frappe.integrations.utils import get_payment_gateway_controller
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import cint, get_link_to_form
|
||||
|
||||
from erpnext.non_profit.doctype.membership_type.membership_type import get_membership_type
|
||||
|
||||
|
||||
class Member(Document):
|
||||
def onload(self):
|
||||
"""Load address and contacts in `__onload`"""
|
||||
load_address_and_contact(self)
|
||||
|
||||
|
||||
def validate(self):
|
||||
if self.email_id:
|
||||
self.validate_email_type(self.email_id)
|
||||
|
||||
def validate_email_type(self, email):
|
||||
from frappe.utils import validate_email_address
|
||||
validate_email_address(email.strip(), True)
|
||||
|
||||
def setup_subscription(self):
|
||||
non_profit_settings = frappe.get_doc('Non Profit Settings')
|
||||
if not non_profit_settings.enable_razorpay_for_memberships:
|
||||
frappe.throw(_('Please check Enable Razorpay for Memberships in {0} to setup subscription')).format(
|
||||
get_link_to_form('Non Profit Settings', 'Non Profit Settings'))
|
||||
|
||||
controller = get_payment_gateway_controller("Razorpay")
|
||||
settings = controller.get_settings({})
|
||||
|
||||
plan_id = frappe.get_value("Membership Type", self.membership_type, "razorpay_plan_id")
|
||||
|
||||
if not plan_id:
|
||||
frappe.throw(_("Please setup Razorpay Plan ID"))
|
||||
|
||||
subscription_details = {
|
||||
"plan_id": plan_id,
|
||||
"billing_frequency": cint(non_profit_settings.billing_frequency),
|
||||
"customer_notify": 1
|
||||
}
|
||||
|
||||
args = {
|
||||
'subscription_details': subscription_details
|
||||
}
|
||||
|
||||
subscription = controller.setup_subscription(settings, **args)
|
||||
|
||||
return subscription
|
||||
|
||||
@frappe.whitelist()
|
||||
def make_customer_and_link(self):
|
||||
if self.customer:
|
||||
frappe.msgprint(_("A customer is already linked to this Member"))
|
||||
|
||||
customer = create_customer(frappe._dict({
|
||||
'fullname': self.member_name,
|
||||
'email': self.email_id,
|
||||
'phone': None
|
||||
}))
|
||||
|
||||
self.customer = customer
|
||||
self.save()
|
||||
frappe.msgprint(_("Customer {0} has been created succesfully.").format(self.customer))
|
||||
|
||||
|
||||
def get_or_create_member(user_details):
|
||||
member_list = frappe.get_all("Member", filters={'email': user_details.email, 'membership_type': user_details.plan_id})
|
||||
if member_list and member_list[0]:
|
||||
return member_list[0]['name']
|
||||
else:
|
||||
return create_member(user_details)
|
||||
|
||||
def create_member(user_details):
|
||||
user_details = frappe._dict(user_details)
|
||||
member = frappe.new_doc("Member")
|
||||
member.update({
|
||||
"member_name": user_details.fullname,
|
||||
"email_id": user_details.email,
|
||||
"pan_number": user_details.pan or None,
|
||||
"membership_type": user_details.plan_id,
|
||||
"customer_id": user_details.customer_id or None,
|
||||
"subscription_id": user_details.subscription_id or None,
|
||||
"subscription_status": user_details.subscription_status or ""
|
||||
})
|
||||
|
||||
member.insert(ignore_permissions=True)
|
||||
member.customer = create_customer(user_details, member.name)
|
||||
member.save(ignore_permissions=True)
|
||||
|
||||
return member
|
||||
|
||||
def create_customer(user_details, member=None):
|
||||
customer = frappe.new_doc("Customer")
|
||||
customer.customer_name = user_details.fullname
|
||||
customer.customer_type = "Individual"
|
||||
customer.flags.ignore_mandatory = True
|
||||
customer.insert(ignore_permissions=True)
|
||||
|
||||
try:
|
||||
contact = frappe.new_doc("Contact")
|
||||
contact.first_name = user_details.fullname
|
||||
if user_details.mobile:
|
||||
contact.add_phone(user_details.mobile, is_primary_phone=1, is_primary_mobile_no=1)
|
||||
if user_details.email:
|
||||
contact.add_email(user_details.email, is_primary=1)
|
||||
contact.insert(ignore_permissions=True)
|
||||
|
||||
contact.append("links", {
|
||||
"link_doctype": "Customer",
|
||||
"link_name": customer.name
|
||||
})
|
||||
|
||||
if member:
|
||||
contact.append("links", {
|
||||
"link_doctype": "Member",
|
||||
"link_name": member
|
||||
})
|
||||
|
||||
contact.save(ignore_permissions=True)
|
||||
|
||||
except frappe.DuplicateEntryError:
|
||||
return customer.name
|
||||
|
||||
except Exception as e:
|
||||
frappe.log_error(frappe.get_traceback(), _("Contact Creation Failed"))
|
||||
pass
|
||||
|
||||
return customer.name
|
||||
|
||||
@frappe.whitelist(allow_guest=True)
|
||||
def create_member_subscription_order(user_details):
|
||||
"""Create Member subscription and order for payment
|
||||
|
||||
Args:
|
||||
user_details (TYPE): Description
|
||||
|
||||
Returns:
|
||||
Dictionary: Dictionary with subscription details
|
||||
{
|
||||
'subscription_details': {
|
||||
'plan_id': 'plan_EXwyxDYDCj3X4v',
|
||||
'billing_frequency': 24,
|
||||
'customer_notify': 1
|
||||
},
|
||||
'subscription_id': 'sub_EZycCvXFvqnC6p'
|
||||
}
|
||||
"""
|
||||
|
||||
user_details = frappe._dict(user_details)
|
||||
member = get_or_create_member(user_details)
|
||||
|
||||
subscription = member.setup_subscription()
|
||||
|
||||
member.subscription_id = subscription.get('subscription_id')
|
||||
member.save(ignore_permissions=True)
|
||||
|
||||
return subscription
|
||||
|
||||
@frappe.whitelist()
|
||||
def register_member(fullname, email, rzpay_plan_id, subscription_id, pan=None, mobile=None):
|
||||
plan = get_membership_type(rzpay_plan_id)
|
||||
if not plan:
|
||||
raise frappe.DoesNotExistError
|
||||
|
||||
member = frappe.db.exists("Member", {'email': email, 'subscription_id': subscription_id })
|
||||
if member:
|
||||
return member
|
||||
else:
|
||||
member = create_member(dict(
|
||||
fullname=fullname,
|
||||
email=email,
|
||||
plan_id=plan,
|
||||
subscription_id=subscription_id,
|
||||
pan=pan,
|
||||
mobile=mobile
|
||||
))
|
||||
|
||||
return member.name
|
@ -1,22 +0,0 @@
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'heatmap': True,
|
||||
'heatmap_message': _('Member Activity'),
|
||||
'fieldname': 'member',
|
||||
'non_standard_fieldnames': {
|
||||
'Bank Account': 'party'
|
||||
},
|
||||
'transactions': [
|
||||
{
|
||||
'label': _('Membership Details'),
|
||||
'items': ['Membership']
|
||||
},
|
||||
{
|
||||
'label': _('Fee'),
|
||||
'items': ['Bank Account']
|
||||
}
|
||||
]
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
frappe.listview_settings['Member'] = {
|
||||
add_fields: ["member_name", "membership_type", "image"],
|
||||
};
|
@ -1,8 +0,0 @@
|
||||
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestMember(unittest.TestCase):
|
||||
pass
|
@ -1,41 +0,0 @@
|
||||
// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Membership', {
|
||||
setup: function(frm) {
|
||||
frappe.db.get_single_value("Non Profit Settings", "enable_razorpay_for_memberships").then(val => {
|
||||
if (val) frm.set_df_property("razorpay_details_section", "hidden", false);
|
||||
})
|
||||
},
|
||||
|
||||
refresh: function(frm) {
|
||||
if (frm.doc.__islocal)
|
||||
return;
|
||||
|
||||
!frm.doc.invoice && frm.add_custom_button("Generate Invoice", () => {
|
||||
frm.call({
|
||||
doc: frm.doc,
|
||||
method: "generate_invoice",
|
||||
args: {save: true},
|
||||
freeze: true,
|
||||
freeze_message: __("Creating Membership Invoice"),
|
||||
callback: function(r) {
|
||||
if (r.invoice)
|
||||
frm.reload_doc();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
frappe.db.get_single_value("Non Profit Settings", "send_email").then(val => {
|
||||
if (val) frm.add_custom_button("Send Acknowledgement", () => {
|
||||
frm.call("send_acknowlement").then(() => {
|
||||
frm.reload_doc();
|
||||
});
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
onload: function(frm) {
|
||||
frm.add_fetch("membership_type", "amount", "amount");
|
||||
}
|
||||
});
|
@ -1,184 +0,0 @@
|
||||
{
|
||||
"actions": [],
|
||||
"autoname": "NPO-MSH-.YYYY.-.#####",
|
||||
"creation": "2017-09-11 11:39:18.492184",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"member",
|
||||
"member_name",
|
||||
"membership_type",
|
||||
"column_break_3",
|
||||
"company",
|
||||
"membership_status",
|
||||
"membership_validity_section",
|
||||
"from_date",
|
||||
"to_date",
|
||||
"column_break_8",
|
||||
"member_since_date",
|
||||
"payment_details",
|
||||
"paid",
|
||||
"currency",
|
||||
"amount",
|
||||
"invoice",
|
||||
"razorpay_details_section",
|
||||
"subscription_id",
|
||||
"payment_id"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "member",
|
||||
"fieldtype": "Link",
|
||||
"label": "Member",
|
||||
"options": "Member"
|
||||
},
|
||||
{
|
||||
"fieldname": "membership_type",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Membership Type",
|
||||
"options": "Membership Type",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_3",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "membership_status",
|
||||
"fieldtype": "Select",
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Membership Status",
|
||||
"options": "New\nCurrent\nExpired\nPending\nCancelled"
|
||||
},
|
||||
{
|
||||
"fieldname": "membership_validity_section",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Validity"
|
||||
},
|
||||
{
|
||||
"fieldname": "from_date",
|
||||
"fieldtype": "Date",
|
||||
"in_list_view": 1,
|
||||
"label": "From",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "to_date",
|
||||
"fieldtype": "Date",
|
||||
"in_list_view": 1,
|
||||
"label": "To",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_8",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "member_since_date",
|
||||
"fieldtype": "Date",
|
||||
"label": "Member Since"
|
||||
},
|
||||
{
|
||||
"fieldname": "payment_details",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Payment Details"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "paid",
|
||||
"fieldtype": "Check",
|
||||
"label": "Paid"
|
||||
},
|
||||
{
|
||||
"fieldname": "currency",
|
||||
"fieldtype": "Link",
|
||||
"label": "Currency",
|
||||
"options": "Currency"
|
||||
},
|
||||
{
|
||||
"fieldname": "amount",
|
||||
"fieldtype": "Float",
|
||||
"label": "Amount"
|
||||
},
|
||||
{
|
||||
"fieldname": "razorpay_details_section",
|
||||
"fieldtype": "Section Break",
|
||||
"hidden": 1,
|
||||
"label": "Razorpay Details"
|
||||
},
|
||||
{
|
||||
"fieldname": "subscription_id",
|
||||
"fieldtype": "Data",
|
||||
"label": "Subscription ID",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "payment_id",
|
||||
"fieldtype": "Data",
|
||||
"label": "Payment ID",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "invoice",
|
||||
"fieldtype": "Link",
|
||||
"label": "Invoice",
|
||||
"options": "Sales Invoice"
|
||||
},
|
||||
{
|
||||
"fetch_from": "member.member_name",
|
||||
"fieldname": "member_name",
|
||||
"fieldtype": "Data",
|
||||
"label": "Member Name",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "company",
|
||||
"fieldtype": "Link",
|
||||
"label": "Company",
|
||||
"options": "Company",
|
||||
"reqd": 1
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2021-02-19 14:33:44.925122",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Non Profit",
|
||||
"name": "Membership",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Non Profit Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Non Profit Member",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"restrict_to_domain": "Non Profit",
|
||||
"search_fields": "member, member_name",
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"title_field": "member_name",
|
||||
"track_changes": 1
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
frappe.listview_settings['Membership'] = {
|
||||
get_indicator: function(doc) {
|
||||
if (doc.membership_status == 'New') {
|
||||
return [__('New'), 'blue', 'membership_status,=,New'];
|
||||
} else if (doc.membership_status === 'Current') {
|
||||
return [__('Current'), 'green', 'membership_status,=,Current'];
|
||||
} else if (doc.membership_status === 'Pending') {
|
||||
return [__('Pending'), 'yellow', 'membership_status,=,Pending'];
|
||||
} else if (doc.membership_status === 'Expired') {
|
||||
return [__('Expired'), 'grey', 'membership_status,=,Expired'];
|
||||
} else {
|
||||
return [__('Cancelled'), 'red', 'membership_status,=,Cancelled'];
|
||||
}
|
||||
}
|
||||
};
|
@ -1,164 +0,0 @@
|
||||
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
from frappe.utils import add_months, nowdate
|
||||
|
||||
import erpnext
|
||||
from erpnext.non_profit.doctype.member.member import create_member
|
||||
from erpnext.non_profit.doctype.membership.membership import update_halted_razorpay_subscription
|
||||
|
||||
|
||||
class TestMembership(unittest.TestCase):
|
||||
def setUp(self):
|
||||
plan = setup_membership()
|
||||
|
||||
# make test member
|
||||
self.member_doc = create_member(
|
||||
frappe._dict({
|
||||
"fullname": "_Test_Member",
|
||||
"email": "_test_member_erpnext@example.com",
|
||||
"plan_id": plan.name,
|
||||
"subscription_id": "sub_DEX6xcJ1HSW4CR",
|
||||
"customer_id": "cust_C0WlbKhp3aLA7W",
|
||||
"subscription_status": "Active"
|
||||
})
|
||||
)
|
||||
self.member_doc.make_customer_and_link()
|
||||
self.member = self.member_doc.name
|
||||
|
||||
def test_auto_generate_invoice_and_payment_entry(self):
|
||||
entry = make_membership(self.member)
|
||||
|
||||
# Naive test to see if at all invoice was generated and attached to member
|
||||
# In any case if details were missing, the invoicing would throw an error
|
||||
invoice = entry.generate_invoice(save=True)
|
||||
self.assertEqual(invoice.name, entry.invoice)
|
||||
|
||||
def test_renew_within_30_days(self):
|
||||
# create a membership for two months
|
||||
# Should work fine
|
||||
make_membership(self.member, { "from_date": nowdate() })
|
||||
make_membership(self.member, { "from_date": add_months(nowdate(), 1) })
|
||||
|
||||
from frappe.utils.user import add_role
|
||||
add_role("test@example.com", "Non Profit Manager")
|
||||
frappe.set_user("test@example.com")
|
||||
|
||||
# create next membership with expiry not within 30 days
|
||||
self.assertRaises(frappe.ValidationError, make_membership, self.member, {
|
||||
"from_date": add_months(nowdate(), 2),
|
||||
})
|
||||
|
||||
frappe.set_user("Administrator")
|
||||
# create the same membership but as administrator
|
||||
make_membership(self.member, {
|
||||
"from_date": add_months(nowdate(), 2),
|
||||
"to_date": add_months(nowdate(), 3),
|
||||
})
|
||||
|
||||
def test_halted_memberships(self):
|
||||
make_membership(self.member, {
|
||||
"from_date": add_months(nowdate(), 2),
|
||||
"to_date": add_months(nowdate(), 3)
|
||||
})
|
||||
|
||||
self.assertEqual(frappe.db.get_value("Member", self.member, "subscription_status"), "Active")
|
||||
payload = get_subscription_payload()
|
||||
update_halted_razorpay_subscription(data=payload)
|
||||
self.assertEqual(frappe.db.get_value("Member", self.member, "subscription_status"), "Halted")
|
||||
|
||||
def tearDown(self):
|
||||
frappe.db.rollback()
|
||||
|
||||
def set_config(key, value):
|
||||
frappe.db.set_value("Non Profit Settings", None, key, value)
|
||||
|
||||
def make_membership(member, payload={}):
|
||||
data = {
|
||||
"doctype": "Membership",
|
||||
"member": member,
|
||||
"membership_status": "Current",
|
||||
"membership_type": "_rzpy_test_milythm",
|
||||
"currency": "INR",
|
||||
"paid": 1,
|
||||
"from_date": nowdate(),
|
||||
"amount": 100
|
||||
}
|
||||
data.update(payload)
|
||||
membership = frappe.get_doc(data)
|
||||
membership.insert(ignore_permissions=True, ignore_if_duplicate=True)
|
||||
return membership
|
||||
|
||||
def create_item(item_code):
|
||||
if not frappe.db.exists("Item", item_code):
|
||||
item = frappe.new_doc("Item")
|
||||
item.item_code = item_code
|
||||
item.item_name = item_code
|
||||
item.stock_uom = "Nos"
|
||||
item.description = item_code
|
||||
item.item_group = "All Item Groups"
|
||||
item.is_stock_item = 0
|
||||
item.save()
|
||||
else:
|
||||
item = frappe.get_doc("Item", item_code)
|
||||
return item
|
||||
|
||||
def setup_membership():
|
||||
# Get default company
|
||||
company = frappe.get_doc("Company", erpnext.get_default_company())
|
||||
|
||||
# update non profit settings
|
||||
settings = frappe.get_doc("Non Profit Settings")
|
||||
# Enable razorpay
|
||||
settings.enable_razorpay_for_memberships = 1
|
||||
settings.billing_cycle = "Monthly"
|
||||
settings.billing_frequency = 24
|
||||
# Enable invoicing
|
||||
settings.allow_invoicing = 1
|
||||
settings.automate_membership_payment_entries = 1
|
||||
settings.company = company.name
|
||||
settings.donation_company = company.name
|
||||
settings.membership_payment_account = company.default_cash_account
|
||||
settings.membership_debit_account = company.default_receivable_account
|
||||
settings.flags.ignore_mandatory = True
|
||||
settings.save()
|
||||
|
||||
# make test plan
|
||||
if not frappe.db.exists("Membership Type", "_rzpy_test_milythm"):
|
||||
plan = frappe.new_doc("Membership Type")
|
||||
plan.membership_type = "_rzpy_test_milythm"
|
||||
plan.amount = 100
|
||||
plan.razorpay_plan_id = "_rzpy_test_milythm"
|
||||
plan.linked_item = create_item("_Test Item for Non Profit Membership").name
|
||||
plan.insert()
|
||||
else:
|
||||
plan = frappe.get_doc("Membership Type", "_rzpy_test_milythm")
|
||||
|
||||
return plan
|
||||
|
||||
def get_subscription_payload():
|
||||
return {
|
||||
"entity": "event",
|
||||
"account_id": "acc_BFQ7uQEaa7j2z7",
|
||||
"event": "subscription.halted",
|
||||
"contains": [
|
||||
"subscription"
|
||||
],
|
||||
"payload": {
|
||||
"subscription": {
|
||||
"entity": {
|
||||
"id": "sub_DEX6xcJ1HSW4CR",
|
||||
"entity": "subscription",
|
||||
"plan_id": "_rzpy_test_milythm",
|
||||
"customer_id": "cust_C0WlbKhp3aLA7W",
|
||||
"status": "halted",
|
||||
"notes": {
|
||||
"Important": "Notes for Internal Reference"
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Membership Type', {
|
||||
refresh: function (frm) {
|
||||
frappe.db.get_single_value('Non Profit Settings', 'enable_razorpay_for_memberships').then(val => {
|
||||
if (val) frm.set_df_property('razorpay_plan_id', 'hidden', false);
|
||||
});
|
||||
|
||||
frappe.db.get_single_value('Non Profit Settings', 'allow_invoicing').then(val => {
|
||||
if (val) frm.set_df_property('linked_item', 'hidden', false);
|
||||
});
|
||||
|
||||
frm.set_query('linked_item', () => {
|
||||
return {
|
||||
filters: {
|
||||
is_stock_item: 0
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
});
|
@ -1,71 +0,0 @@
|
||||
{
|
||||
"actions": [],
|
||||
"autoname": "field:membership_type",
|
||||
"creation": "2017-09-18 12:56:56.343999",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"membership_type",
|
||||
"amount",
|
||||
"razorpay_plan_id",
|
||||
"linked_item"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "membership_type",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Membership Type",
|
||||
"reqd": 1,
|
||||
"unique": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "amount",
|
||||
"fieldtype": "Float",
|
||||
"in_list_view": 1,
|
||||
"label": "Amount",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "razorpay_plan_id",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 1,
|
||||
"label": "Razorpay Plan ID",
|
||||
"unique": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "linked_item",
|
||||
"fieldtype": "Link",
|
||||
"label": "Linked Item",
|
||||
"options": "Item",
|
||||
"unique": 1
|
||||
}
|
||||
],
|
||||
"links": [],
|
||||
"modified": "2020-08-05 15:21:43.595745",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Non Profit",
|
||||
"name": "Membership Type",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Non Profit Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
"restrict_to_domain": "Non Profit",
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class MembershipType(Document):
|
||||
def validate(self):
|
||||
if self.linked_item:
|
||||
is_stock_item = frappe.db.get_value("Item", self.linked_item, "is_stock_item")
|
||||
if is_stock_item:
|
||||
frappe.throw(_("The Linked Item should be a service item"))
|
||||
|
||||
def get_membership_type(razorpay_id):
|
||||
return frappe.db.exists("Membership Type", {"razorpay_plan_id": razorpay_id})
|
@ -1,8 +0,0 @@
|
||||
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestMembershipType(unittest.TestCase):
|
||||
pass
|
@ -1,133 +0,0 @@
|
||||
// Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on("Non Profit Settings", {
|
||||
refresh: function(frm) {
|
||||
frm.set_query("inv_print_format", function() {
|
||||
return {
|
||||
filters: {
|
||||
"doc_type": "Sales Invoice"
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
frm.set_query("membership_print_format", function() {
|
||||
return {
|
||||
filters: {
|
||||
"doc_type": "Membership"
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
frm.set_query("membership_debit_account", function() {
|
||||
return {
|
||||
filters: {
|
||||
"account_type": "Receivable",
|
||||
"is_group": 0,
|
||||
"company": frm.doc.company
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
frm.set_query("donation_debit_account", function() {
|
||||
return {
|
||||
filters: {
|
||||
"account_type": "Receivable",
|
||||
"is_group": 0,
|
||||
"company": frm.doc.donation_company
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
frm.set_query("membership_payment_account", function () {
|
||||
var account_types = ["Bank", "Cash"];
|
||||
return {
|
||||
filters: {
|
||||
"account_type": ["in", account_types],
|
||||
"is_group": 0,
|
||||
"company": frm.doc.company
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
frm.set_query("donation_payment_account", function () {
|
||||
var account_types = ["Bank", "Cash"];
|
||||
return {
|
||||
filters: {
|
||||
"account_type": ["in", account_types],
|
||||
"is_group": 0,
|
||||
"company": frm.doc.donation_company
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
let docs_url = "https://docs.erpnext.com/docs/user/manual/en/non_profit/membership";
|
||||
|
||||
frm.set_intro(__("You can learn more about memberships in the manual. ") + `<a href='${docs_url}'>${__('ERPNext Docs')}</a>`, true);
|
||||
frm.trigger("setup_buttons_for_membership");
|
||||
frm.trigger("setup_buttons_for_donation");
|
||||
},
|
||||
|
||||
setup_buttons_for_membership: function(frm) {
|
||||
let label;
|
||||
|
||||
if (frm.doc.membership_webhook_secret) {
|
||||
|
||||
frm.add_custom_button(__("Copy Webhook URL"), () => {
|
||||
frappe.utils.copy_to_clipboard(`https://${frappe.boot.sitename}/api/method/erpnext.non_profit.doctype.membership.membership.trigger_razorpay_subscription`);
|
||||
}, __("Memberships"));
|
||||
|
||||
frm.add_custom_button(__("Revoke Key"), () => {
|
||||
frm.call("revoke_key", {
|
||||
key: "membership_webhook_secret"
|
||||
}).then(() => {
|
||||
frm.refresh();
|
||||
});
|
||||
}, __("Memberships"));
|
||||
|
||||
label = __("Regenerate Webhook Secret");
|
||||
|
||||
} else {
|
||||
label = __("Generate Webhook Secret");
|
||||
}
|
||||
|
||||
frm.add_custom_button(label, () => {
|
||||
frm.call("generate_webhook_secret", {
|
||||
field: "membership_webhook_secret"
|
||||
}).then(() => {
|
||||
frm.refresh();
|
||||
});
|
||||
}, __("Memberships"));
|
||||
},
|
||||
|
||||
setup_buttons_for_donation: function(frm) {
|
||||
let label;
|
||||
|
||||
if (frm.doc.donation_webhook_secret) {
|
||||
label = __("Regenerate Webhook Secret");
|
||||
|
||||
frm.add_custom_button(__("Copy Webhook URL"), () => {
|
||||
frappe.utils.copy_to_clipboard(`https://${frappe.boot.sitename}/api/method/erpnext.non_profit.doctype.donation.donation.capture_razorpay_donations`);
|
||||
}, __("Donations"));
|
||||
|
||||
frm.add_custom_button(__("Revoke Key"), () => {
|
||||
frm.call("revoke_key", {
|
||||
key: "donation_webhook_secret"
|
||||
}).then(() => {
|
||||
frm.refresh();
|
||||
});
|
||||
}, __("Donations"));
|
||||
|
||||
} else {
|
||||
label = __("Generate Webhook Secret");
|
||||
}
|
||||
|
||||
frm.add_custom_button(label, () => {
|
||||
frm.call("generate_webhook_secret", {
|
||||
field: "donation_webhook_secret"
|
||||
}).then(() => {
|
||||
frm.refresh();
|
||||
});
|
||||
}, __("Donations"));
|
||||
}
|
||||
});
|
@ -1,273 +0,0 @@
|
||||
{
|
||||
"actions": [],
|
||||
"creation": "2020-03-29 12:57:03.005120",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"enable_razorpay_for_memberships",
|
||||
"razorpay_settings_section",
|
||||
"billing_cycle",
|
||||
"billing_frequency",
|
||||
"membership_webhook_secret",
|
||||
"column_break_6",
|
||||
"allow_invoicing",
|
||||
"automate_membership_invoicing",
|
||||
"automate_membership_payment_entries",
|
||||
"company",
|
||||
"membership_debit_account",
|
||||
"membership_payment_account",
|
||||
"column_break_9",
|
||||
"send_email",
|
||||
"send_invoice",
|
||||
"membership_print_format",
|
||||
"inv_print_format",
|
||||
"email_template",
|
||||
"donation_settings_section",
|
||||
"donation_company",
|
||||
"default_donor_type",
|
||||
"donation_webhook_secret",
|
||||
"column_break_22",
|
||||
"automate_donation_payment_entries",
|
||||
"donation_debit_account",
|
||||
"donation_payment_account",
|
||||
"section_break_27",
|
||||
"creation_user"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "billing_cycle",
|
||||
"fieldtype": "Select",
|
||||
"label": "Billing Cycle",
|
||||
"options": "Monthly\nYearly"
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:doc.enable_razorpay_for_memberships",
|
||||
"fieldname": "razorpay_settings_section",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "RazorPay Settings for Memberships"
|
||||
},
|
||||
{
|
||||
"description": "The number of billing cycles for which the customer should be charged. For example, if a customer is buying a 1-year membership that should be billed on a monthly basis, this value should be 12.",
|
||||
"fieldname": "billing_frequency",
|
||||
"fieldtype": "Int",
|
||||
"label": "Billing Frequency"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_6",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Membership Invoicing"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_9",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"description": "This company will be set for the Memberships created via webhook.",
|
||||
"fieldname": "company",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Company",
|
||||
"options": "Company",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"depends_on": "eval:doc.allow_invoicing && doc.send_email",
|
||||
"fieldname": "send_invoice",
|
||||
"fieldtype": "Check",
|
||||
"label": "Send Invoice with Email"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "send_email",
|
||||
"fieldtype": "Check",
|
||||
"label": "Send Membership Acknowledgement"
|
||||
},
|
||||
{
|
||||
"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",
|
||||
"options": "Print Format"
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:doc.send_email",
|
||||
"fieldname": "email_template",
|
||||
"fieldtype": "Link",
|
||||
"label": "Email Template",
|
||||
"mandatory_depends_on": "eval:doc.send_email",
|
||||
"options": "Email Template"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "allow_invoicing",
|
||||
"fieldtype": "Check",
|
||||
"label": "Allow Invoicing for Memberships",
|
||||
"mandatory_depends_on": "eval:doc.send_invoice || doc.make_payment_entry"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"depends_on": "eval:doc.allow_invoicing",
|
||||
"description": "Automatically create an invoice when payment is authorized from a web form entry",
|
||||
"fieldname": "automate_membership_invoicing",
|
||||
"fieldtype": "Check",
|
||||
"label": "Automate Invoicing for Web Forms"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"depends_on": "eval:doc.allow_invoicing",
|
||||
"description": "Auto creates Payment Entry for Sales Invoices created for Membership from web forms.",
|
||||
"fieldname": "automate_membership_payment_entries",
|
||||
"fieldtype": "Check",
|
||||
"label": "Automate Payment Entry Creation"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "enable_razorpay_for_memberships",
|
||||
"fieldtype": "Check",
|
||||
"label": "Enable RazorPay For Memberships"
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:doc.automate_membership_payment_entries",
|
||||
"description": "Account for accepting membership payments",
|
||||
"fieldname": "membership_payment_account",
|
||||
"fieldtype": "Link",
|
||||
"label": "Membership Payment To",
|
||||
"mandatory_depends_on": "eval:doc.automate_membership_payment_entries",
|
||||
"options": "Account"
|
||||
},
|
||||
{
|
||||
"fieldname": "membership_webhook_secret",
|
||||
"fieldtype": "Password",
|
||||
"label": "Membership Webhook Secret",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "donation_webhook_secret",
|
||||
"fieldtype": "Password",
|
||||
"label": "Donation Webhook Secret",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"depends_on": "automate_donation_payment_entries",
|
||||
"description": "Account for accepting donation payments",
|
||||
"fieldname": "donation_payment_account",
|
||||
"fieldtype": "Link",
|
||||
"label": "Donation Payment To",
|
||||
"mandatory_depends_on": "automate_donation_payment_entries",
|
||||
"options": "Account"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"description": "Auto creates Payment Entry for Donations created from web forms.",
|
||||
"fieldname": "automate_donation_payment_entries",
|
||||
"fieldtype": "Check",
|
||||
"label": "Automate Donation Payment Entries"
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:doc.allow_invoicing",
|
||||
"fieldname": "membership_debit_account",
|
||||
"fieldtype": "Link",
|
||||
"label": "Debit Account",
|
||||
"mandatory_depends_on": "eval:doc.allow_invoicing",
|
||||
"options": "Account"
|
||||
},
|
||||
{
|
||||
"depends_on": "automate_donation_payment_entries",
|
||||
"fieldname": "donation_debit_account",
|
||||
"fieldtype": "Link",
|
||||
"label": "Debit Account",
|
||||
"mandatory_depends_on": "automate_donation_payment_entries",
|
||||
"options": "Account"
|
||||
},
|
||||
{
|
||||
"description": "This company will be set for the Donations created via webhook.",
|
||||
"fieldname": "donation_company",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Company",
|
||||
"options": "Company",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "donation_settings_section",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Donation Settings"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_22",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"description": "This Donor Type will be set for the Donor created via Donation web form entry.",
|
||||
"fieldname": "default_donor_type",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Default Donor Type",
|
||||
"options": "Donor Type",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "section_break_27",
|
||||
"fieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"description": "The user that will be used to create Donations, Memberships, Invoices, and Payment Entries. This user should have the relevant permissions.",
|
||||
"fieldname": "creation_user",
|
||||
"fieldtype": "Link",
|
||||
"label": "Creation User",
|
||||
"options": "User",
|
||||
"reqd": 1
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"issingle": 1,
|
||||
"links": [],
|
||||
"modified": "2021-03-11 10:43:38.124240",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Non Profit",
|
||||
"name": "Non Profit Settings",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"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,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.integrations.utils import get_payment_gateway_controller
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class NonProfitSettings(Document):
|
||||
@frappe.whitelist()
|
||||
def generate_webhook_secret(self, field="membership_webhook_secret"):
|
||||
key = frappe.generate_hash(length=20)
|
||||
self.set(field, key)
|
||||
self.save()
|
||||
|
||||
secret_for = "Membership" if field == "membership_webhook_secret" else "Donation"
|
||||
|
||||
frappe.msgprint(
|
||||
_("Here is your webhook secret for {0} API, this will be shown to you only once.").format(secret_for) + "<br><br>" + key,
|
||||
_("Webhook Secret")
|
||||
)
|
||||
|
||||
@frappe.whitelist()
|
||||
def revoke_key(self, key):
|
||||
self.set(key, None)
|
||||
self.save()
|
||||
|
||||
def get_webhook_secret(self, endpoint="Membership"):
|
||||
fieldname = "membership_webhook_secret" if endpoint == "Membership" else "donation_webhook_secret"
|
||||
return self.get_password(fieldname=fieldname, raise_exception=False)
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_plans_for_membership(*args, **kwargs):
|
||||
controller = get_payment_gateway_controller("Razorpay")
|
||||
plans = controller.get_plans()
|
||||
return [plan.get("item") for plan in plans.get("items")]
|
@ -1,9 +0,0 @@
|
||||
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestNonProfitSettings(unittest.TestCase):
|
||||
pass
|
@ -1,8 +0,0 @@
|
||||
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestVolunteer(unittest.TestCase):
|
||||
pass
|
@ -1,17 +0,0 @@
|
||||
// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Volunteer', {
|
||||
refresh: function(frm) {
|
||||
|
||||
frappe.dynamic_link = {doc: frm.doc, fieldname: 'name', doctype: 'Volunteer'};
|
||||
|
||||
frm.toggle_display(['address_html','contact_html'], !frm.doc.__islocal);
|
||||
|
||||
if(!frm.doc.__islocal) {
|
||||
frappe.contacts.render_address_and_contact(frm);
|
||||
} else {
|
||||
frappe.contacts.clear_address_and_contact(frm);
|
||||
}
|
||||
}
|
||||
});
|
@ -1,148 +0,0 @@
|
||||
{
|
||||
"actions": [],
|
||||
"allow_rename": 1,
|
||||
"autoname": "field:email",
|
||||
"creation": "2017-09-19 16:16:45.676019",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"volunteer_name",
|
||||
"column_break_5",
|
||||
"volunteer_type",
|
||||
"email",
|
||||
"image",
|
||||
"address_contacts",
|
||||
"address_html",
|
||||
"column_break_9",
|
||||
"contact_html",
|
||||
"volunteer_availability_and_skills_details",
|
||||
"availability",
|
||||
"availability_timeslot",
|
||||
"column_break_12",
|
||||
"volunteer_skills",
|
||||
"section_break_15",
|
||||
"note"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "volunteer_name",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Volunteer Name",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_5",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "volunteer_type",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Volunteer Type",
|
||||
"options": "Volunteer Type",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "email",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Email",
|
||||
"reqd": 1,
|
||||
"unique": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "image",
|
||||
"fieldtype": "Attach Image",
|
||||
"hidden": 1,
|
||||
"label": "Image",
|
||||
"no_copy": 1,
|
||||
"print_hide": 1
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:!doc.__islocal;",
|
||||
"fieldname": "address_contacts",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Address and Contact",
|
||||
"options": "fa fa-map-marker"
|
||||
},
|
||||
{
|
||||
"fieldname": "address_html",
|
||||
"fieldtype": "HTML",
|
||||
"label": "Address HTML"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_9",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "contact_html",
|
||||
"fieldtype": "HTML",
|
||||
"label": "Contact HTML"
|
||||
},
|
||||
{
|
||||
"fieldname": "volunteer_availability_and_skills_details",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Availability and Skills"
|
||||
},
|
||||
{
|
||||
"fieldname": "availability",
|
||||
"fieldtype": "Select",
|
||||
"label": "Availability",
|
||||
"options": "\nWeekly\nWeekdays\nWeekends"
|
||||
},
|
||||
{
|
||||
"fieldname": "availability_timeslot",
|
||||
"fieldtype": "Select",
|
||||
"label": "Availability Timeslot",
|
||||
"options": "\nMorning\nAfternoon\nEvening\nAnytime"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_12",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "volunteer_skills",
|
||||
"fieldtype": "Table",
|
||||
"label": "Volunteer Skills",
|
||||
"options": "Volunteer Skill"
|
||||
},
|
||||
{
|
||||
"fieldname": "section_break_15",
|
||||
"fieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "note",
|
||||
"fieldtype": "Long Text",
|
||||
"label": "Note"
|
||||
}
|
||||
],
|
||||
"image_field": "image",
|
||||
"links": [],
|
||||
"modified": "2020-09-16 23:45:15.595952",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Non Profit",
|
||||
"name": "Volunteer",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Non Profit Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
"restrict_to_domain": "Non Profit",
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"title_field": "volunteer_name",
|
||||
"track_changes": 1
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
|
||||
from frappe.contacts.address_and_contact import load_address_and_contact
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class Volunteer(Document):
|
||||
def onload(self):
|
||||
"""Load address and contacts in `__onload`"""
|
||||
load_address_and_contact(self)
|
@ -1,73 +0,0 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
"beta": 0,
|
||||
"creation": "2017-09-20 15:26:26.453435",
|
||||
"custom": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "DocType",
|
||||
"document_type": "",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"fields": [
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "volunteer_skill",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Volunteer Skill",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"options": "",
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 0,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
}
|
||||
],
|
||||
"has_web_view": 0,
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 0,
|
||||
"idx": 0,
|
||||
"image_view": 0,
|
||||
"in_create": 0,
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 1,
|
||||
"max_attachments": 0,
|
||||
"modified": "2017-12-06 11:54:14.396354",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Non Profit",
|
||||
"name": "Volunteer Skill",
|
||||
"name_case": "",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
"quick_entry": 1,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"restrict_to_domain": "Non Profit",
|
||||
"show_name_in_global_search": 0,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1,
|
||||
"track_seen": 0
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class VolunteerSkill(Document):
|
||||
pass
|
@ -1,8 +0,0 @@
|
||||
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestVolunteerType(unittest.TestCase):
|
||||
pass
|
@ -1,8 +0,0 @@
|
||||
// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Volunteer Type', {
|
||||
refresh: function() {
|
||||
|
||||
}
|
||||
});
|
@ -1,94 +0,0 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_guest_to_view": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
"autoname": "prompt",
|
||||
"beta": 0,
|
||||
"creation": "2017-09-19 16:13:07.763273",
|
||||
"custom": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "DocType",
|
||||
"document_type": "",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"fields": [
|
||||
{
|
||||
"allow_bulk_edit": 0,
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "amount",
|
||||
"fieldtype": "Float",
|
||||
"hidden": 0,
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Amount",
|
||||
"length": 0,
|
||||
"no_copy": 0,
|
||||
"permlevel": 0,
|
||||
"precision": "",
|
||||
"print_hide": 0,
|
||||
"print_hide_if_no_value": 0,
|
||||
"read_only": 0,
|
||||
"remember_last_selected_value": 0,
|
||||
"report_hide": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
}
|
||||
],
|
||||
"has_web_view": 0,
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 0,
|
||||
"idx": 0,
|
||||
"image_view": 0,
|
||||
"in_create": 0,
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2017-12-06 11:52:08.800425",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Non Profit",
|
||||
"name": "Volunteer Type",
|
||||
"name_case": "",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"amend": 0,
|
||||
"apply_user_permissions": 0,
|
||||
"cancel": 0,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Non Profit Manager",
|
||||
"set_user_permissions": 0,
|
||||
"share": 1,
|
||||
"submit": 0,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"restrict_to_domain": "Non Profit",
|
||||
"show_name_in_global_search": 0,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1,
|
||||
"track_seen": 0
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class VolunteerType(Document):
|
||||
pass
|
@ -1,24 +0,0 @@
|
||||
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
/* eslint-disable */
|
||||
|
||||
frappe.query_reports["Expiring Memberships"] = {
|
||||
"filters": [
|
||||
{
|
||||
"fieldname": "fiscal_year",
|
||||
"label": __("Fiscal Year"),
|
||||
"fieldtype": "Link",
|
||||
"options": "Fiscal Year",
|
||||
"default": frappe.defaults.get_user_default("fiscal_year"),
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname":"month",
|
||||
"label": __("Month"),
|
||||
"fieldtype": "Select",
|
||||
"options": "Jan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug\nSep\nOct\nNov\nDec",
|
||||
"default": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov",
|
||||
"Dec"][frappe.datetime.str_to_obj(frappe.datetime.get_today()).getMonth()],
|
||||
}
|
||||
]
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
{
|
||||
"add_total_row": 0,
|
||||
"apply_user_permissions": 1,
|
||||
"creation": "2018-05-24 11:44:08.942809",
|
||||
"disabled": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "Report",
|
||||
"idx": 0,
|
||||
"is_standard": "Yes",
|
||||
"letter_head": "ERPNext Foundation",
|
||||
"modified": "2018-05-24 11:44:08.942809",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Non Profit",
|
||||
"name": "Expiring Memberships",
|
||||
"owner": "Administrator",
|
||||
"ref_doctype": "Membership",
|
||||
"report_name": "Expiring Memberships",
|
||||
"report_type": "Script Report",
|
||||
"roles": [
|
||||
{
|
||||
"role": "Non Profit Manager"
|
||||
},
|
||||
{
|
||||
"role": "Non Profit Member"
|
||||
}
|
||||
]
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
|
||||
|
||||
def execute(filters=None):
|
||||
columns = get_columns(filters)
|
||||
data = get_data(filters)
|
||||
return columns, data
|
||||
|
||||
def get_columns(filters):
|
||||
return [
|
||||
_("Membership Type") + ":Link/Membership Type:100", _("Membership ID") + ":Link/Membership:140",
|
||||
_("Member ID") + ":Link/Member:140", _("Member Name") + ":Data:140", _("Email") + ":Data:140",
|
||||
_("Expiring On") + ":Date:120"
|
||||
]
|
||||
|
||||
def get_data(filters):
|
||||
|
||||
filters["month"] = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"].index(filters.month) + 1
|
||||
|
||||
return frappe.db.sql("""
|
||||
select ms.membership_type,ms.name,m.name,m.member_name,m.email,ms.max_membership_date
|
||||
from `tabMember` m
|
||||
inner join (select name,membership_type,max(to_date) as max_membership_date,member
|
||||
from `tabMembership`
|
||||
where paid = 1
|
||||
group by member
|
||||
order by max_membership_date asc) ms
|
||||
on m.name = ms.member
|
||||
where month(max_membership_date) = %(month)s and year(max_membership_date) = %(year)s """,{'month': filters.get('month'),'year':filters.get('fiscal_year')})
|
@ -1,12 +0,0 @@
|
||||
import frappe
|
||||
|
||||
|
||||
def get_company():
|
||||
company = frappe.defaults.get_defaults().company
|
||||
if company:
|
||||
return company
|
||||
else:
|
||||
company = frappe.get_list("Company", limit=1)
|
||||
if company:
|
||||
return company[0].name
|
||||
return None
|
@ -1,16 +0,0 @@
|
||||
frappe.ready(function() {
|
||||
// bind events here
|
||||
$(".page-header-actions-block .btn-primary, .page-header-actions-block .btn-default").addClass('hidden');
|
||||
$(".text-right .btn-primary").addClass('hidden');
|
||||
|
||||
if (frappe.utils.get_url_arg('name')) {
|
||||
$('.page-content .btn-form-submit').addClass('hidden');
|
||||
} else {
|
||||
user_name = frappe.full_name
|
||||
user_email_id = frappe.session.user
|
||||
$('[data-fieldname="currency"]').val("INR");
|
||||
$('[data-fieldname="name_of_applicant"]').val(user_name);
|
||||
$('[data-fieldname="email"]').val(user_email_id);
|
||||
$('[data-fieldname="amount"]').val(20000);
|
||||
}
|
||||
})
|
@ -1,79 +0,0 @@
|
||||
{
|
||||
"accept_payment": 1,
|
||||
"allow_comments": 0,
|
||||
"allow_delete": 0,
|
||||
"allow_edit": 0,
|
||||
"allow_incomplete": 0,
|
||||
"allow_multiple": 1,
|
||||
"allow_print": 0,
|
||||
"amount": 0.0,
|
||||
"amount_based_on_field": 1,
|
||||
"amount_field": "amount",
|
||||
"creation": "2018-06-08 16:24:05.805225",
|
||||
"doc_type": "Certification Application",
|
||||
"docstatus": 0,
|
||||
"doctype": "Web Form",
|
||||
"idx": 0,
|
||||
"introduction_text": "",
|
||||
"is_standard": 1,
|
||||
"login_required": 1,
|
||||
"max_attachment_size": 0,
|
||||
"modified": "2018-06-11 16:11:14.544987",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Non Profit",
|
||||
"name": "certification-application",
|
||||
"owner": "Administrator",
|
||||
"payment_button_help": "Pay for your certification using RazorPay",
|
||||
"payment_button_label": "Pay Now",
|
||||
"payment_gateway": "Razorpay",
|
||||
"published": 1,
|
||||
"route": "certification-application",
|
||||
"show_sidebar": 1,
|
||||
"sidebar_items": [],
|
||||
"success_url": "/certification-application",
|
||||
"title": "Certification Application",
|
||||
"web_form_fields": [
|
||||
{
|
||||
"fieldname": "name_of_applicant",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"label": "Name of Applicant",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"read_only": 0,
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "email",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"label": "Email",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"options": "User",
|
||||
"read_only": 1,
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "currency",
|
||||
"fieldtype": "Select",
|
||||
"hidden": 0,
|
||||
"label": "Currency",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"options": "USD\nINR",
|
||||
"read_only": 1,
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "amount",
|
||||
"fieldtype": "Float",
|
||||
"hidden": 0,
|
||||
"label": "Amount",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"read_only": 1,
|
||||
"reqd": 0
|
||||
}
|
||||
]
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
def get_context(context):
|
||||
# do your magic here
|
||||
pass
|
@ -1,16 +0,0 @@
|
||||
frappe.ready(function() {
|
||||
// bind events here
|
||||
$(".page-header-actions-block .btn-primary, .page-header-actions-block .btn-default").addClass('hidden');
|
||||
$(".text-right .btn-primary").addClass('hidden');
|
||||
|
||||
if (frappe.utils.get_url_arg('name')) {
|
||||
$('.page-content .btn-form-submit').addClass('hidden');
|
||||
} else {
|
||||
user_name = frappe.full_name
|
||||
user_email_id = frappe.session.user
|
||||
$('[data-fieldname="currency"]').val("USD");
|
||||
$('[data-fieldname="name_of_applicant"]').val(user_name);
|
||||
$('[data-fieldname="email"]').val(user_email_id);
|
||||
$('[data-fieldname="amount"]').val(300);
|
||||
}
|
||||
})
|
@ -1,80 +0,0 @@
|
||||
{
|
||||
"accept_payment": 1,
|
||||
"allow_comments": 0,
|
||||
"allow_delete": 0,
|
||||
"allow_edit": 0,
|
||||
"allow_incomplete": 0,
|
||||
"allow_multiple": 1,
|
||||
"allow_print": 0,
|
||||
"amount": 0.0,
|
||||
"amount_based_on_field": 1,
|
||||
"amount_field": "amount",
|
||||
"creation": "2018-06-13 09:22:48.262441",
|
||||
"currency": "USD",
|
||||
"doc_type": "Certification Application",
|
||||
"docstatus": 0,
|
||||
"doctype": "Web Form",
|
||||
"idx": 0,
|
||||
"introduction_text": "",
|
||||
"is_standard": 1,
|
||||
"login_required": 1,
|
||||
"max_attachment_size": 0,
|
||||
"modified": "2018-06-13 09:26:35.502064",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Non Profit",
|
||||
"name": "certification-application-usd",
|
||||
"owner": "Administrator",
|
||||
"payment_button_help": "Pay for your certification using PayPal",
|
||||
"payment_button_label": "Pay Now",
|
||||
"payment_gateway": "PayPal",
|
||||
"published": 1,
|
||||
"route": "certification-application-usd",
|
||||
"show_sidebar": 1,
|
||||
"sidebar_items": [],
|
||||
"success_url": "/certification-application-usd",
|
||||
"title": "Certification Application USD",
|
||||
"web_form_fields": [
|
||||
{
|
||||
"fieldname": "name_of_applicant",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"label": "Name of Applicant",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"read_only": 0,
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "email",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"label": "Email",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"options": "User",
|
||||
"read_only": 1,
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "currency",
|
||||
"fieldtype": "Select",
|
||||
"hidden": 0,
|
||||
"label": "Currency",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"options": "USD\nINR",
|
||||
"read_only": 1,
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "amount",
|
||||
"fieldtype": "Float",
|
||||
"hidden": 0,
|
||||
"label": "Amount",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"read_only": 1,
|
||||
"reqd": 0
|
||||
}
|
||||
]
|
||||
}
|
@ -1,3 +0,0 @@
|
||||
def get_context(context):
|
||||
# do your magic here
|
||||
pass
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user