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

(-)a/C4/Circulation.pm (-2 / +2 lines)
Lines 819-827 sub CanBookBeIssued { Link Here
819
    #
819
    #
820
    # BORROWER STATUS
820
    # BORROWER STATUS
821
    #
821
    #
822
    my $patron_borrowing_status = $patron->can_borrow({ patron => $patron });
822
    my $patron_borrowing_status = $patron->can_borrow();
823
    if ( $patron->category->category_type eq 'X' && (  $item_object->barcode  )) {
823
    if ( $patron->category->category_type eq 'X' && (  $item_object->barcode  )) {
824
	# stats only borrower -- add entry to statistics table, and return issuingimpossible{STATS} = 1  .
824
        # stats only borrower -- add entry to statistics table, and return issuingimpossible{STATS} = 1  .
825
        C4::Stats::UpdateStats(
825
        C4::Stats::UpdateStats(
826
            {
826
            {
827
                branch         => C4::Context->userenv->{'branch'},
827
                branch         => C4::Context->userenv->{'branch'},
(-)a/C4/Members.pm (-1 / +1 lines)
Lines 135-141 sub patronflags { Link Here
135
    my $dbh=C4::Context->dbh;
135
    my $dbh=C4::Context->dbh;
136
    my $patron = Koha::Patrons->find( $patroninformation->{borrowernumber} );
136
    my $patron = Koha::Patrons->find( $patroninformation->{borrowernumber} );
137
    my $account = $patron->account;
137
    my $account = $patron->account;
138
    my $patron_charge_limits = $patron->is_patron_inside_charge_limits( { patron => $patron } );
138
    my $patron_charge_limits = $patron->is_patron_inside_charge_limits();
139
    if ( $patron_charge_limits->{noissuescharge}->{charge} > 0 ) {
139
    if ( $patron_charge_limits->{noissuescharge}->{charge} > 0 ) {
140
        my %flaginfo;
140
        my %flaginfo;
141
        my $noissuescharge = $patron_charge_limits->{noissuescharge}->{limit} || 5;
141
        my $noissuescharge = $patron_charge_limits->{noissuescharge}->{limit} || 5;
(-)a/C4/SIP/ILS/Patron.pm (-8 / +10 lines)
Lines 99-121 sub new { Link Here
99
    $dexpiry and $dexpiry =~ s/-//g;    # YYYYMMDD
99
    $dexpiry and $dexpiry =~ s/-//g;    # YYYYMMDD
100
100
101
    # Get fines and add fines for guarantees (depends on preference NoIssuesChargeGuarantees)
101
    # Get fines and add fines for guarantees (depends on preference NoIssuesChargeGuarantees)
102
    my $patron_charge_limits = $patron->is_patron_inside_charge_limits( { patron => $patron } );
102
    my $patron_charge_limits  = $patron->is_patron_inside_charge_limits();
103
    my $fines_amount = $patron_charge_limits->{noissuescharge}->{charge};
103
    my $fines_amount          = $patron_charge_limits->{noissuescharge}->{charge};
104
    my $personal_fines_amount = $fines_amount;
104
    my $personal_fines_amount = $fines_amount;
105
    my $fee_limit = $patron_charge_limits->{noissuescharge}->{limit} || 5;
105
    my $fee_limit             = $patron_charge_limits->{noissuescharge}->{limit} || 5;
106
    my $noissueschargeguarantorswithguarantees = $patron_charge_limits->{NoIssuesChargeGuarantorsWithGuarantees}->{limit};
106
    my $noissueschargeguarantorswithguarantees =
107
        $patron_charge_limits->{NoIssuesChargeGuarantorsWithGuarantees}->{limit};
107
    my $noissueschargeguarantees = $patron_charge_limits->{NoIssuesChargeGuarantees}->{limit};
108
    my $noissueschargeguarantees = $patron_charge_limits->{NoIssuesChargeGuarantees}->{limit};
109
108
    my $fines_msg = "";
110
    my $fines_msg = "";
109
    my $fine_blocked = 0;
111
    my $fine_blocked = 0;
110
    if( $patron_charge_limits->{noissuescharge}->{overlimit} ){
112
    if ( $patron_charge_limits->{noissuescharge}->{overlimit} ) {
111
        $fine_blocked = 1;
113
        $fine_blocked = 1;
112
        $fines_msg .= " -- " . "Patron blocked by fines" if $fine_blocked;
114
        $fines_msg .= " -- " . "Patron blocked by fines" if $fine_blocked;
113
    } elsif ( $noissueschargeguarantorswithguarantees ) {
115
    } elsif ($noissueschargeguarantorswithguarantees) {
114
        $fines_amount = $patron_charge_limits->{NoIssuesChargeGuarantorsWithGuarantees}->{charge};
116
        $fines_amount = $patron_charge_limits->{NoIssuesChargeGuarantorsWithGuarantees}->{charge};
115
        $fine_blocked = $patron_charge_limits->{NoIssuesChargeGuarantorsWithGuarantees}->{overlimit};
117
        $fine_blocked = $patron_charge_limits->{NoIssuesChargeGuarantorsWithGuarantees}->{overlimit};
116
        $fines_msg .= " -- " . "Patron blocked by fines ($fines_amount) on related accounts" if $fine_blocked;
118
        $fines_msg .= " -- " . "Patron blocked by fines ($fines_amount) on related accounts" if $fine_blocked;
117
    } elsif ( $noissueschargeguarantees ) {
119
    } elsif ($noissueschargeguarantees) {
118
        if( $patron->guarantee_relationships->count ){
120
        if ( $patron->guarantee_relationships->count ) {
119
            $fines_amount += $patron_charge_limits->{NoIssuesChargeGuarantees}->{charge};
121
            $fines_amount += $patron_charge_limits->{NoIssuesChargeGuarantees}->{charge};
120
            $fine_blocked = $patron_charge_limits->{NoIssuesChargeGuarantees}->{overlimit};
122
            $fine_blocked = $patron_charge_limits->{NoIssuesChargeGuarantees}->{overlimit};
121
            $fines_msg .= " -- " . "Patron blocked by fines ($fines_amount) on guaranteed accounts" if $fine_blocked;
123
            $fines_msg .= " -- " . "Patron blocked by fines ($fines_amount) on guaranteed accounts" if $fine_blocked;
(-)a/Koha/Patron.pm (-5 / +4 lines)
Lines 2916-2932 If any blockers are found, these are returned in a hash Link Here
2916
=cut
2916
=cut
2917
2917
2918
sub can_borrow {
2918
sub can_borrow {
2919
    my ( $self, $args ) = @_;
2919
    my ( $self ) = @_;
2920
2920
2921
    my $patron = $args->{patron};
2922
    my $status = { can_borrow => 1 };
2921
    my $status = { can_borrow => 1 };
2923
2922
2924
    $status->{debarred}   = 1 if $patron->debarred;
2923
    $status->{debarred}   = 1 if $self->debarred;
2925
    $status->{expired}    = 1 if $patron->is_expired;
2924
    $status->{expired}    = 1 if $self->is_expired;
2926
    $status->{can_borrow} = 0 if $status->{debarred} || $status->{expired};
2925
    $status->{can_borrow} = 0 if $status->{debarred} || $status->{expired};
2927
2926
2928
    # Patron charges
2927
    # Patron charges
2929
    my $patron_charge_limits = $patron->is_patron_inside_charge_limits( { patron => $patron } );
2928
    my $patron_charge_limits = $self->is_patron_inside_charge_limits();
2930
    %$status = ( %$status, %$patron_charge_limits );
2929
    %$status = ( %$status, %$patron_charge_limits );
2931
    $status->{can_borrow} = 0
2930
    $status->{can_borrow} = 0
2932
        if $patron_charge_limits->{noissuescharge}->{overlimit}
2931
        if $patron_charge_limits->{noissuescharge}->{overlimit}
(-)a/circ/circulation.pl (-1 / +1 lines)
Lines 594-600 if ( $patron ) { Link Here
594
        $template->param( is_anonymous => 1 );
594
        $template->param( is_anonymous => 1 );
595
        $noissues = 1;
595
        $noissues = 1;
596
    }
596
    }
597
    my $patron_charge_limits = $patron->is_patron_inside_charge_limits( { patron => $patron } );
597
    my $patron_charge_limits = $patron->is_patron_inside_charge_limits();
598
    if( $patron_charge_limits->{noissuescharge}->{charge} > 0 ) {
598
    if( $patron_charge_limits->{noissuescharge}->{charge} > 0 ) {
599
        my $noissuescharge = $patron_charge_limits->{noissuescharge}->{limit} || 5; # FIXME If noissuescharge == 0 then 5, why??
599
        my $noissuescharge = $patron_charge_limits->{noissuescharge}->{limit} || 5; # FIXME If noissuescharge == 0 then 5, why??
600
        $noissues ||= ( not C4::Context->preference("AllowFineOverride") and $patron_charge_limits->{noissuescharge}->{overlimit} );
600
        $noissues ||= ( not C4::Context->preference("AllowFineOverride") and $patron_charge_limits->{noissuescharge}->{overlimit} );
(-)a/members/moremember.pl (-2 / +1 lines)
Lines 242-248 my $issues = $patron->checkouts; Link Here
242
my $balance = 0;
242
my $balance = 0;
243
$balance = $patron->account->balance;
243
$balance = $patron->account->balance;
244
244
245
my $patron_charge_limits = $patron->is_patron_inside_charge_limits( { patron => $patron } );
245
my $patron_charge_limits = $patron->is_patron_inside_charge_limits();
246
if ( $patron_charge_limits->{noissuescharge}->{charge} > 0 ) {
246
if ( $patron_charge_limits->{noissuescharge}->{charge} > 0 ) {
247
    $template->param(
247
    $template->param(
248
        charges       => 1,
248
        charges       => 1,
249
- 

Return to bug 28924