from action.circulation x
left join money.collections_tracker c ON (c.usr = x.usr AND c.location = ?)
join money.billing b on (b.xact = x.id)
+ LEFT JOIN actor.usr_setting set ON (set.usr = x.usr and set.name='circ.collections.exempt' and set.value = 'true')
where x.xact_finish is null
and c.id is null
and x.circ_lib in (XX)
and b.billing_ts < current_timestamp - ? * '1 day'::interval
and not b.voided
+ and set.id IS NULL
group by 1,2
union all
from money.grocery x
left join money.collections_tracker c ON (c.usr = x.usr AND c.location = ?)
join money.billing b on (b.xact = x.id)
+ LEFT JOIN actor.usr_setting set ON (set.usr = x.usr and set.name='circ.collections.exempt' and set.value = 'true')
where x.xact_finish is null
and c.id is null
and x.billing_location in (XX)
and b.billing_ts < current_timestamp - ? * '1 day'::interval
and not b.voided
+ and set.id IS NULL
group by 1,2
union all
from booking.reservation x
left join money.collections_tracker c ON (c.usr = x.usr AND c.location = ?)
join money.billing b on (b.xact = x.id)
+ LEFT JOIN actor.usr_setting set ON (set.usr = x.usr and set.name='circ.collections.exempt' and set.value = 'true')
where x.xact_finish is null
and c.id is null
and x.pickup_lib in (XX)
and b.billing_ts < current_timestamp - ? * '1 day'::interval
and not b.voided
+ and set.id IS NULL
group by 1,2
) full_list
left join money.payment p on (full_list.id = p.xact)
BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0543', :eg_version); -- dbwells
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0544', :eg_version); -- berick
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
'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'
+);
--- /dev/null
+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;
+
/* fetch any user setting types we need + any that offer opt-in */
userSettingTypes = pcrud.search('cust', {
'-or' : [
- {name:['circ.holds_behind_desk']},
+ {name:['circ.holds_behind_desk', 'circ.collections.exempt']},
{name : {
'in': {
select : {atevdef : ['opt_in_setting']},