View | Details | Raw Unified | Return to bug 34069
Collapse All | Expand All

(-)a/tools/restore_deleted_borrowers.pl (-6 / +15 lines)
Lines 23-30 use CGI qw ( -utf8 ); Link Here
23
use Try::Tiny;
23
use Try::Tiny;
24
use Scalar::Util qw( blessed );
24
use Scalar::Util qw( blessed );
25
25
26
use C4::Auth   qw( get_template_and_user haspermission );
26
use Koha::DateUtils qw( dt_from_string );
27
use C4::Output qw( output_html_with_http_headers );
27
use C4::Auth        qw( get_template_and_user haspermission );
28
use C4::Output      qw( output_html_with_http_headers );
28
use C4::Context;
29
use C4::Context;
29
30
30
use Koha::Old::Patrons;
31
use Koha::Old::Patrons;
Lines 107-118 if ( $op eq 'search' ) { Link Here
107
        $search_params{email}     = { 'like' => "%$email%" }     if $email;
108
        $search_params{email}     = { 'like' => "%$email%" }     if $email;
108
109
109
        #date parameters
110
        #date parameters
111
        my $dtf = Koha::Database->new->schema->storage->datetime_parser;
110
        if ( $deleted_from && $deleted_to ) {
112
        if ( $deleted_from && $deleted_to ) {
111
            $search_params{updated_on} = { -between => [ $deleted_from, $deleted_to ] };
113
            my $from_dt = dt_from_string($deleted_from);
114
            my $to_dt   = dt_from_string($deleted_to)->add( days => 1 );
115
116
            $search_params{updated_on} = {
117
                '>=' => $dtf->format_datetime($from_dt),
118
                '<'  => $dtf->format_datetime($to_dt)
119
            };
112
        } elsif ($deleted_from) {
120
        } elsif ($deleted_from) {
113
            $search_params{updated_on} = { '>=' => $deleted_from };
121
            my $from_dt = dt_from_string($deleted_from);
122
            $search_params{updated_on} = { '>=' => $dtf->format_datetime($from_dt) };
114
        } elsif ($deleted_to) {
123
        } elsif ($deleted_to) {
115
            $search_params{updated_on} = { '<=' => $deleted_to };
124
            my $to_dt = dt_from_string($deleted_to)->add( days => 1 );
125
            $search_params{updated_on} = { '<' => $dtf->format_datetime($to_dt) };
116
        }
126
        }
117
127
118
        my $deleted_patrons_rs = Koha::Old::Patrons->search(
128
        my $deleted_patrons_rs = Koha::Old::Patrons->search(
119
- 

Return to bug 34069