@@ -, +, @@ subscriptions result in matches both before after todays date (but before the date you entered). which will allow you to limit the results to just those that expire between the date you enter and today. --- .../en/modules/serials/checkexpiration.tt | 9 ++++++++- serials/checkexpiration.pl | 20 +++++++++++-------- 2 files changed, 20 insertions(+), 9 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt @@ -24,6 +24,7 @@ Filter results:
    +
    1. @@ -43,7 +44,13 @@ Required
      [% INCLUDE 'date-format.inc' %]
    - + +
  1. + + +
  2. +
--- a/serials/checkexpiration.pl +++ a/serials/checkexpiration.pl @@ -70,6 +70,7 @@ my $issn = $query->param('issn'); my $branch = $query->param('branch'); my $date = $query->param('date'); $date = eval { dt_from_string( scalar $query->param('date') ) } if $date; +my $showhistoricexpired = $query->param('showhistoryexpired'); if ($date) { my @subscriptions = SearchSubscriptions({ title => $title, issn => $issn, orderby => 'title' }); @@ -94,20 +95,23 @@ if ($date) { next if $subscription->{cannotedit}; my $expirationdate_dt = dt_from_string( $expirationdate, 'iso' ); + my $today_dt = dt_from_string(); if ( DateTime->compare( $date, $expirationdate_dt ) == 1 + && ( $showhistoricexpired || DateTime->compare( $expiration_dt, $today_dt ) == 1 ) && ( !$branch || ( $subscription->{'branchcode'} eq $branch ) ) ) { push @subscriptions_loop, $subscription; } } - $template->param ( - title => $title, - issn => $issn, - numsubscription => scalar @subscriptions_loop, - date => $date, - subscriptions_loop => \@subscriptions_loop, - "BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1, - searched => 1, + $template->param( + title => $title, + issn => $issn, + showhistoricexpired => $showhistoricexpired, + numsubscription => scalar @subscriptions_loop, + date => $date, + subscriptions_loop => \@subscriptions_loop, + "BiblioDefaultView" . C4::Context->preference("BiblioDefaultView") => 1, + searched => 1, ); } --