source: main/waeup.sirp/trunk/src/waeup/sirp/students/utils.py @ 6898

Last change on this file since 6898 was 6898, checked in by Henrik Bettermann, 13 years ago

In the base package we can only create payment tickets with amount = 0. Amount calculation must be done in customization packages.

  • Property svn:keywords set to Id
File size: 1006 bytes
Line 
1"""General helper functions for the student section.
2"""
3
4from random import SystemRandom as r
5from waeup.sirp.students.vocabularies import academic_sessions_vocab
6
7def generate_student_id(students,letter):
8    if letter == '?':
9        letter= r().choice('ABCDEFGHKLMNPQRSTUVWXY')
10    sid = u"%c%d" % (letter,r().randint(99999,1000000))
11    while sid in students.keys():
12        sid = u"%c%d" % (letter,r().randint(99999,1000000))
13    return sid
14
15def set_returning_data(student):
16    student['studycourse'].current_level += 100
17    student['studycourse'].current_session += 1
18    verdict = student['studycourse'].current_verdict
19    student['studycourse'].current_verdict = '0'
20    student['studycourse'].previous_verdict = verdict
21    return
22
23# To be defined in customization packages
24def getPaymentDetails(category, student):
25    p_session = None
26    surcharge_1 = surcharge_2 = surcharge_3 = 0
27    p_item = u''
28    amount = 0
29    return amount, p_item, p_session, surcharge_1, surcharge_2, surcharge_3
Note: See TracBrowser for help on using the repository browser.