$args->{limit} = $limit if $limit;
$args->{offset} = $offset if $offset;
+ if (my $max_age = $self->ctx->{get_org_setting}->(
+ $e->requestor->home_ou, "opac.payment_history_age_limit"
+ )) {
+ my $min_ts = DateTime->now(
+ "time_zone" => DateTime::TimeZone->new("name" => "local"),
+ )->subtract("seconds" => interval_to_seconds($max_age))->iso8601();
+
+ $logger->info("XXX min_ts: $min_ts");
+ $args->{"where"} = {"payment_ts" => {">=" => $min_ts}};
+ }
+
$self->ctx->{payments} = $U->simplereq(
'open-ils.actor',
'open-ils.actor.user.payments.retrieve.atomic',
( 'org.patron_opt_default',
oils_i18n_gettext( 'org.patron_opt_default', 'Circ: Patron Opt-In Default', 'coust', 'label'),
oils_i18n_gettext( 'org.patron_opt_default', 'This is the default depth at which a patron is opted in; it is calculated as an org unit relative to the current workstation.', 'coust', 'label'),
- 'integer')
+ 'integer'),
+
+( 'opac.payment_history_age_limit',
+ oils_i18n_gettext( 'opac.payment_history_age_limit', 'OPAC: Payment History Age Limit', 'coust', 'label'),
+ oils_i18n_gettext( 'opac.payment_history_age_limit', 'The OPAC should not display payments by patrons that are older than any interval defined here.', 'coust', 'label'),
+ 'interval')
;
--- /dev/null
+-- Evergreen DB patch XXXX.data.opac_payment_history_age_limit.sql
+
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+INSERT into config.org_unit_setting_type (name, label, description, datatype)
+VALUES (
+ 'opac.payment_history_age_limit',
+ oils_i18n_gettext('opac.payment_history_age_limit',
+ 'OPAC: Payment History Age Limit', 'coust', 'label'),
+ oils_i18n_gettext('opac.payment_history_age_limit',
+ 'The OPAC should not display payments by patrons that are older than any interval defined here.', 'coust', 'label'),
+ 'interval'
+);
+
+COMMIT;