[open-ils-commits] r563 - conifer/trunk/circ (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Jul 3 14:22:57 EDT 2009
Author: dbs
Date: 2009-07-03 14:22:53 -0400 (Fri, 03 Jul 2009)
New Revision: 563
Added:
conifer/trunk/circ/circ_permit_patron.js
Log:
Add checks for fines / overdues before enabling checkout
Added: conifer/trunk/circ/circ_permit_patron.js
===================================================================
--- conifer/trunk/circ/circ_permit_patron.js (rev 0)
+++ conifer/trunk/circ/circ_permit_patron.js 2009-07-03 18:22:53 UTC (rev 563)
@@ -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();
+
+
Property changes on: conifer/trunk/circ/circ_permit_patron.js
___________________________________________________________________
Name: svn:executable
+ *
More information about the open-ils-commits
mailing list