From bb89f6e151dabd9f85ef534675f1fbb80249d77d Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 5 Oct 2016 09:20:28 +0530 Subject: [PATCH] [minor] student applications to be submitted after payment --- .../doctype/student_applicant/student_applicant.js | 12 ++++++------ .../doctype/student_applicant/student_applicant.py | 3 ++- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/erpnext/schools/doctype/student_applicant/student_applicant.js b/erpnext/schools/doctype/student_applicant/student_applicant.js index 6857a667d7e..36baa80bb95 100644 --- a/erpnext/schools/doctype/student_applicant/student_applicant.js +++ b/erpnext/schools/doctype/student_applicant/student_applicant.js @@ -4,22 +4,22 @@ frappe.ui.form.on("Student Applicant", { frm.add_custom_button(__("Approve"), function() { frm.set_value("application_status", "Approved"); frm.save_or_update(); - - }).addClass("btn-primary"); - + + }, 'Actions'); + frm.add_custom_button(__("Reject"), function() { frm.set_value("application_status", "Rejected"); frm.save_or_update(); - }).addClass("btn-danger"); + }, 'Actions'); } - + if(frm.doc.application_status== "Approved" && frm.doc.docstatus== 1 ) { frm.add_custom_button(__("Enroll"), function() { frm.events.enroll(frm) }).addClass("btn-primary"); } }, - + enroll: function(frm) { frappe.model.open_mapped_doc({ method: "erpnext.schools.api.enroll_student", diff --git a/erpnext/schools/doctype/student_applicant/student_applicant.py b/erpnext/schools/doctype/student_applicant/student_applicant.py index eead6b08b33..e54ea0fc7c9 100644 --- a/erpnext/schools/doctype/student_applicant/student_applicant.py +++ b/erpnext/schools/doctype/student_applicant/student_applicant.py @@ -29,4 +29,5 @@ class StudentApplicant(Document): frappe.throw(_("Cannot change status as student {0} is linked with student application {1}").format(student[0].name, self.name)) def on_payment_authorized(self, *args, **kwargs): - self.db_set('paid', 1) \ No newline at end of file + self.db_set('paid', 1) + self.submit() \ No newline at end of file