Lines 60-65
use Koha::Charges::Fees;
Link Here
|
60 |
use Koha::Config::SysPref; |
60 |
use Koha::Config::SysPref; |
61 |
use Koha::Checkouts::ReturnClaims; |
61 |
use Koha::Checkouts::ReturnClaims; |
62 |
use Koha::SearchEngine::Indexer; |
62 |
use Koha::SearchEngine::Indexer; |
|
|
63 |
use Koha::Exceptions::Checkout; |
63 |
use Carp; |
64 |
use Carp; |
64 |
use List::MoreUtils qw( uniq any ); |
65 |
use List::MoreUtils qw( uniq any ); |
65 |
use Scalar::Util qw( looks_like_number ); |
66 |
use Scalar::Util qw( looks_like_number ); |
Lines 2970-2981
sub AddRenewal {
Link Here
|
2970 |
# Update the issues record to have the new due date, and a new count |
2971 |
# Update the issues record to have the new due date, and a new count |
2971 |
# of how many times it has been renewed. |
2972 |
# of how many times it has been renewed. |
2972 |
my $renews = ( $issue->renewals || 0 ) + 1; |
2973 |
my $renews = ( $issue->renewals || 0 ) + 1; |
2973 |
my $sth = $dbh->prepare("UPDATE issues SET date_due = ?, renewals = ?, lastreneweddate = ? |
2974 |
my $sth = $dbh->prepare("UPDATE issues SET date_due = ?, renewals = ?, lastreneweddate = ? WHERE issue_id = ?"); |
2974 |
WHERE borrowernumber=? |
|
|
2975 |
AND itemnumber=?" |
2976 |
); |
2977 |
|
2975 |
|
2978 |
$sth->execute( $datedue->strftime('%Y-%m-%d %H:%M'), $renews, $lastreneweddate, $borrowernumber, $itemnumber ); |
2976 |
eval{ |
|
|
2977 |
$sth->execute( $datedue->strftime('%Y-%m-%d %H:%M'), $renews, $lastreneweddate, $issue->issue_id ); |
2978 |
}; |
2979 |
if( $sth->err ){ |
2980 |
Koha::Exceptions::Checkout::FailedRenewal->throw( |
2981 |
error => 'Update of issue# ' . $issue->issue_id . ' failed with error: ' . $sth->errstr |
2982 |
); |
2983 |
} |
2979 |
|
2984 |
|
2980 |
# Update the renewal count on the item, and tell zebra to reindex |
2985 |
# Update the renewal count on the item, and tell zebra to reindex |
2981 |
$renews = ( $item_object->renewals || 0 ) + 1; |
2986 |
$renews = ( $item_object->renewals || 0 ) + 1; |