From: Bill Ott Date: Tue, 28 Jul 2015 20:05:31 +0000 (-0400) Subject: LP#1394989: Do not include deleted users when retrieving for Collections X-Git-Tag: sprint4-merge-nov22~1277 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0f8ec1475311b8fa3a4027e2d29ec26b36b59daf;p=working%2FEvergreen.git LP#1394989: Do not include deleted users when retrieving for Collections As a side effect of discovering that users with no cards were being retrieved as part of the Collections API calls, those users ended up being mostly made up of deleted users (merged with an actual lead record, etc.) This patch contribued by Bill Ott changes the retrieval so that it skips over those deleted users. Signed-off-by: Bill Ott Signed-off-by: Ben Shum --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/money.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/money.pm index 6b314bd0c5..6507db95ba 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/money.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/money.pm @@ -186,6 +186,8 @@ select group by 1,2 ) full_list left join money.payment p on (full_list.id = p.xact) + left join actor.usr au on (au.id = usr) + where au.deleted is false group by 1 having SUM(total_billing) - SUM(COALESCE(p.amount,0)) > ? ;