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