add courses in the program enrollment (#11694)

This commit is contained in:
Manas Solanki 2017-11-23 12:19:57 +05:30 committed by Nabin Hait
parent ed4191ec5b
commit 30babee2ef
2 changed files with 6 additions and 1 deletions

View File

@ -1,9 +1,12 @@
// Copyright (c) 2016, Frappe and contributors
// For license information, please see license.txt
cur_frm.add_fetch('fee_structure', 'total_amount', 'amount');
frappe.ui.form.on("Program Enrollment", {
setup: function(frm) {
frm.add_fetch('fee_structure', 'total_amount', 'amount');
},
onload: function(frm, cdt, cdn){
frm.set_query("academic_term", "fees", function(){
return{

View File

@ -14,6 +14,8 @@ class ProgramEnrollment(Document):
self.validate_duplication()
if not self.student_name:
self.student_name = frappe.db.get_value("Student", self.student, "title")
if not self.courses:
self.extend("courses", self.get_courses())
def on_submit(self):
self.update_student_joining_date()