From 7de06df1f6e9d665a7f2c55668168501a1697fce Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Wed, 2 Jun 2021 16:21:24 -0400 Subject: [PATCH] schema: adjust fund transfer notes - Change allocation notes to Now Transfer {to,from} FUND_CODE (YEAR) (FUND_ORG_UNIT_SHORTNAME) - Fix issue where the fund org units were not being retrieved correctly, leading to incorrect or missing fund allocation notes Signed-off-by: Galen Charlton --- Open-ILS/src/sql/Pg/200.schema.acq.sql | 16 ++++++++-------- .../sql/Pg/upgrade/XXXX.schema.update_fund_xfr_notes.sql | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Open-ILS/src/sql/Pg/200.schema.acq.sql b/Open-ILS/src/sql/Pg/200.schema.acq.sql index 040f20f964..0cfb6089dc 100644 --- a/Open-ILS/src/sql/Pg/200.schema.acq.sql +++ b/Open-ILS/src/sql/Pg/200.schema.acq.sql @@ -1446,9 +1446,9 @@ BEGIN -- Fetch old and new fund's information -- in order to construct the allocation notes SELECT INTO old_fund_row * FROM acq.fund WHERE id = old_fund; - SELECT INTO old_org_row * FROM actor.org_unit WHERE id = old_fund_row.id; + SELECT INTO old_org_row * FROM actor.org_unit WHERE id = old_fund_row.org; SELECT INTO new_fund_row * FROM acq.fund WHERE id = new_fund; - SELECT INTO new_org_row * FROM actor.org_unit WHERE id = new_fund_row.id; + SELECT INTO new_org_row * FROM actor.org_unit WHERE id = new_fund_row.org; -- -- Identify the funding source(s) from which we want to transfer the money. @@ -1557,9 +1557,9 @@ BEGIN old_fund, source_deduction, user_id, - 'Transfer to fund ' || new_org_row.shortname || ' ' - || new_fund_row.code || ' (' - || new_fund_row.year || ')' + 'Transfer to fund ' || new_fund_row.code || ' (' + || new_fund_row.year || ') (' + || new_org_row.shortname || ')' ); END IF; -- @@ -1622,9 +1622,9 @@ BEGIN new_fund, source_addition, user_id, - 'Transfer from fund ' || old_org_row.shortname || ' ' - || old_fund_row.code || ' (' - || old_fund_row.year || ')' + 'Transfer from fund ' || old_fund_row.code || ' (' + || old_fund_row.year || ') (' + || old_org_row.shortname || ')' ); END IF; END IF; diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.update_fund_xfr_notes.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.update_fund_xfr_notes.sql index a22278074d..2f80e0d08a 100644 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.update_fund_xfr_notes.sql +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.update_fund_xfr_notes.sql @@ -160,9 +160,9 @@ BEGIN -- Fetch old and new fund's information -- in order to construct the allocation notes SELECT INTO old_fund_row * FROM acq.fund WHERE id = old_fund; - SELECT INTO old_org_row * FROM actor.org_unit WHERE id = old_fund_row.id; + SELECT INTO old_org_row * FROM actor.org_unit WHERE id = old_fund_row.org; SELECT INTO new_fund_row * FROM acq.fund WHERE id = new_fund; - SELECT INTO new_org_row * FROM actor.org_unit WHERE id = new_fund_row.id; + SELECT INTO new_org_row * FROM actor.org_unit WHERE id = new_fund_row.org; -- -- Identify the funding source(s) from which we want to transfer the money. @@ -271,9 +271,9 @@ BEGIN old_fund, source_deduction, user_id, - 'Transfer to fund ' || new_org_row.shortname || ' ' - || new_fund_row.code || ' (' - || new_fund_row.year || ')' + 'Transfer to fund ' || new_fund_row.code || ' (' + || new_fund_row.year || ') (' + || new_org_row.shortname || ')' ); END IF; -- @@ -336,9 +336,9 @@ BEGIN new_fund, source_addition, user_id, - 'Transfer from fund ' || old_org_row.shortname || ' ' - || old_fund_row.code || ' (' - || old_fund_row.year || ')' + 'Transfer from fund ' || old_fund_row.code || ' (' + || old_fund_row.year || ') (' + || old_org_row.shortname || ')' ); END IF; END IF; -- 2.11.0