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

(-)a/Koha/Patrons.pm (-3 / +3 lines)
Lines 140-146 sub guarantor { Link Here
140
140
141
    my $patrons = Koha::Patrons->search_patrons_to_anonymise( { before => $older_than_date, [ library => $library ] } );
141
    my $patrons = Koha::Patrons->search_patrons_to_anonymise( { before => $older_than_date, [ library => $library ] } );
142
142
143
This method returns all patrons who has an issue history older than a given date.
143
This method returns all patrons who have an issue history older than a given date, and it may optionally be filtered by 
144
patrons home library
144
145
145
=cut
146
=cut
146
147
Lines 159-165 sub search_patrons_to_anonymise { Link Here
159
        {   returndate                  => { '<'   =>  $dtf->format_datetime($older_than_date), },
160
        {   returndate                  => { '<'   =>  $dtf->format_datetime($older_than_date), },
160
            'old_issues.borrowernumber' => { 'not' => undef },
161
            'old_issues.borrowernumber' => { 'not' => undef },
161
            privacy                     => { '<>'  => 0 },                  # Keep forever
162
            privacy                     => { '<>'  => 0 },                  # Keep forever
162
            ( $library ? ( 'old_issues.branchcode' => $library ) : () ),
163
            ( $library ? ( branchcode => $library ) : () ),
163
        },
164
        },
164
        {   join     => ["old_issues"],
165
        {   join     => ["old_issues"],
165
            distinct => 1,
166
            distinct => 1,
166
- 

Return to bug 20964