rough draft if sql support for allowing staff to excempt patrons from collections
authorberick <berick@esilibrary.com>
Mon, 9 May 2011 19:14:31 +0000 (15:14 -0400)
committerberick <berick@esilibrary.com>
Mon, 9 May 2011 19:14:31 +0000 (15:14 -0400)
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/money.pm
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.data.patron_no_collections.sql [new file with mode: 0644]

index 22ab1f3..050ded1 100644 (file)
@@ -144,6 +144,9 @@ select
                 and x.circ_lib in (XX)
                 and b.billing_ts < current_timestamp - ? * '1 day'::interval
                 and not b.voided
+                and not exists (
+                    select set.id from actor.usr_setting set where set.usr = x.usr and set.name='circ.collections.exempt' and set.value = 'true'
+                )
           group by 1,2
 
                   union all
@@ -161,6 +164,9 @@ select
                 and x.billing_location in (XX)
                 and b.billing_ts < current_timestamp - ? * '1 day'::interval
                 and not b.voided
+                and not exists (
+                    select set.id from actor.usr_setting set where set.usr = x.usr and set.name='circ.collections.exempt' and set.value = 'true'
+                )
           group by 1,2
 
                   union all
@@ -178,6 +184,9 @@ select
                 and x.pickup_lib in (XX)
                 and b.billing_ts < current_timestamp - ? * '1 day'::interval
                 and not b.voided
+                and not exists (
+                    select set.id from actor.usr_setting set where set.usr = x.usr and set.name='circ.collections.exempt' and set.value = 'true'
+                )
           group by 1,2
         ) full_list
         left join money.payment p on (full_list.id = p.xact)
index 1a2259c..6f43d29 100644 (file)
@@ -8021,3 +8021,11 @@ INSERT INTO config.org_unit_setting_type
   'bool'
 );
 
+INSERT INTO config.usr_setting_type 
+( name, opac_visible, label, description, datatype) VALUES 
+( 'circ.collections.exempt',
+  FALSE, 
+  oils_i18n_gettext('circ.collections.exempt', 'Collections: Exempt', 'cust', 'description'),
+  oils_i18n_gettext('circ.collections.exempt', 'User is exempt from collections tracking/processing', 'cust', 'description'),
+  'bool'
+);
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.patron_no_collections.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.patron_no_collections.sql
new file mode 100644 (file)
index 0000000..620c2a4
--- /dev/null
@@ -0,0 +1,15 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('XXX');
+
+INSERT INTO config.usr_setting_type 
+( name, opac_visible, label, description, datatype) VALUES 
+( 'circ.collections.exempt',
+  FALSE, 
+  oils_i18n_gettext('circ.collections.exempt', 'Collections: Exempt', 'cust', 'description'),
+  oils_i18n_gettext('circ.collections.exempt', 'User is exempt from collections tracking/processing', 'cust', 'description'),
+  'bool'
+);
+
+COMMIT;
+