From: Dan Scott Date: Mon, 12 Nov 2012 17:58:42 +0000 (-0500) Subject: Delete ILL copies as well as ILL call numbers X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=33f1bb9f412db672546bf939beee16363625728a;p=contrib%2FConifer.git Delete ILL copies as well as ILL call numbers Evergreen 2.3 likes to show available copies in the holdings maintenance window even if the parent call numbers are deleted. So, do what we should have done before and delete the copies too. Guard against deleting copies that have been renewed rather than having their due dates extended. Signed-off-by: Dan Scott --- diff --git a/tools/daily-scripts/delete_ill_books.pl b/tools/daily-scripts/delete_ill_books.pl index f230433083..28187e6a0c 100644 --- a/tools/daily-scripts/delete_ill_books.pl +++ b/tools/daily-scripts/delete_ill_books.pl @@ -58,6 +58,7 @@ sub delete_racer_callnumbers { SELECT id FROM money.open_billable_xact_summary ) AND acn.deleted IS FALSE + AND ac.status NOT IN (1, 7); SELECT @@ -84,8 +85,20 @@ SELECT SELECT id FROM money.open_billable_xact_summary ) AND acn.deleted IS FALSE + AND ac.status NOT IN (1, 7); DELETE + my $delete_copies_stmt = <selectcol_arrayref($select_stmt); print localtime() . " - found " . scalar(@$results) . " RACER book call numbers to delete:\n"; if (scalar(@$results)) { @@ -94,6 +107,8 @@ DELETE } my $stmt = $dbh->prepare($delete_stmt); my $updates = $stmt->execute(); + $stmt = $dbh->prepare($delete_copies_stmt); + $updates = $stmt->execute(); } }