From: Bill Erickson Date: Wed, 14 Nov 2018 17:21:28 +0000 (-0500) Subject: JBAS-2101 Improve refundable xact summary payment count fix X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e27b9b0f40da4b4b73b3de869d8c837522344699;p=working%2FEvergreen.git JBAS-2101 Improve refundable xact summary payment count fix Signed-off-by: Bill Erickson --- diff --git a/KCLS/sql/schema/deploy/refundable-xact-summary-view-speed.sql b/KCLS/sql/schema/deploy/refundable-xact-summary-view-speed.sql index a1adab27de..693aa4af40 100644 --- a/KCLS/sql/schema/deploy/refundable-xact-summary-view-speed.sql +++ b/KCLS/sql/schema/deploy/refundable-xact-summary-view-speed.sql @@ -21,7 +21,7 @@ CREATE OR REPLACE VIEW money.refundable_xact_summary AS SUM(positive_payments.amount)::NUMERIC(8,2) AS refundable_paid, SUM(total_paid.amount)::NUMERIC(8,2) AS total_paid, COALESCE(-SUM(refund_payments.amount), 0)::NUMERIC(8,2) AS total_refunded, - COUNT(mrp.id) AS num_refundable_payments + COUNT(DISTINCT(mrp.id)) AS num_refundable_payments FROM money.refundable_xact xact JOIN action.circulation circ ON (circ.id = xact.xact) JOIN asset.copy acp ON (acp.id = circ.target_copy)