]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/javascript/backend/penalty/patron_penalty.js
f297a57dc677c8de73b90baa71c643d4ef722a75
[Evergreen.git] / Open-ILS / src / javascript / backend / penalty / patron_penalty.js
1 function go() {
2
3 /* load the lib script */
4 load_lib('circ/circ_lib.js');
5 log_vars('patron_penalty');
6
7 var config = findGroupConfig(patronProfile);
8
9 if( config ) {
10
11         /* check the fine limit */
12         if( config.fineThreshold >= 0 && patronFines >= config.fineThreshold ) 
13                 result.fatalEvents.push('PATRON_EXCEEDS_FINES');
14
15         /* check the overdue limit */
16         if( config.overdueThreshold >= 0 && patronOverdueCount >= config.overdueThreshold )
17                 result.fatalEvents.push('PATRON_EXCEEDS_OVERDUE_COUNT');
18
19 } else {
20         log_warn("profile has no configured information: " + patronProfile);
21 }
22
23
24
25
26
27
28 } go();
29
30