From: Bill Erickson Date: Thu, 25 Oct 2018 16:44:06 +0000 (-0400) Subject: JBAS-2117 Aged payments first in circ aging X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=885b0984160a368e79ec6aa360310f50e6b31016;p=working%2FEvergreen.git JBAS-2117 Aged payments first in circ aging Delete payments from active table first to clear any account_adjustment's that might link to billings that will also be deleted. Signed-off-by: Bill Erickson --- diff --git a/KCLS/sql/schema/deploy/aged-billings-payments.sql b/KCLS/sql/schema/deploy/aged-billings-payments.sql index b5ef7726a5..5e28c2d3dc 100644 --- a/KCLS/sql/schema/deploy/aged-billings-payments.sql +++ b/KCLS/sql/schema/deploy/aged-billings-payments.sql @@ -65,8 +65,8 @@ BEGIN INSERT INTO money.aged_payment SELECT * FROM money.payment_view WHERE xact = OLD.id; - DELETE FROM money.billing WHERE xact = OLD.id; DELETE FROM money.payment WHERE xact = OLD.id; + DELETE FROM money.billing WHERE xact = OLD.id; RETURN OLD; END;