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

(-)a/C4/Members.pm (-23 / +1 lines)
Lines 79-86 BEGIN { Link Here
79
        &GetMemberAccountRecords
79
        &GetMemberAccountRecords
80
        &GetBorNotifyAcctRecord
80
        &GetBorNotifyAcctRecord
81
81
82
        GetBorrowerCategorycode
83
84
        &GetBorrowersToExpunge
82
        &GetBorrowersToExpunge
85
        &GetBorrowersWhoHaveNeverBorrowed
83
        &GetBorrowersWhoHaveNeverBorrowed
86
        &GetBorrowersWithIssuesHistoryOlderThan
84
        &GetBorrowersWithIssuesHistoryOlderThan
Lines 610-616 sub ModMember { Link Here
610
        }
608
        }
611
    }
609
    }
612
610
613
    my $old_categorycode = GetBorrowerCategorycode( $data{borrowernumber} );
611
    my $old_categorycode = Koha::Patrons->find( $data{borrowernumber} )->categorycode;
614
612
615
    # get only the columns of a borrower
613
    # get only the columns of a borrower
616
    my $schema = Koha::Database->new()->schema;
614
    my $schema = Koha::Database->new()->schema;
Lines 1397-1422 sub GetUpcomingMembershipExpires { Link Here
1397
    return $results;
1395
    return $results;
1398
}
1396
}
1399
1397
1400
=head2 GetBorrowerCategorycode
1401
1402
    $categorycode = &GetBorrowerCategoryCode( $borrowernumber );
1403
1404
Given the borrowernumber, the function returns the corresponding categorycode
1405
1406
=cut
1407
1408
sub GetBorrowerCategorycode {
1409
    my ( $borrowernumber ) = @_;
1410
    my $dbh = C4::Context->dbh;
1411
    my $sth = $dbh->prepare( qq{
1412
        SELECT categorycode
1413
        FROM borrowers
1414
        WHERE borrowernumber = ?
1415
    } );
1416
    $sth->execute( $borrowernumber );
1417
    return $sth->fetchrow;
1418
}
1419
1420
=head2 GetAge
1398
=head2 GetAge
1421
1399
1422
  $dateofbirth,$date = &GetAge($date);
1400
  $dateofbirth,$date = &GetAge($date);
(-)a/tools/modborrowers.pl (-3 / +2 lines)
Lines 38-43 use List::MoreUtils qw /any uniq/; Link Here
38
use Koha::DateUtils qw( dt_from_string );
38
use Koha::DateUtils qw( dt_from_string );
39
use Koha::List::Patron;
39
use Koha::List::Patron;
40
use Koha::Patron::Categories;
40
use Koha::Patron::Categories;
41
use Koha::Patrons;
41
42
42
my $input = new CGI;
43
my $input = new CGI;
43
my $op = $input->param('op') || 'show_form';
44
my $op = $input->param('op') || 'show_form';
Lines 288-295 if ( $op eq 'do' ) { Link Here
288
            }
289
            }
289
        }
290
        }
290
291
291
        #
292
        my $borrower_categorycode = Koha::Patrons->find( $borrowernumber )->categorycode;
292
        my $borrower_categorycode = GetBorrowerCategorycode $borrowernumber;
293
        my $i=0;
293
        my $i=0;
294
        for ( @attributes ) {
294
        for ( @attributes ) {
295
            my $attribute;
295
            my $attribute;
296
- 

Return to bug 16852