]> git.evergreen-ils.org Git - Evergreen.git/blob - Evergreen/src/javascript/backend/circ/circ_permit_patron.js
moved the PINES-specific circ rules over to the Evergreen tree
[Evergreen.git] / Evergreen / src / javascript / backend / circ / circ_permit_patron.js
1 function go() {
2
3 /* load the script library */
4 load_lib('circ/circ_lib.js');
5 log_vars('circ_permit_patron');
6
7
8
9 if( isTrue(patron.barred) ) 
10         result.events.push('PATRON_BARRED');
11
12
13 /* ---------------------------------------------------------------------
14         Check the items out count 
15         --------------------------------------------------------------------- */
16 var config = findGroupConfig(patronProfile);
17 if( config ) {
18         
19         var limit = config.maxItemsOut;
20         if( limit >= 0 ) {
21                 /* Patrons are allowed to renew regardless 
22                         of how many items they have checked out */
23                 log_info('patron items out = ' + patronItemsOut +' limit = ' + limit);
24                 if( !isTrue(isRenewal) && patronItemsOut >= limit ) {
25                                 result.events.push('PATRON_EXCEEDS_CHECKOUT_COUNT');
26                 }
27         }
28
29 } else {
30         log_warn("** profile has no configured information: " + patronProfile);
31 }
32
33
34 } go();
35
36