Lines 2740-2746
sub CanBookBeRenewed {
Link Here
|
2740 |
); |
2740 |
); |
2741 |
|
2741 |
|
2742 |
return ( 0, "too_many" ) |
2742 |
return ( 0, "too_many" ) |
2743 |
if not $issuing_rule->{renewalsallowed} or $issuing_rule->{renewalsallowed} <= $issue->renewals; |
2743 |
if not $issuing_rule->{renewalsallowed} or $issuing_rule->{renewalsallowed} <= $issue->renewals_count; |
2744 |
|
2744 |
|
2745 |
return ( 0, "too_unseen" ) |
2745 |
return ( 0, "too_unseen" ) |
2746 |
if C4::Context->preference('UnseenRenewals') && |
2746 |
if C4::Context->preference('UnseenRenewals') && |
Lines 2961-2968
sub AddRenewal {
Link Here
|
2961 |
|
2961 |
|
2962 |
# Update the issues record to have the new due date, and a new count |
2962 |
# Update the issues record to have the new due date, and a new count |
2963 |
# of how many times it has been renewed. |
2963 |
# of how many times it has been renewed. |
2964 |
my $renews = ( $issue->renewals || 0 ) + 1; |
2964 |
my $renews = ( $issue->renewals_count || 0 ) + 1; |
2965 |
my $sth = $dbh->prepare("UPDATE issues SET date_due = ?, renewals = ?, unseen_renewals = ?, lastreneweddate = ? WHERE issue_id = ?"); |
2965 |
my $sth = $dbh->prepare("UPDATE issues SET date_due = ?, renewals_count = ?, unseen_renewals = ?, lastreneweddate = ? WHERE issue_id = ?"); |
2966 |
|
2966 |
|
2967 |
eval{ |
2967 |
eval{ |
2968 |
$sth->execute( $datedue->strftime('%Y-%m-%d %H:%M'), $renews, $unseen_renewals, $lastreneweddate, $issue->issue_id ); |
2968 |
$sth->execute( $datedue->strftime('%Y-%m-%d %H:%M'), $renews, $unseen_renewals, $lastreneweddate, $issue->issue_id ); |
Lines 2974-2981
sub AddRenewal {
Link Here
|
2974 |
} |
2974 |
} |
2975 |
|
2975 |
|
2976 |
# Update the renewal count on the item, and tell zebra to reindex |
2976 |
# Update the renewal count on the item, and tell zebra to reindex |
2977 |
$renews = ( $item_object->renewals || 0 ) + 1; |
2977 |
$renews = ( $item_object->renewals_count || 0 ) + 1; |
2978 |
$item_object->renewals($renews); |
2978 |
$item_object->renewals_count($renews); |
2979 |
$item_object->onloan($datedue); |
2979 |
$item_object->onloan($datedue); |
2980 |
$item_object->store({ log_action => 0 }); |
2980 |
$item_object->store({ log_action => 0 }); |
2981 |
|
2981 |
|
Lines 3090-3096
sub GetRenewCount {
Link Here
|
3090 |
); |
3090 |
); |
3091 |
$sth->execute( $bornum, $itemno ); |
3091 |
$sth->execute( $bornum, $itemno ); |
3092 |
my $data = $sth->fetchrow_hashref; |
3092 |
my $data = $sth->fetchrow_hashref; |
3093 |
$renewcount = $data->{'renewals'} if $data->{'renewals'}; |
3093 |
$renewcount = $data->{'renewals_count'} if $data->{'renewals_count'}; |
3094 |
$unseencount = $data->{'unseen_renewals'} if $data->{'unseen_renewals'}; |
3094 |
$unseencount = $data->{'unseen_renewals'} if $data->{'unseen_renewals'}; |
3095 |
# $item and $borrower should be calculated |
3095 |
# $item and $borrower should be calculated |
3096 |
my $branchcode = _GetCircControlBranch($item->unblessed, $patron->unblessed); |
3096 |
my $branchcode = _GetCircControlBranch($item->unblessed, $patron->unblessed); |
Lines 3884-3890
sub ProcessOfflineReturn {
Link Here
|
3884 |
$itemnumber, |
3884 |
$itemnumber, |
3885 |
$operation->{timestamp}, |
3885 |
$operation->{timestamp}, |
3886 |
); |
3886 |
); |
3887 |
$item->renewals(0); |
3887 |
$item->renewals_count(0); |
3888 |
$item->onloan(undef); |
3888 |
$item->onloan(undef); |
3889 |
$item->store({ log_action => 0 }); |
3889 |
$item->store({ log_action => 0 }); |
3890 |
return "Success."; |
3890 |
return "Success."; |