From 33f1bb9f412db672546bf939beee16363625728a Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Mon, 12 Nov 2012 12:58:42 -0500 Subject: [PATCH] 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 --- tools/daily-scripts/delete_ill_books.pl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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(); } } -- 2.11.0