def enroll_random_student(current_date): random_student = get_random("Student Applicant", {"application_status": "Approved"}) if random_student: enrollment = enroll_student(random_student) enrollment.academic_year = get_random("Academic Year") enrollment.enrollment_date = current_date fee_schedule = get_fee_schedule(enrollment.program) for fee in fee_schedule: enrollment.append("fees", fee) enrollment.submit() frappe.db.commit() assign_student_group(enrollment.student, enrollment.program)
def enroll_students(self): for stud in self.students: if stud.student: prog_enrollment = frappe.new_doc("Program Enrollment") prog_enrollment.student = stud.student prog_enrollment.student_name = stud.student_name prog_enrollment.program = self.new_program prog_enrollment.academic_year = self.new_academic_year prog_enrollment.save() elif stud.student_applicant: prog_enrollment = enroll_student(stud.student_applicant) prog_enrollment.academic_year = self.academic_year prog_enrollment.save() frappe.msgprint("Students have been enrolled.")
def enroll_random_student(current_date): batch = ["Section-A", "Section-B"] random_student = get_random("Student Applicant", {"application_status": "Approved"}) if random_student: enrollment = enroll_student(random_student) enrollment.academic_year = get_random("Academic Year") enrollment.enrollment_date = current_date enrollment.student_batch_name = batch[weighted_choice([9,3])] fee_schedule = get_fee_schedule(enrollment.program) for fee in fee_schedule: enrollment.append("fees", fee) enrolled_courses = get_course(enrollment.program) for course in enrolled_courses: enrollment.append("courses", course) enrollment.submit() frappe.db.commit() assign_student_group(enrollment.student, enrollment.student_name, enrollment.program, enrolled_courses, enrollment.student_batch_name)
def enroll_random_student(current_date): batch = ["Section-A", "Section-B"] random_student = get_random("Student Applicant", {"application_status": "Approved"}) if random_student: enrollment = enroll_student(random_student) enrollment.academic_year = get_random("Academic Year") enrollment.enrollment_date = current_date enrollment.student_batch_name = batch[weighted_choice([9, 3])] fee_schedule = get_fee_schedule(enrollment.program) for fee in fee_schedule: enrollment.append("fees", fee) enrolled_courses = get_course(enrollment.program) for course in enrolled_courses: enrollment.append("courses", course) enrollment.submit() frappe.db.commit() assign_student_group(enrollment.student, enrollment.student_name, enrollment.program, enrolled_courses, enrollment.student_batch_name)