[LP822918] Do not count items out if renewal user/mrpeters-isl/renewal_ignore_maxitemsout
authorMichael Peters <mrpeters@library.in.gov>
Thu, 29 Sep 2011 13:17:18 +0000 (09:17 -0400)
committerMichael Peters <mrpeters@library.in.gov>
Thu, 29 Sep 2011 13:17:18 +0000 (09:17 -0400)
I wrapped the code in action.item_user_circ_test that counts items out in a IF NOT renewal THEN block, not sure if that is the best way to deal with this but it seems to be working.

From: Doug Kyle <root@dkyle-MS-7549. (none)>
Signed-off-by: Michael Peters <mrpeters@library.in.gov>
Open-ILS/src/sql/Pg/2.0-2.1-upgrade-db.sql

index cbb6f71..e1ef2a5 100644 (file)
@@ -1141,6 +1141,7 @@ BEGIN
         END IF;
     END IF;
 
+    IF NOT renwal THEN
     -- Fail if the user has too many items with specific circ_modifiers checked out
     FOR out_by_circ_mod IN SELECT * FROM config.circ_matrix_circ_mod_test WHERE matchpoint = circ_matchpoint.id LOOP
         SELECT  INTO items_out COUNT(*)
@@ -1158,6 +1159,7 @@ BEGIN
             RETURN NEXT result;
         END IF;
     END LOOP;
+    END IF;
 
     -- If we passed everything, return the successful matchpoint id
     IF NOT done THEN