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

(-)a/C4/Members.pm (-21 lines)
Lines 69-76 BEGIN { Link Here
69
        &GetBorrowersToExpunge
69
        &GetBorrowersToExpunge
70
70
71
        &IssueSlip
71
        &IssueSlip
72
73
        GetOverduesForPatron
74
    );
72
    );
75
73
76
    #Modify data
74
    #Modify data
Lines 1089-1113 WHERE borrowernumber = 0 AND DATEDIFF( NOW(), timestamp ) > ?|; Link Here
1089
    return $cnt eq '0E0'? 0: $cnt;
1087
    return $cnt eq '0E0'? 0: $cnt;
1090
}
1088
}
1091
1089
1092
sub GetOverduesForPatron {
1093
    my ( $borrowernumber ) = @_;
1094
1095
    my $sql = "
1096
        SELECT *
1097
        FROM issues, items, biblio, biblioitems
1098
        WHERE items.itemnumber=issues.itemnumber
1099
          AND biblio.biblionumber   = items.biblionumber
1100
          AND biblio.biblionumber   = biblioitems.biblionumber
1101
          AND issues.borrowernumber = ?
1102
          AND date_due < NOW()
1103
    ";
1104
1105
    my $sth = C4::Context->dbh->prepare( $sql );
1106
    $sth->execute( $borrowernumber );
1107
1108
    return $sth->fetchall_arrayref({});
1109
}
1110
1111
END { }    # module clean-up code here (global destructor)
1090
END { }    # module clean-up code here (global destructor)
1112
1091
1113
1;
1092
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