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

(-)a/C4/Members.pm (-21 lines)
Lines 68-75 BEGIN { Link Here
68
        &GetBorrowersToExpunge
68
        &GetBorrowersToExpunge
69
69
70
        &IssueSlip
70
        &IssueSlip
71
72
        GetOverduesForPatron
73
    );
71
    );
74
72
75
    #Modify data
73
    #Modify data
Lines 1112-1136 WHERE borrowernumber = 0 AND DATEDIFF( NOW(), timestamp ) > ?|; Link Here
1112
    return $cnt eq '0E0'? 0: $cnt;
1110
    return $cnt eq '0E0'? 0: $cnt;
1113
}
1111
}
1114
1112
1115
sub GetOverduesForPatron {
1116
    my ( $borrowernumber ) = @_;
1117
1118
    my $sql = "
1119
        SELECT *
1120
        FROM issues, items, biblio, biblioitems
1121
        WHERE items.itemnumber=issues.itemnumber
1122
          AND biblio.biblionumber   = items.biblionumber
1123
          AND biblio.biblionumber   = biblioitems.biblionumber
1124
          AND issues.borrowernumber = ?
1125
          AND date_due < NOW()
1126
    ";
1127
1128
    my $sth = C4::Context->dbh->prepare( $sql );
1129
    $sth->execute( $borrowernumber );
1130
1131
    return $sth->fetchall_arrayref({});
1132
}
1133
1134
END { }    # module clean-up code here (global destructor)
1113
END { }    # module clean-up code here (global destructor)
1135
1114
1136
1;
1115
1;
(-)a/members/print_overdues.pl (-3 / +3 lines)
Lines 24-30 use CGI; Link Here
24
use C4::Context;
24
use C4::Context;
25
use C4::Auth;
25
use C4::Auth;
26
use C4::Output;
26
use C4::Output;
27
use C4::Members qw(GetOverduesForPatron);
28
use C4::Overdues qw(parse_overdues_letter);
27
use C4::Overdues qw(parse_overdues_letter);
29
28
30
use Koha::Patrons;
29
use Koha::Patrons;
Lines 51-57 my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in" Link Here
51
my $patron         = Koha::Patrons->find( $borrowernumber );
50
my $patron         = Koha::Patrons->find( $borrowernumber );
52
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
51
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
53
52
54
my $overdues = GetOverduesForPatron($borrowernumber);
53
my $overdues = [
54
    map { $_->unblessed_all_relateds } $patron->get_overdues
55
];
55
56
56
my $letter = parse_overdues_letter(
57
my $letter = parse_overdues_letter(
57
    {
58
    {
58
- 

Return to bug 17553