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 655-660 sub GetFine { Link Here
655
    return 0;
656
    return 0;
656
}
657
}
657
658
659
=head2 GetTotalFines
660
661
    my $total_fines_owed = GetTotalFines( $borrowernumber );
662
663
    Returns the total amount owed by the given borrower.
664
665
=cut
666
667
sub GetTotalFines {
668
    my ( $borrowernumber ) = @_;
669
    my $dbh = C4::Context->dbh();
670
    my $query = "SELECT SUM( amountoutstanding ) AS total FROM accountlines WHERE borrowernumber = ?";
671
    my $sth = $dbh->prepare( $query );
672
    $sth->execute( $borrowernumber );
673
    my $row = $sth->fetchrow_hashref();
674
    my $total = $row->{'total'};
675
    $total = $total || 0;
676
    return $total;
677
}
658
678
659
=head2 GetIssuingRules
679
=head2 GetIssuingRules
660
680
(-)a/C4/SIP/ILS/Patron.pm (-2 / +2 lines)
Lines 87-94 sub new { Link Here
87
        address         => $adr,
87
        address         => $adr,
88
        home_phone      => $kp->{phone},
88
        home_phone      => $kp->{phone},
89
        email_addr      => $kp->{email},
89
        email_addr      => $kp->{email},
90
        charge_ok       => ( !$debarred && !$expired ),
90
        charge_ok       => ( !$debarred && !$expired && ( $fines_amount < C4::Context->preference('noissuescharge') ) ),
91
        renew_ok        => ( !$debarred && !$expired ),
91
        renew_ok        => ( !$debarred && !$expired && ( $fines_amount < C4::Context->preference('OPACFineNoRenewals') ) ),
92
        recall_ok       => ( !$debarred && !$expired ),
92
        recall_ok       => ( !$debarred && !$expired ),
93
        hold_ok         => ( !$debarred && !$expired ),
93
        hold_ok         => ( !$debarred && !$expired ),
94
        card_lost       => ( $kp->{lost} || $kp->{gonenoaddress} || $flags->{LOST} ),
94
        card_lost       => ( $kp->{lost} || $kp->{gonenoaddress} || $flags->{LOST} ),
(-)a/C4/SIP/ILS/Transaction/Renew.pm (-1 / +7 lines)
Lines 35-41 sub new { Link Here
35
sub do_renew_for ($$) {
35
sub do_renew_for ($$) {
36
	my $self = shift;
36
	my $self = shift;
37
	my $borrower = shift;
37
	my $borrower = shift;
38
	
38
	my ($renewokay,$renewerror) = CanBookBeRenewed($borrower->{borrowernumber},$self->{item}->{itemnumber});
39
	my ($renewokay,$renewerror) = CanBookBeRenewed($borrower->{borrowernumber},$self->{item}->{itemnumber});
40
41
	unless ( C4::Overdues::GetTotalFines($borrower->{borrowernumber}) < C4::Context->preference('OPACFineNoRenewals') ) {
42
	    $renewokay = 0;
43
	    $renewerror = 'too_many_fines'
44
        }
45
39
	if ($renewokay){
46
	if ($renewokay){
40
		my $datedue = AddIssue( $borrower, $self->{item}->id, undef, 0 );
47
		my $datedue = AddIssue( $borrower, $self->{item}->id, undef, 0 );
41
		$self->{due} = $datedue;
48
		$self->{due} = $datedue;
42
- 

Return to bug 7560