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

(-)a/C4/Circulation.pm (-1 / +5 lines)
Lines 3029-3034 C<$seen> is a boolean flag indicating if the item was seen or not during the ren Link Here
3029
informs the incrementing of the unseen_renewals column. If this flag is not supplied, we
3029
informs the incrementing of the unseen_renewals column. If this flag is not supplied, we
3030
fallback to a true value
3030
fallback to a true value
3031
3031
3032
C<$skip_record_index> is an optional boolean flag to indicate whether queuing the search indexing
3033
should be skipped for this renewal.
3034
3032
=cut
3035
=cut
3033
3036
3034
sub AddRenewal {
3037
sub AddRenewal {
Lines 3039-3044 sub AddRenewal { Link Here
3039
    my $lastreneweddate = shift || dt_from_string();
3042
    my $lastreneweddate = shift || dt_from_string();
3040
    my $skipfinecalc    = shift;
3043
    my $skipfinecalc    = shift;
3041
    my $seen            = shift;
3044
    my $seen            = shift;
3045
    my $skip_record_index = shift;
3042
3046
3043
    # Fallback on a 'seen' renewal
3047
    # Fallback on a 'seen' renewal
3044
    $seen = defined $seen && $seen == 0 ? 0 : 1;
3048
    $seen = defined $seen && $seen == 0 ? 0 : 1;
Lines 3131-3137 sub AddRenewal { Link Here
3131
        $renews = ( $item_object->renewals || 0 ) + 1;
3135
        $renews = ( $item_object->renewals || 0 ) + 1;
3132
        $item_object->renewals($renews);
3136
        $item_object->renewals($renews);
3133
        $item_object->onloan($datedue);
3137
        $item_object->onloan($datedue);
3134
        $item_object->store({ log_action => 0 });
3138
        $item_object->store({ log_action => 0, skip_record_index => $skip_record_index });
3135
3139
3136
        # Charge a new rental fee, if applicable
3140
        # Charge a new rental fee, if applicable
3137
        my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber );
3141
        my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber );
(-)a/misc/cronjobs/automatic_renewals.pl (-2 / +8 lines)
Lines 148-153 print "found " . $auto_renews->count . " auto renewals\n" if $verbose; Link Here
148
148
149
my $renew_digest = {};
149
my $renew_digest = {};
150
my %report;
150
my %report;
151
my @item_renewal_ids;
151
while ( my $auto_renew = $auto_renews->next ) {
152
while ( my $auto_renew = $auto_renews->next ) {
152
    print "examining item '" . $auto_renew->itemnumber . "' to auto renew\n" if $verbose;
153
    print "examining item '" . $auto_renew->itemnumber . "' to auto renew\n" if $verbose;
153
154
Lines 180-186 while ( my $auto_renew = $auto_renews->next ) { Link Here
180
              $auto_renew->issue_id, $auto_renew->borrowernumber, $auto_renew->itemnumber, $confirm ? 'will' : 'would';
181
              $auto_renew->issue_id, $auto_renew->borrowernumber, $auto_renew->itemnumber, $confirm ? 'will' : 'would';
181
        }
182
        }
182
        if ($confirm){
183
        if ($confirm){
183
            my $date_due = AddRenewal( $auto_renew->borrowernumber, $auto_renew->itemnumber, $auto_renew->branchcode, undef, undef, undef, 0 );
184
            my $date_due = AddRenewal( $auto_renew->borrowernumber, $auto_renew->itemnumber, $auto_renew->branchcode, undef, undef, undef, 0, 1 );
185
            push @item_renewal_ids, $auto_renew->itemnumber;
184
            $auto_renew->auto_renew_error(undef)->store;
186
            $auto_renew->auto_renew_error(undef)->store;
185
        }
187
        }
186
        push @{ $report{ $auto_renew->borrowernumber } }, $auto_renew
188
        push @{ $report{ $auto_renew->borrowernumber } }, $auto_renew
Lines 226-231 while ( my $auto_renew = $auto_renews->next ) { Link Here
226
228
227
}
229
}
228
230
231
if( @item_renewal_ids ){
232
    my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX });
233
    $indexer->index_records( \@item_renewal_ids, "specialUpdate", "biblioserver" );
234
}
235
229
if ( $send_notices && $confirm ) {
236
if ( $send_notices && $confirm ) {
230
    for my $borrowernumber ( keys %report ) {
237
    for my $borrowernumber ( keys %report ) {
231
        my $patron = Koha::Patrons->find($borrowernumber);
238
        my $patron = Koha::Patrons->find($borrowernumber);
232
- 

Return to bug 32013