From: erickson Date: Fri, 28 Jul 2006 12:54:52 +0000 (+0000) Subject: on renewals, the itemsOut threshold is treated differently X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7d0e03e8f91daf833c00c5a81d0505ab77ba7c04;p=Evergreen.git on renewals, the itemsOut threshold is treated differently git-svn-id: svn://svn.open-ils.org/ILS/trunk@5146 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/javascript/backend/circ/circ_permit_patron.js b/Open-ILS/src/javascript/backend/circ/circ_permit_patron.js index 20152285c7..989f32e5f9 100644 --- a/Open-ILS/src/javascript/backend/circ/circ_permit_patron.js +++ b/Open-ILS/src/javascript/backend/circ/circ_permit_patron.js @@ -16,8 +16,20 @@ if( isTrue(patron.barred) ) var config = findGroupConfig(patronProfile); if( config ) { - if( (config.maxItemsOut >= 0) && (patronItemsOut >= config.maxItemsOut) ) { - result.events.push('PATRON_EXCEEDS_CHECKOUT_COUNT'); + var limit = config.maxItemsOut; + if( limit >= 0 ) { + + /* a renewal does not add to the itemsOut, so just make + sure they are not already over the items out limit */ + if( isTrue(isRenewal) ) { + if( patronItemsOut > limit ) { + result.events.push('PATRON_EXCEEDS_CHECKOUT_COUNT'); + } + } else { + if( patronItemsOut >= limit ) { + result.events.push('PATRON_EXCEEDS_CHECKOUT_COUNT'); + } + } } } else {