LP#1205426: expose OU setting types for item rental/deposit fee exemptions user/gmcharlt/lp1205426_expose_rental_deposit_exemption_option
authorGalen Charlton <gmc@esilibrary.com>
Fri, 26 Jul 2013 19:03:06 +0000 (15:03 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 26 Jul 2013 19:03:06 +0000 (15:03 -0400)
The OU settings circ.deposit.exempt_groups and circ.rental.exempt_groups,
which allow specifying a list of permission group IDs that should be
example from item deposits and item rental fees, have been present
in the code for years but not present in the seed data.  This patch
adds them.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/src/sql/Pg/950.data.seed-values.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.data.expose_deposit_rental_exempt_ous.sql [new file with mode: 0644]

index fb3b637..f5d1059 100644 (file)
@@ -2900,6 +2900,15 @@ INSERT into config.org_unit_setting_type
         'coust', 'description'),
     'currency', null)
 
+,( 'circ.deposit.exempt_groups', 'circ',
+    oils_i18n_gettext('circ.deposit.exempt_groups',
+        'Permission groups exempt from item deposit fees',
+        'coust', 'label'),
+    oils_i18n_gettext('circ.deposit.exempt_groups',
+        'List of the numeric IDs of permission groups who should not be charged item deposit fees. Example: [3]',
+        'coust', 'description'),
+    'array', null)
+
 ,( 'circ.do_not_tally_claims_returned', 'circ',
     oils_i18n_gettext('circ.do_not_tally_claims_returned',
         'Do not include outstanding Claims Returned circulations in lump sum tallies in Patron Display.',
@@ -3372,6 +3381,15 @@ INSERT into config.org_unit_setting_type
         'coust', 'description'),
     'string', null)
 
+,( 'circ.rental.exempt_groups', 'circ',
+    oils_i18n_gettext('circ.rental.exempt_groups',
+        'Permission groups exempt from item rental fees',
+        'coust', 'label'),
+    oils_i18n_gettext('circ.rental.exempt_groups',
+        'List of the numeric IDs of permission groups who should not be charged item rental fees. Example: [3]',
+        'coust', 'description'),
+    'array', null)
+
 ,( 'circ.reshelving_complete.interval', 'lib',
     oils_i18n_gettext('circ.reshelving_complete.interval',
         'Change reshelving status interval',
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.expose_deposit_rental_exempt_ous.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.expose_deposit_rental_exempt_ous.sql
new file mode 100644 (file)
index 0000000..fafeb3e
--- /dev/null
@@ -0,0 +1,40 @@
+-- Evergreen DB patch XXXX.data.expose_deposit_rental_exempt_ous.sql
+--
+-- Make sure circ.deposit.exempt_groups and circ.rental.exempt_groups
+-- OU setting types are present in database.
+--
+BEGIN;
+
+
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+INSERT into config.org_unit_setting_type
+( name, grp, label, description, datatype, fm_class )
+SELECT DISTINCT
+    'circ.deposit.exempt_groups', 'circ',  
+    oils_i18n_gettext('circ.deposit.exempt_groups',
+        'Permission groups exempt from item deposit fees',
+        'coust', 'label'),
+    oils_i18n_gettext('circ.deposit.exempt_groups',
+        'List of the numeric IDs of permission groups who should not be charged item deposit fees. Example: [3]',
+        'coust', 'description'),
+    'array', null
+FROM config.org_unit_setting_type
+WHERE NOT EXISTS (SELECT 1 FROM config.org_unit_setting_type WHERE name = 'circ.deposit.exempt_groups');
+
+INSERT into config.org_unit_setting_type
+( name, grp, label, description, datatype, fm_class )
+SELECT DISTINCT
+    'circ.rental.exempt_groups', 'circ',
+    oils_i18n_gettext('circ.rental.exempt_groups',
+        'Permission groups exempt from item rental fees',
+        'coust', 'label'),
+    oils_i18n_gettext('circ.rental.exempt_groups',
+        'List of the numeric IDs of permission groups who should not be charged item rental fees. Example: [3]',
+        'coust', 'description'),
+    'array', null
+FROM config.org_unit_setting_type
+WHERE NOT EXISTS (SELECT 1 FROM config.org_unit_setting_type WHERE name = 'circ.rental.exempt_groups');
+
+COMMIT;