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

(-)a/misc/cronjobs/cleanup_database.pl (-7 / +14 lines)
Lines 530-543 if ($pStatistics) { Link Here
530
530
531
if ($return_claims) {
531
if ($return_claims) {
532
    print "Purging return claims older than $return_claims days.\n" if $verbose;
532
    print "Purging return claims older than $return_claims days.\n" if $verbose;
533
    $sth = $dbh->prepare(
533
534
        q{
534
    $return_claims = Koha::Checkouts::ReturnClaims->filter_by_last_update(
535
            DELETE FROM return_claims
535
        {
536
            WHERE resolved_on < DATE_SUB(CURDATE(), INTERVAL ? DAY)
536
            timestamp_column_name => 'resolved_on',
537
            days => $return_claims
537
        }
538
        }
538
    );
539
    );
539
    $sth->execute($return_claims);
540
540
    print "Done with purging return claims.\n" if $verbose;
541
    my $count = $return_claims->count;
542
    $return_claims->delete if $confirm;
543
544
    if ($verbose) {
545
        say $confirm
546
            ? sprintf "Done with purging %d resolved return claims.", $count
547
            : sprintf "%d resolved return claims would have been purged.", $count;
548
    }
541
}
549
}
542
550
543
if ($pDeletedCatalog) {
551
if ($pDeletedCatalog) {
544
- 

Return to bug 25429