3 /* load the lib script */
4 load_lib('../circ/circ_lib.js');
7 /* collect some useful variables */
8 var patron = environment.patron;
9 var patronProfile = patron.profile.name.toLowerCase();
10 var patronFines = environment.patronFines;
11 var patronOverdueCount = environment.patronOverdueCount;
14 log_debug('Patron penalty script: ' +
15 ', Patron:' + patron.id +
16 ', Patron Username:' + patron.usrname +
17 ', Patron Profile: ' + patronProfile +
18 ', Patron Library: ' + patron.home_ou.name +
19 ', Patron fines: ' + patronFines +
20 ', Patron overdue: ' + patronOverdueCount +
37 'local system administrator' : {
42 /* Add profiles as necessary ... */
47 var profile = PROFILES[patronProfile];
51 /* check the fine limit */
52 if( profile.fineLimit > 0 && patronFines >= profile.fineLimit )
53 result.fatalEvents.push('PATRON_EXCEEDS_FINES');
55 /* check the overdue limit */
56 if( profile.overdueLimit > 0 && patronOverdueCount > profile.overdueLimit )
57 result.fatalEvents.push('PATRON_EXCEEDS_OVERDUE_COUNT');
60 log_warn("profile has no configured information: " + patronProfile);