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

(-)a/misc/cronjobs/cleanup_database.pl (-7 / +14 lines)
Lines 509-522 if ($pStatistics) { Link Here
509
509
510
if ($return_claims) {
510
if ($return_claims) {
511
    print "Purging return claims older than $return_claims days.\n" if $verbose;
511
    print "Purging return claims older than $return_claims days.\n" if $verbose;
512
    $sth = $dbh->prepare(
512
513
        q{
513
    my $return_claims = Koha::Checkouts::ReturnClaims->filter_by_last_update(
514
            DELETE FROM return_claims
514
        {
515
            WHERE resolved_on < DATE_SUB(CURDATE(), INTERVAL ? DAY)
515
            timestamp_column_name => 'resolved_on',
516
            days => $return_claims
516
        }
517
        }
517
    );
518
    );
518
    $sth->execute($return_claims);
519
519
    print "Done with purging return claims.\n" if $verbose;
520
    my $count = $return_claims->count;
521
    $return_claims->delete if $confirm;
522
523
    if ($verbose) {
524
        say $confirm
525
            ? sprintf "Done with purging %d resolved return claims.", $count
526
            : sprintf "%d resolved return claims would have been purged.", $count;
527
    }
520
}
528
}
521
529
522
if ($pDeletedCatalog) {
530
if ($pDeletedCatalog) {
523
- 

Return to bug 25429