diff --git a/erpnext/hooks.py b/erpnext/hooks.py index cd56dfc9f7..5b88af32fd 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -149,6 +149,7 @@ 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"}, + {"title": _("Certification"), "route": "/certification", "reference_doctype": "Certification Application"}, ] default_roles = [ diff --git a/erpnext/non_profit/doctype/certification_application/__init__.py b/erpnext/non_profit/doctype/certification_application/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/non_profit/doctype/certification_application/certification_application.js b/erpnext/non_profit/doctype/certification_application/certification_application.js new file mode 100644 index 0000000000..1e6a9a4b01 --- /dev/null +++ b/erpnext/non_profit/doctype/certification_application/certification_application.js @@ -0,0 +1,8 @@ +// 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) { + + } +}); diff --git a/erpnext/non_profit/doctype/certification_application/certification_application.json b/erpnext/non_profit/doctype/certification_application/certification_application.json new file mode 100644 index 0000000000..469e287b27 --- /dev/null +++ b/erpnext/non_profit/doctype/certification_application/certification_application.json @@ -0,0 +1,339 @@ +{ + "allow_copy": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "autoname": "CA-.YY.-.####", + "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-06-14 23:17:07.405689", + "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 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 0, + "email": 1, + "export": 0, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 0, + "role": "Customer", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + } + ], + "quick_entry": 0, + "read_only": 0, + "read_only_onload": 0, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0 +} \ No newline at end of file diff --git a/erpnext/non_profit/doctype/certification_application/certification_application.py b/erpnext/non_profit/doctype/certification_application/certification_application.py new file mode 100644 index 0000000000..d4fc76bbfa --- /dev/null +++ b/erpnext/non_profit/doctype/certification_application/certification_application.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import frappe +from frappe.model.document import Document + +class CertificationApplication(Document): + pass diff --git a/erpnext/non_profit/doctype/certification_application/test_certification_application.js b/erpnext/non_profit/doctype/certification_application/test_certification_application.js new file mode 100644 index 0000000000..40e94864d4 --- /dev/null +++ b/erpnext/non_profit/doctype/certification_application/test_certification_application.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Certification Application", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Certification Application + () => frappe.tests.make('Certification Application', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/erpnext/non_profit/doctype/certification_application/test_certification_application.py b/erpnext/non_profit/doctype/certification_application/test_certification_application.py new file mode 100644 index 0000000000..30cb8c0acd --- /dev/null +++ b/erpnext/non_profit/doctype/certification_application/test_certification_application.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors +# See license.txt +from __future__ import unicode_literals + +import frappe +import unittest + +class TestCertificationApplication(unittest.TestCase): + pass diff --git a/erpnext/non_profit/doctype/certified_consultant/__init__.py b/erpnext/non_profit/doctype/certified_consultant/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/non_profit/doctype/certified_consultant/certified_consultant.js b/erpnext/non_profit/doctype/certified_consultant/certified_consultant.js new file mode 100644 index 0000000000..cd004c3489 --- /dev/null +++ b/erpnext/non_profit/doctype/certified_consultant/certified_consultant.js @@ -0,0 +1,8 @@ +// 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) { + + } +}); diff --git a/erpnext/non_profit/doctype/certified_consultant/certified_consultant.json b/erpnext/non_profit/doctype/certified_consultant/certified_consultant.json new file mode 100644 index 0000000000..32a162bbde --- /dev/null +++ b/erpnext/non_profit/doctype/certified_consultant/certified_consultant.json @@ -0,0 +1,304 @@ +{ + "allow_copy": 0, + "allow_guest_to_view": 0, + "allow_import": 0, + "allow_rename": 0, + "autoname": "CC-.YY.-.####", + "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": "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": "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 + } + ], + "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-06-14 07:26:12.646293", + "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, + "show_name_in_global_search": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1, + "track_seen": 0 +} \ No newline at end of file diff --git a/erpnext/non_profit/doctype/certified_consultant/certified_consultant.py b/erpnext/non_profit/doctype/certified_consultant/certified_consultant.py new file mode 100644 index 0000000000..3bc6ed74c2 --- /dev/null +++ b/erpnext/non_profit/doctype/certified_consultant/certified_consultant.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import frappe +from frappe.model.document import Document + +class CertifiedConsultant(Document): + pass diff --git a/erpnext/non_profit/doctype/certified_consultant/test_certified_consultant.js b/erpnext/non_profit/doctype/certified_consultant/test_certified_consultant.js new file mode 100644 index 0000000000..f6a72a4327 --- /dev/null +++ b/erpnext/non_profit/doctype/certified_consultant/test_certified_consultant.js @@ -0,0 +1,23 @@ +/* eslint-disable */ +// rename this file from _test_[name] to test_[name] to activate +// and remove above this line + +QUnit.test("test: Certified Consultant", function (assert) { + let done = assert.async(); + + // number of asserts + assert.expect(1); + + frappe.run_serially([ + // insert a new Certified Consultant + () => frappe.tests.make('Certified Consultant', [ + // values to be set + {key: 'value'} + ]), + () => { + assert.equal(cur_frm.doc.key, 'value'); + }, + () => done() + ]); + +}); diff --git a/erpnext/non_profit/doctype/certified_consultant/test_certified_consultant.py b/erpnext/non_profit/doctype/certified_consultant/test_certified_consultant.py new file mode 100644 index 0000000000..19b485db1f --- /dev/null +++ b/erpnext/non_profit/doctype/certified_consultant/test_certified_consultant.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors +# See license.txt +from __future__ import unicode_literals + +import frappe +import unittest + +class TestCertifiedConsultant(unittest.TestCase): + pass diff --git a/erpnext/non_profit/web_form/certification_application/__init__.py b/erpnext/non_profit/web_form/certification_application/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/non_profit/web_form/certification_application/certification_application.js b/erpnext/non_profit/web_form/certification_application/certification_application.js new file mode 100644 index 0000000000..8b455edafa --- /dev/null +++ b/erpnext/non_profit/web_form/certification_application/certification_application.js @@ -0,0 +1,16 @@ +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); + } +}) diff --git a/erpnext/non_profit/web_form/certification_application/certification_application.json b/erpnext/non_profit/web_form/certification_application/certification_application.json new file mode 100644 index 0000000000..5fda978fba --- /dev/null +++ b/erpnext/non_profit/web_form/certification_application/certification_application.json @@ -0,0 +1,79 @@ +{ + "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 + } + ] +} \ No newline at end of file diff --git a/erpnext/non_profit/web_form/certification_application/certification_application.py b/erpnext/non_profit/web_form/certification_application/certification_application.py new file mode 100644 index 0000000000..2334f8b26d --- /dev/null +++ b/erpnext/non_profit/web_form/certification_application/certification_application.py @@ -0,0 +1,7 @@ +from __future__ import unicode_literals + +import frappe + +def get_context(context): + # do your magic here + pass diff --git a/erpnext/non_profit/web_form/certification_application_usd/__init__.py b/erpnext/non_profit/web_form/certification_application_usd/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/non_profit/web_form/certification_application_usd/certification_application_usd.js b/erpnext/non_profit/web_form/certification_application_usd/certification_application_usd.js new file mode 100644 index 0000000000..005d1dd6c1 --- /dev/null +++ b/erpnext/non_profit/web_form/certification_application_usd/certification_application_usd.js @@ -0,0 +1,16 @@ +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); + } +}) diff --git a/erpnext/non_profit/web_form/certification_application_usd/certification_application_usd.json b/erpnext/non_profit/web_form/certification_application_usd/certification_application_usd.json new file mode 100644 index 0000000000..266109f580 --- /dev/null +++ b/erpnext/non_profit/web_form/certification_application_usd/certification_application_usd.json @@ -0,0 +1,80 @@ +{ + "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 + } + ] +} \ No newline at end of file diff --git a/erpnext/non_profit/web_form/certification_application_usd/certification_application_usd.py b/erpnext/non_profit/web_form/certification_application_usd/certification_application_usd.py new file mode 100644 index 0000000000..2334f8b26d --- /dev/null +++ b/erpnext/non_profit/web_form/certification_application_usd/certification_application_usd.py @@ -0,0 +1,7 @@ +from __future__ import unicode_literals + +import frappe + +def get_context(context): + # do your magic here + pass diff --git a/erpnext/www/__init__.py b/erpnext/www/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/www/payment_setup_certification.html b/erpnext/www/payment_setup_certification.html new file mode 100644 index 0000000000..422d35a34a --- /dev/null +++ b/erpnext/www/payment_setup_certification.html @@ -0,0 +1,86 @@ +{% extends "templates/web.html" %} + +{% block title %} ERPNext Certification {% endblock %} + +{% block page_content %} + +{% macro show_currency_options() %} + +
Certification price is 20,000 INR / 300 USD.
+ +You must first sign up and login to apply for certification.
+ +Certification Id | +From | +To | +Amount | +
---|---|---|---|
{{ certification['name'] }} | +{{ frappe.format_date(certification['from_date']) }} | +{{ frappe.format_date(certification['to_date']) }} | +{{ frappe.utils.fmt_money(certification['amount'],currency=frappe.db.get_value("Currency",certification['currency'],"symbol")) }} | +
Your certification has expired. Click on the button below to start a new certification.
+ {{ show_currency_options() }} + +{% elif all_certifications and (frappe.utils.getdate(frappe.utils.add_days(all_certifications[0]['to_date'], -30)) < frappe.utils.getdate(frappe.utils.nowdate()))%} +Your certification is due to expire soon. Click on the button below to start a new certification.
+ {{ show_currency_options() }} + +{% endif %} + +{% endif %} + +{% endblock %} diff --git a/erpnext/www/payment_setup_certification.py b/erpnext/www/payment_setup_certification.py new file mode 100644 index 0000000000..185c220942 --- /dev/null +++ b/erpnext/www/payment_setup_certification.py @@ -0,0 +1,20 @@ +import frappe +import foundation + +no_cache = 1 + +def get_context(context): + if frappe.session.user != 'Guest': + context.all_certifications = get_all_certifications_of_a_member() + context.show_sidebar = True + + +def get_all_certifications_of_a_member(): + '''Returns all certifications''' + all_certifications = [] + all_certifications = frappe.db.sql(""" select cc.name,cc.from_date,cc.to_date,ca.amount,ca.currency + from `tabCertified Consultant` cc + inner join `tabCertification Application` ca + on cc.certification_application = ca.name + where paid = 1 and email = %(user)s order by cc.to_date desc""" ,{'user': frappe.session.user},as_dict=True) + return all_certifications