|
Lines 33-38
sub do_renew_for {
Link Here
|
| 33 |
my $self = shift; |
33 |
my $self = shift; |
| 34 |
my $borrower = shift; |
34 |
my $borrower = shift; |
| 35 |
my ($renewokay,$renewerror) = CanBookBeRenewed($borrower->{borrowernumber},$self->{item}->{itemnumber}); |
35 |
my ($renewokay,$renewerror) = CanBookBeRenewed($borrower->{borrowernumber},$self->{item}->{itemnumber}); |
|
|
36 |
|
| 36 |
if ($renewokay) { # ok so far check charges |
37 |
if ($renewokay) { # ok so far check charges |
| 37 |
my ($fee, undef) = GetIssuingCharges($self->{item}->{itemnumber}, $self->{patron}->{borrowernumber}); |
38 |
my ($fee, undef) = GetIssuingCharges($self->{item}->{itemnumber}, $self->{patron}->{borrowernumber}); |
| 38 |
if ($fee > 0) { |
39 |
if ($fee > 0) { |
|
Lines 44-49
sub do_renew_for {
Link Here
|
| 44 |
} |
45 |
} |
| 45 |
|
46 |
|
| 46 |
} |
47 |
} |
|
|
48 |
|
| 49 |
unless ( C4::Accounts::GetTotalFines($borrower->{borrowernumber}) < C4::Context->preference('OPACFineNoRenewals') ) { |
| 50 |
$renewokay = 0; |
| 51 |
$renewerror = 'fines_exceed_OPACFineNoRenewals' |
| 52 |
} |
| 53 |
|
| 47 |
if ($renewokay){ |
54 |
if ($renewokay){ |
| 48 |
my $issue = AddIssue( $borrower, $self->{item}->id, undef, 0 ); |
55 |
my $issue = AddIssue( $borrower, $self->{item}->id, undef, 0 ); |
| 49 |
$self->{due} = $self->duedatefromissue($issue, $self->{item}->{itemnumber}); |
56 |
$self->{due} = $self->duedatefromissue($issue, $self->{item}->{itemnumber}); |
|
Lines 51-56
sub do_renew_for {
Link Here
|
| 51 |
} else { |
58 |
} else { |
| 52 |
$renewerror=~s/on_reserve/Item unavailable due to outstanding holds/; |
59 |
$renewerror=~s/on_reserve/Item unavailable due to outstanding holds/; |
| 53 |
$renewerror=~s/too_many/Item has reached maximum renewals/; |
60 |
$renewerror=~s/too_many/Item has reached maximum renewals/; |
|
|
61 |
$renewerror=~s/fines_exceed_OPACFineNoRenewals/Total fines owed exceeds amount that would allow renewal/; |
| 54 |
$self->screen_msg($renewerror); |
62 |
$self->screen_msg($renewerror); |
| 55 |
$self->renewal_ok(0); |
63 |
$self->renewal_ok(0); |
| 56 |
} |
64 |
} |