From 0f8ec1475311b8fa3a4027e2d29ec26b36b59daf Mon Sep 17 00:00:00 2001 From: Bill Ott Date: Tue, 28 Jul 2015 16:05:31 -0400 Subject: [PATCH] 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 --- .../perlmods/lib/OpenILS/Application/Storage/Publisher/money.pm | 2 ++ 1 file changed, 2 insertions(+) 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)) > ? ; -- 2.43.2