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 86-93 sub new { Link Here
86
        address         => $adr,
86
        address         => $adr,
87
        home_phone      => $kp->{phone},
87
        home_phone      => $kp->{phone},
88
        email_addr      => $kp->{email},
88
        email_addr      => $kp->{email},
89
        charge_ok       => ( !$debarred && !$expired ),
89
        charge_ok       => ( !$debarred && !$expired && ( $fines_amount < C4::Context->preference('noissuescharge') ) ),
90
        renew_ok        => ( !$debarred && !$expired ),
90
        renew_ok        => ( !$debarred && !$expired && ( $fines_amount < C4::Context->preference('OPACFineNoRenewals') ) ),
91
        recall_ok       => ( !$debarred && !$expired ),
91
        recall_ok       => ( !$debarred && !$expired ),
92
        hold_ok         => ( !$debarred && !$expired ),
92
        hold_ok         => ( !$debarred && !$expired ),
93
        card_lost       => ( $kp->{lost} || $kp->{gonenoaddress} || $flags->{LOST} ),
93
        card_lost       => ( $kp->{lost} || $kp->{gonenoaddress} || $flags->{LOST} ),
(-)a/C4/SIP/ILS/Transaction/Renew.pm (-1 / +7 lines)
Lines 34-40 sub new { Link Here
34
sub do_renew_for  {
34
sub do_renew_for  {
35
	my $self = shift;
35
	my $self = shift;
36
	my $borrower = shift;
36
	my $borrower = shift;
37
	
37
	my ($renewokay,$renewerror) = CanBookBeRenewed($borrower->{borrowernumber},$self->{item}->{itemnumber});
38
	my ($renewokay,$renewerror) = CanBookBeRenewed($borrower->{borrowernumber},$self->{item}->{itemnumber});
39
40
	unless ( C4::Overdues::GetTotalFines($borrower->{borrowernumber}) < C4::Context->preference('OPACFineNoRenewals') ) {
41
	    $renewokay = 0;
42
	    $renewerror = 'too_many_fines'
43
        }
44
38
	if ($renewokay){
45
	if ($renewokay){
39
		$self->{due} = AddIssue( $borrower, $self->{item}->id, undef, 0 );
46
		$self->{due} = AddIssue( $borrower, $self->{item}->id, undef, 0 );
40
		$self->renewal_ok(1);
47
		$self->renewal_ok(1);
41
- 

Return to bug 7560