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>
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(*)
RETURN NEXT result;
END IF;
END LOOP;
+ END IF;
-- If we passed everything, return the successful matchpoint id
IF NOT done THEN