From: miker Date: Mon, 2 Jul 2007 20:15:35 +0000 (+0000) Subject: Adding bill voiding time to the activity tracking query. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=1098c81c71e58276fa896df4e0436c659937fb2c;p=Evergreen.git Adding bill voiding time to the activity tracking query. git-svn-id: svn://svn.open-ils.org/ILS/trunk@7505 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/money.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/money.pm index 5b32994d35..e4d762848f 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/money.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/money.pm @@ -210,6 +210,18 @@ SELECT usr, MAX(last_pertinent_payment) AS last_pertinent_payment FROM ( SELECT lt.usr, + NULL::TIMESTAMPTZ AS last_pertinent_billing, + NULL::TIMESTAMPTZ AS last_pertinent_payment + FROM money.grocery lt + JOIN money.collections_tracker cl ON (lt.usr = cl.usr) + JOIN money.billing bl ON (lt.id = bl.xact) + WHERE cl.location = ? + AND lt.billing_location IN (XX) + AND bl.void_time BETWEEN ? AND ? + GROUP BY 1 + + UNION ALL + SELECT lt.usr, MAX(bl.billing_ts) AS last_pertinent_billing, NULL::TIMESTAMPTZ AS last_pertinent_payment FROM money.grocery lt @@ -257,6 +269,18 @@ SELECT usr, UNION ALL SELECT lt.usr, + NULL::TIMESTAMPTZ AS last_pertinent_billing, + NULL::TIMESTAMPTZ AS last_pertinent_payment + FROM action.circulation lt + JOIN money.collections_tracker cl ON (lt.usr = cl.usr) + JOIN money.billing bl ON (lt.id = bl.xact) + WHERE cl.location = ? + AND lt.circ_lib IN (XX) + AND bl.void_time BETWEEN ? AND ? + GROUP BY 1 + + UNION ALL + SELECT lt.usr, MAX(bl.billing_ts) AS last_pertinent_billing, NULL::TIMESTAMPTZ AS last_pertinent_payment FROM action.circulation lt