From: dbs Date: Fri, 3 Jul 2009 18:22:53 +0000 (+0000) Subject: Add checks for fines / overdues before enabling checkout X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c7b75c6b629fa4f4d5238a28df7cd4cbf55024e6;p=contrib%2FConifer.git Add checks for fines / overdues before enabling checkout git-svn-id: svn://svn.open-ils.org/ILS-Contrib/conifer/trunk@563 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- diff --git a/circ/circ_permit_patron.js b/circ/circ_permit_patron.js new file mode 100755 index 0000000000..8bb136585e --- /dev/null +++ b/circ/circ_permit_patron.js @@ -0,0 +1,42 @@ +function go() { + +/* load the script library */ +load_lib('circ/circ_lib.js'); +load_lib('JSON_v1.js'); +log_vars('circ_permit_patron'); + + +if( isTrue(patron.barred) ) + result.events.push('PATRON_BARRED'); + +var config = findGroupConfig(patronProfile); + +if( config ) { + + var limit = config.maxItemsOut; + if( limit >= 0 ) { + log_info('patron items out = ' + patronItemsOut +' limit = ' + limit); + if( !isTrue(isRenewal) && patronItemsOut >= limit ) { + result.events.push('PATRON_EXCEEDS_CHECKOUT_COUNT'); + } + } + + if (patronFines > 0 && patron.home_ou == 103) { + result.events.push('PATRON_EXCEEDS_FINES'); + } + + if (patronOverdueCount > 0 && patron.home_ou == 103) { + result.events.push('PATRON_EXCEEDS_OVERDUE_COUNT'); + } + + +} else { + + log_warn("** profile has no configured information: " + patronProfile); +} + + + +} go(); + +