]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/javascript/backend/penalty/patron_penalty.js
Docs: 2.8 Patron Message Center
[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 load_lib('JSON_v1.js');
6 log_vars('patron_penalty');
7
8 var config = findGroupConfig(patronProfile);
9
10 if( config ) {
11
12         /* check the fine limit */
13         if( config.fineThreshold >= 0 && patronFines >= config.fineThreshold ) 
14                 result.fatalEvents.push('PATRON_EXCEEDS_FINES');
15
16         /* check the overdue limit */
17         if( config.overdueThreshold >= 0 && patronOverdueCount >= config.overdueThreshold )
18                 result.fatalEvents.push('PATRON_EXCEEDS_OVERDUE_COUNT');
19
20 } else {
21         log_warn("profile has no configured information: " + patronProfile);
22 }
23
24
25
26
27
28
29 } go();
30
31