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

(-)a/C4/Overdues.pm (+20 lines)
Lines 53-58 BEGIN { Link Here
53
        &GetOverdueDelays
53
        &GetOverdueDelays
54
        &GetOverduerules
54
        &GetOverduerules
55
        &GetFine
55
        &GetFine
56
        &GetTotalFines
56
        &CreateItemAccountLine
57
        &CreateItemAccountLine
57
        &ReplacementCost2
58
        &ReplacementCost2
58
        
59
        
Lines 692-697 sub GetFine { Link Here
692
    return 0;
693
    return 0;
693
}
694
}
694
695
696
=head2 GetTotalFines
697
698
    my $total_fines_owed = GetTotalFines( $borrowernumber );
699
700
    Returns the total amount owed by the given borrower.
701
702
=cut
703
704
sub GetTotalFines {
705
    my ( $borrowernumber ) = @_;
706
    my $dbh = C4::Context->dbh();
707
    my $query = "SELECT SUM( amountoutstanding ) AS total FROM accountlines WHERE borrowernumber = ?";
708
    my $sth = $dbh->prepare( $query );
709
    $sth->execute( $borrowernumber );
710
    my $row = $sth->fetchrow_hashref();
711
    my $total = $row->{'total'};
712
    $total = $total || 0;
713
    return $total;
714
}
695
715
696
=head2 GetIssuingRules
716
=head2 GetIssuingRules
697
717
(-)a/C4/SIP/ILS/Patron.pm (-2 / +2 lines)
Lines 78-85 sub new { Link Here
78
        address         => $adr,
78
        address         => $adr,
79
        home_phone      => $kp->{phone},
79
        home_phone      => $kp->{phone},
80
        email_addr      => $kp->{email},
80
        email_addr      => $kp->{email},
81
        charge_ok       => ( !$debarred && !$expired ),
81
        charge_ok       => ( !$debarred && !$expired && ( $fines_amount < C4::Context->preference('noissuescharge') ) ),
82
        renew_ok        => ( !$debarred && !$expired ),
82
        renew_ok        => ( !$debarred && !$expired && ( $fines_amount < C4::Context->preference('OPACFineNoRenewals') ) ),
83
        recall_ok       => ( !$debarred && !$expired ),
83
        recall_ok       => ( !$debarred && !$expired ),
84
        hold_ok         => ( !$debarred && !$expired ),
84
        hold_ok         => ( !$debarred && !$expired ),
85
        card_lost       => ( $kp->{lost} || $kp->{gonenoaddress} || $flags->{LOST} ),
85
        card_lost       => ( $kp->{lost} || $kp->{gonenoaddress} || $flags->{LOST} ),
(-)a/C4/SIP/ILS/Transaction/Renew.pm (-1 / +6 lines)
Lines 34-39 sub do_renew_for { Link Here
34
    my $self = shift;
34
    my $self = shift;
35
    my $borrower = shift;
35
    my $borrower = shift;
36
    my ($renewokay,$renewerror) = CanBookBeRenewed($borrower->{borrowernumber},$self->{item}->{itemnumber});
36
    my ($renewokay,$renewerror) = CanBookBeRenewed($borrower->{borrowernumber},$self->{item}->{itemnumber});
37
38
    unless ( C4::Overdues::GetTotalFines($borrower->{borrowernumber}) < C4::Context->preference('OPACFineNoRenewals') ) {
39
        $renewokay = 0;
40
        $renewerror = 'too_many_fines'
41
    }
42
    
37
    if ($renewokay){
43
    if ($renewokay){
38
        $self->{due} = undef;
44
        $self->{due} = undef;
39
        my $due_date = AddIssue( $borrower, $self->{item}->id, undef, 0 );
45
        my $due_date = AddIssue( $borrower, $self->{item}->id, undef, 0 );
40
- 

Return to bug 7560