From: Galen Charlton Date: Wed, 2 Jun 2021 20:21:24 +0000 (-0400) Subject: schema: adjust fund transfer notes X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7de06df1f6e9d665a7f2c55668168501a1697fce;p=working%2FEvergreen.git 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 --- 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;