]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/sql/Pg/upgrade/0636.data.grace_period_extend.sql
LP#1758426: Disable triggers before recalculating bib visibility in 1085
[working/Evergreen.git] / Open-ILS / src / sql / Pg / upgrade / 0636.data.grace_period_extend.sql
1 -- Evergreen DB patch 0636.data.grace_period_extend.sql
2 --
3 -- OU setting turns on grace period auto extension. By default they only do so
4 -- when the grace period ends on a closed date, but there are two modifiers to
5 -- change that.
6 -- 
7 -- The first modifier causes grace periods to extend for all closed dates that
8 -- they intersect. This is "grace periods are only consumed by open days."
9 -- 
10 -- The second modifier causes a grace period that ends just before a closed
11 -- day, with or without extension having happened, to include the closed day
12 -- (and any following it) as well. This is mainly so that a backdate into the
13 -- closed period following the grace period will assume the "best case" of the
14 -- item having been returned after hours on the last day of the closed date.
15 --
16 BEGIN;
17
18
19 -- check whether patch can be applied
20 SELECT evergreen.upgrade_deps_block_check('0636', :eg_version);
21
22 INSERT INTO config.org_unit_setting_type(name, grp, label, description, datatype) VALUES
23
24 ( 'circ.grace.extend', 'circ',
25     oils_i18n_gettext('circ.grace.extend',
26         'Auto-Extend Grace Periods',
27         'coust', 'label'),
28     oils_i18n_gettext('circ.grace.extend',
29         'When enabled grace periods will auto-extend. By default this will be only when they are a full day or more and end on a closed date, though other options can alter this.',
30         'coust', 'description'),
31     'bool')
32
33 ,( 'circ.grace.extend.all', 'circ',
34     oils_i18n_gettext('circ.grace.extend.all',
35         'Auto-Extending Grace Periods extend for all closed dates',
36         'coust', 'label'),
37     oils_i18n_gettext('circ.grace.extend.all',
38         'If enabled and Grace Periods auto-extending is turned on grace periods will extend past all closed dates they intersect, within hard-coded limits. This basically becomes "grace periods can only be consumed by closed dates".',
39         'coust', 'description'),
40     'bool')
41
42 ,( 'circ.grace.extend.into_closed', 'circ',
43     oils_i18n_gettext('circ.grace.extend.into_closed',
44         'Auto-Extending Grace Periods include trailing closed dates',
45         'coust', 'label'),
46     oils_i18n_gettext('circ.grace.extend.into_closed',
47          'If enabled and Grace Periods auto-extending is turned on grace periods will include closed dates that directly follow the last day of the grace period, to allow a backdate into the closed dates to assume "returned after hours on the last day of the grace period, and thus still within it" automatically.',
48         'coust', 'description'),
49     'bool');
50
51
52 COMMIT;