[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.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",
|
||||
|
@ -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)
|
||||
self.db_set('paid', 1)
|
||||
self.submit()
|
Loading…
x
Reference in New Issue
Block a user