[minor] student applications to be submitted after payment
This commit is contained in:
parent
efa68fb6b8
commit
bb89f6e151
@ -4,22 +4,22 @@ frappe.ui.form.on("Student Applicant", {
|
|||||||
frm.add_custom_button(__("Approve"), function() {
|
frm.add_custom_button(__("Approve"), function() {
|
||||||
frm.set_value("application_status", "Approved");
|
frm.set_value("application_status", "Approved");
|
||||||
frm.save_or_update();
|
frm.save_or_update();
|
||||||
|
|
||||||
}).addClass("btn-primary");
|
}, 'Actions');
|
||||||
|
|
||||||
frm.add_custom_button(__("Reject"), function() {
|
frm.add_custom_button(__("Reject"), function() {
|
||||||
frm.set_value("application_status", "Rejected");
|
frm.set_value("application_status", "Rejected");
|
||||||
frm.save_or_update();
|
frm.save_or_update();
|
||||||
}).addClass("btn-danger");
|
}, 'Actions');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(frm.doc.application_status== "Approved" && frm.doc.docstatus== 1 ) {
|
if(frm.doc.application_status== "Approved" && frm.doc.docstatus== 1 ) {
|
||||||
frm.add_custom_button(__("Enroll"), function() {
|
frm.add_custom_button(__("Enroll"), function() {
|
||||||
frm.events.enroll(frm)
|
frm.events.enroll(frm)
|
||||||
}).addClass("btn-primary");
|
}).addClass("btn-primary");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
enroll: function(frm) {
|
enroll: function(frm) {
|
||||||
frappe.model.open_mapped_doc({
|
frappe.model.open_mapped_doc({
|
||||||
method: "erpnext.schools.api.enroll_student",
|
method: "erpnext.schools.api.enroll_student",
|
||||||
|
@ -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))
|
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):
|
def on_payment_authorized(self, *args, **kwargs):
|
||||||
self.db_set('paid', 1)
|
self.db_set('paid', 1)
|
||||||
|
self.submit()
|
Loading…
x
Reference in New Issue
Block a user